storresbusquets commited on
Commit
a8ad3ac
β€’
1 Parent(s): 89aa10a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -19
app.py CHANGED
@@ -88,7 +88,7 @@ class GradioInference:
88
  truncation=True
89
  )
90
 
91
- #### Resumen multilingue con mt5
92
  WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
93
 
94
  input_ids_sum = self.mt5_tokenizer(
@@ -111,7 +111,7 @@ class GradioInference:
111
  skip_special_tokens=True,
112
  clean_up_tokenization_spaces=False
113
  )
114
- #### Fin resumen multilingue
115
 
116
  progress(0.60, desc="Extracting Keywords")
117
 
@@ -218,7 +218,7 @@ class GradioInference:
218
  results["text"], max_length=150, min_length=30, do_sample=False, truncation=True
219
  )
220
 
221
- #### Resumen multilingue
222
  WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
223
 
224
  input_ids_sum = self.mt5_tokenizer(
@@ -241,7 +241,7 @@ class GradioInference:
241
  skip_special_tokens=True,
242
  clean_up_tokenization_spaces=False
243
  )
244
- #### Fin resumen multilingue
245
 
246
  progress(0.50, desc="Extracting Keywords")
247
 
@@ -322,7 +322,7 @@ class GradioInference:
322
  article, max_length=150, min_length=30, do_sample=False, truncation=True
323
  )
324
 
325
- #### Resumen multilingue
326
  WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
327
 
328
  input_ids_sum = self.mt5_tokenizer(
@@ -345,7 +345,7 @@ class GradioInference:
345
  skip_special_tokens=True,
346
  clean_up_tokenization_spaces=False
347
  )
348
- #### Fin resumen multilingue
349
 
350
  progress(0.60, desc="Extracting Keywords")
351
 
@@ -455,18 +455,17 @@ with block as demo:
455
  label = gr.Label(label="Sentiment Analysis")
456
  wordcloud_image = gr.Image(label="WordCloud")
457
 
458
- with gr.Row().style(rounded=True):
459
- btn = gr.Button("Get Video Insights πŸ”Ž", variant="primary", scale=1)
460
- clear = gr.ClearButton(
461
- [link, title, img, text, summary, keywords, label, wordcloud_image],
462
- value="Clear πŸ—‘οΈ", scale=1
463
- )
464
- btn.click(
465
- gio,
466
- inputs=[link, lang, size],
467
- outputs=[text, summary, keywords, label, wordcloud_image],
468
- )
469
- link.change(gio.populate_metadata, inputs=[link], outputs=[img, title])
470
 
471
  with gr.Tab("From Audio file πŸŽ™οΈ"):
472
  with gr.Box():
@@ -540,7 +539,9 @@ with block as demo:
540
 
541
  with block:
542
  gr.Markdown("### Video Examples")
543
- gr.Examples(["https://www.youtube.com/shorts/xDNzz8yAH7I","https://www.youtube.com/watch?v=MnrJzXM7a6o&pp=ygURc3RldmUgam9icyBzcGVlY2g%3D"], inputs=link)
 
 
544
 
545
  gr.Markdown("### Audio Examples")
546
  # gr.Examples(
 
88
  truncation=True
89
  )
90
 
91
+ # Multilingual summary with mt5
92
  WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
93
 
94
  input_ids_sum = self.mt5_tokenizer(
 
111
  skip_special_tokens=True,
112
  clean_up_tokenization_spaces=False
113
  )
114
+ # End multilingual summary
115
 
116
  progress(0.60, desc="Extracting Keywords")
117
 
 
218
  results["text"], max_length=150, min_length=30, do_sample=False, truncation=True
219
  )
220
 
221
+ # Multilingual summary with mt5
222
  WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
223
 
224
  input_ids_sum = self.mt5_tokenizer(
 
241
  skip_special_tokens=True,
242
  clean_up_tokenization_spaces=False
243
  )
244
+ # End multilingual summary
245
 
246
  progress(0.50, desc="Extracting Keywords")
247
 
 
322
  article, max_length=150, min_length=30, do_sample=False, truncation=True
323
  )
324
 
325
+ # Multilingual summary with mt5
326
  WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
327
 
328
  input_ids_sum = self.mt5_tokenizer(
 
345
  skip_special_tokens=True,
346
  clean_up_tokenization_spaces=False
347
  )
348
+ # End multilingual summary
349
 
350
  progress(0.60, desc="Extracting Keywords")
351
 
 
455
  label = gr.Label(label="Sentiment Analysis")
456
  wordcloud_image = gr.Image(label="WordCloud")
457
 
458
+ btn = gr.Button("Get Video Insights πŸ”Ž", variant="primary", scale=1)
459
+ clear = gr.ClearButton(
460
+ [link, title, img, text, summary, keywords, label, wordcloud_image],
461
+ value="Clear πŸ—‘οΈ", scale=1
462
+ )
463
+ btn.click(
464
+ gio,
465
+ inputs=[link, lang, size],
466
+ outputs=[text, summary, keywords, label, wordcloud_image],
467
+ )
468
+ link.change(gio.populate_metadata, inputs=[link], outputs=[img, title])
 
469
 
470
  with gr.Tab("From Audio file πŸŽ™οΈ"):
471
  with gr.Box():
 
539
 
540
  with block:
541
  gr.Markdown("### Video Examples")
542
+ gr.Examples(["https://www.youtube.com/shorts/xDNzz8yAH7I",
543
+ "https://www.youtube.com/watch?v=MnrJzXM7a6o&pp=ygURc3RldmUgam9icyBzcGVlY2g%3D",
544
+ "https://www.youtube.com/watch?v=FKjj1tNcbtM&pp=ygUvZGFuaWVsIGdvbGVtYW4gdGVkIHRhbGsgZW1vdGlvbmFsIGludGVsbGlnZW5jZSA%3D"], inputs=link)
545
 
546
  gr.Markdown("### Audio Examples")
547
  # gr.Examples(