storresbusquets commited on
Commit
30cd647
β€’
1 Parent(s): 0135c32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -29
app.py CHANGED
@@ -497,16 +497,16 @@ with block as demo:
497
  label = gr.Label(label="Sentiment Analysis")
498
  wordcloud_image = gr.Image(label="WordCloud")
499
 
500
- with gr.Row():
501
- btn = gr.Button(
502
- "Get Audio Insights πŸ”Ž", variant="primary"
503
- )
504
- clear = gr.ClearButton([audio_file,text, summary, keywords, label, wordcloud_image], value="Clear πŸ—‘οΈ")
505
- btn.click(
506
- gio.from_audio_input,
507
- inputs=[lang, size, audio_file],
508
- outputs=[text, summary, keywords, label, wordcloud_image],
509
  )
 
 
 
 
 
 
510
 
511
  with gr.Tab("From Article πŸ“‹"):
512
  with gr.Box():
@@ -528,37 +528,40 @@ with block as demo:
528
  label = gr.Label(label="Sentiment Analysis")
529
  wordcloud_image = gr.Image(label="WordCloud")
530
 
531
- with gr.Row():
532
- btn = gr.Button(
533
- "Get Text insights πŸ”Ž", variant="primary")
534
- clear = gr.ClearButton([article, summary, keywords, label, wordcloud_image], value="Clear")
535
- btn.click(
536
- gio.from_article,
537
- inputs=[article],
538
- outputs=[summary, keywords, label, wordcloud_image],
539
- )
540
 
541
  with block:
542
  gr.Markdown("### Video Examples")
543
  gr.Examples(["https://www.youtube.com/shorts/xDNzz8yAH7I",
544
  "https://www.youtube.com/watch?v=MnrJzXM7a6o&pp=ygURc3RldmUgam9icyBzcGVlY2g%3D",
545
- "https://www.youtube.com/watch?v=FKjj1tNcbtM&pp=ygUvZGFuaWVsIGdvbGVtYW4gdGVkIHRhbGsgZW1vdGlvbmFsIGludGVsbGlnZW5jZSA%3D"], inputs=link)
 
546
 
547
  gr.Markdown("### Audio Examples")
548
- # gr.Examples(
549
- # [[os.path.join(os.path.dirname(__file__),"audios/TED_lagrange_point.wav")],[os.path.join(os.path.dirname(__file__),"audios/TED_platon.wav")]],
550
- # inputs=audio_file)
 
 
551
 
552
  gr.Markdown("### About the app:")
553
 
554
- with gr.Accordion("What is YouTube Insights?", open=False):
555
  gr.Markdown(
556
- "YouTube Insights is a tool developed for academic purposes that allows you to analyze YouTube videos or audio files. It provides features like transcription, summarization, keyword extraction, sentiment analysis, and word cloud generation for multimedia content."
557
  )
558
 
559
- with gr.Accordion("How does YouTube Insights work?", open=False):
560
  gr.Markdown(
561
- "YouTube Insights leverages several powerful AI models and libraries. It uses OpenAI's Whisper for Automatic Speech Recognition (ASR) to transcribe audio content. It summarizes the transcribed text using Facebook's BART model, extracts keywords with VoiceLabT5, performs sentiment analysis with DistilBERT, and generates word clouds."
562
  )
563
 
564
  with gr.Accordion("What languages are supported for the analysis?", open=False):
@@ -568,7 +571,7 @@ with block:
568
 
569
  with gr.Accordion("Can I analyze audio files instead of YouTube videos?", open=False):
570
  gr.Markdown(
571
- "Yes, you can analyze audio files directly. Simply upload your audio file to the app, and it will provide the same transcription, summarization, keyword extraction, sentiment analysis, and word cloud generation features."
572
  )
573
 
574
  with gr.Accordion("What are the different model sizes available for transcription?", open=False):
@@ -581,9 +584,9 @@ with block:
581
  "The time taken for analysis may vary based on the duration of the video or audio file and the selected model size. Shorter content will be processed more quickly."
582
  )
583
 
584
- with gr.Accordion("Who developed YouTube Insights?" ,open=False):
585
  gr.Markdown(
586
- "YouTube Insights was developed by students as part of the 2022/23 Master's in Big Data & Data Science program at Universidad Complutense de Madrid for academic purposes (Trabajo de Fin de Master)."
587
  )
588
 
589
  gr.HTML(
 
497
  label = gr.Label(label="Sentiment Analysis")
498
  wordcloud_image = gr.Image(label="WordCloud")
499
 
500
+ with gr.Row():
501
+ btn = gr.Button(
502
+ "Get Audio Insights πŸ”Ž", variant="primary"
 
 
 
 
 
 
503
  )
504
+ clear = gr.ClearButton([audio_file,text, summary, keywords, label, wordcloud_image], value="Clear πŸ—‘οΈ")
505
+ btn.click(
506
+ gio.from_audio_input,
507
+ inputs=[lang, size, audio_file],
508
+ outputs=[text, summary, keywords, label, wordcloud_image],
509
+ )
510
 
511
  with gr.Tab("From Article πŸ“‹"):
512
  with gr.Box():
 
528
  label = gr.Label(label="Sentiment Analysis")
529
  wordcloud_image = gr.Image(label="WordCloud")
530
 
531
+ with gr.Row():
532
+ btn = gr.Button(
533
+ "Get Text insights πŸ”Ž", variant="primary")
534
+ clear = gr.ClearButton([article, summary, keywords, label, wordcloud_image], value="Clear")
535
+ btn.click(
536
+ gio.from_article,
537
+ inputs=[article],
538
+ outputs=[summary, keywords, label, wordcloud_image],
539
+ )
540
 
541
  with block:
542
  gr.Markdown("### Video Examples")
543
  gr.Examples(["https://www.youtube.com/shorts/xDNzz8yAH7I",
544
  "https://www.youtube.com/watch?v=MnrJzXM7a6o&pp=ygURc3RldmUgam9icyBzcGVlY2g%3D",
545
+ "https://www.youtube.com/watch?v=FKjj1tNcbtM&pp=ygUvZGFuaWVsIGdvbGVtYW4gdGVkIHRhbGsgZW1vdGlvbmFsIGludGVsbGlnZW5jZSA%3D"],
546
+ inputs=link)
547
 
548
  gr.Markdown("### Audio Examples")
549
+ gr.Examples([
550
+ [os.path.join(os.path.dirname(__file__),"audios/EnglishLectura.wav")],
551
+ # [os.path.join(os.path.dirname(__file__),"audios/TED_platon.wav")],
552
+ ]
553
+ inputs=audio_file)
554
 
555
  gr.Markdown("### About the app:")
556
 
557
+ with gr.Accordion("What is Media Insights?", open=False):
558
  gr.Markdown(
559
+ "Media Insights is a tool developed for academic purposes that allows you to analyze YouTube videos, audio files or some text. It provides features like transcription, summarization, keyword extraction, sentiment analysis, and word cloud generation for multimedia content."
560
  )
561
 
562
+ with gr.Accordion("How does Media Insights work?", open=False):
563
  gr.Markdown(
564
+ "Media Insights leverages several powerful AI models and libraries. It uses OpenAI's Whisper for Automatic Speech Recognition (ASR) to transcribe audio content. It summarizes the transcribed text using Facebook's BART model, extracts keywords with VoiceLabT5, performs sentiment analysis with DistilBERT, and generates word clouds."
565
  )
566
 
567
  with gr.Accordion("What languages are supported for the analysis?", open=False):
 
571
 
572
  with gr.Accordion("Can I analyze audio files instead of YouTube videos?", open=False):
573
  gr.Markdown(
574
+ "Yes, you can analyze audio files directly. Simply upload your audio file to the app, and it will provide the same transcription, summarization, keyword extraction, sentiment analysis, and word cloud generation features. In addition, you can also paste your article or text of your preference, to get all the insights directly from it."
575
  )
576
 
577
  with gr.Accordion("What are the different model sizes available for transcription?", open=False):
 
584
  "The time taken for analysis may vary based on the duration of the video or audio file and the selected model size. Shorter content will be processed more quickly."
585
  )
586
 
587
+ with gr.Accordion("Who developed Media Insights?" ,open=False):
588
  gr.Markdown(
589
+ "Media Insights was developed by students as part of the 2022/23 Master's in Big Data & Data Science program at Universidad Complutense de Madrid for academic purposes (Trabajo de Fin de Master)."
590
  )
591
 
592
  gr.HTML(