|
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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
def manager(word,group,aligner): |
|
fig = vowel_length.runan(word,group,aligner,vck,dat,sources) |
|
return fig |
|
|
|
|
|
bl = gr.Blocks() |
|
with bl: |
|
gr.Markdown( |
|
""" |
|
# Title |
|
etc. |
|
""" |
|
) |
|
|
|
|
|
|
|
|
|
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() |
|
|
|
|
|
|