EDC_IE / app.py
dexay's picture
Update app.py
25a02b8
raw
history blame
569 Bytes
import streamlit as st
import transformers
from transformers import pipeline, TokenClassificationPipeline, BertForTokenClassification , AutoTokenizer
#model.to("cpu")
tokenizer = AutoTokenizer.from_pretrained("dmis-lab/biobert-large-cased-v1.1", truncation = True, padding=True, model_max_length=512,)
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
token_classifier = pipeline("token-classification", tokenizer = tokenizer,model=model_checkpoint, )
x = st.text_area('enter text')
if x:
out = token_classifier(x)
st.json(out)