Diwank Singh commited on
Commit
467f601
1 Parent(s): 26753ef

Update dataset script

Browse files

Signed-off-by: Diwank Singh <diwank.singh@gmail.com>

Files changed (1) hide show
  1. hinglish-dump.py +11 -7
hinglish-dump.py CHANGED
@@ -57,12 +57,12 @@ class HinglishDumpDataset(datasets.GeneratorBasedBuilder):
57
  """Raw merged dump of Hinglish (hi-EN) datasets."""
58
 
59
  VERSION = datasets.Version("1.0.0")
60
- BUILDER_CONFIGS = [
61
- datasets.BuilderConfig(name="diwank--hinglish-dump", version=VERSION, description="default config"),
62
- ]
63
-
64
  CONFIGS = _URLS.keys()
65
 
 
 
 
 
66
 
67
  def _info(self):
68
 
@@ -77,6 +77,10 @@ class HinglishDumpDataset(datasets.GeneratorBasedBuilder):
77
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
78
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
79
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
80
- urls = [item for sublist in _URLS.values() for item in sublist]
81
- data_dir = dl_manager.download_and_extract(urls)
82
- return []
 
 
 
 
 
57
  """Raw merged dump of Hinglish (hi-EN) datasets."""
58
 
59
  VERSION = datasets.Version("1.0.0")
 
 
 
 
60
  CONFIGS = _URLS.keys()
61
 
62
+ BUILDER_CONFIGS = [
63
+ datasets.BuilderConfig(name=subset, version=VERSION, description=f"Config for {subset}")
64
+ for subset in CONFIGS
65
+ ]
66
 
67
  def _info(self):
68
 
 
77
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
78
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
79
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
80
+
81
+ data_dir = dl_manager.download_and_extract(_URLS)
82
+ return [
83
+ datasets.SplitGenerator(
84
+ name=datasets.Split.ALL,
85
+ ),
86
+ ]