Datasets:

Sub-tasks:
fact-checking
Languages:
English
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Language Creators:
found
Annotations Creators:
crowdsourced
ArXiv:
Tags:
stance-detection
License:
mkon commited on
Commit
6dd037e
1 Parent(s): aec05e6
Files changed (2) hide show
  1. rumoureval2019_test.csv +0 -0
  2. rumoureval_2019.py +15 -17
rumoureval2019_test.csv ADDED
The diff for this file is too large to render. See raw diff
rumoureval_2019.py CHANGED
@@ -51,12 +51,12 @@ class RumourEval2019Config(datasets.BuilderConfig):
51
  super(RumourEval2019Config, self).__init__(**kwargs)
52
 
53
  class RumourEval2019(datasets.GeneratorBasedBuilder):
54
- """TODO: Short description of my dataset."""
55
 
56
  VERSION = datasets.Version("0.9.0")
57
 
58
  BUILDER_CONFIGS = [
59
- RumourEval2019Config(name="RumourEval2019", version=VERSION, description="Stance Detection texts"),
60
  ]
61
 
62
  def _info(self):
@@ -87,23 +87,21 @@ class RumourEval2019(datasets.GeneratorBasedBuilder):
87
  def _split_generators(self, dl_manager):
88
  train_text = dl_manager.download_and_extract("rumoureval2019_train.csv")
89
  validation_text = dl_manager.download_and_extract("rumoureval2019_val.csv")
 
90
  return [
91
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_text, "split": "train"}),
92
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": validation_text, "split": "validation"})
 
93
  ]
94
 
95
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
96
  def _generate_examples(self, filepath, split):
97
- # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
98
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
99
- if split == "train" or split == "validation":
100
- with open(filepath, encoding="utf-8") as f:
101
- reader = csv.DictReader(f, delimiter=",")
102
- guid = 0
103
- for instance in reader:
104
- instance["source_text"] = instance.pop("source_text")
105
- instance["reply_text"] = instance.pop("reply_text")
106
- instance["label"] = instance.pop("label")
107
- instance['id'] = str(guid)
108
- yield guid, instance
109
- guid += 1
51
  super(RumourEval2019Config, self).__init__(**kwargs)
52
 
53
  class RumourEval2019(datasets.GeneratorBasedBuilder):
54
+ """RumourEval2019 Stance Detection Dataset formatted in triples of (source_text, reply_text, label)"""
55
 
56
  VERSION = datasets.Version("0.9.0")
57
 
58
  BUILDER_CONFIGS = [
59
+ RumourEval2019Config(name="RumourEval2019", version=VERSION, description="Stance Detection Dataset"),
60
  ]
61
 
62
  def _info(self):
87
  def _split_generators(self, dl_manager):
88
  train_text = dl_manager.download_and_extract("rumoureval2019_train.csv")
89
  validation_text = dl_manager.download_and_extract("rumoureval2019_val.csv")
90
+ test_text = dl_manager.download_and_extract("rumoureval2019_test.csv")
91
  return [
92
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_text, "split": "train"}),
93
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": validation_text, "split": "validation"}),
94
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_text, "split": "test"}),
95
  ]
96
 
 
97
  def _generate_examples(self, filepath, split):
98
+ with open(filepath, encoding="utf-8") as f:
99
+ reader = csv.DictReader(f, delimiter=",")
100
+ guid = 0
101
+ for instance in reader:
102
+ instance["source_text"] = instance.pop("source_text")
103
+ instance["reply_text"] = instance.pop("reply_text")
104
+ instance["label"] = instance.pop("label")
105
+ instance['id'] = str(guid)
106
+ yield guid, instance
107
+ guid += 1