Views
No views yet
thomasbeste/modernbert-da-ner-base.| Entity | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| PER | 0.8962 | 0.9061 | 0.9011 | 181 |
| ORG | 0.6929 | 0.6299 | 0.6599 | 154 |
| LOC | 0.7500 | 0.8969 | 0.8169 | 97 |
| MISC | 0.4878 | 0.6316 | 0.5505 | 95 |
| micro avg | 0.7260 | 0.7742 | 0.7493 |
1from optimum.onnxruntime import ORTModelForTokenClassification
2from transformers import AutoTokenizer, pipeline
3
4model = ORTModelForTokenClassification.from_pretrained("thomasbeste/modernbert-da-ner-base-onnx-int8")
5tokenizer = AutoTokenizer.from_pretrained("thomasbeste/modernbert-da-ner-base-onnx-int8")
6ner = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
7
8results = ner("Jens Peter Hansen bor i København og arbejder hos Novo Nordisk.")
9for entity in results:
10 print(f"{entity['word']}: {entity['entity_group']} ({entity['score']:.3f})")