Update labels.py
Browse files
labels.py
CHANGED
|
@@ -48,8 +48,8 @@ _CITATION = """\
|
|
| 48 |
}
|
| 49 |
"""
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
_TOPICS = [
|
| 55 |
"Society & Culture",
|
|
@@ -93,17 +93,11 @@ class YahooAnswersTopics(datasets.GeneratorBasedBuilder):
|
|
| 93 |
)
|
| 94 |
|
| 95 |
def _split_generators(self, dl_manager):
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
# Extracting (un-taring) the training data
|
| 99 |
-
# data_dir = os.path.join(data_dir)
|
| 100 |
return [
|
| 101 |
-
datasets.SplitGenerator(
|
| 102 |
-
|
| 103 |
-
),
|
| 104 |
-
datasets.SplitGenerator(
|
| 105 |
-
name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(data_dir, "test.csv")}
|
| 106 |
-
),
|
| 107 |
]
|
| 108 |
|
| 109 |
def _generate_examples(self, filepath):
|
|
|
|
| 48 |
}
|
| 49 |
"""
|
| 50 |
|
| 51 |
+
_TRAIN_DOWNLOAD_URL = "https://github.com/edubrigham/data/blob/541db4cdbb566aa5909e3eb4904d64f9683e5d4a/yahoo_answers_csv/train.csv"
|
| 52 |
+
_TEST_DOWNLOAD_URL = "https://github.com/edubrigham/data/blob/541db4cdbb566aa5909e3eb4904d64f9683e5d4a/yahoo_answers_csv/test.csv"
|
| 53 |
|
| 54 |
_TOPICS = [
|
| 55 |
"Society & Culture",
|
|
|
|
| 93 |
)
|
| 94 |
|
| 95 |
def _split_generators(self, dl_manager):
|
| 96 |
+
train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
|
| 97 |
+
test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
|
|
|
|
|
|
|
| 98 |
return [
|
| 99 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
|
| 100 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
]
|
| 102 |
|
| 103 |
def _generate_examples(self, filepath):
|