-
Notifications
You must be signed in to change notification settings - Fork 6
/
parameters_filtering.py
618 lines (595 loc) · 23.1 KB
/
parameters_filtering.py
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
import string
import emoji # Use version emoji==1.6.1, otherwise it won't have UNICODE_EMOJI
main_special_characters = string.punctuation + string.digits + string.whitespace
other_special_characters = (
" ’“”–ー一▬…✦�£•€«»°·═"
"×士^˘⇓↓↑←→()§″′´¿−±∈¢ø‚„½¼¾¹²³―⁃,ˌ¸‹›ʺˈʻ¦‐⠀‰
‑≤≥‖"
"◆●■►▼▲▴∆▻¡★☆✱ːº。¯˜¥ɪ≈†上ン:∼⁄・♡✓⊕․.⋅÷1‟;،、¨ाাी्े◦˚"
"゜ʼ≖ʼ¤ッツシ℃√!【】‿∞➤~πه۩☛₨➩☻๑٪♥ıॽ《‘©﴿٬?▷Г♫∟™ª₪®「—❖"
"」﴾》"
)
emoji = list(emoji.UNICODE_EMOJI["en"].keys())
special_characters_default = set(main_special_characters + other_special_characters)
special_characters_default.update(emoji)
parameters_filtering_default = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": False,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": False,
"length_word_max_cutoff": 50,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 10,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.2,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.3,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.4,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.1,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.1,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.70,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 10000,
}
parameters_filtering_ar = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 25,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 20,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.20,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.34,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.30,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.07,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.03,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.81,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 2300,
}
parameters_filtering_bn = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 20,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 33,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.13,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.21,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.45,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.002,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.001,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.95,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 2000,
}
parameters_filtering_ca = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 20,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 15,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.2,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.4,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.25,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.25,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.1,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.8,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 2500,
}
parameters_filtering_en = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 25,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 20,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.106,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.19,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.4,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.3,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.01,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.80,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 1500,
}
parameters_filtering_es = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 25,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 16,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.14,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.25,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.34,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.4,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.01,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.8,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 1300,
}
parameters_filtering_eu = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 28,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 8,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.20,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.40,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.31,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.05,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.1,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.70,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 3000,
}
parameters_filtering_fr = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 45,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 13,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.14,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.13,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.34,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.27,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.008,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.8,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 1770,
}
parameters_filtering_hi = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 25,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 38,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.18,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.47,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.45,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.01,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.005,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.90,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 1517,
}
parameters_filtering_pt = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 19,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 19,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.25,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.98,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.35,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.2,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.007,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.6,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 3038,
}
parameters_filtering_ur = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 20,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 25,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.19,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 7,
"word_repetition_max_cutoff": 0.5,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.25,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.01,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.025,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.90,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 1495,
}
parameters_filtering_zh = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": False,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": False,
"length_word_max_cutoff": 1000,
"cond_check_number_words": True,
"tokenization": False,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 30,
"number_words_max_cutoff": 1000000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 3,
"character_repetition_max_cutoff": 0.2,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.96,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.3,
"cond_words_augmentation": True,
"words_augmentation_group_sizes": [2],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.1691,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.001,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.85,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 2095,
}
parameters_filtering_id = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": True,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 30,
"cond_check_number_words": True,
"tokenization": True,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 10,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.5,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.5,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.5,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": False,
"stopwords_min_cutoff": 0.1,
"stopwords_max_cutoff": 0.7,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.1,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.7,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 3500,
}
parameters_filtering_vi = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": True,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 25,
"cond_check_number_words": True,
"tokenization": True,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 10,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.5,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.5,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.5,
"cond_words_augmentation": True,
"words_augmentation_group_sizes": [2],
"words_augmentation_join_char": " ",
"cond_check_stopwords": False,
"stopwords_min_cutoff": 0.1,
"stopwords_max_cutoff": 0.7,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.1,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.7,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 3500,
}
parameters_filtering_th = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": True,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 30,
"cond_check_number_words": True,
"tokenization": True,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 30,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.2,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.2,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.4,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": False,
"stopwords_min_cutoff": 0.1,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.01,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.7,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 3500,
}
parameters_filtering_lo = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": False,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 30,
"cond_check_number_words": True,
"tokenization": True,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 10,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.1,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.5,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.4,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": True,
"stopwords_min_cutoff": 0.15,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.1,
"cond_check_lang_id": True,
"lang_id_min_cutoff": 0.70,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 3000,
}
parameters_filtering_ms = {
"cond_uniform_whitespace": True,
"cond_replace_unicode_punctuation": True,
"cond_remove_words_with_incorrect_substrings": True,
"incorrect_word_substrings": ["http", "www", ".com", "href", "//"],
"cond_remove_long_words": True,
"length_word_max_cutoff": 30,
"cond_check_number_words": True,
"tokenization": True,
"strip_characters": special_characters_default,
"number_words_min_cutoff": 15,
"number_words_max_cutoff": 100000,
"cond_check_character_repetition_removal": True,
"character_repetition_length": 10,
"character_repetition_max_cutoff": 0.15,
"cond_check_word_repetition_removal": True,
"word_repetition_length": 5,
"word_repetition_max_cutoff": 0.20,
"cond_check_special_characters": True,
"special_characters": special_characters_default,
"special_characters_max_cutoff": 0.34,
"cond_words_augmentation": False,
"words_augmentation_group_sizes": [],
"words_augmentation_join_char": "",
"cond_check_stopwords": False,
"stopwords_min_cutoff": 0.4,
"cond_check_flagged_words": True,
"flagged_words_max_cutoff": 0.01,
"cond_check_lang_id": False,
"lang_id_min_cutoff": 0.7,
"cond_check_perplexity": True,
"perplexity_max_cutoff": 5000,
}
parameters_filtering = {
"default": parameters_filtering_default,
"ar": parameters_filtering_ar,
"bn": parameters_filtering_bn,
"ca": parameters_filtering_ca,
"en": parameters_filtering_en,
"es": parameters_filtering_es,
"eu": parameters_filtering_eu,
"fr": parameters_filtering_fr,
"hi": parameters_filtering_hi,
"id": parameters_filtering_id,
"pt": parameters_filtering_pt,
"ur": parameters_filtering_ur,
"vi": parameters_filtering_vi,
"zh": parameters_filtering_zh,
"th": parameters_filtering_th,
"lo": parameters_filtering_lo,
"ms": parameters_filtering_ms,
}