cornelius commited on
Commit
c8fdb4e
1 Parent(s): 465ca86

Upload TFRobertaForSequenceClassification

Browse files
Files changed (3) hide show
  1. README.md +19 -121
  2. config.json +2 -2
  3. tf_model.h5 +2 -2
README.md CHANGED
@@ -1,150 +1,48 @@
1
  ---
2
  license: cc-by-sa-4.0
3
- language:
4
- - en
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: "The Labour Party will seek to re-open negotiations on sugar production on the possibility of regaining sugar quota when the matter comes up for review at EU level.The commitment follows last week's hearing of the Oireachtas Agricultural Committee at which it was stated that Ireland could not have access to sugar quota at this time.Sean Sherlock said: What this means in real terms is that Ireland is not allowed to produce sugar for the EU domestic market nor for export to countries outside the EU. However, the review of the current EU sugar regime scheduled to take place in 2014 must be seized as an opportunity to secure an allocation of tonnage or quota to enable Ireland produce sugar again. While this is an issue dominated by countries such as Germany and France the Labour Party will adopt a strong position and we will be seeking a feasibility study involving all stakeholders and a renegotiation at European level through intense dialogue with our European partners."
15
  ---
16
 
17
- # PARTYPRESS monolingual Ireland
 
18
 
 
19
 
20
- Fine-tuned model, based on [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english). 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 [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english) 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-ireland", tokenizer = "cornelius/partypress-monolingual-ireland", **tokenizer_kwargs)
70
- >>> partypress("Your text here.")
71
- ```
72
-
73
- ### Limitations and bias
74
-
75
- The model was trained with data from parties in Ireland. 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 Ireland. The press releases were labeled by two expert human coders.
82
-
83
- For the training data of the underlying model, please refer to [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english)
84
 
85
  ## Training procedure
86
 
87
- ### Preprocessing
88
 
89
- For the preprocessing, please refer to [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english)
 
 
90
 
91
- ### Pretraining
92
 
93
- For the pretraining, please refer to [distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english)
94
 
95
- ### Fine-tuning
96
 
97
- We fine-tuned the model using about 3,000 labeled press releases from political parties in Ireland.
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 Ireland´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
-
 
1
  ---
2
  license: cc-by-sa-4.0
 
 
 
 
 
3
  tags:
4
+ - generated_from_keras_callback
5
+ model-index:
6
+ - name: partypress-monolingual-ireland
7
+ results: []
 
 
8
  ---
9
 
10
+ <!-- This model card has been generated automatically according to the information Keras had access to. You should
11
+ probably proofread and complete it, then remove this comment. -->
12
 
13
+ # partypress-monolingual-ireland
14
 
15
+ This model is a fine-tuned version of [cornelius/partypress-monolingual-ireland](https://huggingface.co/cornelius/partypress-monolingual-ireland) on an unknown dataset.
16
+ It achieves the following results on the evaluation set:
17
 
18
 
19
  ## Model description
20
 
21
+ More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  ## Intended uses & limitations
24
 
25
+ More information needed
26
 
27
+ ## Training and evaluation data
28
 
29
+ More information needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  ## Training procedure
32
 
33
+ ### Training hyperparameters
34
 
35
+ The following hyperparameters were used during training:
36
+ - optimizer: None
37
+ - training_precision: float32
38
 
39
+ ### Training results
40
 
 
41
 
 
42
 
43
+ ### Framework versions
 
 
 
 
 
 
 
44
 
45
  - Transformers 4.28.0
46
  - TensorFlow 2.12.0
47
  - Datasets 2.12.0
48
  - Tokenizers 0.13.3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "_name_or_path": "cornelius/partypress-monolingual-ireland",
3
  "architectures": [
4
- "BertForSequenceClassification"
5
  ],
6
  "attention_probs_dropout_prob": 0.1,
7
  "bos_token_id": 0,
@@ -64,7 +64,7 @@
64
  },
65
  "layer_norm_eps": 1e-05,
66
  "max_position_embeddings": 514,
67
- "model_type": "bert",
68
  "num_attention_heads": 12,
69
  "num_hidden_layers": 12,
70
  "pad_token_id": 1,
 
1
  {
2
  "_name_or_path": "cornelius/partypress-monolingual-ireland",
3
  "architectures": [
4
+ "RobertaForSequenceClassification"
5
  ],
6
  "attention_probs_dropout_prob": 0.1,
7
  "bos_token_id": 0,
 
64
  },
65
  "layer_norm_eps": 1e-05,
66
  "max_position_embeddings": 514,
67
+ "model_type": "roberta",
68
  "num_attention_heads": 12,
69
  "num_hidden_layers": 12,
70
  "pad_token_id": 1,
tf_model.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bf9fc2dab165f12db2bed75d873be844c233a9413dcb52d1a395b1b1567d1a19
3
- size 498941292
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75c528cf65de88a65572556e6f76b36e887bf2ccde4932a400b3b21c12e8782d
3
+ size 498942784