File size: 428 Bytes
97edd96 0d8c4af 6330360 97edd96 0b94c3f 685dadd 03337d8 0df0413 a64855b 3194d5e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import streamlit as st
from transformers import pipeline
pipe = pipeline(task='text-generation', model='Marxav/frpron')
x = st.text_input('Write a French word:')
if x:
x += ':'
out = pipe(x)
word_ipa = out[0]["generated_text"]
word = word_ipa.split(":")[0]
ipa = word_ipa.split(":")[1]
#st.json(out)
txt = 'The phonemized and syllabized pronunciation of ['+word+'] is \\'+ipa+'\\'
st.write(txt) |