test / app.py
IJAB's picture
Create app.py
11c0e68
raw
history blame
487 Bytes
import streamlit as st
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("Davlan/bert-base-multilingual-cased-ner-hrl")
model = AutoModelForTokenClassification.from_pretrained("Davlan/bert-base-multilingual-cased-ner-hrl")
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = st.text_area("Enter text: ")
if example:
ner_results = nlp(example)
st.json(ner_results)