clr commited on
Commit
1360ce0
·
1 Parent(s): 10b96a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -4
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import subprocess,os
3
  from datasets import load_dataset, Audio
4
  import corpora
 
5
 
6
 
7
  import matplotlib
@@ -44,20 +45,26 @@ def load_lang(langname):
44
 
45
  def f1(langname):
46
  if langname=="Icelandic":
47
- ds = corpora.ds_i
48
  elif langname =="Faroese":
49
- ds = corpora.ds_f
50
 
51
- print([th for th in ds.sample()])
52
 
53
  fig = plt.figure(figsize=(10,4))
54
  plt.axline((0,0),slope=1,color="darkgray")
55
  plt.xlabel("Vowel length (ms)")
56
  plt.ylabel("Consonant length (ms)")
57
 
58
-
59
  return(fig)
60
 
 
 
 
 
 
 
 
 
61
  bl = gr.Blocks()
62
 
63
  with bl:
@@ -80,5 +87,30 @@ with bl:
80
  lloadr.change(load_lang,lloadr,[databrowser])
81
 
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  if __name__ == "__main__":
84
  bl.launch()
 
2
  import subprocess,os
3
  from datasets import load_dataset, Audio
4
  import corpora
5
+ import graph
6
 
7
 
8
  import matplotlib
 
45
 
46
  def f1(langname):
47
  if langname=="Icelandic":
48
+ df = corpora.ds_i
49
  elif langname =="Faroese":
50
+ df = corpora.ds_f
51
 
 
52
 
53
  fig = plt.figure(figsize=(10,4))
54
  plt.axline((0,0),slope=1,color="darkgray")
55
  plt.xlabel("Vowel length (ms)")
56
  plt.ylabel("Consonant length (ms)")
57
 
 
58
  return(fig)
59
 
60
+ ds = df.sample()
61
+ #print([th for th in ds.sample()])
62
+ print(ds['audio'])
63
+ print(ds['normalized_text'])
64
+
65
+ #return graph.align_and_graph(wav_path, transcript)
66
+
67
+
68
  bl = gr.Blocks()
69
 
70
  with bl:
 
87
  lloadr.change(load_lang,lloadr,[databrowser])
88
 
89
 
90
+ gr.Markdown(
91
+ """
92
+ # ABOUT
93
+ This is a work-in-progress demo.
94
+
95
+ Icelandic uses the (samromur-asr)[https://huggingface.co/datasets/language-and-voice-lab/samromur_asr] corpus
96
+ and Faroese uses (ravnursson-asr)[https://huggingface.co/datasets/carlosdanielhernandezmena/ravnursson_asr].
97
+
98
+ After you select a language, a few example sentences from the corpus are displayed.
99
+
100
+ Click the button to view time-aligned prosody information for a random sentence -
101
+ this could be any sentence, not only one of the ones shown above.
102
+
103
+ ABOUT REAPER
104
+
105
+ ABOUT RMSE
106
+
107
+ ABOUT CTC ALIGNMENT
108
+
109
+ CONTACT INFO ETC
110
+ caitlinr@ru.is / https://github.com/catiR/
111
+ """
112
+ )
113
+
114
+
115
  if __name__ == "__main__":
116
  bl.launch()