Manish-4007 commited on
Commit
0cd5f06
·
1 Parent(s): e5831b9
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -11,8 +11,8 @@ def load_topic_transfomers():
11
 
12
  def suggest_topic(text):
13
 
14
- while len(text)> 1024:
15
- text = summarize(whole_text[:-10])
16
 
17
  possible_topics = ["Gadgets", 'Business','Finance', 'Health', 'Sports', 'Politics','Government','Science','Education', 'Travel', 'Tourism', 'Finance & Economics','Market','Technology','Scientific Discovery',
18
  'Entertainment','Environment','News & Media' "Space,Universe & Cosmos", "Fashion", "Manufacturing and Constructions","Law & Crime","Motivation", "Development & Socialization", "Archeology"]
@@ -23,15 +23,15 @@ def suggest_topic(text):
23
 
24
  st.title("Topic Suggestion")
25
  with st.spinner("Loading Model....."):
26
- topic_classifier = load_topic_transfomers()
27
- st.success("Model_loaded")
28
 
29
  whole_text = st.text_input("Enter the text Here: ")
30
  predicted_topic = suggest_topic(whole_text)
31
 
32
  st.write('Suggested Topics')
33
  for i in predicted_topic:
34
- st.write(i)
35
 
36
 
37
 
 
11
 
12
  def suggest_topic(text):
13
 
14
+ # while len(text)> 1024:
15
+ # text = summarize(whole_text[:-10])
16
 
17
  possible_topics = ["Gadgets", 'Business','Finance', 'Health', 'Sports', 'Politics','Government','Science','Education', 'Travel', 'Tourism', 'Finance & Economics','Market','Technology','Scientific Discovery',
18
  'Entertainment','Environment','News & Media' "Space,Universe & Cosmos", "Fashion", "Manufacturing and Constructions","Law & Crime","Motivation", "Development & Socialization", "Archeology"]
 
23
 
24
  st.title("Topic Suggestion")
25
  with st.spinner("Loading Model....."):
26
+ topic_classifier = load_topic_transfomers()
27
+ st.success("Model_loaded")
28
 
29
  whole_text = st.text_input("Enter the text Here: ")
30
  predicted_topic = suggest_topic(whole_text)
31
 
32
  st.write('Suggested Topics')
33
  for i in predicted_topic:
34
+ st.write(i)
35
 
36
 
37