Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import time | |
| def speech_to_text(speech): | |
| time.sleep(1) | |
| return """SPEAKER_00: ''So I've prepared a presentation I'm sharing it with All you should be able to seat on your screen right now. Got it?'' from 0.258-6.249 | |
| SPEAKER_01: ''I don't see a link anywhere says it Headed down low a plug and.'' from 6.384-9.573""", """so i've prepared a presentation i'm sharing it with all you should be able to seat on your screen right now got it i don't see a link anywhere says it headed down low a plug and""" | |
| def sentiment(checked_options): | |
| time.sleep(0.3) | |
| return {"happy": 0.5, "confused": 0.3, "sad": 0.2} | |
| demo = gr.Blocks() | |
| with demo: | |
| with gr.Row(): | |
| with gr.Column(): | |
| audio = gr.Audio() | |
| with gr.Row(): | |
| btn = gr.Button("Transcribe") | |
| with gr.Column(): | |
| diarized = gr.Textbox(lines=5, label="Diarized Output") | |
| full = gr.Textbox(lines=4, label="Full Transcript") | |
| check = gr.CheckboxGroup(["Speaker 1", "Speaker 2"]) | |
| label = gr.Label() | |
| btn.click(speech_to_text, audio, [diarized, full], status_tracker=gr.StatusTracker(cover_container=True)) | |
| check.change(sentiment, check, label, status_tracker=gr.StatusTracker(cover_container=True)) | |
| demo.launch() |