from Summarizer_Agent import Summarizer import gradio as gr summarizer=Summarizer() flags = { "us": "🇺🇸", "england": "🏴", "australia": "🇦🇺", "indian": "🇮🇳", "canada": "🇨🇦", "bermuda": "🇧🇲", "scotland": "🏴", "african": "🌍", "ireland": "🇮🇪", "newzealand": "🇳🇿", "wales": "🏴", "malaysia": "🇲🇾", "philippines": "🇵🇭", "singapore": "🇸🇬", "hongkong": "🇭🇰", "southatlandtic": "🌊" } def process_youtube(url): try: summary = summarizer.summarize(url) accent_info = summarizer.classify(url) accent = accent_info["label"] flag = flags.get(accent.lower(), "🏳️") # fallback to white flag if not found accent_display = f"{flag} {accent.capitalize()}" return summary, accent_display, accent_info["score"] except Exception as e: return f"Error: {e}" demo = gr.Interface( fn=process_youtube, inputs=gr.Textbox(label="public video URL", placeholder="Enter public video link here..."), outputs=[ gr.Textbox(label="Candidate Summary", lines=10), gr.Textbox(label="Detected Accent"), gr.Slider(label="Confidence Score (%)", minimum=0, maximum=1, step=0.001, interactive=False) ], title="Interview Audio Summarizer", description="Paste an interview video link. The app will summarize the candidate's response and detect the speaker's accent." ) if __name__=="__main__": demo.launch()