Irpan commited on
Commit
0e8c610
1 Parent(s): 8556a23
Files changed (1) hide show
  1. app.py +38 -32
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
- 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,34 +46,40 @@ with gr.Blocks() as app:
46
 
47
  # Output Column
48
  with gr.Column(scale=1):
49
- with gr.Row():
50
- transcript_ugArab_box = gr.Textbox(
51
- label="ASR Transcript (Uyghur Arabic)",
52
- placeholder="Automatic transcription of your audio..."
53
- )
54
- transcript_ugLatn_box = gr.Textbox(
55
- label="ASR Transcript (Uyghur Latin)",
56
- placeholder="Automatic transcription of your audio..."
57
- )
58
- with gr.Row():
59
- correct_pronunciation_box = gr.Textbox(
60
- label="Correct Pronunciation",
61
- placeholder="IPA representation of the correct pronunciation..."
62
- )
63
- user_pronunciation_box = gr.Textbox(
64
- label="User Pronunciation",
65
- placeholder="IPA representation of your pronunciation..."
66
- )
67
- with gr.Row():
68
- match_box = gr.Textbox(
69
- label="Pronunciation Match",
70
- placeholder="Matching and mismatched characters visualized here..."
71
- )
72
- with gr.Row():
73
- score_box = gr.Textbox(
74
- label="Pronunciation Score",
75
- placeholder="Your pronunciation score as a percentage..."
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(