replaced corpus with text-corpus
Browse files- phantom-wiki-v050.py +3 -3
phantom-wiki-v050.py
CHANGED
@@ -56,7 +56,7 @@ for depth in [20]:
|
|
56 |
for size in SIZES:
|
57 |
for seed in [1, 2, 3]:
|
58 |
SPLITS.append(f"depth_{depth}_size_{size}_seed_{seed}")
|
59 |
-
for filename, config in [("articles.json", "corpus"), ("questions.json", "question-answer"), ("facts.pl", "database")]:
|
60 |
_URLS[config] = {}
|
61 |
for split in SPLITS:
|
62 |
_URLS[config][split] = f"https://huggingface.co/datasets/ag2435/phantom-wiki/resolve/main/{split}/{filename}"
|
@@ -88,7 +88,7 @@ class PhantomWiki(datasets.GeneratorBasedBuilder):
|
|
88 |
def _info(self):
|
89 |
"""This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
90 |
"""
|
91 |
-
if self.config.name == "corpus": # This is the name of the configuration selected in BUILDER_CONFIGS above
|
92 |
features = datasets.Features(
|
93 |
{
|
94 |
"title": datasets.Value("string"),
|
@@ -167,7 +167,7 @@ class PhantomWiki(datasets.GeneratorBasedBuilder):
|
|
167 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
168 |
with open(filepath, encoding="utf-8") as f:
|
169 |
for key, data in enumerate(json.load(f)):
|
170 |
-
if self.config.name == "corpus":
|
171 |
yield key, data
|
172 |
elif self.config.name == "question-answer":
|
173 |
yield key, data
|
|
|
56 |
for size in SIZES:
|
57 |
for seed in [1, 2, 3]:
|
58 |
SPLITS.append(f"depth_{depth}_size_{size}_seed_{seed}")
|
59 |
+
for filename, config in [("articles.json", "text-corpus"), ("questions.json", "question-answer"), ("facts.pl", "database")]:
|
60 |
_URLS[config] = {}
|
61 |
for split in SPLITS:
|
62 |
_URLS[config][split] = f"https://huggingface.co/datasets/ag2435/phantom-wiki/resolve/main/{split}/{filename}"
|
|
|
88 |
def _info(self):
|
89 |
"""This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
90 |
"""
|
91 |
+
if self.config.name == "text-corpus": # This is the name of the configuration selected in BUILDER_CONFIGS above
|
92 |
features = datasets.Features(
|
93 |
{
|
94 |
"title": datasets.Value("string"),
|
|
|
167 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
168 |
with open(filepath, encoding="utf-8") as f:
|
169 |
for key, data in enumerate(json.load(f)):
|
170 |
+
if self.config.name == "text-corpus":
|
171 |
yield key, data
|
172 |
elif self.config.name == "question-answer":
|
173 |
yield key, data
|