Spaces:
Runtime error
Runtime error
RamAnanth1
commited on
Commit
·
09c8fac
1
Parent(s):
e268f63
Update app.py
Browse files
app.py
CHANGED
@@ -90,8 +90,10 @@ def get_transcript_url(url):
|
|
90 |
|
91 |
df = pd.DataFrame(res)
|
92 |
df = df.loc[:, ["text", "sentiment", "confidence"]]
|
|
|
|
|
93 |
|
94 |
-
return transcription_result['text'], transcription_result['summary'], df
|
95 |
|
96 |
# def get_transcript_file(filename):
|
97 |
|
@@ -187,10 +189,12 @@ with gr.Blocks() as demo:
|
|
187 |
summary = gr.Textbox(label = "Summary Result")
|
188 |
with gr.TabItem('Sentiment Analysis', visible = False) as sentiment_tab:
|
189 |
sentiment_analysis = gr.Dataframe(label = "Sentiment Analysis Result" )
|
|
|
|
|
190 |
|
191 |
|
192 |
-
inputs.submit(get_transcript_url, [inputs], [transcript, summary, sentiment_analysis])
|
193 |
-
b1.click(get_transcript_url, [inputs], [transcript, summary, sentiment_analysis])
|
194 |
|
195 |
examples = gr.Examples(examples = [["https://github.com/AssemblyAI-Examples/assemblyai-and-python-in-5-minutes/blob/main/audio.mp3?raw=true"]], inputs = inputs, outputs=[transcript, summary, sentiment_analysis], cache_examples = True, fn = get_transcript_url)
|
196 |
|
|
|
90 |
|
91 |
df = pd.DataFrame(res)
|
92 |
df = df.loc[:, ["text", "sentiment", "confidence"]]
|
93 |
+
|
94 |
+
topic = transcription_result['iab_categories_result']['summary']
|
95 |
|
96 |
+
return transcription_result['text'], transcription_result['summary'], df, topic
|
97 |
|
98 |
# def get_transcript_file(filename):
|
99 |
|
|
|
189 |
summary = gr.Textbox(label = "Summary Result")
|
190 |
with gr.TabItem('Sentiment Analysis', visible = False) as sentiment_tab:
|
191 |
sentiment_analysis = gr.Dataframe(label = "Sentiment Analysis Result" )
|
192 |
+
with gr.TabItem('Topic Detection', visible = False) as topic_detection_tab:
|
193 |
+
topic_detection = gr.Textbox(label = "Topic Detection Result" )
|
194 |
|
195 |
|
196 |
+
inputs.submit(get_transcript_url, [inputs], [transcript, summary, sentiment_analysis, topic_detection])
|
197 |
+
b1.click(get_transcript_url, [inputs], [transcript, summary, sentiment_analysis,topic_detection])
|
198 |
|
199 |
examples = gr.Examples(examples = [["https://github.com/AssemblyAI-Examples/assemblyai-and-python-in-5-minutes/blob/main/audio.mp3?raw=true"]], inputs = inputs, outputs=[transcript, summary, sentiment_analysis], cache_examples = True, fn = get_transcript_url)
|
200 |
|