Spaces:
Runtime error
Runtime error
Download app.py from Sarath2002/YouTube_Video_Summarizer: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/spaces/Sarath2002/YouTube_Video_Summarizer/resolve/main/app.py
- Command line
-
hf download hf://spaces/Sarath2002/YouTube_Video_Summarizer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sarath2002/YouTube_Video_Summarizer/resolve/main/app.py
1.48 kB
| import gradio as gr | |
| from support import * | |
| import os | |
| import nltk | |
| nltk.download('punkt') | |
| os.system("pip install -r requirements.txt") | |
| description = """ | |
| Repo on Github --> YouTube_Summarizer_using_BART --> https://github.com/Sarath1729-2002/YouTube_Summarizer_using_BART | |
| 🎯 Input the link of the video to be summarized, and click ''submit''' to get the summary | |
| ⌛️ It takes about 2 to 15 mins to generate detection results, depending on the video size. Best to use videos shorter than 10 mins for optimum efficiency | |
| 🏠 Uses extractive summarisation by TextRank in step 1 to get the top-priority sentences, then using BART summarizer, this intermediate summary is then summarised within the given max_length | |
| Try these sample videos if in a hurry 😊 | |
| --> https://youtu.be/s4g1XFU8Gto | |
| --> https://youtu.be/L5YHlH0f4Uw | |
| """ | |
| def initialize(link, max_length,min_length): | |
| path = "plaintext.txt" | |
| url = link | |
| video = get_vidid(url) | |
| vid_transcript(video) | |
| temp_summ = ext_summarizer(path) | |
| summ = abs_summarizer(temp_summ, max_length) | |
| return summ | |
| interface = gr.Interface( | |
| inputs=[ | |
| gr.inputs.Textbox(lines=2,label="YouTube Link"), | |
| gr.Slider(minimum=200,maximum=500,default=350,label="Max Length") | |
| ], | |
| outputs=[ | |
| gr.outputs.Textbox(label="Summarised YouTube Video "), | |
| ], | |
| fn=initialize, | |
| description=description) | |
| interface.launch() |