Datasets:
added load script
Browse files- afriberta.py +7 -6
afriberta.py
CHANGED
@@ -15,6 +15,7 @@
|
|
15 |
|
16 |
# Lint as: python3
|
17 |
|
|
|
18 |
import datasets
|
19 |
|
20 |
_DESCRIPTION = """\
|
@@ -56,11 +57,11 @@ _DATASET_URLS = {
|
|
56 |
} for language in _LANGUAGES
|
57 |
}
|
58 |
|
59 |
-
class
|
60 |
BUILDER_CONFIGS = [
|
61 |
datasets.BuilderConfig(
|
62 |
version=datasets.Version(_VERSION),
|
63 |
-
name=language,
|
64 |
description=f"AfriBERTa corpus for {language}."
|
65 |
) for language in _LANGUAGES
|
66 |
]
|
@@ -85,15 +86,15 @@ class MrTyDiCorpus(datasets.GeneratorBasedBuilder):
|
|
85 |
|
86 |
splits = [
|
87 |
datasets.SplitGenerator(
|
88 |
-
name=
|
89 |
gen_kwargs={
|
90 |
-
"file_path": downloaded_files["train"],
|
91 |
},
|
92 |
),
|
93 |
datasets.SplitGenerator(
|
94 |
-
name=
|
95 |
gen_kwargs={
|
96 |
-
"file_path": downloaded_files["
|
97 |
},
|
98 |
),
|
99 |
]
|
|
|
15 |
|
16 |
# Lint as: python3
|
17 |
|
18 |
+
import os
|
19 |
import datasets
|
20 |
|
21 |
_DESCRIPTION = """\
|
|
|
57 |
} for language in _LANGUAGES
|
58 |
}
|
59 |
|
60 |
+
class Afriberta(datasets.GeneratorBasedBuilder):
|
61 |
BUILDER_CONFIGS = [
|
62 |
datasets.BuilderConfig(
|
63 |
version=datasets.Version(_VERSION),
|
64 |
+
name=language,
|
65 |
description=f"AfriBERTa corpus for {language}."
|
66 |
) for language in _LANGUAGES
|
67 |
]
|
|
|
86 |
|
87 |
splits = [
|
88 |
datasets.SplitGenerator(
|
89 |
+
name=datasets.Split.TRAIN,
|
90 |
gen_kwargs={
|
91 |
+
"file_path": os.path.join(downloaded_files["train"], "train.txt"),
|
92 |
},
|
93 |
),
|
94 |
datasets.SplitGenerator(
|
95 |
+
name=datasets.Split.TEST,
|
96 |
gen_kwargs={
|
97 |
+
"file_path": os.path.join(downloaded_files["train"], "eval.txt"),
|
98 |
},
|
99 |
),
|
100 |
]
|