Spaces:
Runtime error
Runtime error
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() |