Commit
·
dd812a3
1
Parent(s):
ce6b3c6
Add config name for download url
Browse files- malayalam_news.py +26 -2
malayalam_news.py
CHANGED
@@ -22,10 +22,32 @@ _CITATION = """\
|
|
22 |
}
|
23 |
"""
|
24 |
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
class MalayalamNews(datasets.GeneratorBasedBuilder):
|
28 |
"""Malayalam News topic classification dataset."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
def _info(self):
|
30 |
return datasets.DatasetInfo(
|
31 |
description=_DESCRIPTION,
|
@@ -41,7 +63,9 @@ class MalayalamNews(datasets.GeneratorBasedBuilder):
|
|
41 |
)
|
42 |
|
43 |
def _split_generators(self, dl_manager):
|
44 |
-
|
|
|
|
|
45 |
return [
|
46 |
datasets.SplitGenerator(
|
47 |
name=datasets.Split.TRAIN,
|
|
|
22 |
}
|
23 |
"""
|
24 |
|
25 |
+
_URLs = {
|
26 |
+
"malayalam_news": "https://storage.googleapis.com/ai4bharat-public-indic-nlp-corpora/evaluations/classification/indicnlp-news-articles.tgz",
|
27 |
+
}
|
28 |
+
|
29 |
+
class MalayalamNewsConfig(datasets.BuilderConfig):
|
30 |
+
"""BuilderConfig for MalayalamNews."""
|
31 |
+
|
32 |
+
def __init__(self, **kwargs):
|
33 |
+
"""BuilderConfig for MalayalamNews.
|
34 |
+
|
35 |
+
Args:
|
36 |
+
**kwargs: keyword arguments forwarded to super.
|
37 |
+
"""
|
38 |
+
super(MalayalamNewsConfig, self).__init__(**kwargs)
|
39 |
|
40 |
class MalayalamNews(datasets.GeneratorBasedBuilder):
|
41 |
"""Malayalam News topic classification dataset."""
|
42 |
+
|
43 |
+
VERSION = datasets.Version("1.0.0")
|
44 |
+
|
45 |
+
BUILDER_CONFIGS = [
|
46 |
+
MalayalamNewsConfig(
|
47 |
+
name="malayalam_news", version=VERSION, description="Malayalam News topic classification dataset."
|
48 |
+
),
|
49 |
+
]
|
50 |
+
|
51 |
def _info(self):
|
52 |
return datasets.DatasetInfo(
|
53 |
description=_DESCRIPTION,
|
|
|
63 |
)
|
64 |
|
65 |
def _split_generators(self, dl_manager):
|
66 |
+
"""Returns SplitGenerators."""
|
67 |
+
download_url = _URLs[self.config.name]
|
68 |
+
data_dir = dl_manager.download_and_extract(download_url)
|
69 |
return [
|
70 |
datasets.SplitGenerator(
|
71 |
name=datasets.Split.TRAIN,
|