/ Модель

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

Контекст
514 токенов
Параметры
152 млн
Лицензия
MIT
Архитектура
roberta · dense
Опубликована
14 мар 2022

emoberta-base

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

EmoBERTa-base — англоязычная RoBERTa-модель для классификации эмоций в отдельных репликах диалога.

110скачиваний за 30 дней6лайковвеса обновлены16 мар 2022

Бенчмарки

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

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

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

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

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

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

EmoBERTa-base — текстовая модель классификации эмоций в репликах диалога, опубликованная Taewoon Kim. Она основана на RoBERTa-base и дообучена на MELD и IEMOCAP; архитектура — RoBERTa для классификации последовательностей, размер — 151,8 млн параметров, контекст — до 514 токенов.

Модель принимает одну реплику за раз и предсказывает её эмоциональную категорию. Она рассчитана на распознавание эмоций в разговорном тексте и может использоваться, например, для анализа диалогов. Опубликованный чекпойнт не учитывает говорящего и соседние реплики, хотя эксперименты обучения на MELD и IEMOCAP исследовали также контекст прошлых и будущих реплик. Поддерживается английский язык. Лицензия — MIT.

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

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

Ограничения

Опубликованная модель классифицирует реплики по отдельности, без информации о говорящем и соседних репликах; README описывает только эксперименты на MELD и IEMOCAP.

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

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

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

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

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

Открыть на Hugging Face

Check https://github.com/tae898/erc for the details

Watch a demo video!

Emotion Recognition in Coversation (ERC)

PWC PWC

At the moment, we only use the text modality to correctly classify the emotion of the utterances.The experiments were carried out on two datasets (i.e. MELD and IEMOCAP)

Prerequisites

  1. An x86-64 Unix or Unix-like machine
  2. Python 3.8 or higher
  3. Running in a virtual environment (e.g., conda, virtualenv, etc.) is highly recommended so that you don't mess up with the system python.
  4. multimodal-datasets repo (submodule)
  5. pip install -r requirements.txt

EmoBERTa training

First configure the hyper parameters and the dataset in train-erc-text.yaml and then, In this directory run the below commands. I recommend you to run this in a virtualenv.

python train-erc-text.py

This will subsequently call train-erc-text-hp.py and train-erc-text-full.py.

Results on the test split (weighted f1 scores)

ModelMELDIEMOCAP
EmoBERTaNo past and future utterances63.4656.09
Only past utterances64.5568.57
Only future utterances64.2366.56
Both past and future utterances65.6167.42
→ without speaker names65.0764.02

Above numbers are the mean values of five random seed runs.

If you want to see more training test details, check out ./results/

If you want to download the trained checkpoints and stuff, then here is where you can download them. It's a pretty big zip file.

Deployment

Huggingface

We have released our models on huggingface:

They are based on RoBERTa-base and RoBERTa-large, respectively. They were trained on both MELD and IEMOCAP datasets. Our deployed models are neither speaker-aware nor take previous utterances into account, meaning that it only classifies one utterance at a time without the speaker information (e.g., "I love you").

Flask app

You can either run the Flask RESTful server app as a docker container or just as a python script.

  1. Running the app as a docker container (recommended).

    There are four images. Take what you need:

    • docker run -it --rm -p 10006:10006 tae898/emoberta-base
    • docker run -it --rm -p 10006:10006 --gpus all tae898/emoberta-base-cuda
    • docker run -it --rm -p 10006:10006 tae898/emoberta-large
    • docker run -it --rm -p 10006:10006 --gpus all tae898/emoberta-large-cuda
  2. Running the app in your python environment:

    This method is less recommended than the docker one.

    Run pip install -r requirements-deploy.txt first. The app.py is a flask RESTful server. The usage is below:

    app.py [-h] [--host HOST] [--port PORT] [--device DEVICE] [--model-type MODEL_TYPE]
    

    For example:

    python app.py --host 0.0.0.0 --port 10006 --device cpu --model-type emoberta-base
    

Client

Once the app is running, you can send a text to the server. First install the necessary packages: pip install -r requirements-client.txt, and the run the client.py. The usage is as below:

client.py [-h] [--url-emoberta URL_EMOBERTA] --text TEXT

For example:

python client.py --text "Emotion recognition is so cool\!"

will give you:

{
    "neutral": 0.0049800905,
    "joy": 0.96399665,
    "surprise": 0.018937444,
    "anger": 0.0071516023,
    "sadness": 0.002021492,
    "disgust": 0.001495996,
    "fear": 0.0014167271
}

Troubleshooting

The best way to find and solve your problems is to see in the github issue tab. If you can't find what you want, feel free to raise an issue. We are pretty responsive.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Run make style && quality in the root repo directory, to ensure code quality.
  4. Commit your Changes (git commit -m 'Add some AmazingFeature')
  5. Push to the Branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request

Cite our work

Check out the paper.

@misc{kim2021emoberta,
      title={EmoBERTa: Speaker-Aware Emotion Recognition in Conversation with RoBERTa}, 
      author={Taewoon Kim and Piek Vossen},
      year={2021},
      eprint={2108.12009},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

DOI

Authors

License

MIT

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaForSequenceClassification
Ревизия весов
64377bd

0 моделей