Spaces:
Runtime error
Runtime error
Commit ·
b32f4b5
1
Parent(s): b15874e
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,12 +8,13 @@ dictionary=PyDictionary()
|
|
| 8 |
|
| 9 |
def get_output(event_info):
|
| 10 |
if len(event_info.split(' '))>=20:
|
| 11 |
-
topic_name, distance_name,topic_name_dep, distance_name_dep,
|
| 12 |
work_list, keywords_2 = extract_topics(event_info)
|
| 13 |
work_list = [i for i in work_list if bool(dictionary.meaning(i))]
|
| 14 |
-
|
|
|
|
| 15 |
else:
|
| 16 |
-
return 'Event discription should have >= 20 words', None, None, None,None
|
| 17 |
|
| 18 |
|
| 19 |
with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:
|
|
@@ -34,18 +35,17 @@ with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo
|
|
| 34 |
|
| 35 |
output_sec = gradio.outputs.Textbox(label="Mapped sector and score")
|
| 36 |
output_dep = gradio.outputs.Textbox(label="Mapped industry and score")
|
| 37 |
-
|
| 38 |
|
| 39 |
with gradio.Row():
|
| 40 |
output_keybert = gradio.outputs.Textbox(label="Identified keywords (1 word)")
|
| 41 |
-
|
| 42 |
-
output_tags_identified = gradio.outputs.Textbox(label="Identified Tags")
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
button.click(get_output,
|
| 47 |
[event_info],
|
| 48 |
-
outputs=[output_sec, output_dep,
|
| 49 |
|
| 50 |
#keyword_cluster_demo.queue().launch(share=True,debug =True, show_error =True)
|
| 51 |
keyword_cluster_demo.queue().launch()
|
|
|
|
| 8 |
|
| 9 |
def get_output(event_info):
|
| 10 |
if len(event_info.split(' '))>=20:
|
| 11 |
+
topic_name, distance_name,topic_name_dep, distance_name_dep,tags_list = get_mapping(event_info)
|
| 12 |
work_list, keywords_2 = extract_topics(event_info)
|
| 13 |
work_list = [i for i in work_list if bool(dictionary.meaning(i))]
|
| 14 |
+
others = []
|
| 15 |
+
return topic_name+ ' '+str(distance_name), str(topic_name_dep) + ' '+str(distance_name_dep),tags_list, str(work_list), str(others)
|
| 16 |
else:
|
| 17 |
+
return 'Event discription should have >= 20 words', None, None, None,None
|
| 18 |
|
| 19 |
|
| 20 |
with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:
|
|
|
|
| 35 |
|
| 36 |
output_sec = gradio.outputs.Textbox(label="Mapped sector and score")
|
| 37 |
output_dep = gradio.outputs.Textbox(label="Mapped industry and score")
|
| 38 |
+
output_tags= gradio.outputs.Textbox(label="Identified tags")
|
| 39 |
|
| 40 |
with gradio.Row():
|
| 41 |
output_keybert = gradio.outputs.Textbox(label="Identified keywords (1 word)")
|
| 42 |
+
output_other_tags = gradio.outputs.Textbox(label="Identified other tags")
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
button.click(get_output,
|
| 47 |
[event_info],
|
| 48 |
+
outputs=[output_sec, output_dep, output_tags, output_keybert, output_other_tags])
|
| 49 |
|
| 50 |
#keyword_cluster_demo.queue().launch(share=True,debug =True, show_error =True)
|
| 51 |
keyword_cluster_demo.queue().launch()
|