text-emotion

Multilingual Emotion Classification


Keywords
text-emotion, xlm-roberta, text-classification, multilingual, emotion, emotion-classification, huggingface, roberta, transformers
License
MIT
Install
pip install text-emotion==0.0.3

Documentation

Text Emotion

Introduction

Supported Languages

The following languages are supported by the finetuned xlm-roberta model:

  • English
  • French
  • Spanish
  • German
  • Italian

All other languages are translated to English using the EasyNMT library. If the language is not supported by EasyNMT, then it is not supported.

Installation

You can install emotion using:

$ pip install text-emotion

Usage

from text_emotion import Detector

detector = Detector(emotion_language="fr")

print(detector.detect("Hello, I am so happy!"))

XLM-Roberta

The underlying model is xlm-roberta-large. You can test it at:

https://huggingface.co/ma2za/xlm-roberta-emotion

References

Unsupervised Cross-lingual Representation Learning at Scale (Conneau et al., ACL 2020)