/ Модель

Характеристики

Контекст
514 токенов
Параметры
138 млн
Лицензия
MIT
Архитектура
camembert · dense
Базовая модель
camembert-base
Опубликована
12 июн 2024

french_emotion_camembert

Классификация текстаТекст → label3 профессии

Модель на основе CamemBERT определяет эмоциональную категорию франкоязычного текста.

1 047скачиваний за 30 дней1лайквеса обновлены16 июн 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

astrosbd/french_emotion_camembert — модель классификации эмоций во франкоязычных текстах, созданная дообучением CamemBERT. Она принимает текст и относит его к одной из шести эмоциональных категорий; среди примеров указаны радость, грусть, гнев и отвращение. Модель построена на архитектуре CamemBERT для классификации последовательностей, содержит 137,8 млн параметров и рассчитана на контекст до 514 токенов. Лицензия — MIT.

Модель подходит для анализа отзывов и комментариев, изучения эмоционального тона пользовательских публикаций, а также как компонент интерфейсов, реагирующих на эмоциональную окраску текста. На тестовом наборе автор README сообщает точность 0,8295 и F1 0,8269. Модель обучалась на нескольких тысячах размеченных французских отзывов; результаты могут быть хуже на других языках, специализированных текстах и случаях, где эмоция выражена косвенно. Возможны смещения обучающих данных, поэтому предсказания не следует считать надёжной оценкой эмоционального состояния человека.

Сценарии применения

  • определение эмоций в отзывах на французском языке
  • анализ эмоционального тона комментариев и публикаций
  • изучение реакции клиентов по текстовым отзывам
  • маркировка эмоционально окрашенных сообщений для модерации
  • адаптация интерфейса к эмоциональной окраске пользовательского текста

Ограничения

Модель предназначена для французского текста и может ошибаться на других языках, специализированной лексике и текстах с неявно выраженными эмоциями. Данные обучения могут содержать смещения, а качество предсказаний не подтверждает реальное эмоциональное состояние автора.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

french_emotion_camembert

This model, french_emotion_camembert, is a fine-tuned version of the camembert-base transformer model, adapted specifically for emotion classification in French text. The original camembert-base model, which is extensively trained on a diverse range of French text from the Allociné dataset, has been repurposed and further trained on an enriched dataset tailored to capture a spectrum of emotional responses. It achieves the following results on the evaluation set:

  • Loss: 0.5368
  • Accuracy: 0.8295
  • Precision: 0.8265
  • Recall: 0.8295
  • F1: 0.8269

Model description

This model, fine-tuned on CamemBERT, is designed for the specific task of emotion classification from text. It aims to classify text inputs into various emotional categories such as joy, sadness, anger, etc., based on the dataset it was trained on. The fine-tuning process has optimized the model for better understanding and processing of French language texts.

Intended uses & limitations

Intended Uses

This model is intended for use in applications involving the classification of emotions in French text. Suitable applications include:

Sentiment Analysis: Analyzing customer feedback, user reviews, or any form of user-generated content to gauge the prevailing emotional tones. Content Moderation: Assisting in the moderation of text to flag potentially harmful content based on the emotional tone. Market Research: Understanding consumer sentiments in different market segments by analyzing social media posts, comments, or discussions. Human-Computer Interaction: Enhancing user interfaces that adapt dynamically based on the emotional context of user inputs. The model is designed to be used by developers, data scientists, or researchers who are working on natural language processing tasks that require emotion detection in French-language text.

Limitations

While the model has been trained to perform well across various texts, it has several limitations:

Language Specificity: The model is trained on French text and may not perform well on texts in other languages. Contextual Understanding: It may misinterpret texts where emotions are implied rather than explicitly expressed, due to the subtleties and complexities of human emotions. Training Data Bias: The training data may not encompass a sufficiently wide variety of text sources, which can lead to biased predictions against certain demographics or topics. Ethical Considerations: Care should be taken when using the model in scenarios where misclassification of emotional tone could lead to adverse consequences, such as filtering content in sensitive contexts. Generalization: The model may not generalize well to very different or specialized domains or jargons not well represented in the training data. Recommended Precautions

Modal architecture

The model is based on the CamemBERT architecture, which is itself a variant of the BERT model adapted for French text. CamemBERT is a transformer-based model that has shown state-of-the-art performance on a range of natural language processing tasks in French.

Training and evaluation data

The model was trained on a custom dataset comprising several thousand French language reviews, labeled with emotions. Each text was manually annotated to reflect one of six emotional states, which include but are not limited to disgust, sadness, and happiness.

Training procedure

Preprocessing: Text inputs were cleaned and preprocessed to remove any non-relevant characters and tokenized using CamemBERT’s default tokenizer. Configuration: The model was trained with a batch size of 16, using a learning rate of 2e-5 with the Adam optimizer. Training was conducted for 3 epochs to avoid overfitting. Environment: Training was performed on a single GPU setup, ensuring efficient use of resources.

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 16
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 3

Example of USE

Here's a Python snippet demonstrating how to use this model:

from transformers import AutoModelForSequenceClassification, AutoTokenizer

model_name = "your_huggingface_username/french_emotion_camembert" tokenizer = AutoTokenizer.from_pretrained(model_answer) model = AutoModelForSequenceClassification.from_pretrained(model_name)

text = "Je suis très heureux de votre service rapide et efficace." inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=512) outputs = model(**inputs)

Decode and print the predicted emotion

prediction = torch.nn.functional.softmax(outputs.logits, dim=-1) predicted_emotion = prediction.argmax().item() print("Predicted emotion:", predicted_emotion)

Training results

Training LossEpochStepValidation LossAccuracyPrecisionRecallF1
0.52491.028250.48660.81960.80790.81960.8073
0.37512.056500.48910.82150.82220.82150.8210
0.26893.084750.53680.82950.82650.82950.8269

Framework versions

  • Transformers 4.41.2
  • Pytorch 2.3.0+cu121
  • Datasets 2.19.2
  • Tokenizers 0.19.1

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
CamembertForSequenceClassification
Ревизия весов
d7e7906

0 моделей