harshithakr commited on
Commit
c7236e1
·
1 Parent(s): 9dea803

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -4,12 +4,14 @@ from mapping import get_mapping
4
 
5
 
6
  def get_output(event_info):
7
- topic_name, distance_name, topic_name_other, distance_name_other = get_mapping(event_info)
8
- work_list = extract_topics(event_info)
9
-
10
- return topic_name+ ' '+str(distance_name), str(topic_name_other) + ' '+str(distance_name_other), str(work_list)
11
-
12
-
 
 
13
  with gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:
14
 
15
  gradio.Markdown(
 
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:
16
 
17
  gradio.Markdown(