Datasets:

Languages:
English
ArXiv:
Rricha commited on
Commit
b9a3784
1 Parent(s): 00907bf

Upload climate-evaluation.py

Browse files
Files changed (1) hide show
  1. climate-evaluation.py +254 -0
climate-evaluation.py ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Climate Evaluation: Datasets used in the ClimateGPT paper"""
2
+
3
+ import os
4
+ import datasets
5
+ import csv
6
+ import textwrap
7
+ import json
8
+
9
+
10
+ _CITATION = """
11
+ @misc{thulke2024climategpt,
12
+ title={ClimateGPT: Towards AI Synthesizing Interdisciplinary Research on Climate Change},
13
+ author={David Thulke and Yingbo Gao and Petrus Pelser and Rein Brune and Rricha Jalota and Floris Fok and Michael Ramos and Ian van Wyk and Abdallah Nasir and Hayden Goldstein and Taylor Tragemann and Katie Nguyen and Ariana Fowler and Andrew Stanco and Jon Gabriel and Jordan Taylor and Dean Moro and Evgenii Tsymbalov and Juliette de Waal and Evgeny Matusov and Mudar Yaghi and Mohammad Shihadah and Hermann Ney and Christian Dugast and Jonathan Dotan and Daniel Erasmus},
14
+ year={2024},
15
+ eprint={2401.09646},
16
+ archivePrefix={arXiv},
17
+ primaryClass={cs.LG}
18
+ }
19
+ """
20
+
21
+ _HOMEPAGE = "https://arxiv.org/abs/2401.09646"
22
+
23
+ _LICENSE = ""
24
+
25
+ _ClimateEvaluation_BASE_KWARGS = dict(
26
+ citation=_CITATION,
27
+ url=_HOMEPAGE,
28
+ )
29
+
30
+ # DEFAULT_CONFIG_NAME = "climate_stance"
31
+
32
+ class ClimateEvaluationConfig(datasets.BuilderConfig):
33
+ """BuilderConfig for ClimateEvaluation."""
34
+
35
+ def __init__(
36
+ self,
37
+ data_dir,
38
+ citation,
39
+ url=None,
40
+ text_features=None,
41
+ label_column=None,
42
+ label_classes=None,
43
+ process_label=lambda x: x,
44
+ **kwargs,
45
+ ):
46
+ """BuilderConfig for ClimateGPT-Evaluation.
47
+ Args:
48
+ text_features: `dict[string, string]`, map from the name of the feature
49
+ dict for each text field to the name of the column in the tsv file
50
+ label_column: `string`, name of the column in the tsv file corresponding
51
+ to the label
52
+ data_dir: `string`, the path to the folder containing the tsv files in the
53
+ downloaded zip
54
+ citation: `string`, citation for the data set
55
+ url: `string`, url for information about the data set
56
+ label_classes: `list[string]`, the list of classes if the label is
57
+ categorical. If not provided, then the label will be of type
58
+ `datasets.Value('float32')`.
59
+ process_label: `Function[string, any]`, function taking in the raw value
60
+ of the label and processing it to the form required by the label feature
61
+ **kwargs: keyword arguments forwarded to super.
62
+ """
63
+ super(ClimateEvaluationConfig, self).__init__(
64
+ version=datasets.Version("1.0.0", ""), **kwargs
65
+ )
66
+ self.text_features = text_features
67
+ self.label_column = label_column
68
+ self.label_classes = label_classes
69
+ self.data_dir = data_dir
70
+ self.citation = citation
71
+ self.url = url
72
+ self.process_label = process_label
73
+
74
+
75
+ class ClimateEvaluation(datasets.GeneratorBasedBuilder):
76
+ """Based on ClimaBench, Pira 2.0 MCQs, Exeter datasets"""
77
+
78
+ BUILDER_CONFIGS = [
79
+ ClimateEvaluationConfig(
80
+ name="climate_stance",
81
+ description=textwrap.dedent(
82
+ """\
83
+ Climate-Stance contains climate change-related tweets that were posted during the 2019 United Nations Framework Convention on Climate Change. The tweets have been manually categorized into three groups for the purpose of stance detection: those expressing support for climate change prevention, those opposing it, and those with an ambiguous stance."""
84
+ ),
85
+ text_features={"text": "text"},
86
+ label_classes=[0, 1, 2],
87
+ label_column="label",
88
+ data_dir="ClimateStance",
89
+ citation=textwrap.dedent(
90
+ """\
91
+ @inproceedings{vaid-etal-2022-towards,
92
+ title = "Towards Fine-grained Classification of Climate Change related Social Media Text",
93
+ author = "Vaid, Roopal and
94
+ Pant, Kartikey and
95
+ Shrivastava, Manish",
96
+ booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop",
97
+ month = may,
98
+ year = "2022",
99
+ address = "Dublin, Ireland",
100
+ publisher = "Association for Computational Linguistics",
101
+ url = "https://aclanthology.org/2022.acl-srw.35",
102
+ doi = "10.18653/v1/2022.acl-srw.35",
103
+ pages = "434--443",
104
+ abstract = "With climate change becoming a cause of concern worldwide, it becomes essential to gauge people{'}s reactions. This can help educate and spread awareness about it and help leaders improve decision-making. This work explores the fine-grained classification and Stance detection of climate change-related social media text. Firstly, we create two datasets, ClimateStance and ClimateEng, consisting of 3777 tweets each, posted during the 2019 United Nations Framework Convention on Climate Change and comprehensively outline the dataset collection, annotation methodology, and dataset composition. Secondly, we propose the task of Climate Change stance detection based on our proposed ClimateStance dataset. Thirdly, we propose a fine-grained classification based on the ClimateEng dataset, classifying social media text into five categories: Disaster, Ocean/Water, Agriculture/Forestry, Politics, and General. We benchmark both the datasets for climate change stance detection and fine-grained classification using state-of-the-art methods in text classification. We also create a Reddit-based dataset for both the tasks, ClimateReddit, consisting of 6262 pseudo-labeled comments along with 329 manually annotated comments for the label. We then perform semi-supervised experiments for both the tasks and benchmark their results using the best-performing model for the supervised experiments. Lastly, we provide insights into the ClimateStance and ClimateReddit using part-of-speech tagging and named-entity recognition.",
105
+ }
106
+ }"""
107
+ ),
108
+ url="https://github.com/roopalv54/finegrained-climate-change-social-media",
109
+ ),
110
+ ClimateEvaluationConfig(
111
+ name="climate_eng",
112
+ description=textwrap.dedent(
113
+ """\
114
+ ClimateEng contains climate change-related tweets that were posted during the 2019 United Nations Framework Convention on Climate Change. The tweets have been manually categorized for the task of fine-grained classification into topics such as: Disaster, Ocean/Water, Agriculture/forestry, Politics, General. """
115
+ ),
116
+ text_features={"text": "text"},
117
+ label_classes=["0", "1", "2", "3", "4"],
118
+ label_column="label",
119
+ data_dir="ClimateEng",
120
+ citation=textwrap.dedent(
121
+ """\
122
+ @inproceedings{vaid-etal-2022-towards,
123
+ title = "Towards Fine-grained Classification of Climate Change related Social Media Text",
124
+ author = "Vaid, Roopal and
125
+ Pant, Kartikey and
126
+ Shrivastava, Manish",
127
+ booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop",
128
+ month = may,
129
+ year = "2022",
130
+ address = "Dublin, Ireland",
131
+ publisher = "Association for Computational Linguistics",
132
+ url = "https://aclanthology.org/2022.acl-srw.35",
133
+ doi = "10.18653/v1/2022.acl-srw.35",
134
+ pages = "434--443",
135
+ abstract = "With climate change becoming a cause of concern worldwide, it becomes essential to gauge people{'}s reactions. This can help educate and spread awareness about it and help leaders improve decision-making. This work explores the fine-grained classification and Stance detection of climate change-related social media text. Firstly, we create two datasets, ClimateStance and ClimateEng, consisting of 3777 tweets each, posted during the 2019 United Nations Framework Convention on Climate Change and comprehensively outline the dataset collection, annotation methodology, and dataset composition. Secondly, we propose the task of Climate Change stance detection based on our proposed ClimateStance dataset. Thirdly, we propose a fine-grained classification based on the ClimateEng dataset, classifying social media text into five categories: Disaster, Ocean/Water, Agriculture/Forestry, Politics, and General. We benchmark both the datasets for climate change stance detection and fine-grained classification using state-of-the-art methods in text classification. We also create a Reddit-based dataset for both the tasks, ClimateReddit, consisting of 6262 pseudo-labeled comments along with 329 manually annotated comments for the label. We then perform semi-supervised experiments for both the tasks and benchmark their results using the best-performing model for the supervised experiments. Lastly, we provide insights into the ClimateStance and ClimateReddit using part-of-speech tagging and named-entity recognition.",
136
+ }
137
+ }"""
138
+ ),
139
+ url="https://github.com/roopalv54/finegrained-climate-change-social-media",
140
+ ),
141
+ ClimateEvaluationConfig(
142
+ name="climatext",
143
+ description=textwrap.dedent(
144
+ """\
145
+ ClimaText is a binary classification dataset containing sentences from the web, Wikipedia and the section of US public companies' 10-K reports that addresses climate-related risks. The dataset is employed for the task of predicting whether a given sentence is relevant to climate change or not. """
146
+ ),
147
+ text_features={"text": "sentence"},
148
+ label_classes=["0", "1"],
149
+ label_column="label",
150
+ data_dir="ClimaText",
151
+ citation=textwrap.dedent(
152
+ """\
153
+ @misc{varini2021climatext,
154
+ title={ClimaText: A Dataset for Climate Change Topic Detection},
155
+ author={Francesco S. Varini and Jordan Boyd-Graber and Massimiliano Ciaramita and Markus Leippold},
156
+ year={2021},
157
+ eprint={2012.00483},
158
+ archivePrefix={arXiv},
159
+ primaryClass={cs.CL}
160
+ }
161
+ }"""
162
+ ),
163
+ url="https://www.sustainablefinance.uzh.ch/en/research/climate-fever/climatext.html",
164
+ ),
165
+ ClimateEvaluationConfig(
166
+ name="cdp_qa",
167
+ description=textwrap.dedent(
168
+ """\
169
+ CDP-QA is a dataset compiled from the questionnaires of the Carbon Disclosure Project, where cities, corporations, and states disclose their environmental information. The dataset presents pairs of questions and answers, and the objective is to predict whether a given answer is valid for the corresponding question. We benchmarked ClimateGPT on the questionnaires from the Combined split. """
170
+ ),
171
+ data_dir="CDP/Combined",
172
+ text_features={"question": "question", "answer": "answer"},
173
+ label_classes=["0", "1"],
174
+ label_column="label",
175
+ url="https://arxiv.org/abs/2301.04253"
176
+ citation=textwrap.dedent(
177
+ """\
178
+ @misc{laud2023Climabench,
179
+ title={ClimaBench: A Benchmark Dataset For Climate Change Text Understanding in English},
180
+ author={Tanmay Laud and Daniel Spokoyny and Tom Corringham and Taylor Berg-Kirkpatrick},
181
+ year={2023},
182
+ eprint={2301.04253},
183
+ archivePrefix={arXiv},
184
+ primaryClass={cs.CL}
185
+ }
186
+ }"""
187
+ ),
188
+ ),
189
+ ClimateEvaluationConfig(
190
+ name="exeter",
191
+ description=textwrap.dedent(
192
+ """\
193
+ The Exeter Climate Claims dataset contains textual data from 33 influential climate contrarian blogs and the climate-change-related content from 20 conservative think tanks spanning the years 1998 to 2020. Annotation of the dataset was done manually using a thorough three-layer taxonomy of (climate-change related) contrarian claims, which was developed by the authors. We utilize this dataset specifically for the binary classification task of discerning whether a given text contains a contrarian claim pertaining to climate change or not.  """
194
+ ),
195
+ data_dir="exeter",
196
+ text_features={"text": "text"},
197
+ label_classes=["0", "1"],
198
+ label_column="label",
199
+ url="https://www.nature.com/articles/s41598-021-01714-4"
200
+ citation=textwrap.dedent(
201
+ """\
202
+ @article{coan2021computer,
203
+ title={Computer-assisted classification of contrarian claims about climate change},
204
+ author={Coan, Travis G and Boussalis, Constantine and Cook, John and Nanko, Mirjam O},
205
+ journal={Scientific reports},
206
+ volume={11},
207
+ number={1},
208
+ pages={22320},
209
+ year={2021},
210
+ publisher={Nature Publishing Group UK London}
211
+ }
212
+ }"""
213
+ ),
214
+ ),
215
+ ClimateEvaluationConfig(
216
+ name="exams",
217
+ description=textwrap.dedent(
218
+ """\
219
+ EXAMS is a multiple choice question answering collected from high school examinations. To evaluate ClimateGPT on the cascaded machine translation approach, we evaluate on the Arabic subset of this dataset. The Arabic subset covers questions from biology, physics, science, social science and Islamic studies.
220
+ """
221
+ ),
222
+ data_dir="exams/translated",
223
+ text_features={"subject": "subject", "question_stem": "question_stem", "choices": "choices"},
224
+ label_classes=["A", "B", "C", "D"],
225
+ label_column="answerKey",
226
+ url="https://arxiv.org/abs/2301.04253",
227
+ citation=textwrap.dedent(
228
+ """\
229
+ @inproceedings{hardalov-etal-2020-exams,
230
+ title = "{EXAMS}: A Multi-subject High School Examinations Dataset for Cross-lingual and Multilingual Question Answering",
231
+ author = "Hardalov, Momchil and
232
+ Mihaylov, Todor and
233
+ Zlatkova, Dimitrina and
234
+ Dinkov, Yoan and
235
+ Koychev, Ivan and
236
+ Nakov, Preslav",
237
+ editor = "Webber, Bonnie and
238
+ Cohn, Trevor and
239
+ He, Yulan and
240
+ Liu, Yang",
241
+ booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
242
+ month = nov,
243
+ year = "2020",
244
+ address = "Online",
245
+ publisher = "Association for Computational Linguistics",
246
+ url = "https://aclanthology.org/2020.emnlp-main.438",
247
+ doi = "10.18653/v1/2020.emnlp-main.438",
248
+ pages = "5427--5444",
249
+ }
250
+ }"""
251
+ ),
252
+ **_ClimateEvaluation_BASE_KWARGS,
253
+ ),
254
+ ]