asdc commited on
Commit
6c2c9be
·
verified ·
1 Parent(s): d9a6a4e

Upload streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -1
src/streamlit_app.py CHANGED
@@ -137,7 +137,8 @@ if user_text:
137
  if entities:
138
  st.markdown('#### Detected Entities:')
139
  for ent, label in entities:
140
- st.markdown(f'- <span style="background-color:{LABEL_COLORS[label]};padding:2px 8px;border-radius:4px;">{ent}</span> <span style="color:#888;">({LABEL_MEANINGS[label]})</span>', unsafe_allow_html=True)
 
141
  else:
142
  st.info('No entities detected.')
143
  else:
 
137
  if entities:
138
  st.markdown('#### Detected Entities:')
139
  for ent, label in entities:
140
+ norm_label = label.replace('_', '-')
141
+ st.markdown(f'- <span style="background-color:{LABEL_COLORS[norm_label]};padding:2px 8px;border-radius:4px;">{ent}</span> <span style="color:#888;">({LABEL_MEANINGS[norm_label]})</span>', unsafe_allow_html=True)
142
  else:
143
  st.info('No entities detected.')
144
  else: