aadelucia commited on
Commit
06f33a9
β€’
1 Parent(s): ed53ab3
This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. bernice-pretrain-data.py +9 -6
  3. data/{2016_01.txt.gz β†’ all/2016_01.txt.gz} +0 -0
  4. data/{2016_02.txt.gz β†’ all/2016_02.txt.gz} +0 -0
  5. data/{2016_03.txt.gz β†’ all/2016_03.txt.gz} +0 -0
  6. data/{2016_04.txt.gz β†’ all/2016_04.txt.gz} +0 -0
  7. data/{2016_05.txt.gz β†’ all/2016_05.txt.gz} +0 -0
  8. data/{2016_06.txt.gz β†’ all/2016_06.txt.gz} +0 -0
  9. data/{2016_07.txt.gz β†’ all/2016_07.txt.gz} +0 -0
  10. data/{2016_08.txt.gz β†’ all/2016_08.txt.gz} +0 -0
  11. data/{2016_09.txt.gz β†’ all/2016_09.txt.gz} +0 -0
  12. data/{2016_10.txt.gz β†’ all/2016_10.txt.gz} +0 -0
  13. data/{2016_11.txt.gz β†’ all/2016_11.txt.gz} +0 -0
  14. data/{2016_12.txt.gz β†’ all/2016_12.txt.gz} +0 -0
  15. data/{2017_01.txt.gz β†’ all/2017_01.txt.gz} +0 -0
  16. data/{2017_02.txt.gz β†’ all/2017_02.txt.gz} +0 -0
  17. data/{2017_03.txt.gz β†’ all/2017_03.txt.gz} +0 -0
  18. data/{2017_04.txt.gz β†’ all/2017_04.txt.gz} +0 -0
  19. data/{2017_05.txt.gz β†’ all/2017_05.txt.gz} +0 -0
  20. data/{2017_06.txt.gz β†’ all/2017_06.txt.gz} +0 -0
  21. data/{2017_07.txt.gz β†’ all/2017_07.txt.gz} +0 -0
  22. data/{2017_09.txt.gz β†’ all/2017_09.txt.gz} +0 -0
  23. data/{2017_10.txt.gz β†’ all/2017_10.txt.gz} +0 -0
  24. data/{2017_11.txt.gz β†’ all/2017_11.txt.gz} +0 -0
  25. data/{2017_12.txt.gz β†’ all/2017_12.txt.gz} +0 -0
  26. data/{2018_01.txt.gz β†’ all/2018_01.txt.gz} +0 -0
  27. data/{2018_02.txt.gz β†’ all/2018_02.txt.gz} +0 -0
  28. data/{2018_03.txt.gz β†’ all/2018_03.txt.gz} +0 -0
  29. data/{2018_04.txt.gz β†’ all/2018_04.txt.gz} +0 -0
  30. data/{2018_05.txt.gz β†’ all/2018_05.txt.gz} +0 -0
  31. data/{2018_06.txt.gz β†’ all/2018_06.txt.gz} +0 -0
  32. data/{2018_07.txt.gz β†’ all/2018_07.txt.gz} +0 -0
  33. data/{2018_08.txt.gz β†’ all/2018_08.txt.gz} +0 -0
  34. data/{2018_09.txt.gz β†’ all/2018_09.txt.gz} +0 -0
  35. data/{2018_10.txt.gz β†’ all/2018_10.txt.gz} +0 -0
  36. data/{2018_11.txt.gz β†’ all/2018_11.txt.gz} +0 -0
  37. data/{2018_12.txt.gz β†’ all/2018_12.txt.gz} +0 -0
  38. data/{2019_01.txt.gz β†’ all/2019_01.txt.gz} +0 -0
  39. data/{2019_02.txt.gz β†’ all/2019_02.txt.gz} +0 -0
  40. data/{2019_03.txt.gz β†’ all/2019_03.txt.gz} +0 -0
  41. data/{2019_04.txt.gz β†’ all/2019_04.txt.gz} +0 -0
  42. data/{2019_05.txt.gz β†’ all/2019_05.txt.gz} +0 -0
  43. data/{2019_06.txt.gz β†’ all/2019_06.txt.gz} +0 -0
  44. data/{2019_07.txt.gz β†’ all/2019_07.txt.gz} +0 -0
  45. data/{2019_08.txt.gz β†’ all/2019_08.txt.gz} +0 -0
  46. data/{2019_09.txt.gz β†’ all/2019_09.txt.gz} +0 -0
  47. data/{2019_10.txt.gz β†’ all/2019_10.txt.gz} +0 -0
  48. data/{2019_11.txt.gz β†’ all/2019_11.txt.gz} +0 -0
  49. data/{2019_12.txt.gz β†’ all/2019_12.txt.gz} +0 -0
  50. data/{2020_01.txt.gz β†’ all/2020_01.txt.gz} +0 -0
.gitattributes CHANGED
@@ -125,3 +125,5 @@ data/2021_09.txt.gz filter=lfs diff=lfs merge=lfs -text
125
  data/2017_07.txt.gz filter=lfs diff=lfs merge=lfs -text
126
  data/2017_09.txt.gz filter=lfs diff=lfs merge=lfs -text
127
  indic_tweet_ids.txt.gz filter=lfs diff=lfs merge=lfs -text
 
 
125
  data/2017_07.txt.gz filter=lfs diff=lfs merge=lfs -text
126
  data/2017_09.txt.gz filter=lfs diff=lfs merge=lfs -text
127
  indic_tweet_ids.txt.gz filter=lfs diff=lfs merge=lfs -text
128
+ data/all filter=lfs diff=lfs merge=lfs -text
129
+ data/indic filter=lfs diff=lfs merge=lfs -text
bernice-pretrain-data.py CHANGED
@@ -21,7 +21,6 @@ import os
21
  import gzip
22
  import datasets
23
 
24
-
25
  # TODO: Add BibTeX citation
26
  # Find for instance the citation on arxiv or on the dataset repo/website
27
  _CITATION = """\
@@ -51,10 +50,11 @@ _LICENSE = ""
51
  # If the data files live in the same folder or repository of the dataset script,
52
  # you can just pass the relative paths to the files instead of URLs.
53
  # Only train data, validation split not provided
54
- _URLS = {
55
- "all": [f"data/{f}" for f in os.listdir("data")],
56
- "indic": ["data/indic_tweet_ids.txt.gz"]
57
- }
 
58
 
59
 
60
  # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
@@ -113,7 +113,10 @@ class BernicePretrainData(datasets.GeneratorBasedBuilder):
113
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
114
  # 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.
115
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
116
- urls_to_download = self._URLS[self.config.name]
 
 
 
117
  downloaded_files = dl_manager.download_and_extract(urls_to_download)
118
  return [
119
  datasets.SplitGenerator(
21
  import gzip
22
  import datasets
23
 
 
24
  # TODO: Add BibTeX citation
25
  # Find for instance the citation on arxiv or on the dataset repo/website
26
  _CITATION = """\
50
  # If the data files live in the same folder or repository of the dataset script,
51
  # you can just pass the relative paths to the files instead of URLs.
52
  # Only train data, validation split not provided
53
+ _BASE_DATA_URL = "data"
54
+ # _URLS = {
55
+ # "all": f"{_BASE_URL}",
56
+ # "indic": ["data/indic_tweet_ids.txt.gz"]
57
+ # }
58
 
59
 
60
  # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
113
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
114
  # 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.
115
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
116
+ data_url = f"{self._BASE_DATA_URL}/{self.config.name}"
117
+ print(f"{data_url=}")
118
+ print(f"{os.listdir()}")
119
+ urls_to_download = [f"{data_url}/{f}" for f in os.listdir(data_url)]
120
  downloaded_files = dl_manager.download_and_extract(urls_to_download)
121
  return [
122
  datasets.SplitGenerator(
data/{2016_01.txt.gz β†’ all/2016_01.txt.gz} RENAMED
File without changes
data/{2016_02.txt.gz β†’ all/2016_02.txt.gz} RENAMED
File without changes
data/{2016_03.txt.gz β†’ all/2016_03.txt.gz} RENAMED
File without changes
data/{2016_04.txt.gz β†’ all/2016_04.txt.gz} RENAMED
File without changes
data/{2016_05.txt.gz β†’ all/2016_05.txt.gz} RENAMED
File without changes
data/{2016_06.txt.gz β†’ all/2016_06.txt.gz} RENAMED
File without changes
data/{2016_07.txt.gz β†’ all/2016_07.txt.gz} RENAMED
File without changes
data/{2016_08.txt.gz β†’ all/2016_08.txt.gz} RENAMED
File without changes
data/{2016_09.txt.gz β†’ all/2016_09.txt.gz} RENAMED
File without changes
data/{2016_10.txt.gz β†’ all/2016_10.txt.gz} RENAMED
File without changes
data/{2016_11.txt.gz β†’ all/2016_11.txt.gz} RENAMED
File without changes
data/{2016_12.txt.gz β†’ all/2016_12.txt.gz} RENAMED
File without changes
data/{2017_01.txt.gz β†’ all/2017_01.txt.gz} RENAMED
File without changes
data/{2017_02.txt.gz β†’ all/2017_02.txt.gz} RENAMED
File without changes
data/{2017_03.txt.gz β†’ all/2017_03.txt.gz} RENAMED
File without changes
data/{2017_04.txt.gz β†’ all/2017_04.txt.gz} RENAMED
File without changes
data/{2017_05.txt.gz β†’ all/2017_05.txt.gz} RENAMED
File without changes
data/{2017_06.txt.gz β†’ all/2017_06.txt.gz} RENAMED
File without changes
data/{2017_07.txt.gz β†’ all/2017_07.txt.gz} RENAMED
File without changes
data/{2017_09.txt.gz β†’ all/2017_09.txt.gz} RENAMED
File without changes
data/{2017_10.txt.gz β†’ all/2017_10.txt.gz} RENAMED
File without changes
data/{2017_11.txt.gz β†’ all/2017_11.txt.gz} RENAMED
File without changes
data/{2017_12.txt.gz β†’ all/2017_12.txt.gz} RENAMED
File without changes
data/{2018_01.txt.gz β†’ all/2018_01.txt.gz} RENAMED
File without changes
data/{2018_02.txt.gz β†’ all/2018_02.txt.gz} RENAMED
File without changes
data/{2018_03.txt.gz β†’ all/2018_03.txt.gz} RENAMED
File without changes
data/{2018_04.txt.gz β†’ all/2018_04.txt.gz} RENAMED
File without changes
data/{2018_05.txt.gz β†’ all/2018_05.txt.gz} RENAMED
File without changes
data/{2018_06.txt.gz β†’ all/2018_06.txt.gz} RENAMED
File without changes
data/{2018_07.txt.gz β†’ all/2018_07.txt.gz} RENAMED
File without changes
data/{2018_08.txt.gz β†’ all/2018_08.txt.gz} RENAMED
File without changes
data/{2018_09.txt.gz β†’ all/2018_09.txt.gz} RENAMED
File without changes
data/{2018_10.txt.gz β†’ all/2018_10.txt.gz} RENAMED
File without changes
data/{2018_11.txt.gz β†’ all/2018_11.txt.gz} RENAMED
File without changes
data/{2018_12.txt.gz β†’ all/2018_12.txt.gz} RENAMED
File without changes
data/{2019_01.txt.gz β†’ all/2019_01.txt.gz} RENAMED
File without changes
data/{2019_02.txt.gz β†’ all/2019_02.txt.gz} RENAMED
File without changes
data/{2019_03.txt.gz β†’ all/2019_03.txt.gz} RENAMED
File without changes
data/{2019_04.txt.gz β†’ all/2019_04.txt.gz} RENAMED
File without changes
data/{2019_05.txt.gz β†’ all/2019_05.txt.gz} RENAMED
File without changes
data/{2019_06.txt.gz β†’ all/2019_06.txt.gz} RENAMED
File without changes
data/{2019_07.txt.gz β†’ all/2019_07.txt.gz} RENAMED
File without changes
data/{2019_08.txt.gz β†’ all/2019_08.txt.gz} RENAMED
File without changes
data/{2019_09.txt.gz β†’ all/2019_09.txt.gz} RENAMED
File without changes
data/{2019_10.txt.gz β†’ all/2019_10.txt.gz} RENAMED
File without changes
data/{2019_11.txt.gz β†’ all/2019_11.txt.gz} RENAMED
File without changes
data/{2019_12.txt.gz β†’ all/2019_12.txt.gz} RENAMED
File without changes
data/{2020_01.txt.gz β†’ all/2020_01.txt.gz} RENAMED
File without changes