File size: 948 Bytes
06eca01 afe6d37 06eca01 5f40629 06eca01 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
import gradio as gr
import vowel_length
tsv = 'data/set1.tsv'
ph_key = 'data/key_set1_mfaCapt.tsv'
sources = {'w2v2':'data/set1_w2v2/','mfa':'data/set1_mfa/'}
dat,vck,kws = vowel_length.setup(tsv,ph_key)
# runan(w,'l1','w2v2',vck,dat,sources)
# runan(w,'l1','mfa',vck,dat,sources)
def manager(word,group,aligner):
fig = vowel_length.runan(word.lower(),group.lower(),aligner.lower(),vck,dat,sources)
return fig
bl = gr.Blocks()
with bl:
gr.Markdown(
"""
# Title
etc.
"""
)
# dont forget actually 2 columns of this ...
wmenu = gr.Dropdown(["conversation_1", "word4","word",'kalla','aki','alla','baggi','spjalla','svala'])
lmenu = gr.Dropdown(["L1", "L2","All"])
amenu = gr.Dropdown(["MFA", "w2v2"])
btn = gr.Button(value="Update Plot")
pl1 = gr.Plot()
btn.click(manager, [wmenu, lmenu, amenu], pl1)
if __name__ == "__main__":
bl.launch()
|