|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""A dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change collected on the internet.""" |
|
|
|
|
|
import json |
|
import os |
|
|
|
import datasets |
|
|
|
|
|
|
|
_CITATION = """\ |
|
@misc{diggelmann2020climatefever, |
|
title={CLIMATE-FEVER: A Dataset for Verification of Real-World Climate Claims}, |
|
author={Thomas Diggelmann and Jordan Boyd-Graber and Jannis Bulian and Massimiliano Ciaramita and Markus Leippold}, |
|
year={2020}, |
|
eprint={2012.00614}, |
|
archivePrefix={arXiv}, |
|
primaryClass={cs.CL} |
|
} |
|
""" |
|
|
|
|
|
_DESCRIPTION = """\ |
|
A dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change collected on the internet. Each claim is accompanied by five manually annotated evidence sentences retrieved from the English Wikipedia that support, refute or do not give enough information to validate the claim totalling in 7,675 claim-evidence pairs. The dataset features challenging claims that relate multiple facets and disputed cases of claims where both supporting and refuting evidence are present. |
|
""" |
|
|
|
|
|
_VERSION = "1.0.1" |
|
|
|
|
|
_HOMEPAGE = "http://climatefever.ai" |
|
|
|
|
|
_LICENSE = "" |
|
|
|
|
|
_URL = f"https://raw.githubusercontent.com/tdiggelm/climate-fever-dataset/{_VERSION}/dataset/climate-fever.jsonl" |
|
|
|
|
|
class ClimateFever(datasets.GeneratorBasedBuilder): |
|
"""CLIMATE-FEVER: A dataset adopting the FEVER methodology that consists of 1,535 real-world claims regarding climate-change collected on the internet. Each claim is accompanied by five manually annotated evidence sentences retrieved from the English Wikipedia that support, refute or do not give enough information to validate the claim totalling in 7,675 claim-evidence pairs. The dataset features challenging claims that relate multiple facets and disputed cases of claims where both supporting and refuting evidence are present.""" |
|
|
|
VERSION = datasets.Version(_VERSION) |
|
|
|
def _info(self): |
|
|
|
features = datasets.Features( |
|
{ |
|
"claim_id": datasets.Value("string"), |
|
"claim": datasets.Value("string"), |
|
"claim_label": datasets.ClassLabel(names=["SUPPORTS", "REFUTES", "NOT_ENOUGH_INFO", "DISPUTED"]), |
|
"evidences": [ |
|
{ |
|
"evidence_id": datasets.Value("string"), |
|
"evidence_label": datasets.ClassLabel(names=["SUPPORTS", "REFUTES", "NOT_ENOUGH_INFO"]), |
|
"article": datasets.Value("string"), |
|
"evidence": datasets.Value("string"), |
|
"entropy": datasets.Value("float32"), |
|
"votes": [datasets.Value("string")], |
|
}, |
|
], |
|
} |
|
) |
|
|
|
return datasets.DatasetInfo( |
|
|
|
description=_DESCRIPTION, |
|
|
|
features=features, |
|
|
|
|
|
|
|
supervised_keys=None, |
|
|
|
homepage=_HOMEPAGE, |
|
|
|
license=_LICENSE, |
|
|
|
citation=_CITATION, |
|
) |
|
|
|
def _split_generators(self, dl_manager): |
|
"""Returns SplitGenerators.""" |
|
data_path = dl_manager.download(_URL) |
|
return [ |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TEST, |
|
|
|
gen_kwargs={"filepath": data_path}, |
|
), |
|
] |
|
|
|
def _generate_examples(self, filepath): |
|
"""Yields examples.""" |
|
with open(filepath, encoding="utf-8") as f: |
|
for id_, row in enumerate(f): |
|
doc = json.loads(row) |
|
yield id_, doc |
|
|