IGPTeam4 commited on
Commit
bfb8098
·
verified ·
1 Parent(s): 221fe60

Update src/webApp.py

Browse files
Files changed (1) hide show
  1. 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 word_fig:
484
- st.plotly_chart(word_fig, use_container_width=True)
 
 
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")