Update metrecv2.py
Browse files- metrecv2.py +24 -12
metrecv2.py
CHANGED
@@ -47,11 +47,11 @@ class MetRecV2(datasets.GeneratorBasedBuilder):
|
|
47 |
"""Metrec dataset."""
|
48 |
|
49 |
BUILDER_CONFIGS = [
|
50 |
-
|
51 |
-
|
52 |
-
description="Plain text",
|
53 |
-
)
|
54 |
]
|
|
|
|
|
55 |
|
56 |
def _info(self):
|
57 |
return datasets.DatasetInfo(
|
@@ -95,14 +95,26 @@ class MetRecV2(datasets.GeneratorBasedBuilder):
|
|
95 |
def _split_generators(self, dl_manager):
|
96 |
data_dir = dl_manager.download_and_extract(_DOWNLOAD_URL)
|
97 |
#data_dir = os.path.join(arch_path, "final_baits")
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
def _generate_examples(self, directory, labeled=True):
|
108 |
"""Generate examples."""
|
|
|
47 |
"""Metrec dataset."""
|
48 |
|
49 |
BUILDER_CONFIGS = [
|
50 |
+
datasets.BuilderConfig(name="train_all", description="Full dataset"),
|
51 |
+
datasets.BuilderConfig(name="train_50k", description="Subset with 50K max baits per meter"),
|
|
|
|
|
52 |
]
|
53 |
+
|
54 |
+
DEFAULT_CONFIG_NAME = "train_all"
|
55 |
|
56 |
def _info(self):
|
57 |
return datasets.DatasetInfo(
|
|
|
95 |
def _split_generators(self, dl_manager):
|
96 |
data_dir = dl_manager.download_and_extract(_DOWNLOAD_URL)
|
97 |
#data_dir = os.path.join(arch_path, "final_baits")
|
98 |
+
if self.config.name == "train_full":
|
99 |
+
|
100 |
+
return [
|
101 |
+
datasets.SplitGenerator(
|
102 |
+
name=datasets.Split.TRAIN, gen_kwargs={"directory": os.path.join(data_dir, "train.txt")}
|
103 |
+
),
|
104 |
+
datasets.SplitGenerator(
|
105 |
+
name=datasets.Split.TEST, gen_kwargs={"directory": os.path.join(data_dir, "test.txt")}
|
106 |
+
),
|
107 |
+
]
|
108 |
+
else:
|
109 |
+
return [
|
110 |
+
datasets.SplitGenerator(
|
111 |
+
name=datasets.Split.TRAIN, gen_kwargs={"directory": os.path.join(data_dir, "train_50k.txt")}
|
112 |
+
),
|
113 |
+
datasets.SplitGenerator(
|
114 |
+
name=datasets.Split.TEST, gen_kwargs={"directory": os.path.join(data_dir, "test.txt")}
|
115 |
+
),
|
116 |
+
]
|
117 |
+
|
118 |
|
119 |
def _generate_examples(self, directory, labeled=True):
|
120 |
"""Generate examples."""
|