clr commited on
Commit
540656c
·
1 Parent(s): 896c819

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -58,7 +58,11 @@ def f1(langname,lang_aligner):
58
  ds = ds.select([random.randint(maxdat-1)])
59
  sound_path = ds['audio'][0]['path'] # audio 0 array is the audio data itself
60
  transcript = ds['normalized_text'][0]
61
- return (graph.align_and_graph(sound_path,transcript,lang_aligner),sound_path)
 
 
 
 
62
 
63
 
64
  bl = gr.Blocks()
@@ -87,13 +91,18 @@ with bl:
87
 
88
 
89
  with gr.Row():
90
- btn1 = gr.Button(value="CLICK HERE")
91
- btn1.style(full_width=False)
92
- audio1 = gr.Audio(interactive=False)
 
 
 
 
 
93
 
94
  pl1 = gr.Plot()
95
 
96
- btn1.click(f1, [lloadr,align_func], [pl1,audio1])
97
 
98
 
99
 
@@ -117,9 +126,9 @@ with bl:
117
  ### Intensity
118
  The orange line is root mean squared energy, which reflects loudness and is also a good indication of syllable placement, as it should correspond to vowels and similar sounds.
119
 
120
- This is a work-in-progress basic demo for automatic prosodic annotation in Faroese and Icelandic.
121
  So far, you cannot select or upload your own choice of sentence for analysis, nor search the corpora. Also, it does not display well when the sentence is too long. In that case, or if there are serious errors in the automated analyses, try another random sentence.
122
- Contact caitlinr@ru.is / https://github.com/catiR/ when things break, or with ideas/suggestions about how to apply this.
123
  The source code is available under the Files tab at the top of the Space.
124
  """
125
  )
 
58
  ds = ds.select([random.randint(maxdat-1)])
59
  sound_path = ds['audio'][0]['path'] # audio 0 array is the audio data itself
60
  transcript = ds['normalized_text'][0]
61
+
62
+ rec_info = f"{ds['audio_id'][0]}, {ds['gender'][0]}, {ds['age'][0]}"
63
+ if langname =="Faroese":
64
+ rec_info += f", {ds['dialect'][0]}"
65
+ return (graph.align_and_graph(sound_path,transcript,lang_aligner),sound_path,rec_info)
66
 
67
 
68
  bl = gr.Blocks()
 
91
 
92
 
93
  with gr.Row():
94
+ with gradio.Column(scale=1):
95
+ btn1 = gr.Button(value="CLICK HERE")
96
+ btn1.style(full_width=False)
97
+ with gradio.Column(scale=4):
98
+ audio1 = gr.Audio(interactive=False)
99
+ ainfo = gr.Markdown("""
100
+ Audio file info
101
+ """)
102
 
103
  pl1 = gr.Plot()
104
 
105
+ btn1.click(f1, [lloadr,align_func], [pl1,audio1,ainfo])
106
 
107
 
108
 
 
126
  ### Intensity
127
  The orange line is root mean squared energy, which reflects loudness and is also a good indication of syllable placement, as it should correspond to vowels and similar sounds.
128
 
129
+ This is a work-in-progress basic demo for automatic prosodic annotation in Faroese and Icelandic.
130
  So far, you cannot select or upload your own choice of sentence for analysis, nor search the corpora. Also, it does not display well when the sentence is too long. In that case, or if there are serious errors in the automated analyses, try another random sentence.
131
+ Contact caitlinr@ru.is / https://github.com/catiR/ when things break, or with ideas/suggestions about how to apply this. Unfortunately I am not a web/interface designer so this is not going to look nice or be user friendly, I only do speech processing.
132
  The source code is available under the Files tab at the top of the Space.
133
  """
134
  )