File size: 1,244 Bytes
928867a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12b932d
 
 
 
 
 
 
 
928867a
 
 
 
 
 
33de79e
 
928867a
 
 
 
 
 
 
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
38
---
pipeline_tag: token-classification
tags:
- named-entity-recognition
- sequence-tagger-model
widget:
- text: A nevem Amadeus Wolfgang és Berlinben élek
inference:
  parameters:
    aggregation_strategy: simple
    grouped_entities: true
language:
- hu
---

xlm-roberta model trained on [hungarian ner](https://flairnlp.github.io/docs/tutorial-training/how-to-load-prepared-dataset) dataset from flair

| Test metric             | Results             |
|-------------------------|--------------------------|
| test_f1_mac_hu_ner      | 0.9962009787559509       |
| test_loss_hu_ner        | 0.019755737856030464     |
| test_prec_mac_hu_ner    | 0.9692726135253906       |
| test_rec_mac_hu_ner     | 0.9708725810050964       |


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

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

nlp = pipeline("ner", model=ner_model, tokenizer=tokenizer, aggregation_strategy="simple")
example = "A nevem Amadeus Wolfgang és Berlinben élek"

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