owaiskha9654 commited on
Commit
30f53c4
·
1 Parent(s): 9b75a60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,8 +2,8 @@ from transformers import pipeline
2
  from youtube_transcript_api import YouTubeTranscriptApi
3
  import gradio as gr
4
 
5
- def summarize(Youtube_video_Link):
6
- video_id = youtube_video.split("=")[1]
7
  transcript = YouTubeTranscriptApi.get_transcript(video_id)
8
 
9
  summarizer = pipeline('summarization',model='sshleifer/distilbart-cnn-12-6')
@@ -29,7 +29,7 @@ def summarize(Youtube_video_Link):
29
  output_text=' '.join(summarized_text)
30
  return output_text
31
 
32
- title = "YouTube Live Video Summarization"
33
  examples = [
34
  ("https://www.youtube.com/watch?v=zKvd1JwJ4Po"),
35
  ("https://www.youtube.com/watch?v=9izcbNYmP8M"),
@@ -38,6 +38,6 @@ text1 = (
38
  "<center> Author: Owais Ahmad Data Scientist at <b> Thoucentric </b> <a href=\"https://www.linkedin.com/in/owaiskhan9654/\">Visit Profile</a> <br></center>"
39
  "<center> Kaggle Profile <a href=\"https://www.kaggle.com/owaiskhan9654\">Link</a> <br> </center>"
40
  )
41
- Youtube_video_Link = gr.Textbox("Input Youtube Link here (Note: This will take time if passed a long video)", show_label=False)
42
- App= gr.Interface(fn=summarize, inputs=Youtube_video_Link, outputs="text", examples=examples, title=title,article=text1)
43
  App.launch()
 
2
  from youtube_transcript_api import YouTubeTranscriptApi
3
  import gradio as gr
4
 
5
+ def summarize(Youtube_Video_Link):
6
+ video_id = Youtube_Video_Link.split("=")[1]
7
  transcript = YouTubeTranscriptApi.get_transcript(video_id)
8
 
9
  summarizer = pipeline('summarization',model='sshleifer/distilbart-cnn-12-6')
 
29
  output_text=' '.join(summarized_text)
30
  return output_text
31
 
32
+ title = "YouTube Live 😎 Video Summarization"
33
  examples = [
34
  ("https://www.youtube.com/watch?v=zKvd1JwJ4Po"),
35
  ("https://www.youtube.com/watch?v=9izcbNYmP8M"),
 
38
  "<center> Author: Owais Ahmad Data Scientist at <b> Thoucentric </b> <a href=\"https://www.linkedin.com/in/owaiskhan9654/\">Visit Profile</a> <br></center>"
39
  "<center> Kaggle Profile <a href=\"https://www.kaggle.com/owaiskhan9654\">Link</a> <br> </center>"
40
  )
41
+ Youtube_Video_Link = gr.Textbox("Input Youtube Link here (Note: This will take time if passed a long video)", show_label=False)
42
+ App= gr.Interface(fn=summarize, inputs=Youtube_Video_Link, outputs="text", examples=examples, title=title,article=text1)
43
  App.launch()