/ Модель

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

Контекст
512 токенов
Архитектура
distilbert · dense
Опубликована
10 ноя 2023

Sentimental-Analysis

Классификация текстаТекст → label

Дообученная на DistilBERT модель классифицирует текст как положительный, отрицательный или нейтральный по тональности.

8скачиваний за 30 дней6лайковвеса обновлены10 ноя 2023

Бенчмарки

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

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

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

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

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

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

Dmyadav2001 разработал модель анализа тональности на основе DistilBERT, дообученного для классификации текста по трём категориям: положительная, отрицательная и нейтральная. Она подходит для определения эмоциональной окраски отзывов, сообщений и других текстов; заявленная схема предобработки удаляет специальные символы, ссылки и упоминания пользователей.

Модель использует архитектуру DistilBertForSequenceClassification и принимает текстовые последовательности длиной до 512 токенов. DistilBERT компактнее и быстрее исходного BERT, что удобно для прикладной классификации, но может уступать более крупным моделям в точности. Карточка описывает обучение и оценку на разделённых наборах данных, однако не приводит конкретных численных результатов. Веса опубликованы в формате safetensors; сведения о лицензии отсутствуют в предоставленных данных.

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

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

Ограничения

Классификатор рассчитан на три категории тональности; для других наборов меток потребуется адаптация. README не приводит численных метрик качества, а компактность DistilBERT может сопровождаться снижением точности по сравнению с более крупными моделями.

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

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

Открыть на Hugging Face

Sentiment Analysis with DistilBERT

This repository contains a sentiment analysis project using the DistilBERT model. Sentiment analysis involves classifying text data into different sentiment categories, such as positive (label-1), negative (label-0), or neutral (label-2).

Overview

The project is implemented using Python and leverages several libraries for natural language processing and machine learning. It includes the following components:

  1. Dataset: The Sentiment Analysis dataset is loaded using the [datasets] library. The dataset is split into training and validation sets for model training and evaluation.

  2. Text Preprocessing: Text data is preprocessed to remove special characters, links, and user mentions. The DistilBERT tokenizer is used to tokenize and preprocess the text, and the data is prepared for training.

  3. Training Configuration: The training configuration, including batch size, learning rate, and evaluation settings, is defined using the [TrainingArguments].

  4. Model: The sentiment analysis model is based on DistilBERT, a lightweight version of BERT, and is fine-tuned for sequence classification. The model is initialized, and the number of labels (positive, negative, and neutral) is specified.

  5. Trainer: A [Trainer] instance is created to handle the training process. It takes the training dataset, evaluation dataset, and training configuration.

  6. Training: The model is trained using the training dataset with the provided configuration. Training results, including loss and accuracy, are recorded.

  7. Evaluation: After training, the model's performance is evaluated on the validation dataset. A classification report is generated to assess the model's accuracy and performance in classifying sentiments.

  8. Model Saving: The trained model and tokenizer are saved for later use or deployment.

Usage

To use this code for your own sentiment analysis tasks, you can follow these steps:

  1. Installation: Install the required libraries using the provided pip commands.

  2. Load Dataset: Replace the dataset with your text data or use the provided SST-2 dataset.

  3. Training Configuration: Modify the training arguments, such as batch size, learning rate, and evaluation strategy, in the TrainingArguments section to suit your specific task.

  4. Model Customization: If needed, customize the model architecture or the number of labels according to your sentiment classification requirements.

  5. Training: Train the model on your dataset by running the training code.

  6. Evaluation: Evaluate the model's performance using your validation dataset or sample data.

  7. Model Saving: Save the trained model and tokenizer for future use or deployment.

Limitations

  • The provided code assumes a three-class sentiment classification task (positive, negative, and neutral). It may require adaptation for tasks with different label sets or multi-class classification.

  • The code uses DistilBERT, a smaller and faster version of BERT. For tasks that demand highly accurate but more computationally intensive models, it may be necessary to switch to the full BERT model or other advanced architectures.

Future Requirements

To further enhance and extend this sentiment analysis project, consider the following:

  • Custom Dataset: If you have a specific domain or industry, consider collecting and preparing a custom dataset that is more relevant to your application.

  • Fine-tuning: Experiment with fine-tuning hyperparameters and explore techniques like learning rate schedules or additional layers for the model.

  • Deployment: If you plan to use the model in a real-world application, explore deployment options, such as building a web service or integrating the model into an existing system.

  • Performance Optimization: Optimize the code for training on larger datasets and explore distributed training to improve efficiency.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DistilBertForSequenceClassification
Ревизия весов
56daf81

0 моделей