File size: 6,670 Bytes
27e2dfc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | from __future__ import annotations
LANGUAGE_BUCKETS = {
# ~41% of CC β intentionally capped to avoid crowding out other languages
"English": {
"langs": ["en"],
"weight": 2.5,
"min_chars": 2_000,
"latin": True,
},
# ~6.3% of CC β was badly underweighted relative to German/French
"Russian": {
"langs": ["ru"],
"weight": 1.8,
"min_chars": 2_000,
"latin": False,
},
# ~5.9% of CC
"German": {
"langs": ["de"],
"weight": 1.8,
"min_chars": 2_000,
"latin": True,
},
# ~5.7% of CC β bumped up from 1.7 to match its actual footprint
"Japanese": {
"langs": ["ja"],
"weight": 1.8,
"min_chars": 1_200,
"latin": False,
},
# ~5.0% of CC β CC likely undercounts due to Great Firewall
"Chinese": {
"langs": ["zh"],
"weight": 1.8,
"min_chars": 1_200,
"latin": False,
},
# ~4.6% of CC
"French": {
"langs": ["fr"],
"weight": 1.8,
"min_chars": 2_000,
"latin": True,
},
# ~4.6% of CC
"Spanish": {
"langs": ["es"],
"weight": 1.8,
"min_chars": 2_000,
"latin": True,
},
# ~2.5% of CC
"Portuguese": {
"langs": ["pt"],
"weight": 1.6,
"min_chars": 2_000,
"latin": True,
},
# ~2.4% of CC
"Italian": {
"langs": ["it"],
"weight": 1.5,
"min_chars": 2_000,
"latin": True,
},
# ~2.0% of CC β split out from CentralEuropeanLatin; rivals Italian/Portuguese
"Polish": {
"langs": ["pl"],
"weight": 1.5,
"min_chars": 2_000,
"latin": True,
},
# ~1.8% of CC β was significantly underweighted at 1.15
"Dutch": {
"langs": ["nl"],
"weight": 1.5,
"min_chars": 2_000,
"latin": True,
},
# ~1.2% of CC β split out from CentralEuropeanLatin; large internet population
"Turkish": {
"langs": ["tr"],
"weight": 1.4,
"min_chars": 2_000,
"latin": True,
},
# ind ~1.1%, vie ~1.05% of CC
"SoutheastAsianLatin": {
"langs": ["vi", "id", "ms", "sq", "la"],
"weight": 1.4,
"min_chars": 2_000,
"latin": True,
},
# ces ~1.14%, ron ~0.53%, hun ~0.52% of CC β smaller tier after splitting out pl/tr
"CentralEuropeanLatin": {
"langs": ["cs", "ro", "hu"],
"weight": 1.2,
"min_chars": 2_000,
"latin": True,
},
# ~0.81% of CC β was overweighted at 1.7
"Korean": {
"langs": ["ko"],
"weight": 1.3,
"min_chars": 1_200,
"latin": False,
},
# ukr ~0.70%, bel ~0.017% of CC
"EastSlavicCyrillic": {
"langs": ["uk", "be"],
"weight": 1.15,
"min_chars": 2_000,
"latin": False,
},
# ~0.65% of CC β upweighted relative to CC share given speaker population
"Arabic": {
"langs": ["ar"],
"weight": 1.35,
"min_chars": 2_000,
"latin": False,
},
# sv ~0.7%, dan ~0.51%, nor+nno ~0.33%, fin ~0.37%, isl ~0.04%, afr ~0.01%
# combined ~2.0% of CC β was drastically overweighted at 6.0
# note: Swedish Wikipedia is heavily bot-generated stubs, don't rely on article count
"NordicCore": {
"langs": ["sv", "da", "no", "is", "af", "fi"],
"weight": 1.8,
"min_chars": 2_000,
"latin": True,
},
# bul ~0.27%, srp ~0.25%, mkd ~0.037% of CC
"BalkanCyrillic": {
"langs": ["bg", "sr", "mk"],
"weight": 1.0,
"min_chars": 2_000,
"latin": False,
},
# fas ~0.20% of CC (ignore the one anomalous crawl spike)
"ArabicOther": {
"langs": ["fa", "ps", "sd", "ug"],
"weight": 0.9,
"min_chars": 2_000,
"latin": False,
},
# ~0.22% of CC β genuine web underrepresentation relative to speaker count,
# but corpus is thin; 1.0 avoids oversampling a small pool
"Hindi": {
"langs": ["hi"],
"weight": 1.0,
"min_chars": 2_000,
"latin": False,
},
# combined ~0.27% of CC β upweighted for script diversity
"IndicOther": {
"langs": ["ur", "bn", "ta", "te", "mr", "gu", "kn", "ml", "pa", "as", "or"],
"weight": 0.9,
"min_chars": 2_000,
"latin": False,
},
# kk ~0.038%, mn ~0.016% of CC β very thin corpus, weight is already a large relative boost
"CentralAsianCyrillic": {
"langs": ["kk", "mn"],
"weight": 0.9,
"min_chars": 2_000,
"latin": False,
},
"AfricanLatin": {
"langs": ["sw", "tl", "eu"],
"weight": 0.8,
"min_chars": 1_500,
"latin": True,
},
# el ~0.55%, he ~0.24%, th ~0.38%, hy ~0.033%, ka ~0.044% etc. β combined ~1%+
# nudged up slightly from 0.8 given Greek and Thai have meaningful CC presence
"OtherScripts": {
"langs": ["el", "he", "hy", "ka", "am", "km", "lo", "my", "th", "si", "bo", "ti", "dv"],
"weight": 0.9,
"min_chars": 2_000,
"latin": False,
},
}
POOL = {
"wiki": {
"reserve": 0.60,
"min": 4,
"max": 120_000,
},
"smol": {
"reserve": 0.95,
"min": 1,
"max": 1_000,
},
"ft": {
"reserve": 0.60,
"min": 1,
"max": 30_000,
},
}
DOC_MIX = {
"pure": {
"fraction": 0.60,
"pool": "reserve",
"min_sentences": 1,
"max_sentences": 4,
"strip_punct_prob": 0.10,
},
"homogeneous": {
"fraction": 0.30,
"pool": "main",
"min_sentences": 2,
"max_sentences": 6,
"strip_punct_prob": 0.15,
},
"mixed": {
"fraction": 0.10,
"pool": "main",
"min_segments": 2,
"max_segments": 4,
"strip_punct_prob": 0.25,
"swap_prob": 0.06,
"o_inject_prob": 0.06,
"allow_repeated_langs": True,
},
}
SMOL = {
"use": True,
"rebuild": False,
}
FT = {
"use": True,
"rebuild": False,
"max_lang": 50_000,
"overflow_lang": 75_000,
"max_row": 50_000,
"miss": 1_000,
"include_en": True,
"langs": {"en", "es", "fr", "pt", "it", "nl", "de", "sv", "da", "id", "ms"},
}
FT["every"] = len(FT["langs"])
RUN = {
"len": 512,
"target": 2_500_000, # synthetic mixed-language training examples to generate
"syn_cache": True,
"syn_rebuild": False,
"tok_cache": True,
"tok_rebuild": False,
"tok_skip_check": False,
"retry": 8,
"preview": 2_000,
}
|