Spaces:
Sleeping
Sleeping
File size: 1,290 Bytes
33e6674 2175de9 5a75be5 33e6674 2175de9 5a75be5 33e6674 |
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 33 |
# Event handlers for buttons
gen_btn.click(
fn=get_random_sentence,
inputs=[lang_choice],
outputs=[intended_display]
)
analyze_btn.click(
fn=compare_pronunciation,
inputs=[audio_input, lang_choice, intended_display],
outputs=[
status_output, # status
pass1_out, # actual_text
pass2_out, # corrected_text
wer_out, # wer formatted
cer_out, # cer formatted
gr.skip(), # actual_text (duplicate)
gr.skip(), # actual_hk (not displayed)
gr.skip(), # intended_sentence (duplicate)
gr.skip(), # target_hk (not displayed)
diff_html_box, # diff_html
char_html_box, # char_html
gr.skip(), # intended_sentence (duplicate)
target_display # target_display
]
)
# Auto-generate sentence on language change
lang_choice.change(
fn=get_random_sentence,
inputs=[lang_choice],
outputs=[intended_display]
) |