File size: 6,051 Bytes
efa8b77
6d8ccba
 
efa8b77
 
025706d
efa8b77
 
 
 
 
 
 
025706d
6d8ccba
 
efa8b77
 
990b366
efa8b77
025706d
efa8b77
 
 
 
 
 
 
 
 
 
025706d
efa8b77
 
025706d
 
738833d
 
efa8b77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738833d
efa8b77
 
 
 
9c3b72c
 
 
 
 
 
8f5af5e
 
54f639b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
efa8b77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17c31f7
 
efa8b77
 
 
 
 
eba310d
 
 
 
 
 
 
 
 
 
 
efa8b77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
base_model:
- intfloat/multilingual-e5-large
library_name: setfit
metrics:
- f1
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
widget: []
inference: true
license: mit
language:
- multilingual
---

# Automated Motive Coder with intfloat/multilingual-e5-large as base

This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses a finetuned version of [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) as the Sentence Transformer embedding model. A OneVsRestClassifier instance with SGDClassifier estimators is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
2. Training a classification head with features from the fine-tuned Sentence Transformer.

## Model Details

### Model Description
- **Model Type:** SetFit
- **Sentence Transformer body:** [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large)
- **Classification head:** a OneVsRestClassifier instance
- **Maximum Sequence Length:** 512 tokens
- **Number of Classes:** 4 classes (nAch: "ach", nAff: "aff", nPow: "pow", Null: "null")
- **Training Dataset:** [Labeled PSE-stories published by Schönbrodt and colleagues](http://dx.doi.org/10.23668/psycharchives.2738)
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### Model Sources

- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)

## Uses

### Direct Use for Inference

First install the SetFit library:

```bash
pip install setfit
```

Then you can load this model and run inference.

```python
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("automatedMotiveCoder/setfit")
# Run inference
preds = model("I loved the spiderman movie!")
```

When using the `predict_proba()` method, the predicted probabilities for
all classes might not sum to 1. This is because the model loaded uses a
One-vs-Rest classification approach, which means the model treats each
class as a binary classification problem. As a result, the probabilities
are independent, and their sum may exceed or fall below 1.

For more details on how to use this model, see [our blogpost](https://mbrede.github.io/blog/using_setfit/).

### Versioning

The most recent version is the version at submission to the [NLPSI workshop](https://nlpsi-workshop.github.io/) at the ICWSM 2025 in Kopenhagen.

For all Versions see this table:

| Commit-Hash | SemVer | Comment |
|:----|:----|:----|
|738833d| 1.0.0| Version at submission|

To use the model with a specific version, add the `revision` argument to the model-loading:

```
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("automatedMotiveCoder/setfit",
                                    revision="738833d") # Version 1.0.0
```

<!--
### Downstream Use

*List how someone could finetune this model on their own dataset.*
-->

<!--
### Out-of-Scope Use

*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->

<!--
## Bias, Risks and Limitations

*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->

<!--
### Recommendations

*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->

## Training Details

### Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 3.3.1
- Transformers: 4.46.3
- PyTorch: 2.3.1+cu121
- Datasets: 2.21.0
- Tokenizers: 0.20.3
- Scikit-learn: 1.6.1


## Citation

### BibTeX
```bibtex
@inproceedings{bredeAutomaticallyCodingImplicit2025,
  title = {Automatically {{Coding Implicit Motives}} in {{Picture Story Exercises}}: {{The Automated Motive Coder}}},
  shorttitle = {Automatically {{Coding Implicit Motives}} in {{Picture Story Exercises}}},
  author = {Brede, Max and Sch{\"o}nbrodt, Felix and Hagemeyer, Birk and Lerche, Veronika},
  year = {2025},
  month = jun,
  publisher = {ICWSM},
  address = {US},
  urldate = {2025-06-23},
  abstract = {The Picture Story Exercise (PSE) is a projective measure in personality psychology where individuals create narratives based on ambiguous images. Traditionally, the coding of these narratives has been labor-intensive. We introduce the Automated Motive Coder (AMC), which employs recent advances in natural language processing and machine learning to automate the coding of PSE narratives. Trained on an extensive dataset, the AMC demonstrates accuracy comparable to expert coders for both original and translated texts. The model offers support for multiple languages that were absent in prior methods while improving in accuracy and speed. To illustrate its effectiveness, we tested and successfully replicated the established psychological effect of gender difference in the affiliation motive. The AMC can be utilized through established machine learning tools, offering a pragmatic and reliable method for coding across several languages. This tool provides an option to reduce the workload involved in PSE coding, promoting efficiency and consistency in motive assessment.},
  langid = {english}
}
```

<!--
## Glossary

*Clearly define terms in order to be accessible across audiences.*
-->

<!--
## Model Card Authors

*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->

<!--
## Model Card Contact

*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->