amirhoseinsedaghati commited on
Commit
c266bd4
·
verified ·
1 Parent(s): f156672

Update pages/Find_Topic.py

Browse files
Files changed (1) hide show
  1. pages/Find_Topic.py +8 -0
pages/Find_Topic.py CHANGED
@@ -6,6 +6,8 @@ import regex as re
6
  from configs.db_configs import add_one_item
7
  from streamlit.components.v1 import html
8
  from configs.html_features import set_image
 
 
9
 
10
 
11
  def preprocess_text(text):
@@ -35,8 +37,10 @@ def main():
35
  html(set_image(url), height=500, width=500)
36
  with im3:
37
  pass
 
38
  text = st.text_area('Find Topic', placeholder='Enter your input text here ...', height=200, label_visibility='hidden')
39
  num_top_words = st.sidebar.slider('Number of Top Keywords', min_value=5, max_value=20, step=1, value=10)
 
40
  if st.button('Find Topic'):
41
  if text != '':
42
  with st.expander('Original Text'):
@@ -47,5 +51,9 @@ def main():
47
  topic_words = show_topics(text, num_top_words)
48
  st.write(topic_words)
49
 
 
 
 
 
50
  if __name__ == '__main__':
51
  main()
 
6
  from configs.db_configs import add_one_item
7
  from streamlit.components.v1 import html
8
  from configs.html_features import set_image
9
+ from configs.download_files import FileDownloader
10
+
11
 
12
 
13
  def preprocess_text(text):
 
37
  html(set_image(url), height=500, width=500)
38
  with im3:
39
  pass
40
+
41
  text = st.text_area('Find Topic', placeholder='Enter your input text here ...', height=200, label_visibility='hidden')
42
  num_top_words = st.sidebar.slider('Number of Top Keywords', min_value=5, max_value=20, step=1, value=10)
43
+
44
  if st.button('Find Topic'):
45
  if text != '':
46
  with st.expander('Original Text'):
 
51
  topic_words = show_topics(text, num_top_words)
52
  st.write(topic_words)
53
 
54
+ with st.expander('Download Topic words'):
55
+ FileDownloader(data=topic_words, file_ext='txt').download()
56
+
57
+
58
  if __name__ == '__main__':
59
  main()