emotion english distilroberta base

j-hartmann

Introduction

The "Emotion English DistilRoBERTa-base" model is designed to classify emotions in English text data. It predicts Ekman's six basic emotions—anger, disgust, fear, joy, sadness, surprise—and a neutral class. This model is a fine-tuned version of DistilRoBERTa-base.

Architecture

The model leverages the architecture of DistilRoBERTa-base, a distilled version of RoBERTa, which is optimized for efficiency and speed without significantly compromising accuracy. For those interested in non-distilled models, a larger RoBERTa version is also available.

Training

The model was trained on a balanced subset of six diverse datasets, including sources like Twitter, Reddit, and TV dialogues. Each dataset provides emotion labels, and the training set consists of 2,811 observations per emotion, totaling nearly 20,000 observations. The training utilized 80% of the data, with 20% reserved for evaluation, achieving an accuracy of 66%.

Guide: Running Locally

To run the model locally, you can use the Hugging Face pipeline with the following steps:

  1. Install the Transformers library: Ensure you have the transformers library installed via pip.
    pip install transformers
    
  2. Import and use the model:
    from transformers import pipeline
    classifier = pipeline("text-classification", model="j-hartmann/emotion-english-distilroberta-base", return_all_scores=True)
    print(classifier("I love this!"))
    

For enhanced performance, consider using cloud GPUs such as those provided by Google Colab, which offers free access to GPUs.

License

The model and its usage adhere to the licensing terms specified by Hugging Face. For detailed licensing information, please refer to the Hugging Face model card and associated documentation.

More Related APIs in Text Classification