Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import AutoTokenizer, AutoModelForTokenClassification | |
from transformers import pipeline | |
text=st.text_area("Enter customer feedback") | |
tokenizer = AutoTokenizer.from_pretrained("dslim/bert-base-NER") | |
model = AutoModelForTokenClassification.from_pretrained("dslim/bert-base-NER") | |
nlp = pipeline("ner", model=model, tokenizer=tokenizer) | |
example = "My name is Wolfgang and I live in Berlin" | |
if text: | |
ner_results = nlp(text) | |
st.json(ner_results) |