hplisiecki commited on
Commit
80d247b
1 Parent(s): 42c8d28

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -3
README.md CHANGED
@@ -1,3 +1,72 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ ---
6
+
7
+ # Affective Norms Extrapolation Model for English Language
8
+
9
+ ## Model Description
10
+
11
+ This transformer-based model is designed to extrapolate affective norms for English words, including metrics such as valence, arousal, dominance, concreteness, and age of acquisition. It has been finetuned from the ERNIE 2.0 model, 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."
12
+
13
+
14
+ ## Training Data
15
+
16
+ The model was trained on the ANEW corpus (Bradley & Lang, 1999) and the corpus collected by Warriner et al. (2013) [ https://doi.org/10.3758/s13428-012-0314-x]. The ANEW corpus consists of 1030 words, while Warriner's dataset includes 13,915 words rated on various emotional and semantic dimensions. The combined dataset was split into training, validation, and test sets in an 8:1:1 ratio.
17
+
18
+ ## Performance
19
+
20
+ The model achieved the following Pearson correlations with human judgments on the test set:
21
+
22
+ - Valence: 0.95
23
+ - Arousal: 0.76
24
+ - Dominance: 0.86
25
+ - Concreteness: 0.95
26
+ - Age of Acquisition: 0.85
27
+
28
+
29
+
30
+ ## Usage
31
+
32
+ You can use the model and tokenizer as follows:
33
+
34
+ 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.
35
+
36
+ ```bash
37
+ git clone https://huggingface.co/hplisiecki/word2affect_english
38
+ ```
39
+
40
+ Proceed as follows:
41
+
42
+ ```python
43
+ from word2affect_polish.model_script import CustomModel # importing the custom model class
44
+ from transformers import PreTrainedTokenizerFast
45
+
46
+ model_directory = "word2affect_english" # path to the cloned repository
47
+
48
+ model = CustomModel.from_pretrained(model_directory)
49
+ tokenizer = PreTrainedTokenizerFast.from_pretrained(model_directory)
50
+
51
+ inputs = tokenizer("This is a test input.", return_tensors="pt")
52
+ outputs = model(inputs['input_ids'], inputs['attention_mask'])
53
+
54
+ # Print out the emotion ratings
55
+ for emotion, rating in zip(['valence', 'arousal', 'dominance', 'aoa', 'concreteness'], outputs):
56
+ print(f"{emotion}: {rating.item()}")
57
+ ```
58
+
59
+ ## Citation
60
+
61
+ If you use this model please cite the following paper.
62
+
63
+ ```sql
64
+ @article{Plisiecki_Sobieszek_2023,
65
+ title={Extrapolation of affective norms using transformer-based neural networks and its application to experimental stimuli selection},
66
+ author={Plisiecki, Hubert and Sobieszek, Adam},
67
+ journal={Behavior Research Methods},
68
+ year={2023},
69
+ pages={1-16}
70
+ doi={https://doi.org/10.3758/s13428-023-02212-3}
71
+ }
72
+ ```