XQ commited on
Commit
a6115ff
·
1 Parent(s): fa0cc5c

Update UI and umami

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. src/ui/app.py +13 -17
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Dokumentassistent
3
  emoji: 📄
4
  colorFrom: red
5
  colorTo: gray
 
1
  ---
2
+ title: Dokumentintelligens-system
3
  emoji: 📄
4
  colorFrom: red
5
  colorTo: gray
src/ui/app.py CHANGED
@@ -1,4 +1,4 @@
1
- """Streamlit frontend for Dokumentassistent.
2
 
3
  Calls the FastAPI backend at http://localhost:8000.
4
  Single-page document search interface with clean sans-serif design.
@@ -37,7 +37,7 @@ EXAMPLE_QUESTIONS: list[str] = [
37
  # ---------------------------------------------------------------------------
38
  TEXTS: dict[str, dict[str, str]] = {
39
  "da": {
40
- "page_title": "Dokumentassistent",
41
  "lang_label": "Sprog",
42
  "sidebar_heading": "Om systemet",
43
  "sidebar_body": (
@@ -61,8 +61,8 @@ TEXTS: dict[str, dict[str, str]] = {
61
  "chunking_help": "Vælg hvordan dokumenterne opdeles i tekststykker.",
62
  "topk_label": "Antal kilder (top_k)",
63
  "topk_help": "Antal dokumentfragmenter der hentes fra søgeindekset.",
64
- "title": "Dokumentassistent",
65
- "title_badge": "Demo",
66
  "subtitle": (
67
  "Et dokumentintelligens-system bygget på en RAG-arkitektur, dækkende file-indlæsning, semantisk chunking, "
68
  "hybrid søgning med reranking "
@@ -117,7 +117,7 @@ TEXTS: dict[str, dict[str, str]] = {
117
  "pipeline_tool_calls": "Værktøjskald",
118
  },
119
  "en": {
120
- "page_title": "Document Assistant",
121
  "lang_label": "Language",
122
  "sidebar_heading": "About the system",
123
  "sidebar_body": (
@@ -141,8 +141,8 @@ TEXTS: dict[str, dict[str, str]] = {
141
  "chunking_help": "Choose how documents are split into text chunks.",
142
  "topk_label": "Number of sources (top_k)",
143
  "topk_help": "Number of document fragments retrieved from the search index.",
144
- "title": "Document Assistant",
145
- "title_badge": "Demo",
146
  "subtitle": (
147
  "A document intelligence system built on a RAG architecture, covering file ingestion, semantic chunking, "
148
  "hybrid retrieval with reranking, "
@@ -203,7 +203,7 @@ TEXTS: dict[str, dict[str, str]] = {
203
  # Page config
204
  # ---------------------------------------------------------------------------
205
  st.set_page_config(
206
- page_title="Dokumentassistent",
207
  page_icon="📄",
208
  layout="centered",
209
  )
@@ -213,10 +213,12 @@ st.markdown('<meta name="robots" content="noindex, nofollow">', unsafe_allow_htm
213
  # ---------------------------------------------------------------------------
214
  # Analytics — Umami Cloud
215
  # ---------------------------------------------------------------------------
216
- st.markdown(
 
217
  '<script async src="https://cloud.umami.is/script.js"'
218
  ' data-website-id="cf6c908e-1236-4406-8c02-88aa7c9a0db2"></script>',
219
- unsafe_allow_html=True,
 
220
  )
221
 
222
  # ---------------------------------------------------------------------------
@@ -608,13 +610,7 @@ st.markdown('<div class="accent-line"></div>', unsafe_allow_html=True)
608
 
609
  # Title block
610
  st.markdown(
611
- f'<div class="app-title">'
612
- f'{t["title"]}'
613
- f'<span style="font-size:1rem; font-weight:500; color:#FFFFFF; '
614
- f'background:#901A1E; padding:0.15rem 0.55rem; margin-left:0.6rem; '
615
- f'vertical-align:middle; letter-spacing:0.05em;">'
616
- f'{t["title_badge"]}</span>'
617
- f'</div>',
618
  unsafe_allow_html=True,
619
  )
620
  # Subtitle placeholder — filled after we know whether search was clicked
 
1
+ """Streamlit frontend for Dokumentintelligens-system.
2
 
3
  Calls the FastAPI backend at http://localhost:8000.
4
  Single-page document search interface with clean sans-serif design.
 
37
  # ---------------------------------------------------------------------------
38
  TEXTS: dict[str, dict[str, str]] = {
39
  "da": {
40
+ "page_title": "Dokumentintelligens-system",
41
  "lang_label": "Sprog",
42
  "sidebar_heading": "Om systemet",
43
  "sidebar_body": (
 
61
  "chunking_help": "Vælg hvordan dokumenterne opdeles i tekststykker.",
62
  "topk_label": "Antal kilder (top_k)",
63
  "topk_help": "Antal dokumentfragmenter der hentes fra søgeindekset.",
64
+ "title": "Dokumentintelligens-system",
65
+ "title_badge": "",
66
  "subtitle": (
67
  "Et dokumentintelligens-system bygget på en RAG-arkitektur, dækkende file-indlæsning, semantisk chunking, "
68
  "hybrid søgning med reranking "
 
117
  "pipeline_tool_calls": "Værktøjskald",
118
  },
119
  "en": {
120
+ "page_title": "Document Intelligence System",
121
  "lang_label": "Language",
122
  "sidebar_heading": "About the system",
123
  "sidebar_body": (
 
141
  "chunking_help": "Choose how documents are split into text chunks.",
142
  "topk_label": "Number of sources (top_k)",
143
  "topk_help": "Number of document fragments retrieved from the search index.",
144
+ "title": "Document Intelligence System",
145
+ "title_badge": "",
146
  "subtitle": (
147
  "A document intelligence system built on a RAG architecture, covering file ingestion, semantic chunking, "
148
  "hybrid retrieval with reranking, "
 
203
  # Page config
204
  # ---------------------------------------------------------------------------
205
  st.set_page_config(
206
+ page_title="Dokumentintelligens-system",
207
  page_icon="📄",
208
  layout="centered",
209
  )
 
213
  # ---------------------------------------------------------------------------
214
  # Analytics — Umami Cloud
215
  # ---------------------------------------------------------------------------
216
+ import streamlit.components.v1 as components
217
+ components.html(
218
  '<script async src="https://cloud.umami.is/script.js"'
219
  ' data-website-id="cf6c908e-1236-4406-8c02-88aa7c9a0db2"></script>',
220
+ height=0,
221
+ width=0,
222
  )
223
 
224
  # ---------------------------------------------------------------------------
 
610
 
611
  # Title block
612
  st.markdown(
613
+ f'<div class="app-title">{t["title"]}</div>',
 
 
 
 
 
 
614
  unsafe_allow_html=True,
615
  )
616
  # Subtitle placeholder — filled after we know whether search was clicked