File size: 3,065 Bytes
60681e6 4d1537e 5307137 90e0f97 60681e6 5d2f300 2849ef0 5d2f300 60681e6 6d220ae 60681e6 6d220ae 60681e6 dec20c5 60681e6 4f43fca a6b71d3 60681e6 7692b09 60681e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
---
license: apache-2.0
language:
- pl
pipeline_tag: text-classification
inference: false
---
# Affective Norms Extrapolation Model for Polish Language
## Disclaimer
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.
## Model Description
This transformer-based model is designed to extrapolate affective norms for Polish words, including metrics such as valence, arousal, dominance, concreteness, age of acquisition, origin, significance, and imageability. It has been finetuned from the Polish RoBerta Model (https://github.com/sdadas/polish-roberta), 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 ]
## Training Data
The model was trained on the Polish affective norms dataset by Imbir (2016) [ https://doi.org/10.3389/fpsyg.2016.01081 ], which includes 4900 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.
## Performance
The model achieved the following Pearson correlations with human judgments on the test set:
- Valence: 0.93
- Arousal: 0.86
- Dominance: 0.92
- Concreteness: 0.95
- Age of Acquisition: 0.81
- Origin: 0.86
- Significance: 0.88
- Imageability: 0.88
## Usage
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.
```bash
git lfs clone https://huggingface.co/hplisiecki/word2affect_polish
```
Proceed as follows:
```python
from word2affect_polish.model_script import CustomModel # importing the custom model class
from transformers import PreTrainedTokenizerFast
model_directory = "word2affect_polish" # path to the cloned repository
model = CustomModel.from_pretrained(model_directory)
tokenizer = PreTrainedTokenizerFast.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', 'Dominance', 'Origin', 'Significance', 'Concreteness', 'Imageability', 'Age of Acquisition'], outputs):
print(f"{emotion}: {rating.item()}")
```
## Citation
If you use this model please cite the following paper.
```sql
@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}
}
``` |