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