lab10_630510671 / app.py
BlueberryChickenPie's picture
Update app.py
e1ada92
raw
history blame contribute delete
595 Bytes
import streamlit as st
from transformers import pipeline,AutoTokenizer,AutoModelForTokenClassification
classifier = pipeline('token-classification', model='mrm8488/bert-base-german-finetuned-ler')
def main():
st.title("Token classifier")
with st.form("text_field"):
text = st.text_area('enter some text ')
st.text('ex.I live in chiangmai')
# 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()