๐ Ner-rubert-tiny-RuNews
This is a Named Entity Recognition (NER) model designed for Russian news texts.
The model is based on RuBERT-tiny2 and is fine - tuned on the Collection3 dataset. This dataset is rich in news content, allowing the model to effectively identify entities such as Persons, Organizations, and other types of entities in Russian news.
โจ Features
The recognized entity types are as follows:
Entity Type |
Description |
PER |
Person |
ORG |
Organization |
LOC |
Location |
GEOPOLIT |
Geopolitical entity |
MEDIA |
Media |
๐ฆ Installation
No installation steps are provided in the original document, so this section is skipped.
๐ป Usage Examples
Basic Usage
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
label2id = {
'O': 0,
'B-GEOPOLIT': 1, 'I-GEOPOLIT': 2,
'B-MEDIA': 3, 'I-MEDIA': 4,
'B-LOC': 5, 'I-LOC': 6,
'B-ORG': 7, 'I-ORG': 8,
'B-PER': 9, 'I-PER': 10
}
id2label = {v: k for k, v in label2id.items()}
model_id = "r1char9/ner-rubert-tiny-RuNews"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(
model_id,
num_labels=len(label2id),
id2label=id2label,
label2id=label2id
)
ner_pipeline = pipeline(
"ner",
model=model,
tokenizer=tokenizer,
aggregation_strategy="simple"
)
text = (
"โรฌโยตโฮฉโยตโรโโโยชโรฅโฮฉโรฃโฯ โยฅโโโรโยตโโซโรโรฆโร โยฐโยฑโยตโรโยฑโโโฮฉโโซโโ โรฌโยตโรโยบโโโฮฉ โรฌโรโยตโร โฮฉโโ โโซโรฆโฮฉโรโยตโรโยตโฮฉโรโโโโ โโค โรบโรฆโร
โโซโโคโยต โโโโโรจโโคโโโยช, "
"โรกโรโรฆ โร
โรฆโรโรโรโยฅโฮฉโโโรกโยตโร
โรโโคโรฆ โร
โรโฮฉโยฅโยตโโซโร
โรฆโยบ โโค โรฆโยฑโยชโโโร
โรโโ โโโร
โโซโรโร
โร
โรโโคโยตโฮฉโฮฉโรฆโโฅโรฆ โโโฮฉโรโยตโยชโยชโยตโโซโรโโ โโคโรฃโรโรฆโยฅโโโร โฮฉโโ โฮฉโรฆโโคโรฃโฯ โรโรโรฆโโคโยตโฮฉโรฅ. "
"โรปโฮฉ โรโโโโซโโโยต โรฆโรโยบโยตโรโโโยช, โรกโรโรฆ โรธโรโโโโคโโโรโยตโยชโรฅโร
โรโโคโรฆ โโ โรฆโร
โร
โโโฯโร
โโซโรฆโฯ โยงโยตโยฅโยตโรโโโรโโโโ โรธโรฆโยฅโยฅโยตโรโโโโโโคโโโยตโร โรโโโโโโคโโโรโโโยต โรโโโรโรโรฆโโคโรฆโฯ โรงโโซโรฆโฮฉโรฆโยบโโโโซโโ, "
"โรฆโร
โรฆโยฑโยตโฮฉโฮฉโรฆ โโค โรโโโยบโโซโโโร โรฏโโคโรโโโโโโโฯโร
โโซโรฆโโฅโรฆ โรงโโซโรฆโฮฉโรฆโยบโโโรกโยตโร
โโซโรฆโโฅโรฆ โร
โรฆโรฉโโโโ."
)
results = ner_pipeline(text)
for entity in results:
print(entity)
Advanced Usage
No advanced usage examples are provided in the original document, so this part is not added.
๐ Documentation
Metrics
Metric |
Value |
Precision |
0.793 |
Recall |
0.914 |
F1 - score |
0.849 |
Accuracy |
0.972 |
๐ง Technical Details
No technical details are provided in the original document, so this section is skipped.
๐ License
This project is licensed under the MIT license.