complaint_mgnt / app.py
agshubhi's picture
Create app.py
ca447e9 verified
raw
history blame
490 Bytes
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)