Spaces:
Running
Running
alessandro trinca tornidor
commited on
Commit
·
662a135
1
Parent(s):
5cec49a
feat: improve the onboarding driverjs tour for new users
Browse files- aip_trainer/lambdas/js.py +8 -17
- app.py +2 -2
aip_trainer/lambdas/js.py
CHANGED
@@ -115,25 +115,16 @@ head_driver_tour = """
|
|
115 |
const driver = window.driver.js.driver;
|
116 |
|
117 |
const driverSteps = [
|
118 |
-
{ element: "id-ai-pronunciation-trainer-gradio-app-container", popover: { title: "AI Pronunciation Trainer Gradio
|
119 |
-
{ element: "#
|
120 |
-
{ element: "#
|
121 |
-
{ element: "#
|
122 |
-
{ element: "#
|
123 |
-
{ element: "#audio-tts-id-element", popover: { title: "Audio TTS", description: "Speech-to-text audio output." } },
|
124 |
-
{ element: "#btn-run-tts-id-element", popover: { title: "In-browser Text-to-Speech", description: "Execute the text-to-speech functionality in the browser by reading the student's transcription." } },
|
125 |
{ element: "#btn-run-tts-backend-id-element", popover: { title: "Backend Text-to-Speech", description: "Execute the text-to-speech functionality in the backend by reading the student's transcription." } },
|
126 |
{ element: "#btn-clear-tts-backend-id-element", popover: { title: "Clear Text-to-Speech", description: "Clear the synthetic audio output of the text-to-speech synthesis." } },
|
127 |
-
{ element: "
|
128 |
-
{ element: "#
|
129 |
-
|
130 |
-
{ element: ".speech-output-group", popover: { title: "Detailed speech accuracy output", description: "Detailed output of speech accuracy, word by word." } },
|
131 |
-
{ element: "#number-pronunciation-accuracy-id-element", popover: { title: "Current accuracy", description: "Current speech accuracy." } },
|
132 |
-
{ element: "#number-score-de-id-element", popover: { title: "Global German accuracy", description: "Total speech accuracy in German." } },
|
133 |
-
{ element: "#number-score-en-id-element", popover: { title: "Global English accuracy", description: "Total speech accuracy in English." } },
|
134 |
-
{ element: "#btn-recognize-speech-accuracy-id-element", popover: { title: "Run speech accuracy recognition", description: "Execute the speech accuracy recognition." } },
|
135 |
-
{ element: "#accordion-examples-id-element", popover: { title: "Text examples", description: "Some text examples to be used as input for speech recognition." } }
|
136 |
-
]
|
137 |
const driverObj = driver({
|
138 |
showProgress: true,
|
139 |
steps: driverSteps
|
|
|
115 |
const driver = window.driver.js.driver;
|
116 |
|
117 |
const driverSteps = [
|
118 |
+
{ element: "id-ai-pronunciation-trainer-gradio-app-container", popover: { title: "AI Pronunciation Trainer Gradio App", description: "A quick tour of the features of the Gradio app 'AI Pronunciation Trainer'." } },
|
119 |
+
{ element: "#id-choose-random-phrase-by-language-and-difficulty", popover: { title: "Choose a Random Phrase", description: "Choose a random sentence to be used as input for speech recognition, defining your own language and difficulty..." } },
|
120 |
+
{ element: "#accordion-examples-id-element", popover: { title: "Text Examples", description: "...Or start with these text examples, increasing in difficulty." } },
|
121 |
+
{ element: "#text-student-transcription-id-element", popover: { title: "Phrase to Read for Speech Recognition", description: "You can also write your own sentence." } },
|
122 |
+
{ element: "#btn-run-tts-id-element", popover: { title: "In-Browser Text-to-Speech", description: "Execute the text-to-speech functionality in the browser by reading the student's transcription." } },
|
|
|
|
|
123 |
{ element: "#btn-run-tts-backend-id-element", popover: { title: "Backend Text-to-Speech", description: "Execute the text-to-speech functionality in the backend by reading the student's transcription." } },
|
124 |
{ element: "#btn-clear-tts-backend-id-element", popover: { title: "Clear Text-to-Speech", description: "Clear the synthetic audio output of the text-to-speech synthesis." } },
|
125 |
+
{ element: ".speech-output-group", popover: { title: "Detailed Speech Accuracy Output", description: "Detailed output of speech accuracy, word by word." } },
|
126 |
+
{ element: "#id-replay-splitted-audio-by-words", popover: { title: "Replay Split Audio by Words", description: "Replay your recorded audio split into single words followed by the 'ideal' pronunciation spelled by the text-to-speech audio output for the same word." } },
|
127 |
+
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
const driverObj = driver({
|
129 |
showProgress: true,
|
130 |
steps: driverSteps
|
app.py
CHANGED
@@ -43,7 +43,7 @@ with gr.Blocks(css=css, head=js.head_driver_tour) as gradio_app:
|
|
43 |
gr.Markdown(md_app_description.format(sample_rate_start=sample_rate_start))
|
44 |
with gr.Row():
|
45 |
with gr.Column(scale=4, min_width=300):
|
46 |
-
with gr.Row():
|
47 |
with gr.Column(scale=2, min_width=80):
|
48 |
radio_language = gr.Radio(["de", "en"], label="Language", value="en", elem_id="radio-language-id-element")
|
49 |
with gr.Column(scale=5, min_width=160):
|
@@ -134,7 +134,7 @@ with gr.Blocks(css=css, head=js.head_driver_tour) as gradio_app:
|
|
134 |
with gr.Column(min_width=100, elem_classes="speech-accuracy-score-container row2 col3"):
|
135 |
num_score_en = gr.Number(label="Global score EN %", value=0, interactive=False, elem_id="number-score-en-id-element")
|
136 |
btn_recognize_speech_accuracy = gr.Button(value="Get speech accuracy score (%)", elem_id="btn-recognize-speech-accuracy-id-element")
|
137 |
-
with gr.Row():
|
138 |
num_tot_recognized_words = gr.Number(label="Total recognized words", visible=False, minimum=0, interactive=False)
|
139 |
with gr.Column(scale=1, min_width=50):
|
140 |
num_selected_recognized_word = gr.Number(label=word_idx_text, visible=True, minimum=0, value=0, interactive=False)
|
|
|
43 |
gr.Markdown(md_app_description.format(sample_rate_start=sample_rate_start))
|
44 |
with gr.Row():
|
45 |
with gr.Column(scale=4, min_width=300):
|
46 |
+
with gr.Row(elem_id="id-choose-random-phrase-by-language-and-difficulty"):
|
47 |
with gr.Column(scale=2, min_width=80):
|
48 |
radio_language = gr.Radio(["de", "en"], label="Language", value="en", elem_id="radio-language-id-element")
|
49 |
with gr.Column(scale=5, min_width=160):
|
|
|
134 |
with gr.Column(min_width=100, elem_classes="speech-accuracy-score-container row2 col3"):
|
135 |
num_score_en = gr.Number(label="Global score EN %", value=0, interactive=False, elem_id="number-score-en-id-element")
|
136 |
btn_recognize_speech_accuracy = gr.Button(value="Get speech accuracy score (%)", elem_id="btn-recognize-speech-accuracy-id-element")
|
137 |
+
with gr.Row(elem_id="id-replay-splitted-audio-by-words"):
|
138 |
num_tot_recognized_words = gr.Number(label="Total recognized words", visible=False, minimum=0, interactive=False)
|
139 |
with gr.Column(scale=1, min_width=50):
|
140 |
num_selected_recognized_word = gr.Number(label=word_idx_text, visible=True, minimum=0, value=0, interactive=False)
|