Spaces:
Running
Running
alessandro trinca tornidor
commited on
Commit
•
8b62994
1
Parent(s):
5d533ea
feat: make score de/en components not interactive, fix some typos
Browse files- aip_trainer/lambdas/app_description.md +1 -1
- app.py +8 -8
aip_trainer/lambdas/app_description.md
CHANGED
@@ -3,6 +3,6 @@
|
|
3 |
See [my fork](https://github.com/trincadev/ai-pronunciation-trainer) of [AI Pronunciation Trainer](https://github.com/Thiagohgl/ai-pronunciation-trainer) repository
|
4 |
for more details.
|
5 |
|
6 |
-
Selecting a new example invalidates all previous inputs (Text-to-Speech audio and Speech-to-Text recordings): in that case you should
|
7 |
|
8 |
Right now this tool uses {sample_rate_start} as sample rate value. From empirical tests the best sample rate value is 48000.
|
|
|
3 |
See [my fork](https://github.com/trincadev/ai-pronunciation-trainer) of [AI Pronunciation Trainer](https://github.com/Thiagohgl/ai-pronunciation-trainer) repository
|
4 |
for more details.
|
5 |
|
6 |
+
Selecting a new example invalidates all previous inputs (Text-to-Speech audio and Speech-to-Text recordings): in that case you should record again your audio speech.
|
7 |
|
8 |
Right now this tool uses {sample_rate_start} as sample rate value. From empirical tests the best sample rate value is 48000.
|
app.py
CHANGED
@@ -61,8 +61,8 @@ with gr.Blocks() as gradio_app:
|
|
61 |
show_download_button=True,
|
62 |
)
|
63 |
with gr.Column(scale=4, min_width=320):
|
64 |
-
|
65 |
-
lines=2, placeholder=None, label="
|
66 |
)
|
67 |
text_letter_correctness = gr.Textbox(
|
68 |
lines=1,
|
@@ -76,9 +76,9 @@ with gr.Blocks() as gradio_app:
|
|
76 |
with gr.Column(min_width=100):
|
77 |
number_pronunciation_accuracy = gr.Number(label="Current score")
|
78 |
with gr.Column(min_width=100):
|
79 |
-
number_score_de = gr.Number(label="Global score DE", value=0)
|
80 |
with gr.Column(min_width=100):
|
81 |
-
number_score_en = gr.Number(label="Global score EN", value=0)
|
82 |
text_recording_ipa = gr.Textbox(
|
83 |
lines=1, placeholder=None, label="Learner phonetic transcription"
|
84 |
)
|
@@ -111,9 +111,9 @@ with gr.Blocks() as gradio_app:
|
|
111 |
)
|
112 |
|
113 |
def get_updated_score_by_language(text: str, audio_rec: str | Path, lang: str, score_de: float, score_en: float):
|
114 |
-
|
115 |
output = {
|
116 |
-
|
117 |
text_letter_correctness: _letter_correctness,
|
118 |
number_pronunciation_accuracy: _pronunciation_accuracy,
|
119 |
text_recording_ipa: _recording_ipa,
|
@@ -140,7 +140,7 @@ with gr.Blocks() as gradio_app:
|
|
140 |
get_updated_score_by_language,
|
141 |
inputs=[text_learner_transcription, audio_learner_recording_stt, radio_language, number_score_de, number_score_en],
|
142 |
outputs=[
|
143 |
-
|
144 |
text_letter_correctness,
|
145 |
number_pronunciation_accuracy,
|
146 |
text_recording_ipa,
|
@@ -166,7 +166,7 @@ with gr.Blocks() as gradio_app:
|
|
166 |
)
|
167 |
html_output.change(
|
168 |
None,
|
169 |
-
inputs=[
|
170 |
outputs=[html_output],
|
171 |
js=js.js_update_ipa_output,
|
172 |
)
|
|
|
61 |
show_download_button=True,
|
62 |
)
|
63 |
with gr.Column(scale=4, min_width=320):
|
64 |
+
text_transcribed_hidden = gr.Textbox(
|
65 |
+
lines=2, placeholder=None, label="Transcribed text", visible=False
|
66 |
)
|
67 |
text_letter_correctness = gr.Textbox(
|
68 |
lines=1,
|
|
|
76 |
with gr.Column(min_width=100):
|
77 |
number_pronunciation_accuracy = gr.Number(label="Current score")
|
78 |
with gr.Column(min_width=100):
|
79 |
+
number_score_de = gr.Number(label="Global score DE", value=0, interactive=False)
|
80 |
with gr.Column(min_width=100):
|
81 |
+
number_score_en = gr.Number(label="Global score EN", value=0, interactive=False)
|
82 |
text_recording_ipa = gr.Textbox(
|
83 |
lines=1, placeholder=None, label="Learner phonetic transcription"
|
84 |
)
|
|
|
111 |
)
|
112 |
|
113 |
def get_updated_score_by_language(text: str, audio_rec: str | Path, lang: str, score_de: float, score_en: float):
|
114 |
+
_transcribed_text, _letter_correctness, _pronunciation_accuracy, _recording_ipa, _ideal_ipa, _res = lambdaSpeechToScore.get_speech_to_score_tuple(text, audio_rec, lang)
|
115 |
output = {
|
116 |
+
text_transcribed_hidden: _transcribed_text,
|
117 |
text_letter_correctness: _letter_correctness,
|
118 |
number_pronunciation_accuracy: _pronunciation_accuracy,
|
119 |
text_recording_ipa: _recording_ipa,
|
|
|
140 |
get_updated_score_by_language,
|
141 |
inputs=[text_learner_transcription, audio_learner_recording_stt, radio_language, number_score_de, number_score_en],
|
142 |
outputs=[
|
143 |
+
text_transcribed_hidden,
|
144 |
text_letter_correctness,
|
145 |
number_pronunciation_accuracy,
|
146 |
text_recording_ipa,
|
|
|
166 |
)
|
167 |
html_output.change(
|
168 |
None,
|
169 |
+
inputs=[text_transcribed_hidden, text_letter_correctness],
|
170 |
outputs=[html_output],
|
171 |
js=js.js_update_ipa_output,
|
172 |
)
|