ner-swedish-wikiann / eval_script.py
birgermoell's picture
Updated eval
b91f5df
raw
history blame
420 Bytes
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("birgermoell/ner-swedish-wikiann")
model = AutoModelForTokenClassification.from_pretrained("birgermoell/ner-swedish-wikiann")
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "Kungliga Tekniska Högskolan ligger på östermalm"
print(nlp(example))