storresbusquets commited on
Commit
9a38a5b
1 Parent(s): 29f2c16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -47,8 +47,8 @@ class GradioInference():
47
  keywords = [x.strip() for x in predicted.split(',') if x.strip()]
48
 
49
  label = self.classifier(results["text"])[0]["label"]
50
-
51
- return results["text"], transcription_summary[0]["summary_text"], keywords, label
52
 
53
  def populate_metadata(self, link):
54
  self.yt = YouTube(link)
@@ -139,7 +139,7 @@ with block as demo:
139
  with gr.Row().style(equal_height=True):
140
  clear = gr.ClearButton([text], scale=1)
141
  btn = gr.Button("Get video insights", variant='primary', scale=1) # Updated button label
142
- btn.click(gio.from_audio_input, inputs=[lang, size, audio_file], outputs=[text, summary, keywords, label])
143
 
144
 
145
  with block:
 
47
  keywords = [x.strip() for x in predicted.split(',') if x.strip()]
48
 
49
  label = self.classifier(results["text"])[0]["label"]
50
+ wordcloud = WordCloud(width=800, height=400, background_color='white').generate(results["text"])
51
+ return results["text"], transcription_summary[0]["summary_text"], keywords, label, wordcloud
52
 
53
  def populate_metadata(self, link):
54
  self.yt = YouTube(link)
 
139
  with gr.Row().style(equal_height=True):
140
  clear = gr.ClearButton([text], scale=1)
141
  btn = gr.Button("Get video insights", variant='primary', scale=1) # Updated button label
142
+ btn.click(gio.from_audio_input, inputs=[lang, size, audio_file], outputs=[text, summary, keywords, label, wordcloud])
143
 
144
 
145
  with block: