Update IndicParaphrase.py
Browse files- IndicParaphrase.py +20 -2
IndicParaphrase.py
CHANGED
|
@@ -44,7 +44,7 @@ _LANGUAGES = [
|
|
| 44 |
]
|
| 45 |
|
| 46 |
|
| 47 |
-
class
|
| 48 |
VERSION = datasets.Version("1.0.0")
|
| 49 |
|
| 50 |
BUILDER_CONFIGS = [
|
|
@@ -79,7 +79,23 @@ class Xlsum(datasets.GeneratorBasedBuilder):
|
|
| 79 |
url = _URL.format(lang, self.VERSION.version_str[:-2])
|
| 80 |
|
| 81 |
data_dir = dl_manager.download_and_extract(url)
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
datasets.SplitGenerator(
|
| 84 |
name=datasets.Split.TRAIN,
|
| 85 |
gen_kwargs={
|
|
@@ -99,6 +115,8 @@ class Xlsum(datasets.GeneratorBasedBuilder):
|
|
| 99 |
},
|
| 100 |
),
|
| 101 |
]
|
|
|
|
|
|
|
| 102 |
|
| 103 |
def _generate_examples(self, filepath):
|
| 104 |
"""Yields examples as (key, example) tuples."""
|
|
|
|
| 44 |
]
|
| 45 |
|
| 46 |
|
| 47 |
+
class IndicParaphrase(datasets.GeneratorBasedBuilder):
|
| 48 |
VERSION = datasets.Version("1.0.0")
|
| 49 |
|
| 50 |
BUILDER_CONFIGS = [
|
|
|
|
| 79 |
url = _URL.format(lang, self.VERSION.version_str[:-2])
|
| 80 |
|
| 81 |
data_dir = dl_manager.download_and_extract(url)
|
| 82 |
+
if lang == 'as' :
|
| 83 |
+
|
| 84 |
+
datasets.SplitGenerator(
|
| 85 |
+
name=datasets.Split.TEST,
|
| 86 |
+
gen_kwargs={
|
| 87 |
+
"filepath": os.path.join(data_dir, "test_" + lang + ".jsonl"),
|
| 88 |
+
},
|
| 89 |
+
),
|
| 90 |
+
datasets.SplitGenerator(
|
| 91 |
+
name=datasets.Split.VALIDATION,
|
| 92 |
+
gen_kwargs={
|
| 93 |
+
"filepath": os.path.join(data_dir, "dev_" + lang + ".jsonl"),
|
| 94 |
+
},
|
| 95 |
+
),
|
| 96 |
+
]
|
| 97 |
+
else :
|
| 98 |
+
return [
|
| 99 |
datasets.SplitGenerator(
|
| 100 |
name=datasets.Split.TRAIN,
|
| 101 |
gen_kwargs={
|
|
|
|
| 115 |
},
|
| 116 |
),
|
| 117 |
]
|
| 118 |
+
|
| 119 |
+
|
| 120 |
|
| 121 |
def _generate_examples(self, filepath):
|
| 122 |
"""Yields examples as (key, example) tuples."""
|