Downloads · 30 days
18
24% of all-time downloads
hplisiecki/word2affect_french
word2affect_french is a text classification model from hplisiecki. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model and other models from the word2affect line are finetuned to predict emotional load for singular words, not longer utterances. Their accuracy on long-form text is unknown.
Downloads · 30 days
18
24% of all-time downloads
All-time downloads
76
Public
Parameters
111M
891 MB on disk
Likes
0
Public
Click a slice to open those files.
.bin447 MB · 50%
From the Hugging Face model README
This model and other models from the word2affect line are finetuned to predict emotional load for singular words, not longer utterances. Their accuracy on long-form text is unknown.
This transformer-based model is designed to extrapolate affective norms for French words, including metrics such as valence, and arousal. It has been finetuned from the French Toxicity Classifier Plus Model ("EIStakovskii/french_toxicity_classifier_plus_v2"), enhanced with additional layers to predict the affective dimensions. This model was first released as a part of the publication: "Extrapolation of affective norms using transformer-based neural networks and its application to experimental stimuli selection." (Plisiecki, Sobieszek; 2023) [ https://doi.org/10.3758/s13428-023-02212-3 ]
The model was trained on the French affective norms dataset by Syssau et al. (2021) (http://dx.doi.org/10.3758/s13428-020-01450-z), which includes 1031 words rated by participants on various emotional and semantic dimensions. The dataset was split into training, validation, and test sets in an 8:1:1 ratio.
The model achieved the following Pearson correlations with human judgments on the test set:
You can use the model and tokenizer as follows:
First run the bash code below to clone the repository (this will take some time). Because of the custom model class, this model cannot be run with the usual huggingface Model setups.
git lfs clone https://huggingface.co/hplisiecki/word2affect_french
Proceed as follows:
from word2affect_french.model_script import CustomModel # importing the custom model class
from transformers import AutoTokenizer
model_directory = "word2affect_french" # path to the cloned repository
model = CustomModel.from_pretrained(model_directory)
tokenizer = AutoTokenizer.from_pretrained(model_directory)
inputs = tokenizer("test", return_tensors="pt")
outputs = model(inputs['input_ids'], inputs['attention_mask'])
# Print out the emotion ratings
for emotion, rating in zip(['Valence', 'Arousal'], outputs):
print(f"{emotion}: {rating.item()}")
If you use this model please cite the following paper.
@article{Plisiecki_Sobieszek_2023,
title={Extrapolation of affective norms using transformer-based neural networks and its application to experimental stimuli selection},
author={Plisiecki, Hubert and Sobieszek, Adam},
journal={Behavior Research Methods},
year={2023},
pages={1-16}
doi={https://doi.org/10.3758/s13428-023-02212-3}
}