Irpan
commited on
Commit
•
0e8c610
1
Parent(s):
8556a23
app
Browse files
app.py
CHANGED
@@ -7,8 +7,8 @@ def generate_example_pronunciation(input_text, script):
|
|
7 |
|
8 |
def check_pronunciation(input_text, script, user_audio):
|
9 |
# Placeholder logic for pronunciation checking
|
10 |
-
transcript_ugArab_box = "Automatic transcription of your audio..."
|
11 |
-
transcript_ugLatn_box = "Automatic transcription of your audio..."
|
12 |
correct_pronunciation = "Correct pronunciation in IPA"
|
13 |
user_pronunciation = "User pronunciation in IPA"
|
14 |
pronunciation_match = "Matching segments in green, mismatched in red"
|
@@ -32,9 +32,9 @@ with gr.Blocks() as app:
|
|
32 |
placeholder="Enter Uyghur text here...",
|
33 |
)
|
34 |
with gr.Row():
|
35 |
-
|
36 |
with gr.Row():
|
37 |
-
|
38 |
with gr.Row():
|
39 |
user_audio = gr.Audio(
|
40 |
label="4. Record/Upload Your Pronunciation",
|
@@ -46,34 +46,40 @@ with gr.Blocks() as app:
|
|
46 |
|
47 |
# Output Column
|
48 |
with gr.Column(scale=1):
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
# Bind functions to buttons
|
79 |
generate_btn.click(
|
|
|
7 |
|
8 |
def check_pronunciation(input_text, script, user_audio):
|
9 |
# Placeholder logic for pronunciation checking
|
10 |
+
transcript_ugArab_box = "Automatic transcription of your audio (Arabic)..."
|
11 |
+
transcript_ugLatn_box = "Automatic transcription of your audio (Latin)..."
|
12 |
correct_pronunciation = "Correct pronunciation in IPA"
|
13 |
user_pronunciation = "User pronunciation in IPA"
|
14 |
pronunciation_match = "Matching segments in green, mismatched in red"
|
|
|
32 |
placeholder="Enter Uyghur text here...",
|
33 |
)
|
34 |
with gr.Row():
|
35 |
+
example_audio = gr.Audio(label="3. Click Generate Example Pronunciation")
|
36 |
with gr.Row():
|
37 |
+
generate_btn = gr.Button("Generate Example Pronunciation")
|
38 |
with gr.Row():
|
39 |
user_audio = gr.Audio(
|
40 |
label="4. Record/Upload Your Pronunciation",
|
|
|
46 |
|
47 |
# Output Column
|
48 |
with gr.Column(scale=1):
|
49 |
+
# Group transcripts together
|
50 |
+
with gr.Group(label="ASR Transcripts"):
|
51 |
+
with gr.Row():
|
52 |
+
transcript_ugArab_box = gr.Textbox(
|
53 |
+
label="ASR Transcript (Uyghur Arabic)",
|
54 |
+
placeholder="Automatic transcription of your audio..."
|
55 |
+
)
|
56 |
+
with gr.Row():
|
57 |
+
transcript_ugLatn_box = gr.Textbox(
|
58 |
+
label="ASR Transcript (Uyghur Latin)",
|
59 |
+
placeholder="Automatic transcription of your audio..."
|
60 |
+
)
|
61 |
+
|
62 |
+
# Group correct and user pronunciation
|
63 |
+
with gr.Group(label="Pronunciation Details"):
|
64 |
+
with gr.Row():
|
65 |
+
correct_pronunciation_box = gr.Textbox(
|
66 |
+
label="Correct Pronunciation",
|
67 |
+
placeholder="IPA representation of the correct pronunciation..."
|
68 |
+
)
|
69 |
+
with gr.Row():
|
70 |
+
user_pronunciation_box = gr.Textbox(
|
71 |
+
label="User Pronunciation",
|
72 |
+
placeholder="IPA representation of your pronunciation..."
|
73 |
+
)
|
74 |
+
|
75 |
+
match_box = gr.Textbox(
|
76 |
+
label="Pronunciation Match",
|
77 |
+
placeholder="Matching and mismatched characters visualized here..."
|
78 |
+
)
|
79 |
+
score_box = gr.Textbox(
|
80 |
+
label="Pronunciation Score",
|
81 |
+
placeholder="Your pronunciation score as a percentage..."
|
82 |
+
)
|
83 |
|
84 |
# Bind functions to buttons
|
85 |
generate_btn.click(
|