Spaces:
Sleeping
Sleeping
Update src/webApp.py
Browse files- src/webApp.py +4 -2
src/webApp.py
CHANGED
|
@@ -480,8 +480,10 @@ if st.button("Analyse Review"):
|
|
| 480 |
with st.spinner("Computing word importance..."):
|
| 481 |
word_importance = get_word_importance(review, tokenizer, bert_model, s_label)
|
| 482 |
|
| 483 |
-
if
|
| 484 |
-
|
|
|
|
|
|
|
| 485 |
|
| 486 |
# Plain English explanation of top words
|
| 487 |
st.markdown("#### What the words mean for this prediction")
|
|
|
|
| 480 |
with st.spinner("Computing word importance..."):
|
| 481 |
word_importance = get_word_importance(review, tokenizer, bert_model, s_label)
|
| 482 |
|
| 483 |
+
if word_importance:
|
| 484 |
+
word_fig = word_importance_chart(word_importance, s_label)
|
| 485 |
+
if word_fig:
|
| 486 |
+
st.plotly_chart(word_fig, use_container_width=True)
|
| 487 |
|
| 488 |
# Plain English explanation of top words
|
| 489 |
st.markdown("#### What the words mean for this prediction")
|