Spaces:
Runtime error
Runtime error
iamviveksrk
commited on
Commit
β’
bd2f707
1
Parent(s):
f2fae48
Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +68,7 @@ def ask_question(query):
|
|
68 |
"link":None,
|
69 |
"context": None,
|
70 |
"answer": None,
|
71 |
-
"
|
72 |
}
|
73 |
)
|
74 |
return results
|
@@ -93,7 +93,7 @@ if st.session_state.results:
|
|
93 |
markdown(context[:start_idx] + str(annotation(body=answer, label="RELEVANT", background="#964448", color='#ffffff')) + context[end_idx:]),
|
94 |
unsafe_allow_html=True,
|
95 |
)
|
96 |
-
st.markdown(f"**Title:** [{result['title']}]({result['link']})\n**Relevance:** {result['
|
97 |
else:
|
98 |
st.info(
|
99 |
"π€ Haystack is unsure whether any of the documents contain an answer to your question. Try to reformulate it!"
|
|
|
68 |
"link":None,
|
69 |
"context": None,
|
70 |
"answer": None,
|
71 |
+
"score": round(answer["score"] * 100, 2),
|
72 |
}
|
73 |
)
|
74 |
return results
|
|
|
93 |
markdown(context[:start_idx] + str(annotation(body=answer, label="RELEVANT", background="#964448", color='#ffffff')) + context[end_idx:]),
|
94 |
unsafe_allow_html=True,
|
95 |
)
|
96 |
+
st.markdown(f"**Title:** [{result['title']}]({result['link']})\n**Relevance:** {result['score']}")
|
97 |
else:
|
98 |
st.info(
|
99 |
"π€ Haystack is unsure whether any of the documents contain an answer to your question. Try to reformulate it!"
|