File size: 1,270 Bytes
c703d4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

import gradio as gr
from subtitles import Video_To_Text
from summary import summary_nlp,Summary_BART
from translate import Translation

def Processing(url,model,lang):
    summary_result=" "
    trans_res=" "
    language=""
    data=Video_To_Text(url)
    if(model=="NLP"):
        summary_result=summary_nlp(data)
    elif(model=="BART"):
        summary_result=Summary_BART(data)
    if(lang=="Urdu"):
        language="urdu"
    elif(lang=="German"):
        language="german"
    elif(lang=="Hindi"):
        language="hindi"
    trans_res=Translation(summary_result,language)
    return summary_result,trans_res


interface=gr.Interface(fn=Processing,inputs=[gr.components.Textbox(placeholder="Enter YouTube Video Link",label="YouTube Video Link"),gr.components.Radio(["NLP","BART"],type="value",label="Select any one Summary Model"),gr.components.Radio(["Urdu","German","Hindi"],type="value",label="Select any one Language")],
                       outputs=[gr.components.Textbox(label="Summary in English"),gr.components.Textbox(label="Summary in English")],
                       examples=[
                           ["https://www.youtube.com/watch?v=ZSt9tm3RoUU","BART","Urdu"],
                       ]
                      )
interface.launch(debug=True)