annikwag commited on
Commit
082c0d4
verified
1 Parent(s): 0059f4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -135,10 +135,8 @@ if button:
135
  st.write(preview_text + ("..." if remainder_text else ""))
136
  # ------ Extract top 5 keywords and display ------
137
  top_keywords = extract_top_keywords(full_text, top_n=5)
138
- # Join them with " 路 " and make them italic
139
  if top_keywords:
140
- st.write("")
141
- st.markdown(f"_{' 路 '.join(top_keywords)}_") # e.g. _keyword1 路 keyword2 路 keyword3_
142
  # ------- Additional info below the text -------
143
  metadata = res.payload.get('metadata', {})
144
  countries = metadata.get('countries', "[]")
@@ -186,10 +184,8 @@ if button:
186
  st.write(preview_text + ("..." if remainder_text else ""))
187
  # ------ Extract top 5 keywords and display ------
188
  top_keywords = extract_top_keywords(full_text, top_n=5)
189
- # Join them with " 路 " and make them italic
190
  if top_keywords:
191
- st.write("") # line break
192
- st.markdown(f"_{' 路 '.join(top_keywords)}_")
193
 
194
  # Additional text below the content
195
  metadata = res.payload.get('metadata', {})
 
135
  st.write(preview_text + ("..." if remainder_text else ""))
136
  # ------ Extract top 5 keywords and display ------
137
  top_keywords = extract_top_keywords(full_text, top_n=5)
 
138
  if top_keywords:
139
+ st.markdown(f"_{' 路 '.join(top_keywords)}_") # italic + ' 路 ' separator
 
140
  # ------- Additional info below the text -------
141
  metadata = res.payload.get('metadata', {})
142
  countries = metadata.get('countries', "[]")
 
184
  st.write(preview_text + ("..." if remainder_text else ""))
185
  # ------ Extract top 5 keywords and display ------
186
  top_keywords = extract_top_keywords(full_text, top_n=5)
 
187
  if top_keywords:
188
+ st.markdown(f"_{' 路 '.join(top_keywords)}_") # italic + ' 路 ' separator
 
189
 
190
  # Additional text below the content
191
  metadata = res.payload.get('metadata', {})