Spaces:
Runtime error
Runtime error
Commit ·
066ab05
1
Parent(s): dcf2a73
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,12 +8,12 @@ dictionary=PyDictionary()
|
|
| 8 |
|
| 9 |
def get_output(event_info):
|
| 10 |
if len(event_info.split(' '))>=20:
|
| 11 |
-
topic_name, distance_name, topic_name_other, distance_name_other = get_mapping(event_info)
|
| 12 |
work_list = extract_topics(event_info)
|
| 13 |
-
work_list = [i for i in work_list if bool(dictionary.meaning(i))]
|
| 14 |
-
return topic_name+ ' '+str(distance_name), str(topic_name_other) + ' '+str(distance_name_other), str(work_list),classify(event_info)
|
| 15 |
else:
|
| 16 |
-
return 'Event discription should have >= 20 words', None, None,None
|
| 17 |
|
| 18 |
|
| 19 |
with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:
|
|
@@ -31,16 +31,17 @@ with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo
|
|
| 31 |
with gradio.Column(scale=1):
|
| 32 |
event_info = gradio.Textbox(label='enter event discription')
|
| 33 |
button = gradio.Button("Submit")
|
| 34 |
-
output_sec = gradio.outputs.Textbox(label="
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
button.click(get_output,
|
| 42 |
[event_info],
|
| 43 |
-
outputs=[output_sec, output_other, output_keybert, output_tags_identified])
|
| 44 |
|
| 45 |
#keyword_cluster_demo.queue().launch(share=True,debug =True, show_error =True)
|
| 46 |
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, topic_name_other, distance_name_other = get_mapping(event_info)
|
| 12 |
work_list = extract_topics(event_info)
|
| 13 |
+
work_list = [i for i in work_list if bool(dictionary.meaning(i))]
|
| 14 |
+
return topic_name+ ' '+str(distance_name), str(topic_name_dep) + ' '+str(distance_name_dep),str(topic_name_other) + ' '+str(distance_name_other), str(work_list),classify(event_info)
|
| 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:
|
|
|
|
| 31 |
with gradio.Column(scale=1):
|
| 32 |
event_info = gradio.Textbox(label='enter event discription')
|
| 33 |
button = gradio.Button("Submit")
|
| 34 |
+
output_sec = gradio.outputs.Textbox(label="Mapped sector and score")
|
| 35 |
+
output_dep = gradio.outputs.Textbox(label="Mapped industry and score")
|
| 36 |
+
output_other= gradio.outputs.Textbox(label="Mapped other departments/categories")
|
| 37 |
+
output_keybert = gradio.outputs.Textbox(label="Identified keywords (1 word)")
|
| 38 |
+
output_tags_identified = gradio.outputs.Textbox(label="Identified Tags")
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
button.click(get_output,
|
| 43 |
[event_info],
|
| 44 |
+
outputs=[output_sec, output_dep, output_other, output_keybert, output_tags_identified])
|
| 45 |
|
| 46 |
#keyword_cluster_demo.queue().launch(share=True,debug =True, show_error =True)
|
| 47 |
keyword_cluster_demo.queue().launch()
|