maxspad commited on
Commit
cf0d6b4
·
1 Parent(s): 0568b17

added spinners for word importance

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -148,18 +148,21 @@ with st.expander('Expand to explore further'):
148
  st.markdown('### Level of Detail')
149
  st.write(f"The model identified a **{q1_map[results['q1']['label']]}** level of detail in your comment.")
150
  st.write("Below are words that pointed the model toward (green) or against (red) identifying a high level of detail:")
151
- annotated_text(get_explained_words(st.session_state['comment'], models['q1'], 'LABEL_3', RdYlGn_10))
 
152
 
153
  st.markdown('### Suggestion for Improvement')
154
  st.write(f"The model **{q2i_map[results['q2i']['label']]}** predict that you provided a suggestion for improvement in your comment.")
155
  st.write(f"Below are words that pointed the model toward (green) or against (red) identifying a suggestion for improvement:")
156
- annotated_text(get_explained_words(st.session_state['comment'], models['q2i'], 'LABEL_0', RdYlGn_10))
 
157
 
158
  if results['q2i']['label'] == 0:
159
  st.markdown('### Suggestion Linking')
160
  st.write(f"The model **{q2i_map[results['q3i']['label']]}** predict that you linked your suggestion")
161
  st.write(f"Below are words that pointed the model toward (green) or against (red) identifying a linked suggestion:")
162
- annotated_text(get_explained_words(st.session_state['comment'], models['q3i'], 'LABEL_0', RdYlGn_10))
 
163
 
164
 
165
  # annotated_text(to_disp)
 
148
  st.markdown('### Level of Detail')
149
  st.write(f"The model identified a **{q1_map[results['q1']['label']]}** level of detail in your comment.")
150
  st.write("Below are words that pointed the model toward (green) or against (red) identifying a high level of detail:")
151
+ with st.spinner("Calculating word importances, may take a while..."):
152
+ annotated_text(get_explained_words(st.session_state['comment'], models['q1'], 'LABEL_3', RdYlGn_10))
153
 
154
  st.markdown('### Suggestion for Improvement')
155
  st.write(f"The model **{q2i_map[results['q2i']['label']]}** predict that you provided a suggestion for improvement in your comment.")
156
  st.write(f"Below are words that pointed the model toward (green) or against (red) identifying a suggestion for improvement:")
157
+ with st.spinner("Calculating word importances, may take a while..."):
158
+ annotated_text(get_explained_words(st.session_state['comment'], models['q2i'], 'LABEL_0', RdYlGn_10))
159
 
160
  if results['q2i']['label'] == 0:
161
  st.markdown('### Suggestion Linking')
162
  st.write(f"The model **{q2i_map[results['q3i']['label']]}** predict that you linked your suggestion")
163
  st.write(f"Below are words that pointed the model toward (green) or against (red) identifying a linked suggestion:")
164
+ with st.spinner("Calculating word importances, may take a while..."):
165
+ annotated_text(get_explained_words(st.session_state['comment'], models['q3i'], 'LABEL_0', RdYlGn_10))
166
 
167
 
168
  # annotated_text(to_disp)