Emotion English DistilRoBERTa-base (safetensors copy)

This repository is an unmodified copy of j-hartmann/emotion-english-distilroberta-base by Jochen Hartmann, with the weights stored in the safetensors format. All credit for the model goes to the original author. Please cite the original (see below).

Why this copy exists

The original repository provides its PyTorch weights only as pytorch_model.bin, a Python pickle archive that cannot be read outside Python. The R package Rhobots, which runs transformer models natively in R through torch, needs safetensors weights. This copy makes the model usable from R without Python.

  • model.safetensors is the safetensors conversion made by Hugging Face's official conversion bot (pull request refs/pr/9 on the original repository). All 106 weight tensors were checked to be bit-for-bit identical to the original pytorch_model.bin at commit 0e1cd914e3d46199ed785853e12b57304e04178b.
  • config.json and the tokenizer files (tokenizer.json, tokenizer_config.json, special_tokens_map.json, vocab.json, merges.txt) are copied unchanged from that commit.

Model

The model classifies English text into Ekman's six basic emotions plus a neutral class: anger, disgust, fear, joy, neutral, sadness, surprise.

It is a fine-tuned checkpoint of DistilRoBERTa-base, trained on a balanced subset (2,811 texts per emotion) of six datasets covering Twitter, Reddit, student self-reports and TV dialogue: Crowdflower (2016), Emotion Dataset (Elvis et al., 2018), GoEmotions (Demszky et al., 2020), ISEAR (Vikash, 2018), MELD (Poria et al., 2019) and SemEval-2018 EI-reg (Mohammad et al., 2018). The original author reports an evaluation accuracy of 66% (random baseline 14%). See the original model card for full details.

Usage

R (Rhobots)

library(Rhobots)
clf <- load_hf_classifier("NetworkIsLife/emotion-english-distilroberta-base")
classify_texts(clf, c("I am furious about this.", "The meeting is at 3pm."))
#>                       text   label score anger disgust   fear     joy neutral sadness surprise
#> 1 I am furious about this.   anger  0.99 0.986  0.0032 0.0024 0.00043  0.0051   0.002   0.0014
#> 2   The meeting is at 3pm. neutral  0.75 0.019  0.0151 0.0952 0.04529  0.7477   0.022   0.0562

Python (transformers)

from transformers import pipeline
classifier = pipeline("text-classification",
                      model="NetworkIsLife/emotion-english-distilroberta-base", top_k=None)
classifier("I love this!")

Licence

The original repository does not state a licence. This copy is provided only to make the model usable from R, with full attribution. If you are the author and would like this copy changed or removed, please open a discussion on this repository.

Reference

Please cite the original model:

Jochen Hartmann, "Emotion English DistilRoBERTa-base".
https://huggingface.co/j-hartmann/emotion-english-distilroberta-base/, 2022.
@misc{hartmann2022emotionenglish,
  author       = {Hartmann, Jochen},
  title        = {Emotion English DistilRoBERTa-base},
  year         = {2022},
  howpublished = {\url{https://huggingface.co/j-hartmann/emotion-english-distilroberta-base/}},
}
Downloads last month
25
Safetensors
Model size
82.1M params
Tensor type
I64
ยท
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for NetworkIsLife/emotion-english-distilroberta-base

Finetuned
(8)
this model