Update fever-span-annotated.py
Browse files- fever-span-annotated.py +17 -11
fever-span-annotated.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import os
|
| 2 |
import gzip
|
| 3 |
import pandas as pd
|
| 4 |
import datasets
|
|
@@ -22,20 +21,27 @@ class FeverDataset(GeneratorBasedBuilder):
|
|
| 22 |
license="CC BY 4.0"
|
| 23 |
)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
def _split_generators(self, dl_manager):
|
| 26 |
-
base_path = os.path.abspath("data") # Get absolute path to the data directory
|
| 27 |
return [
|
| 28 |
SplitGenerator(
|
| 29 |
name=Split.TEST,
|
| 30 |
-
gen_kwargs={
|
| 31 |
-
"file_paths": [
|
| 32 |
-
os.path.join(base_path, "fever-pairs_shard_000000.tsv.gz"),
|
| 33 |
-
os.path.join(base_path, "fever-pairs_shard_000001.tsv.gz"),
|
| 34 |
-
os.path.join(base_path, "fever-pairs_shard_000002.tsv.gz"),
|
| 35 |
-
os.path.join(base_path, "fever-pairs_shard_000003.tsv.gz"),
|
| 36 |
-
os.path.join(base_path, "fever-pairs_shard_000004.tsv.gz"),
|
| 37 |
-
]
|
| 38 |
-
},
|
| 39 |
),
|
| 40 |
]
|
| 41 |
|
|
|
|
|
|
|
| 1 |
import gzip
|
| 2 |
import pandas as pd
|
| 3 |
import datasets
|
|
|
|
| 21 |
license="CC BY 4.0"
|
| 22 |
)
|
| 23 |
|
| 24 |
+
def _download_and_prepare(self, dl_manager):
|
| 25 |
+
# Define the URLs for the dataset files
|
| 26 |
+
urls = [
|
| 27 |
+
"https://example.com/path/to/fever-pairs_shard_000000.tsv.gz",
|
| 28 |
+
"https://example.com/path/to/fever-pairs_shard_000001.tsv.gz",
|
| 29 |
+
"https://example.com/path/to/fever-pairs_shard_000002.tsv.gz",
|
| 30 |
+
"https://example.com/path/to/fever-pairs_shard_000003.tsv.gz",
|
| 31 |
+
"https://example.com/path/to/fever-pairs_shard_000004.tsv.gz",
|
| 32 |
+
]
|
| 33 |
+
|
| 34 |
+
# Download the files using the dl_manager
|
| 35 |
+
downloaded_files = dl_manager.download(urls)
|
| 36 |
+
|
| 37 |
+
# Set the file paths for the split generators
|
| 38 |
+
self.file_paths = downloaded_files
|
| 39 |
+
|
| 40 |
def _split_generators(self, dl_manager):
|
|
|
|
| 41 |
return [
|
| 42 |
SplitGenerator(
|
| 43 |
name=Split.TEST,
|
| 44 |
+
gen_kwargs={"file_paths": self.file_paths},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
),
|
| 46 |
]
|
| 47 |
|