phonalign / app.py
cati
.
afe6d37
raw
history blame
948 Bytes
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()