/
allelleo
/
UCarTopDoerTestTask
Обзор
Документация
Войти
/
allelleo
/
UCarTopDoerTestTask
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
settings.py
18 строк
598 B
Овчинников Алексей Александрович
init commit
15 июл 2025, 12:49
15 июл 2025, 12:49
82148b7
Код
Авторство
О чём код?
from transformers import AutoTokenizer, AutoModelForSequenceClassification DB_PATH = "reviews.db" # Загружаем модель tokenizer = AutoTokenizer.from_pretrained("cointegrated/rubert-tiny2-cedr-emotion-detection") model = AutoModelForSequenceClassification.from_pretrained("cointegrated/rubert-tiny2-cedr-emotion-detection") # Маппинг эмоций в тональности label_to_sentiment = { "joy": "positive", "surprise": "neutral", "neutral": "neutral", "sadness": "negative", "anger": "negative", "disgust": "negative", "fear": "negative" }