Update README.md
Browse files
README.md
CHANGED
@@ -1,47 +1,150 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
tags:
|
3 |
-
-
|
4 |
-
|
5 |
-
-
|
6 |
-
|
|
|
|
|
7 |
---
|
8 |
|
9 |
-
|
10 |
-
probably proofread and complete it, then remove this comment. -->
|
11 |
|
12 |
-
# partypress-monolingual-denmark
|
13 |
|
14 |
-
|
15 |
-
It achieves the following results on the evaluation set:
|
16 |
|
17 |
|
18 |
## Model description
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
## Intended uses & limitations
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
## Training procedure
|
31 |
|
32 |
-
###
|
33 |
|
34 |
-
|
35 |
-
- optimizer: None
|
36 |
-
- training_precision: float32
|
37 |
|
38 |
-
###
|
39 |
|
|
|
40 |
|
|
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
- Transformers 4.28.0
|
45 |
- TensorFlow 2.12.0
|
46 |
- Datasets 2.12.0
|
47 |
- Tokenizers 0.13.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: cc-by-sa-4.0
|
3 |
+
language:
|
4 |
+
- de
|
5 |
+
metrics:
|
6 |
+
- accuracy
|
7 |
+
pipeline_tag: text-classification
|
8 |
tags:
|
9 |
+
- partypress
|
10 |
+
- political science
|
11 |
+
- parties
|
12 |
+
- press releases
|
13 |
+
widget:
|
14 |
+
- text: 'Immissionsschutzgesetz muss ein Klagerecht für BürgerInnen beinhalten: "Es ist seit Jahren bekannt, welche Maßnahmen zur Reduktion der Feinstaubbelastung gesetzt werden müssen. Diese neuerlich bloß aufzuzählen, wie es jetzt Minister Berlakovich tut, hilft den Betroffenen nicht", kritisiert die Grüne Umweltsprecherin Christiane Brunner die jüngsten Aussagen des Umweltministers zur Problematik Feinstaub.'
|
15 |
---
|
16 |
|
17 |
+
# PARTYPRESS monolingual Denmark
|
|
|
18 |
|
|
|
19 |
|
20 |
+
Fine-tuned model, based on [Maltehb/danish-bert-botxo](https://huggingface.co/Maltehb/danish-bert-botxo). Used in Erfort et al. (2023), building on the PARTYPRESS database. For the downstream task of classyfing press releases from political parties into 23 unique policy areas we achieve a performance comparable to expert human coders.
|
|
|
21 |
|
22 |
|
23 |
## Model description
|
24 |
|
25 |
+
The PARTYPRESS monolingual model builds on [Maltehb/danish-bert-botxo](https://huggingface.co/Maltehb/danish-bert-botxo) but has a supervised component. This means, it was fine-tuned using texts labeled by humans. The labels indicate 23 different political issue categories derived from the Comparative Agendas Project (CAP):
|
26 |
+
| Code | Issue |
|
27 |
+
|--|-------|
|
28 |
+
| 1 | Macroeconomics |
|
29 |
+
| 2 | Civil Rights |
|
30 |
+
| 3 | Health |
|
31 |
+
| 4 | Agriculture |
|
32 |
+
| 5 | Labor |
|
33 |
+
| 6 | Education |
|
34 |
+
| 7 | Environment |
|
35 |
+
| 8 | Energy |
|
36 |
+
| 9 | Immigration |
|
37 |
+
| 10 | Transportation |
|
38 |
+
| 12 | Law and Crime |
|
39 |
+
| 13 | Social Welfare |
|
40 |
+
| 14 | Housing |
|
41 |
+
| 15 | Domestic Commerce |
|
42 |
+
| 16 | Defense |
|
43 |
+
| 17 | Technology |
|
44 |
+
| 18 | Foreign Trade |
|
45 |
+
| 19.1 | International Affairs |
|
46 |
+
| 19.2 | European Union |
|
47 |
+
| 20 | Government Operations |
|
48 |
+
| 23 | Culture |
|
49 |
+
| 98 | Non-thematic |
|
50 |
+
| 99 | Other |
|
51 |
+
|
52 |
+
## Model variations
|
53 |
+
|
54 |
+
There are several monolingual models for different countries, and a multilingual model. The multilingual model can be easily extended to other languages, country contexts, or time periods by fine-tuning it with minimal additional labeled texts.
|
55 |
|
56 |
## Intended uses & limitations
|
57 |
|
58 |
+
The main use of the model is for text classification of press releases from political parties. It may also be useful for other political texts.
|
59 |
|
60 |
+
The classification can then be used to measure which issues parties are discussing in their communication.
|
61 |
|
62 |
+
### How to use
|
63 |
+
|
64 |
+
This model can be used directly with a pipeline for text classification:
|
65 |
+
|
66 |
+
```python
|
67 |
+
>>> from transformers import pipeline
|
68 |
+
>>> tokenizer_kwargs = {'padding':True,'truncation':True,'max_length':512}
|
69 |
+
>>> partypress = pipeline("text-classification", model = "cornelius/partypress-monolingual-Denmark", tokenizer = "cornelius/partypress-monolingual-Denmark", **tokenizer_kwargs)
|
70 |
+
>>> partypress("Your text here.")
|
71 |
+
```
|
72 |
+
|
73 |
+
### Limitations and bias
|
74 |
+
|
75 |
+
The model was trained with data from parties in Denmark. For use in other countries, the model may be further fine-tuned. Without further fine-tuning, the performance of the model may be lower.
|
76 |
+
|
77 |
+
The model may have biased predictions. We discuss some biases by country, party, and over time in the release paper for the PARTYPRESS database. For example, the performance is highest for press releases from Ireland (75%) and lowest for Poland (55%).
|
78 |
+
|
79 |
+
## Training data
|
80 |
+
|
81 |
+
The PARTYPRESS multilingual model was fine-tuned with about 3,000 press releases from parties in Denmark. The press releases were labeled by two expert human coders.
|
82 |
+
|
83 |
+
For the training data of the underlying model, please refer to [Maltehb/danish-bert-botxo](https://huggingface.co/Maltehb/danish-bert-botxo)
|
84 |
|
85 |
## Training procedure
|
86 |
|
87 |
+
### Preprocessing
|
88 |
|
89 |
+
For the preprocessing, please refer to [Maltehb/danish-bert-botxo](https://huggingface.co/Maltehb/danish-bert-botxo)
|
|
|
|
|
90 |
|
91 |
+
### Pretraining
|
92 |
|
93 |
+
For the pretraining, please refer to [Maltehb/danish-bert-botxo](https://huggingface.co/Maltehb/danish-bert-botxo)
|
94 |
|
95 |
+
### Fine-tuning
|
96 |
|
97 |
+
We fine-tuned the model using about 3,000 labeled press releases from political parties in Denmark.
|
98 |
+
|
99 |
+
#### Training Hyperparameters
|
100 |
+
|
101 |
+
The batch size for training was 12, for testing 2, with four epochs. All other hyperparameters were the standard from the transformers library.
|
102 |
+
|
103 |
+
|
104 |
+
#### Framework versions
|
105 |
|
106 |
- Transformers 4.28.0
|
107 |
- TensorFlow 2.12.0
|
108 |
- Datasets 2.12.0
|
109 |
- Tokenizers 0.13.3
|
110 |
+
|
111 |
+
|
112 |
+
## Evaluation results
|
113 |
+
|
114 |
+
Fine-tuned on our downstream task, this model achieves the following results in a five-fold cross validation that are comparable to the performance of our expert human coders. Please refer to Erfort et al. (2023)
|
115 |
+
|
116 |
+
### BibTeX entry and citation info
|
117 |
+
|
118 |
+
```bibtex
|
119 |
+
@article{erfort_partypress_2023,
|
120 |
+
author = {Cornelius Erfort and
|
121 |
+
Lukas F. Stoetzer and
|
122 |
+
Heike Klüver},
|
123 |
+
title = {The PARTYPRESS Database: A New Comparative Database of Parties’ Press Releases},
|
124 |
+
journal = {Research and Politics},
|
125 |
+
volume = {forthcoming},
|
126 |
+
year = {2023},
|
127 |
+
}
|
128 |
+
```
|
129 |
+
|
130 |
+
### Further resources
|
131 |
+
|
132 |
+
Github: [cornelius-erfort/partypress](https://github.com/cornelius-erfort/partypress)
|
133 |
+
|
134 |
+
Research and Politics Dataverse: [Replication Data for: The PARTYPRESS Database: A New Comparative Database of Parties’ Press Releases](https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi%3A10.7910%2FDVN%2FOINX7Q)
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
+
## Acknowledgements
|
139 |
+
|
140 |
+
Research for this contribution is part of the Cluster of Excellence "Contestations of the Liberal Script" (EXC 2055, Project-ID: 390715649), funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Denmark´s Excellence Strategy. Cornelius Erfort is moreover grateful for generous funding provided by the DFG through the Research Training Group DYNAMICS (GRK 2458/1).
|
141 |
+
|
142 |
+
## Contact
|
143 |
+
|
144 |
+
Cornelius Erfort
|
145 |
+
|
146 |
+
Humboldt-Universität zu Berlin
|
147 |
+
|
148 |
+
[corneliuserfort.de](corneliuserfort.de)
|
149 |
+
|
150 |
+
|