mkon commited on
Commit
5d7fefc
1 Parent(s): 5d9de26

fixed dataset and loader

Browse files
NLPCC2016_Stance_Detection_Task_A_Testdata.tsv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:bda780fb9ec241f8c2d3fdb2d0ccfe24bead13e36a9d41455db045aa279f6a34
3
- size 3492261
 
 
 
 
NLPCC2016_Stance_Detection_Task_B_Testdata.tsv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:69fede318c337d49e0fbbe277aa66d25d3e7ce5451f4b3d56d47ae5126ec8492
3
- size 1850423
 
 
 
 
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"task_a": {"description": "", "citation": "", "homepage": "", "license": "cc-by-4.0", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "stance": {"num_classes": 3, "names": ["AGAINST", "FAVOR", "NONE"], "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "nlpcc_stance", "config_name": "task_a", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 775152, "num_examples": 2986, "dataset_name": "nlpcc_stance"}}, "download_checksums": {"taska_train.csv": {"num_bytes": 744329, "checksum": "8d27fe452e00bbcb5f20c3d7eaac21ef9a6df27598db6c87b79353e2fdd96e41"}}, "download_size": 744329, "post_processing_size": null, "dataset_size": 775152, "size_in_bytes": 1519481}}
evasampledata4-TaskAA.tsv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b8e2bbeb09e2b92dcdf46381b7814ad413cad1bfbb92c1227be4694fe427e50d
3
- size 750935
 
 
 
 
evasampledata4-TaskBR.tsv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f8dd4a444ee3c20a7236a23ee3bb9490b052f1a4d9b337697593312ed9b19bfd
3
- size 419068
 
 
 
 
nlpcc_stance.py CHANGED
@@ -69,11 +69,9 @@ class NLPCCStance(datasets.GeneratorBasedBuilder):
69
  )
70
 
71
  def _split_generators(self, dl_manager):
72
- train_text = dl_manager.download_and_extract("nlpcc_taska.csv")
73
- test_text = dl_manager.download_and_extract("NLPCC2016_Stance_Detection_Task_A_Testdata.tsv")
74
  return [
75
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_text, "split": "train"}),
76
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_text, "split": "test"}),
77
  ]
78
 
79
  def _generate_examples(self, filepath, split):
@@ -81,10 +79,10 @@ class NLPCCStance(datasets.GeneratorBasedBuilder):
81
  reader = csv.DictReader(f, delimiter=",")
82
  guid = 0
83
  for instance in reader:
84
- print(f"At iteration: {guid}")
85
- instance["target"] = instance.pop("TARGET")
86
- instance["text"] = instance.pop("TEXT")
87
- instance["stance"] = instance.pop("STANCE")
88
  instance['id'] = str(guid)
89
  yield guid, instance
90
  guid += 1
 
69
  )
70
 
71
  def _split_generators(self, dl_manager):
72
+ train_text = dl_manager.download_and_extract("taska_train.csv")
 
73
  return [
74
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_text, "split": "train"}),
 
75
  ]
76
 
77
  def _generate_examples(self, filepath, split):
 
79
  reader = csv.DictReader(f, delimiter=",")
80
  guid = 0
81
  for instance in reader:
82
+ print(f"At iteration: {guid+1}")
83
+ instance["target"] = instance.pop("target")
84
+ instance["text"] = instance.pop("text")
85
+ instance["stance"] = instance.pop("stance")
86
  instance['id'] = str(guid)
87
  yield guid, instance
88
  guid += 1
taska_train.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:67b893c1073569618840ea9bc2c30c2ec86b24ac976da60f41d8a201df5f5b92
3
- size 748131
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d27fe452e00bbcb5f20c3d7eaac21ef9a6df27598db6c87b79353e2fdd96e41
3
+ size 744329