Spaces:
Runtime error
Runtime error
Commit ·
066ab05
1
Parent(s): dcf2a73
Update app.py
Browse files7 unmodified lines891011121314151617181911 unmodified lines313233343536373839404142434445467 unmodified linesdef get_output(event_info):if len(event_info.split(' '))>=20:topic_name, distance_name, topic_name_other, distance_name_other = get_mapping(event_info)work_list = extract_topics(event_info)work_list = [i for i in work_list if bool(dictionary.meaning(i))])return topic_name+ ' '+str(distance_name), str(topic_name_other) + ' '+str(distance_name_other), str(work_list),classify(event_info)else:return 'Event discription should have >= 20 words', None, None,Nonewith gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:11 unmodified lineswith gradio.Column(scale=1):event_info = gradio.Textbox(label='enter event discription')button = gradio.Button("Submit")output_sec = gradio.outputs.Textbox(label="mapped sector and score")output_other = gradio.outputs.Textbox(label="mapped other industry and score")output_keybert = gradio.outputs.Textbox(label="identified keywords")output_tags_identified = gradio.outputs.Textbox(label="identified Tags")button.click(get_output,[event_info],outputs=[output_sec, output_other, output_keybert, output_tags_identified])#keyword_cluster_demo.queue().launch(share=True,debug =True, show_error =True)keyword_cluster_demo.queue().launch()7 unmodified lines891011121314151617181911 unmodified lines31323334353637383940414243444546477 unmodified linesdef get_output(event_info):if len(event_info.split(' '))>=20:topic_name, distance_name,topic_name_dep, distance_name_dep, topic_name_other, distance_name_other = get_mapping(event_info)work_list = extract_topics(event_info)work_list = [i for i in work_list if bool(dictionary.meaning(i))]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)else:return 'Event discription should have >= 20 words', None, None, None,Nonewith gradio.Blocks(theme = 'gradio/monochrome', title = 'Keyword clustering Demo') as keyword_cluster_demo:11 unmodified lineswith gradio.Column(scale=1):event_info = gradio.Textbox(label='enter event discription')button = gradio.Button("Submit")output_sec = gradio.outputs.Textbox(label="Mapped sector and score")output_dep = gradio.outputs.Textbox(label="Mapped industry and score")output_other= gradio.outputs.Textbox(label="Mapped other departments/categories")output_keybert = gradio.outputs.Textbox(label="Identified keywords (1 word)")output_tags_identified = gradio.outputs.Textbox(label="Identified Tags")button.click(get_output,[event_info],outputs=[output_sec, output_dep, output_other, output_keybert, output_tags_identified])#keyword_cluster_demo.queue().launch(share=True,debug =True, show_error =True)keyword_cluster_demo.queue().launch()
app.py+10-9