clemsadand
commited on
Commit
•
c9644c1
1
Parent(s):
559789d
customised
Browse files
mc4.py
CHANGED
@@ -34,226 +34,11 @@ _URL = "https://github.com/allenai/allennlp/discussions/5056"
|
|
34 |
|
35 |
_DATA_URL = "https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/multilingual/c4-{language}{split_suffix}.tfrecord-{index:05d}-of-{n_shards:05d}.json.gz"
|
36 |
|
37 |
-
_LANGUAGES = [
|
38 |
-
"af",
|
39 |
-
"am",
|
40 |
-
"ar",
|
41 |
-
"az",
|
42 |
-
"be",
|
43 |
-
"bg",
|
44 |
-
"bg-Latn",
|
45 |
-
"bn",
|
46 |
-
"ca",
|
47 |
-
"ceb",
|
48 |
-
"co",
|
49 |
-
"cs",
|
50 |
-
"cy",
|
51 |
-
"da",
|
52 |
-
"de",
|
53 |
-
"el",
|
54 |
-
"el-Latn",
|
55 |
-
"en",
|
56 |
-
"eo",
|
57 |
-
"es",
|
58 |
-
"et",
|
59 |
-
"eu",
|
60 |
-
"fa",
|
61 |
-
"fi",
|
62 |
-
"fil",
|
63 |
-
"fr",
|
64 |
-
"fy",
|
65 |
-
"ga",
|
66 |
-
"gd",
|
67 |
-
"gl",
|
68 |
-
"gu",
|
69 |
-
"ha",
|
70 |
-
"haw",
|
71 |
-
"hi",
|
72 |
-
"hi-Latn",
|
73 |
-
"hmn",
|
74 |
-
"ht",
|
75 |
-
"hu",
|
76 |
-
"hy",
|
77 |
-
"id",
|
78 |
-
"ig",
|
79 |
-
"is",
|
80 |
-
"it",
|
81 |
-
"iw",
|
82 |
-
"ja",
|
83 |
-
"ja-Latn",
|
84 |
-
"jv",
|
85 |
-
"ka",
|
86 |
-
"kk",
|
87 |
-
"km",
|
88 |
-
"kn",
|
89 |
-
"ko",
|
90 |
-
"ku",
|
91 |
-
"ky",
|
92 |
-
"la",
|
93 |
-
"lb",
|
94 |
-
"lo",
|
95 |
-
"lt",
|
96 |
-
"lv",
|
97 |
-
"mg",
|
98 |
-
"mi",
|
99 |
-
"mk",
|
100 |
-
"ml",
|
101 |
-
"mn",
|
102 |
-
"mr",
|
103 |
-
"ms",
|
104 |
-
"mt",
|
105 |
-
"my",
|
106 |
-
"ne",
|
107 |
-
"nl",
|
108 |
-
"no",
|
109 |
-
"ny",
|
110 |
-
"pa",
|
111 |
-
"pl",
|
112 |
-
"ps",
|
113 |
-
"pt",
|
114 |
-
"ro",
|
115 |
-
"ru",
|
116 |
-
"ru-Latn",
|
117 |
-
"sd",
|
118 |
-
"si",
|
119 |
-
"sk",
|
120 |
-
"sl",
|
121 |
-
"sm",
|
122 |
-
"sn",
|
123 |
-
"so",
|
124 |
-
"sq",
|
125 |
-
"sr",
|
126 |
-
"st",
|
127 |
-
"su",
|
128 |
-
"sv",
|
129 |
-
"sw",
|
130 |
-
"ta",
|
131 |
-
"te",
|
132 |
-
"tg",
|
133 |
-
"th",
|
134 |
-
"tr",
|
135 |
-
"uk",
|
136 |
-
"und",
|
137 |
-
"ur",
|
138 |
-
"uz",
|
139 |
-
"vi",
|
140 |
-
"xh",
|
141 |
-
"yi",
|
142 |
-
"yo",
|
143 |
-
"zh",
|
144 |
-
"zh-Latn",
|
145 |
-
"zu",
|
146 |
-
]
|
147 |
|
148 |
_N_SHARDS_PER_SPLIT = {
|
149 |
-
"
|
150 |
-
"
|
151 |
-
"ar": {"train": 1024, "validation": 4},
|
152 |
-
"az": {"train": 256, "validation": 1},
|
153 |
-
"be": {"train": 128, "validation": 1},
|
154 |
-
"bg": {"train": 1024, "validation": 1},
|
155 |
-
"bg-Latn": {"train": 4, "validation": 1},
|
156 |
-
"bn": {"train": 512, "validation": 1},
|
157 |
-
"ca": {"train": 512, "validation": 1},
|
158 |
-
"ceb": {"train": 8, "validation": 1},
|
159 |
-
"co": {"train": 8, "validation": 1},
|
160 |
-
"cs": {"train": 1024, "validation": 2},
|
161 |
-
"cy": {"train": 256, "validation": 1},
|
162 |
-
"da": {"train": 1024, "validation": 1},
|
163 |
-
"de": {"train": 2048, "validation": 16},
|
164 |
-
"el": {"train": 1024, "validation": 2},
|
165 |
-
"el-Latn": {"train": 16, "validation": 1},
|
166 |
-
"en": {"train": 11264, "validation": 128},
|
167 |
-
"eo": {"train": 32, "validation": 1},
|
168 |
-
"es": {"train": 2048, "validation": 16},
|
169 |
-
"et": {"train": 256, "validation": 1},
|
170 |
-
"eu": {"train": 64, "validation": 1},
|
171 |
-
"fa": {"train": 1024, "validation": 2},
|
172 |
-
"fi": {"train": 1024, "validation": 1},
|
173 |
-
"fil": {"train": 64, "validation": 1},
|
174 |
-
"fr": {"train": 2048, "validation": 16},
|
175 |
-
"fy": {"train": 16, "validation": 1},
|
176 |
-
"ga": {"train": 16, "validation": 1},
|
177 |
-
"gd": {"train": 16, "validation": 1},
|
178 |
-
"gl": {"train": 128, "validation": 1},
|
179 |
-
"gu": {"train": 64, "validation": 1},
|
180 |
-
"ha": {"train": 8, "validation": 1},
|
181 |
-
"haw": {"train": 2, "validation": 1},
|
182 |
-
"hi": {"train": 1024, "validation": 2},
|
183 |
-
"hi-Latn": {"train": 16, "validation": 1},
|
184 |
-
"hmn": {"train": 8, "validation": 1},
|
185 |
-
"ht": {"train": 8, "validation": 1},
|
186 |
-
"hu": {"train": 1024, "validation": 2},
|
187 |
-
"hy": {"train": 128, "validation": 1},
|
188 |
-
"id": {"train": 1024, "validation": 4},
|
189 |
-
"ig": {"train": 4, "validation": 1},
|
190 |
-
"is": {"train": 128, "validation": 1},
|
191 |
-
"it": {"train": 1024, "validation": 8},
|
192 |
-
"iw": {"train": 1024, "validation": 1},
|
193 |
-
"ja": {"train": 1024, "validation": 8},
|
194 |
-
"ja-Latn": {"train": 8, "validation": 1},
|
195 |
-
"jv": {"train": 8, "validation": 1},
|
196 |
-
"ka": {"train": 256, "validation": 1},
|
197 |
-
"kk": {"train": 256, "validation": 1},
|
198 |
-
"km": {"train": 64, "validation": 1},
|
199 |
-
"kn": {"train": 64, "validation": 1},
|
200 |
-
"ko": {"train": 1024, "validation": 1},
|
201 |
-
"ku": {"train": 16, "validation": 1},
|
202 |
-
"ky": {"train": 64, "validation": 1},
|
203 |
-
"la": {"train": 64, "validation": 1},
|
204 |
-
"lb": {"train": 32, "validation": 1},
|
205 |
-
"lo": {"train": 8, "validation": 1},
|
206 |
-
"lt": {"train": 512, "validation": 1},
|
207 |
-
"lv": {"train": 256, "validation": 1},
|
208 |
-
"mg": {"train": 8, "validation": 1},
|
209 |
-
"mi": {"train": 4, "validation": 1},
|
210 |
-
"mk": {"train": 128, "validation": 1},
|
211 |
-
"ml": {"train": 128, "validation": 1},
|
212 |
-
"mn": {"train": 128, "validation": 1},
|
213 |
-
"mr": {"train": 1024, "validation": 1},
|
214 |
-
"ms": {"train": 512, "validation": 1},
|
215 |
-
"mt": {"train": 128, "validation": 1},
|
216 |
-
"my": {"train": 64, "validation": 1},
|
217 |
-
"ne": {"train": 256, "validation": 1},
|
218 |
-
"nl": {"train": 1024, "validation": 4},
|
219 |
-
"no": {"train": 1024, "validation": 1},
|
220 |
-
"ny": {"train": 4, "validation": 1},
|
221 |
-
"pa": {"train": 32, "validation": 1},
|
222 |
-
"pl": {"train": 1024, "validation": 4},
|
223 |
-
"ps": {"train": 16, "validation": 1},
|
224 |
-
"pt": {"train": 1024, "validation": 4},
|
225 |
-
"ro": {"train": 1024, "validation": 2},
|
226 |
-
"ru": {"train": 4096, "validation": 32},
|
227 |
-
"ru-Latn": {"train": 32, "validation": 1},
|
228 |
-
"sd": {"train": 64, "validation": 1},
|
229 |
-
"si": {"train": 64, "validation": 1},
|
230 |
-
"sk": {"train": 512, "validation": 1},
|
231 |
-
"sl": {"train": 256, "validation": 1},
|
232 |
-
"sm": {"train": 4, "validation": 1},
|
233 |
-
"sn": {"train": 8, "validation": 1},
|
234 |
-
"so": {"train": 64, "validation": 1},
|
235 |
-
"sq": {"train": 128, "validation": 1},
|
236 |
-
"sr": {"train": 256, "validation": 1},
|
237 |
-
"st": {"train": 2, "validation": 1},
|
238 |
-
"su": {"train": 4, "validation": 1},
|
239 |
-
"sv": {"train": 1024, "validation": 2},
|
240 |
-
"sw": {"train": 32, "validation": 1},
|
241 |
-
"ta": {"train": 256, "validation": 1},
|
242 |
-
"te": {"train": 128, "validation": 1},
|
243 |
-
"tg": {"train": 64, "validation": 1},
|
244 |
-
"th": {"train": 1024, "validation": 1},
|
245 |
-
"tr": {"train": 1024, "validation": 4},
|
246 |
-
"uk": {"train": 1024, "validation": 2},
|
247 |
-
"und": {"train": 3072, "validation": 32},
|
248 |
-
"ur": {"train": 128, "validation": 1},
|
249 |
-
"uz": {"train": 32, "validation": 1},
|
250 |
-
"vi": {"train": 1024, "validation": 4},
|
251 |
-
"xh": {"train": 2, "validation": 1},
|
252 |
-
"yi": {"train": 16, "validation": 1},
|
253 |
-
"yo": {"train": 2, "validation": 1},
|
254 |
-
"zh": {"train": 1024, "validation": 2},
|
255 |
-
"zh-Latn": {"train": 8, "validation": 1},
|
256 |
-
"zu": {"train": 8, "validation": 1},
|
257 |
}
|
258 |
|
259 |
|
|
|
34 |
|
35 |
_DATA_URL = "https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/multilingual/c4-{language}{split_suffix}.tfrecord-{index:05d}-of-{n_shards:05d}.json.gz"
|
36 |
|
37 |
+
_LANGUAGES = ["fr", "en"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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