lab10_630510680 / app.py
minjibi's picture
Update app.py
19fc848
raw
history blame
531 Bytes
import streamlit as st
from transformers import pipeline
classifier = pipeline("Token Classification", model="KoichiYasuoka/bert-base-japanese-upos")
def main():
st.title("POS-tagging for Japanese texts")
with st.form("text_field"):
text = st.text_area('enter some Japanese texts:')
# clicked==True only when the button is clicked
clicked = st.form_submit_button("Submit")
if clicked:
results = classifier([text])
st.json(results)
if __name__ == "__main__":
main()