Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ if st.button('Run semantic question answering'):
|
|
43 |
start_par, stop_para = max(0, qa_result["start"]-86), min(qa_result["end"]+90, len(paragraph))
|
44 |
answer_context = paragraph[start_par:stop_para].replace(answer_span, f'**{answer_span}**')
|
45 |
st.write(f'Answer context (and score): ... _{answer_context}_ ...')
|
46 |
-
color_string = 'green' if answer_score > 0.65 else '
|
47 |
# st.markdown("""This text is :red[colored red]""")
|
48 |
st.markdown(f'(answer confidence: :{color_string}[{format(answer_score, ".3f")}])')
|
49 |
|
|
|
43 |
start_par, stop_para = max(0, qa_result["start"]-86), min(qa_result["end"]+90, len(paragraph))
|
44 |
answer_context = paragraph[start_par:stop_para].replace(answer_span, f'**{answer_span}**')
|
45 |
st.write(f'Answer context (and score): ... _{answer_context}_ ...')
|
46 |
+
color_string = 'green' if answer_score > 0.65 else 'yellow' if answer_score > 0.45 else 'red'
|
47 |
# st.markdown("""This text is :red[colored red]""")
|
48 |
st.markdown(f'(answer confidence: :{color_string}[{format(answer_score, ".3f")}])')
|
49 |
|