Datasets:
dataloader bugs
Browse files
CaSET-catalan-stance-emotions-twitter.py
CHANGED
@@ -80,14 +80,25 @@ class CaSET(datasets.GeneratorBasedBuilder):
|
|
80 |
['FAVOUR', 'AGAINST', 'NEUTRAL', 'NA'
|
81 |
]
|
82 |
),
|
83 |
-
"original_emotion": datasets.Value("
|
84 |
-
"answer_emotion": datasets.Value("
|
85 |
}
|
86 |
),
|
87 |
homepage=_HOMEPAGE,
|
88 |
citation=_CITATION,
|
89 |
)
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
def _generate_examples(self, filepath):
|
92 |
"""This function returns the examples in the raw (text) form."""
|
93 |
logger.info("generating examples from = %s", filepath)
|
|
|
80 |
['FAVOUR', 'AGAINST', 'NEUTRAL', 'NA'
|
81 |
]
|
82 |
),
|
83 |
+
"original_emotion": datasets.Value("string"),
|
84 |
+
"answer_emotion": datasets.Value("string"),
|
85 |
}
|
86 |
),
|
87 |
homepage=_HOMEPAGE,
|
88 |
citation=_CITATION,
|
89 |
)
|
90 |
|
91 |
+
def _split_generators(self, dl_manager):
|
92 |
+
"""Returns SplitGenerators."""
|
93 |
+
urls_to_download = {
|
94 |
+
"data": f"{_URL}{_FILE}",
|
95 |
+
}
|
96 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
97 |
+
|
98 |
+
return [
|
99 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["data"]}),
|
100 |
+
]
|
101 |
+
|
102 |
def _generate_examples(self, filepath):
|
103 |
"""This function returns the examples in the raw (text) form."""
|
104 |
logger.info("generating examples from = %s", filepath)
|