Stefano Fiorucci commited on
Commit
567babf
1 Parent(s): c5b375b
Files changed (1) hide show
  1. app.py +5 -2
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'])>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,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("<h4 style='color: darkred'>Attention, the following answers have low score:</h3>", unsafe_allow_html=True)
 
 
 
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("🤔 &nbsp;&nbsp; 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)