Update HuffPost.py
Browse files- HuffPost.py +2 -9
HuffPost.py
CHANGED
|
@@ -108,12 +108,6 @@ class HuffPost(datasets.GeneratorBasedBuilder):
|
|
| 108 |
)
|
| 109 |
|
| 110 |
def _split_generators(self, dl_manager):
|
| 111 |
-
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
| 112 |
-
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
| 113 |
-
|
| 114 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
| 115 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
| 116 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 117 |
|
| 118 |
data_dir = dl_manager.download_and_extract(_URLS)
|
| 119 |
return [
|
|
@@ -124,9 +118,8 @@ class HuffPost(datasets.GeneratorBasedBuilder):
|
|
| 124 |
]
|
| 125 |
|
| 126 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 127 |
-
def _generate_examples(self, filepath
|
| 128 |
-
|
| 129 |
-
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
| 130 |
with open(filepath, encoding="utf-8") as f:
|
| 131 |
for key, row in enumerate(f):
|
| 132 |
data = json.loads(row)
|
|
|
|
| 108 |
)
|
| 109 |
|
| 110 |
def _split_generators(self, dl_manager):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
data_dir = dl_manager.download_and_extract(_URLS)
|
| 113 |
return [
|
|
|
|
| 118 |
]
|
| 119 |
|
| 120 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 121 |
+
def _generate_examples(self, filepath):
|
| 122 |
+
|
|
|
|
| 123 |
with open(filepath, encoding="utf-8") as f:
|
| 124 |
for key, row in enumerate(f):
|
| 125 |
data = json.loads(row)
|