Spaces:
Sleeping
Sleeping
import streamlit as st | |
from bertopic import BERTopic | |
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") | |
# topic_model=BERTopic.load("MaartenGr/BERTopic_Wikipedia") | |
# if text: | |
# results = topic_model(text) | |
# st.json(results) | |
nlp = pipeline("ner", model=model, tokenizer=tokenizer) | |
if text: | |
ner_results = nlp(text) | |
st.json(ner_results) | |