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)) | |