Are you the author?
GPU deploy isn't supported for this model type.
label_names = ['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC']| Epoch | Training Loss | Validation Loss | Precision | Recall | F1 | Accuracy |
|---|---|---|---|---|---|---|
| 1 | 0.041000 | 0.032810 | 0.959569 | 0.974253 | 0.966855 | 0.993325 |
| 2 | 0.020800 | 0.028395 | 0.959569 | 0.974253 | 0.966855 | 0.993325 |
| 3 | 0.010500 | 0.029138 | 0.963239 | 0.973767 | 0.968474 | 0.993247 |
1import torch
2
3from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline
4from datasets import load_dataset
5
6
7model_ckpt = "nesemenpolkov/msu-wiki-ner"
8
9label_names = ['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC']
10
11id2label = {i: label for i, label in enumerate(label_names)}
12label2id = {v: k for k, v in id2label.items()}
13
14tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
15model = AutoModelForTokenClassification.from_pretrained(
16 model_ckpt,
17 id2label=id2label,
18 label2id=label2id,
19 ignore_mismatched_sizes=True
20)
21
22pipe = pipeline(
23 task="token-classification",
24 model=model,
25 tokenizer=tokenizer,
26 device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
27 aggregation_strategy="simple"
28)
29
30demo_sample = "Этот Иван Иванов, в паспорте Иванов И.И."
31
32with torch.no_grad():
33 out = pipe(demo_sample)@inproceedings{tedeschi-etal-2021-wikineural-combined,
title = "Fine-tuned multilingual model for russian language NER.",
author = "nesemenpolkov",
booktitle = "Detecting names in noisy and dirty data.",
month = oct,
year = "2024",
address = "Moscow, Russian Federation",
}