IJAB commited on
Commit
11c0e68
1 Parent(s): 4897479

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
3
+ from transformers import pipeline
4
+
5
+ tokenizer = AutoTokenizer.from_pretrained("Davlan/bert-base-multilingual-cased-ner-hrl")
6
+ model = AutoModelForTokenClassification.from_pretrained("Davlan/bert-base-multilingual-cased-ner-hrl")
7
+ nlp = pipeline("ner", model=model, tokenizer=tokenizer)
8
+
9
+ example = st.text_area("Enter text: ")
10
+
11
+ if example:
12
+ ner_results = nlp(example)
13
+ st.json(ner_results)