Spaces:
Runtime error
Runtime error
Commit ·
2e6a042
1
Parent(s): d56b313
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
import gradio
|
| 2 |
from kbert_topics import extract_topics
|
| 3 |
from mapping import get_mapping
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
def get_output(event_info):
|
| 7 |
if len(event_info.split(' '))>=20:
|
| 8 |
topic_name, distance_name, topic_name_other, distance_name_other = get_mapping(event_info)
|
| 9 |
work_list = extract_topics(event_info)
|
| 10 |
-
return topic_name+ ' '+str(distance_name), str(topic_name_other) + ' '+str(distance_name_other), str(work_list)
|
| 11 |
else:
|
| 12 |
-
return 'Event discription should have >= 20 words', None, None
|
| 13 |
|
| 14 |
|
| 15 |
with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:
|
|
|
|
| 1 |
import gradio
|
| 2 |
from kbert_topics import extract_topics
|
| 3 |
from mapping import get_mapping
|
| 4 |
+
from topics_extraction import classify
|
| 5 |
|
| 6 |
|
| 7 |
def get_output(event_info):
|
| 8 |
if len(event_info.split(' '))>=20:
|
| 9 |
topic_name, distance_name, topic_name_other, distance_name_other = get_mapping(event_info)
|
| 10 |
work_list = extract_topics(event_info)
|
| 11 |
+
return topic_name+ ' '+str(distance_name), str(topic_name_other) + ' '+str(distance_name_other), str(work_list),classify(event_info)
|
| 12 |
else:
|
| 13 |
+
return 'Event discription should have >= 20 words', None, None,None
|
| 14 |
|
| 15 |
|
| 16 |
with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:
|