Downloads · 30 days
99
2% of all-time downloads
data-silence/any-news-classifier
any-news-classifier is a text classification model from data-silence. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
99
2% of all-time downloads
All-time downloads
6K
Public
Parameters
471M
1.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.9 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of sentence-transformers/LaBSE on my news dataset. The learning news dataset is a well-balanced sample of recent news from the last five years.
It achieves the following results on the evaluation set:
This is a multi-class classifier of Russian news, made with the LaBSE model finetune for AntiSMI Project. The news category is assigned by the classifier to one of 11 categories:
SpacesYou can try the model and evaluate its quality here
from transformers import pipeline
category_mapper = {
'LABEL_0': 'climate',
'LABEL_1': 'conflicts',
'LABEL_2': 'culture',
'LABEL_3': 'economy',
'LABEL_4': 'gloss',
'LABEL_5': 'health',
'LABEL_6': 'politics',
'LABEL_7': 'science',
'LABEL_8': 'society',
'LABEL_9': 'sports',
'LABEL_10': 'travel'
}
# Используйте предобученную модель из Hugging Face Hub
classifier = pipeline("text-classification", model="data-silence/rus-news-classifier")
def predict_category(text):
result = classifier(text)
category = category_mapper[result[0]['label']]
score = result[0]['score']
return category, score
predict_category("В Париже завершилась церемония закрытия Олимпийских игр")
# ('sports', 0.9959506988525391)
The "gloss" category is used to select yellow press, trashy and dubious news. The model can get confused in the classification of news categories politics, society and conflicts.
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall |
|---|---|---|---|---|---|---|---|
| 0.3544 | 1.0 | 3596 | 0.3517 | 0.8861 | 0.8860 | 0.8915 | 0.8861 |
| 0.2738 | 2.0 | 7192 | 0.3190 | 0.8995 | 0.8987 | 0.9025 | 0.8995 |
| 0.19 | 3.0 | 10788 | 0.3524 | 0.9016 | 0.9015 | 0.9019 | 0.9016 |
| 0.1402 | 4.0 | 14384 | 0.3820 | 0.9029 | 0.9025 | 0.9030 | 0.9029 |
| 0.1055 | 5.0 | 17980 | 0.4399 | 0.9022 | 0.9018 | 0.9024 | 0.9022 |