Модель для
распознавания именованных сущностей (NER)
в
русскоязычных новостных текстах
.
🔍 Основана на
RuBERT-tiny2
и дообучена на новостном корпусе
Collection3
, с фокусом на тексты, содержащие упоминания
Сбербанка
,
Яндекса
, а также других медиа и государственных структур.
💡 Что умеет модель
Распознаёт следующие типы сущностей:
Метка
Значение
PER
Персоны
ORG
Организации
LOC
Локации
GEOPOLIT
Геополитические образования (страны, регионы)
MEDIA
СМИ и медиа-ресурсы
📊 Метрики на тестовом наборе
Метрика
Значение
Precision
0.793
Recall
0.914
F1-score
0.849
Accuracy
0.972
🛠️ Пример использования
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)
# {'entity_group': 'ORG', 'score': 0.951569, 'word': 'Сбербанка', 'start': 21, 'end': 30}# {'entity_group': 'PER', 'score': 0.9922959, 'word': 'Герман Греф', 'start': 31, 'end': 42}# {'entity_group': 'LOC', 'score': 0.60198957, 'word': 'Москве', 'start': 60, 'end': 66}# {'entity_group': 'ORG', 'score': 0.6973838, 'word': 'Яндексом', 'start': 96, 'end': 104}# {'entity_group': 'GEOPOLIT', 'score': 0.9631994, 'word': 'Российской Федерации', 'start': 203, 'end': 223}# {'entity_group': 'ORG', 'score': 0.85091865, 'word': 'Евразийского экономического союза.', 'start': 284, 'end': 318}
Runs of r1char9 ner-rubert-tiny-news on huggingface.co
37.0K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
21.3K
30-day runs
More Information About ner-rubert-tiny-news huggingface.co Model
ner-rubert-tiny-news huggingface.co is an AI model on huggingface.co that provides ner-rubert-tiny-news's model effect (), which can be used instantly with this r1char9 ner-rubert-tiny-news model. huggingface.co supports a free trial of the ner-rubert-tiny-news model, and also provides paid use of the ner-rubert-tiny-news. Support call ner-rubert-tiny-news model through api, including Node.js, Python, http.
ner-rubert-tiny-news huggingface.co is an online trial and call api platform, which integrates ner-rubert-tiny-news's modeling effects, including api services, and provides a free online trial of ner-rubert-tiny-news, you can try ner-rubert-tiny-news online for free by clicking the link below.
r1char9 ner-rubert-tiny-news online free url in huggingface.co:
ner-rubert-tiny-news is an open source model from GitHub that offers a free installation service, and any user can find ner-rubert-tiny-news on GitHub to install. At the same time, huggingface.co provides the effect of ner-rubert-tiny-news install, users can directly use ner-rubert-tiny-news installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ner-rubert-tiny-news install url in huggingface.co: