Stefano Fiorucci
commited on
Commit
•
567babf
1
Parent(s):
c5b375b
fix bug
Browse files
app.py
CHANGED
@@ -205,7 +205,7 @@ and see if the AI can find an answer...
|
|
205 |
st.write("## Results:")
|
206 |
|
207 |
alert_irrelevance=True
|
208 |
-
if len(st.session_state.results['answers'])
|
209 |
st.info("🤔 Haystack is unsure whether any of the documents contain an answer to your question. Try to reformulate it!")
|
210 |
|
211 |
for count, result in enumerate(st.session_state.results['answers']):
|
@@ -213,7 +213,10 @@ and see if the AI can find an answer...
|
|
213 |
if result["answer"]:
|
214 |
if alert_irrelevance and result['score']<0.50:
|
215 |
alert_irrelevance = False
|
216 |
-
st.write("
|
|
|
|
|
|
|
217 |
|
218 |
answer, context = result["answer"], result["context"]
|
219 |
start_idx = context.find(answer)
|
|
|
205 |
st.write("## Results:")
|
206 |
|
207 |
alert_irrelevance=True
|
208 |
+
if len(st.session_state.results['answers'])==0:
|
209 |
st.info("🤔 Haystack is unsure whether any of the documents contain an answer to your question. Try to reformulate it!")
|
210 |
|
211 |
for count, result in enumerate(st.session_state.results['answers']):
|
|
|
213 |
if result["answer"]:
|
214 |
if alert_irrelevance and result['score']<0.50:
|
215 |
alert_irrelevance = False
|
216 |
+
st.write("""
|
217 |
+
<h4 style='color: darkred'>Attention, the
|
218 |
+
following answers have low relevance:</h4>""",
|
219 |
+
unsafe_allow_html=True)
|
220 |
|
221 |
answer, context = result["answer"], result["context"]
|
222 |
start_idx = context.find(answer)
|