Update README.md
Browse files
README.md
CHANGED
@@ -11,59 +11,23 @@ language:
|
|
11 |
- da
|
12 |
- fr
|
13 |
pipeline_tag: text-classification
|
|
|
14 |
---
|
15 |
|
16 |
# Model Card for Model ID
|
17 |
|
18 |
-
|
19 |
|
20 |
|
21 |
|
22 |
## Model Details
|
23 |
|
24 |
### Model Description
|
|
|
25 |
|
26 |
-
<!-- Provide a longer summary of what this model is. -->
|
27 |
|
28 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
29 |
|
30 |
-
- **Developed by:** [More Information Needed]
|
31 |
-
- **Funded by [optional]:** [More Information Needed]
|
32 |
-
- **Shared by [optional]:** [More Information Needed]
|
33 |
-
- **Model type:** [More Information Needed]
|
34 |
-
- **Language(s) (NLP):** [More Information Needed]
|
35 |
-
- **License:** [More Information Needed]
|
36 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
37 |
|
38 |
-
### Model Sources [optional]
|
39 |
-
|
40 |
-
<!-- Provide the basic links for the model. -->
|
41 |
-
|
42 |
-
- **Repository:** [More Information Needed]
|
43 |
-
- **Paper [optional]:** [More Information Needed]
|
44 |
-
- **Demo [optional]:** [More Information Needed]
|
45 |
-
|
46 |
-
## Uses
|
47 |
-
|
48 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
49 |
-
|
50 |
-
### Direct Use
|
51 |
-
|
52 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
53 |
-
|
54 |
-
[More Information Needed]
|
55 |
-
|
56 |
-
### Downstream Use [optional]
|
57 |
-
|
58 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
59 |
-
|
60 |
-
[More Information Needed]
|
61 |
-
|
62 |
-
### Out-of-Scope Use
|
63 |
-
|
64 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
65 |
-
|
66 |
-
[More Information Needed]
|
67 |
|
68 |
## Bias, Risks, and Limitations
|
69 |
|
@@ -71,140 +35,41 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
71 |
|
72 |
[More Information Needed]
|
73 |
|
74 |
-
### Recommendations
|
75 |
-
|
76 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
77 |
-
|
78 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
79 |
|
80 |
## How to Get Started with the Model
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
## Training Details
|
87 |
|
88 |
### Training Data
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
[More Information Needed]
|
93 |
-
|
94 |
-
### Training Procedure
|
95 |
-
|
96 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
97 |
-
|
98 |
-
#### Preprocessing [optional]
|
99 |
-
|
100 |
-
[More Information Needed]
|
101 |
|
102 |
|
103 |
#### Training Hyperparameters
|
104 |
|
105 |
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
106 |
|
107 |
-
#### Speeds, Sizes, Times [optional]
|
108 |
-
|
109 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
110 |
|
111 |
[More Information Needed]
|
112 |
|
113 |
## Evaluation
|
114 |
-
|
115 |
-
|
116 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
117 |
-
|
118 |
-
### Testing Data, Factors & Metrics
|
119 |
-
|
120 |
-
#### Testing Data
|
121 |
-
|
122 |
-
<!-- This should link to a Dataset Card if possible. -->
|
123 |
-
|
124 |
-
[More Information Needed]
|
125 |
-
|
126 |
-
#### Factors
|
127 |
-
|
128 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
129 |
-
|
130 |
-
[More Information Needed]
|
131 |
-
|
132 |
-
#### Metrics
|
133 |
-
|
134 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
135 |
-
|
136 |
-
[More Information Needed]
|
137 |
-
|
138 |
-
### Results
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
#### Summary
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
## Model Examination [optional]
|
147 |
-
|
148 |
-
<!-- Relevant interpretability work for the model goes here -->
|
149 |
-
|
150 |
-
[More Information Needed]
|
151 |
-
|
152 |
-
## Environmental Impact
|
153 |
-
|
154 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
155 |
-
|
156 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
157 |
-
|
158 |
-
- **Hardware Type:** [More Information Needed]
|
159 |
-
- **Hours used:** [More Information Needed]
|
160 |
-
- **Cloud Provider:** [More Information Needed]
|
161 |
-
- **Compute Region:** [More Information Needed]
|
162 |
-
- **Carbon Emitted:** [More Information Needed]
|
163 |
-
|
164 |
-
## Technical Specifications [optional]
|
165 |
-
|
166 |
-
### Model Architecture and Objective
|
167 |
-
|
168 |
-
[More Information Needed]
|
169 |
-
|
170 |
-
### Compute Infrastructure
|
171 |
-
|
172 |
-
[More Information Needed]
|
173 |
-
|
174 |
-
#### Hardware
|
175 |
-
|
176 |
-
[More Information Needed]
|
177 |
-
|
178 |
-
#### Software
|
179 |
-
|
180 |
-
[More Information Needed]
|
181 |
-
|
182 |
-
## Citation [optional]
|
183 |
-
|
184 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
185 |
-
|
186 |
-
**BibTeX:**
|
187 |
-
|
188 |
-
[More Information Needed]
|
189 |
-
|
190 |
-
**APA:**
|
191 |
-
|
192 |
-
[More Information Needed]
|
193 |
-
|
194 |
-
## Glossary [optional]
|
195 |
-
|
196 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
197 |
-
|
198 |
-
[More Information Needed]
|
199 |
-
|
200 |
-
## More Information [optional]
|
201 |
-
|
202 |
-
[More Information Needed]
|
203 |
-
|
204 |
-
## Model Card Authors [optional]
|
205 |
-
|
206 |
-
[More Information Needed]
|
207 |
|
208 |
-
##
|
209 |
|
210 |
-
|
|
|
11 |
- da
|
12 |
- fr
|
13 |
pipeline_tag: text-classification
|
14 |
+
license: cc-by-4.0
|
15 |
---
|
16 |
|
17 |
# Model Card for Model ID
|
18 |
|
19 |
+
This model is fine-tuned for topic classification and uses the labels provided by the Comparative Agendas project. It can be used for the downstream task of classyfing press releases from political parties into 23 policy areas. It is similar to [partypress/partypress-multilingual](https://huggingface.co/partypress/partypress-multilingual), however, its base model is FacebookAI/xlm-roberta-large and it was fine-tuned on more data.
|
20 |
|
21 |
|
22 |
|
23 |
## Model Details
|
24 |
|
25 |
### Model Description
|
26 |
+
This model is based on FacebookAI/xlm-roberta-large and was trained in a two-step process. In the first step a dataset of press releases was weakly labeled with GPT-4o and the model was trained on the data. In a second step, it was trained on the same human annotated dataset as partypress/partypress-multilingual. The weak pre-training led to improved results (see below).
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
## Bias, Risks, and Limitations
|
33 |
|
|
|
35 |
|
36 |
[More Information Needed]
|
37 |
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
## How to Get Started with the Model
|
40 |
|
41 |
+
```python
|
42 |
+
>>> from transformers import pipeline
|
43 |
+
>>> tokenizer_kwargs = {'padding':True,'truncation':True,'max_length':512}
|
44 |
+
>>> partypress = pipeline("text-classification", model = "Sami92/XLM-R-Large-PartyPress", tokenizer = "Sami92/XLM-R-Large-PartyPress", **tokenizer_kwargs)
|
45 |
+
>>> partypress(["We urgently need to fight climate change and reduce carbon emissions. This is what our party stands for.",
|
46 |
+
"We urge all parties to end the violence and come to the table. This conflict between the two countries must end.",
|
47 |
+
"Así, “el trabajo de los militares españoles está al servicio de España y de los demás países”, que participan en esta misión por mandato de la OTAN, ha recordado.",
|
48 |
+
"Dass es immer noch einen Gender-Pay-Gap gibt, geht auf das Konto dieser Regierung."])
|
49 |
+
```
|
50 |
|
51 |
## Training Details
|
52 |
|
53 |
### Training Data
|
54 |
|
55 |
+
The model was trained on two datasets, each based on the data from partypress/partypress-multilingual. The first dataset was weakly labeled using GPT-4o. The prompt contained the label description taken from [Erfort et al. (2023)](https://journals.sagepub.com/doi/10.1177/20531680231183512). The weakly labeled dataset contains 32,060 press releases.
|
56 |
+
The second dataset is the human-annotated dataset that is used for training partypress/partypress-multilingual. For training only the single-coded examples were used (24,117). Evaluation was performed on the data that is annotated by two human coders per example (3,121).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
|
59 |
#### Training Hyperparameters
|
60 |
|
61 |
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
62 |
|
|
|
|
|
|
|
63 |
|
64 |
[More Information Needed]
|
65 |
|
66 |
## Evaluation
|
67 |
+
The following figure below displays the performance and compares it to two benchmarks ((scores as csv)[https://huggingface.co/Sami92/XLM-R-Large-PartyPress/blob/main/scores.csv]). The first benchmark is the coder agreement of the two coders per country (for details, see [Erfort et al. (2023)](https://journals.sagepub.com/doi/10.1177/20531680231183512)). It is referred to as Coder F1 and the difference between the model performance and the coder agreement is referred to as Coder Difference. The model comes close to the agreement of human coders in almost all classes. One notable exception is Foreign Trade and to a lesser extent Defence and Law and Crime. The second benchmark are the results of partypress/partypress-multilingual, referred to as Party Press F1 and the difference to the present model is referred to as Party Press Difference. Except for Foreign Trade and Law and Crime, the present model is on par or stronger than the other Party Press Model. In total it achieves an F1 score that is .06 higher.
|
68 |
+
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
+
The figure below displays the confusion matrix of the individual classes on the test set.
|
71 |
+
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
+
## Acknowledgements
|
74 |
|
75 |
+
I thank Cornelius Erfort for making the annotated press releases available.
|