Sami92 commited on
Commit
7820915
1 Parent(s): 5039c56

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -138
README.md CHANGED
@@ -5,7 +5,7 @@ tags: []
5
 
6
  # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
10
 
11
 
@@ -13,47 +13,9 @@ tags: []
13
 
14
  ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
 
58
  ## Bias, Risks, and Limitations
59
 
@@ -61,71 +23,60 @@ This is the model card of a 🤗 transformers model that has been pushed on the
61
 
62
  [More Information Needed]
63
 
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
  ## How to Get Started with the Model
71
 
72
  Use the code below to get started with the model.
 
 
73
 
74
- [More Information Needed]
 
 
75
 
76
- ## Training Details
 
77
 
78
- ### Training Data
 
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
 
82
- [More Information Needed]
83
 
84
- ### Training Procedure
 
 
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
 
88
- #### Preprocessing [optional]
89
 
90
- [More Information Needed]
91
 
92
 
93
  #### Training Hyperparameters
94
 
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
 
97
- #### Speeds, Sizes, Times [optional]
 
 
 
 
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
 
101
- [More Information Needed]
102
 
103
  ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
 
107
- ### Testing Data, Factors & Metrics
108
 
109
- #### Testing Data
110
 
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
 
115
- #### Factors
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
 
127
  ### Results
128
 
 
129
  | Label | Percentage | Count |
130
  |:------------:|:----------:|:-----:|
131
  | **Maintopic** | 0.82 | 69 |
@@ -171,68 +122,6 @@ Use the code below to get started with the model.
171
 
172
 
173
 
174
- ## Model Examination [optional]
175
-
176
- <!-- Relevant interpretability work for the model goes here -->
177
-
178
- [More Information Needed]
179
-
180
- ## Environmental Impact
181
-
182
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
183
-
184
- 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).
185
-
186
- - **Hardware Type:** [More Information Needed]
187
- - **Hours used:** [More Information Needed]
188
- - **Cloud Provider:** [More Information Needed]
189
- - **Compute Region:** [More Information Needed]
190
- - **Carbon Emitted:** [More Information Needed]
191
-
192
- ## Technical Specifications [optional]
193
-
194
- ### Model Architecture and Objective
195
-
196
- [More Information Needed]
197
-
198
- ### Compute Infrastructure
199
-
200
- [More Information Needed]
201
-
202
- #### Hardware
203
-
204
- [More Information Needed]
205
-
206
- #### Software
207
-
208
- [More Information Needed]
209
-
210
- ## Citation [optional]
211
-
212
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
213
-
214
- **BibTeX:**
215
-
216
- [More Information Needed]
217
-
218
- **APA:**
219
-
220
- [More Information Needed]
221
-
222
- ## Glossary [optional]
223
-
224
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
225
-
226
- [More Information Needed]
227
-
228
- ## More Information [optional]
229
-
230
- [More Information Needed]
231
-
232
- ## Model Card Authors [optional]
233
-
234
- [More Information Needed]
235
-
236
- ## Model Card Contact
237
 
238
- [More Information Needed]
 
5
 
6
  # Model Card for Model ID
7
 
8
+ 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 Telegram Posts 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 and different data sources.
9
 
10
 
11
 
 
13
 
14
  ### Model Description
15
 
16
+ This model is based on FacebookAI/xlm-roberta-large and was trained in a three-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 fine-tuned again with GPT-4o labeled data but this time the dataset was drawn from Telegram. In a third step, it was trained on the same human annotated dataset as partypress/partypress-multilingual. The weak pre-training led to improved results on Telegram data.
17
 
 
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  ## Bias, Risks, and Limitations
21
 
 
23
 
24
  [More Information Needed]
25
 
 
 
 
 
 
26
 
27
  ## How to Get Started with the Model
28
 
29
  Use the code below to get started with the model.
30
+ ```python
31
+ >>> from transformers import pipeline
32
 
33
+ >>> texts = ['Neue Anschuldigungen gegen die russischen Angriffstruppen in der Ukraine: Laut den USA sollen diese Chlorpikrin als Kampfstoff verwendet haben. Das sei ein Verstoß gegen die Chemiewaffenkonvention. /',
34
+ 'Tiktok ist ja eine chinesische App. Bestimmt wird bald über eine Tonaufnahme diskutiert, die der tschechische Geheimdienst aufgezeichnet hat: Krah am Telefon mit einem chinesischen Tech-Entwickler im TikTok-Business, der den Algorithmus extra zu Gunsten der AfD manipuliert.',
35
+ 'Saubere Bluttransfusion ,dem normalen Menschen ,ist die eigen Blut Spende nicht mehr erlaubt bzw gibt es wiedermal die Empfehlung von hochrangiger Stelle an Blutspendedienste und Krankenhäuser dieses nicht zu ermöglichen.In gehobenen Kreisen sind private Dienstleister in dieser Nische sehr aktiv.']
36
 
37
+ >>> tokenizer_kwargs = {'padding':True,'truncation':True,'max_length':512}
38
+ >>> partypress_telegram = pipeline("text-classification", model = "Sami92/XLM-R-Large-PartyPress-Telegram", tokenizer = "Sami92/XLM-R-Large-PartyPress-Telegram", **tokenizer_kwargs)
39
 
40
+ >>> partypress_telegram(texts)
41
+ ```
42
 
43
+ ## Training Details
44
 
45
+ ### Training Data
46
 
47
+ The model was trained on three datasets, each based on the data from partypress/partypress-multilingual. The first dataset was weakly labeled using GPT-4o. The [prompt](https://huggingface.co/Sami92/XLM-R-Large-PartyPress/blob/main/FinalPromptPartyPress.txt) 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.
48
+ The second dataset was drawn from Telegram channels. More specifically a sample from about 200 channels that have been subject to a fact-check from either Correctiv, dpa, Faktenfuchs or AFP. 7741 posts were sampled and weakly annotated by GPT-4o with the same prompt as before.
49
+ The third 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).
50
 
 
51
 
 
52
 
 
53
 
54
 
55
  #### Training Hyperparameters
56
 
 
57
 
58
+ - Epochs: 10
59
+ - Batch size: 16
60
+ - learning_rate: 2e-5
61
+ - weight_decay: 0.01
62
+ - fp16: True
63
 
 
64
 
 
65
 
66
  ## Evaluation
67
 
 
68
 
 
69
 
70
+ ### Testing Data
71
 
72
+ The testing was performed on the same data as for the [Sami92/XLM-R-Large-PartyPress](https://huggingface.co/Sami92/XLM-R-Large-PartyPress/edit/main/README.md). Due to the extra training step on the Telegram data, the F1-score on press releases reduced from 0.72 to 0.62.
 
 
73
 
74
+ However, for the second test, there is an improvement. For testing on Telegram data, a sample of 84 posts was taken and labeled by the model. Three annotators were then asked if the prediction of the model is either a main topic of the post, a subtopic, or incorrect. The majority vote was used as final label. The detailed results can be found below. For 93% of the Telegram posts, the model prediction was either a main or subtopic. For [Sami92/XLM-R-Large-PartyPress](https://huggingface.co/Sami92/XLM-R-Large-PartyPress/edit/main/README.md) it was only in 88% of the cases a main or subtopic. The improvement is even more visible when focusing on main topics only. For the Telegram-fine-tuned model the prediction is a main topic in 82% of the cases and for the model without training on Telegram data it is 75%.
75
 
 
 
 
 
 
 
 
 
 
76
 
77
  ### Results
78
 
79
+
80
  | Label | Percentage | Count |
81
  |:------------:|:----------:|:-----:|
82
  | **Maintopic** | 0.82 | 69 |
 
122
 
123
 
124
 
125
+ ## Acknowledgements
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
+ I thank Cornelius Erfort for making the annotated press releases available.