Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -157,9 +157,7 @@ def transliterate_to_hk(text, lang_choice):
|
|
157 |
"""Transliterate Indic text to Harvard-Kyoto"""
|
158 |
mapping = {
|
159 |
"Tamil": sanscript.TAMIL,
|
160 |
-
"Malayalam": sanscript.MALAYALAM,
|
161 |
-
"Hindi": sanscript.DEVANAGARI,
|
162 |
-
"Sanskrit": sanscript.DEVANAGARI,
|
163 |
"English": None
|
164 |
}
|
165 |
|
@@ -433,7 +431,7 @@ def create_interface():
|
|
433 |
gr.Markdown("""
|
434 |
# ποΈ Multilingual Pronunciation Trainer
|
435 |
|
436 |
-
**Practice pronunciation in Tamil, Malayalam
|
437 |
|
438 |
### π How to Use:
|
439 |
1. **Select** your target language π
|
@@ -525,33 +523,6 @@ def create_interface():
|
|
525 |
visible=False
|
526 |
)
|
527 |
|
528 |
-
# Event handlers
|
529 |
-
def generate_and_clear(language):
|
530 |
-
sentence = get_random_sentence(language)
|
531 |
-
return sentence, "", "", "", "", "", "", "", "", "", "", "", ""
|
532 |
-
|
533 |
-
gen_btn.click(
|
534 |
-
fn=generate_and_clear,
|
535 |
-
inputs=[lang_choice],
|
536 |
-
outputs=[
|
537 |
-
intended_display, status_output, pass1_out, pass2_out,
|
538 |
-
wer_out, cer_out, actual_text_display, actual_transliteration,
|
539 |
-
target_text_display, target_transliteration, diff_html_box,
|
540 |
-
char_html_box, target_display
|
541 |
-
]
|
542 |
-
)
|
543 |
-
|
544 |
-
analyze_btn.click(
|
545 |
-
fn=compare_pronunciation,
|
546 |
-
inputs=[audio_input, lang_choice, intended_display],
|
547 |
-
outputs=[
|
548 |
-
status_output, pass1_out, pass2_out,
|
549 |
-
wer_out, cer_out, actual_text_display, actual_transliteration,
|
550 |
-
target_text_display, target_transliteration, diff_html_box,
|
551 |
-
char_html_box, intended_display, target_display
|
552 |
-
]
|
553 |
-
)
|
554 |
-
|
555 |
# Auto-generate sentence on language change
|
556 |
lang_choice.change(
|
557 |
fn=get_random_sentence,
|
@@ -563,12 +534,13 @@ def create_interface():
|
|
563 |
gr.Markdown("""
|
564 |
---
|
565 |
### π§ Technical Details:
|
566 |
-
- **ASR Models**: Community-trained Whisper models optimized for
|
567 |
- **Metrics**: WER (Word Error Rate) and CER (Character Error Rate)
|
568 |
- **Transliteration**: Harvard-Kyoto system for Indic scripts
|
569 |
- **Analysis**: Dual-pass approach for comprehensive feedback
|
570 |
|
571 |
**Note**: TTS (Text-to-Speech) reference audio will be added in future updates.
|
|
|
572 |
""")
|
573 |
|
574 |
return demo
|
@@ -586,7 +558,7 @@ if __name__ == "__main__":
|
|
586 |
print("β
English model loaded successfully")
|
587 |
except Exception as e:
|
588 |
print(f"β οΈ Warning: Could not pre-load English model: {e}")
|
589 |
-
|
590 |
demo = create_interface()
|
591 |
demo.launch(
|
592 |
share=True,
|
|
|
157 |
"""Transliterate Indic text to Harvard-Kyoto"""
|
158 |
mapping = {
|
159 |
"Tamil": sanscript.TAMIL,
|
160 |
+
"Malayalam": sanscript.MALAYALAM,
|
|
|
|
|
161 |
"English": None
|
162 |
}
|
163 |
|
|
|
431 |
gr.Markdown("""
|
432 |
# ποΈ Multilingual Pronunciation Trainer
|
433 |
|
434 |
+
**Practice pronunciation in Tamil, Malayalam & English** using advanced speech recognition!
|
435 |
|
436 |
### π How to Use:
|
437 |
1. **Select** your target language π
|
|
|
523 |
visible=False
|
524 |
)
|
525 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
# Auto-generate sentence on language change
|
527 |
lang_choice.change(
|
528 |
fn=get_random_sentence,
|
|
|
534 |
gr.Markdown("""
|
535 |
---
|
536 |
### π§ Technical Details:
|
537 |
+
- **ASR Models**: Community-trained Whisper models optimized for Tamil & Malayalam
|
538 |
- **Metrics**: WER (Word Error Rate) and CER (Character Error Rate)
|
539 |
- **Transliteration**: Harvard-Kyoto system for Indic scripts
|
540 |
- **Analysis**: Dual-pass approach for comprehensive feedback
|
541 |
|
542 |
**Note**: TTS (Text-to-Speech) reference audio will be added in future updates.
|
543 |
+
**Languages**: Currently supports English, Tamil, and Malayalam.
|
544 |
""")
|
545 |
|
546 |
return demo
|
|
|
558 |
print("β
English model loaded successfully")
|
559 |
except Exception as e:
|
560 |
print(f"β οΈ Warning: Could not pre-load English model: {e}")
|
561 |
+
|
562 |
demo = create_interface()
|
563 |
demo.launch(
|
564 |
share=True,
|