File size: 1,232 Bytes
b968ced
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0dd3cc5
f229fea
e98d7a9
 
 
 
 
 
b968ced
 
 
 
 
 
 
 
 
a392847
b968ced
 
1ca6ce3
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
pipeline_tag: token-classification
tags:
- named-entity-recognition
- sequence-tagger-model
widget:
- text: Mit navn er Amadeus Wolfgang, og jeg bor i Berlin
inference:
  parameters:
    aggregation_strategy: simple
    grouped_entities: true
language:
- da
---

xlm-roberta model trained on [DaNe](https://aclanthology.org/2020.lrec-1.565/), performing 97.1 f1-Macro on test set.

| Test metric             | Results                   |
|-------------------------|---------------------------|
| test_f1_mac_dane_ner    | 0.9713183641433716        |
| test_loss_dane_ner      | 0.11384682357311249       |
| test_prec_mac_dane_ner  | 0.8712055087089539        |
| test_rec_mac_dane_ner   | 0.8684446811676025        |

```python
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("EvanD/xlm-roberta-base-danish-ner-daner")
ner_model = AutoModelForTokenClassification.from_pretrained("EvanD/xlm-roberta-base-danish-ner-daner")

nlp = pipeline("ner", model=ner_model, tokenizer=tokenizer, aggregation_strategy="simple")
example = "Mit navn er Amadeus Wolfgang, og jeg bor i Berlin"

ner_results = nlp(example)
print(ner_results)
```