Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -362,11 +362,11 @@ if show_exact_matches:
|
|
362 |
title_html = highlight_query(metadata["title"], var) if var.strip() else metadata["title"]
|
363 |
st.markdown(f"#### {title_html}", unsafe_allow_html=True)
|
364 |
# Build snippet from objectives and description
|
365 |
-
objectives = metadata.get("objectives", "")
|
366 |
desc_en = metadata.get("description.en", "").strip()
|
367 |
desc_de = metadata.get("description.de", "").strip()
|
368 |
description = desc_en if desc_en != "" else desc_de
|
369 |
-
full_snippet = f"{
|
370 |
words = full_snippet.split()
|
371 |
preview_word_count = 90
|
372 |
preview_text = " ".join(words[:preview_word_count])
|
@@ -405,6 +405,7 @@ if show_exact_matches:
|
|
405 |
contact = metadata.get("contact", "").strip()
|
406 |
additional_text = (
|
407 |
f"Commissioned by **{client_name}**<br>"
|
|
|
408 |
f"Projekt duration **{start_year_str}-{end_year_str}**<br>"
|
409 |
f"Budget: Project: **{formatted_project_budget}**, Total volume: **{formatted_total_volume}**<br>"
|
410 |
f"Country: **{', '.join(matched_countries)}**<br>"
|
@@ -422,7 +423,7 @@ else:
|
|
422 |
else:
|
423 |
top_results = filtered_semantic_no_dupe[:10]
|
424 |
rag_answer = get_rag_answer(var, top_results)
|
425 |
-
st.markdown(f"<h2 style='text-align:center; font-size:2.5em;'>
|
426 |
st.write(rag_answer)
|
427 |
st.divider()
|
428 |
st.write("Showing **Top 15 Semantic Search results**")
|
|
|
362 |
title_html = highlight_query(metadata["title"], var) if var.strip() else metadata["title"]
|
363 |
st.markdown(f"#### {title_html}", unsafe_allow_html=True)
|
364 |
# Build snippet from objectives and description
|
365 |
+
objectives = metadata.get("objectives", "None")
|
366 |
desc_en = metadata.get("description.en", "").strip()
|
367 |
desc_de = metadata.get("description.de", "").strip()
|
368 |
description = desc_en if desc_en != "" else desc_de
|
369 |
+
full_snippet = f"{description}"
|
370 |
words = full_snippet.split()
|
371 |
preview_word_count = 90
|
372 |
preview_text = " ".join(words[:preview_word_count])
|
|
|
405 |
contact = metadata.get("contact", "").strip()
|
406 |
additional_text = (
|
407 |
f"Commissioned by **{client_name}**<br>"
|
408 |
+
f"Objective **{objectives}**<br>"
|
409 |
f"Projekt duration **{start_year_str}-{end_year_str}**<br>"
|
410 |
f"Budget: Project: **{formatted_project_budget}**, Total volume: **{formatted_total_volume}**<br>"
|
411 |
f"Country: **{', '.join(matched_countries)}**<br>"
|
|
|
423 |
else:
|
424 |
top_results = filtered_semantic_no_dupe[:10]
|
425 |
rag_answer = get_rag_answer(var, top_results)
|
426 |
+
st.markdown(f"<h2 style='text-align:center; font-size:2.5em;'>{var}</h2>", unsafe_allow_html=True)
|
427 |
st.write(rag_answer)
|
428 |
st.divider()
|
429 |
st.write("Showing **Top 15 Semantic Search results**")
|