Spaces:
Runtime error
Runtime error
Commit
ยท
a8ad3ac
1
Parent(s):
89aa10a
Update app.py
Browse files
app.py
CHANGED
@@ -88,7 +88,7 @@ class GradioInference:
|
|
88 |
truncation=True
|
89 |
)
|
90 |
|
91 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
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 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
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",
|
|
|
|
|
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(
|