failed09 commited on
Commit
2bee276
·
verified ·
1 Parent(s): e7c93cd

Add filtered config (two-voice LASER+LaBSE filter, v8): README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -55
README.md CHANGED
@@ -19,6 +19,10 @@ configs:
19
  data_files:
20
  - split: train
21
  path: scored/data.parquet
 
 
 
 
22
  tags:
23
  - bashkir
24
  - russian
@@ -35,12 +39,12 @@ tags:
35
  Sentence-level Bashkir-Russian parallel data extracted from the Bashkir and
36
  Russian Wikipedia dumps dated `2026-08-01`.
37
 
38
- This repository provides three configurations. The default `cleaned`
39
  configuration is recommended for machine translation training. The
40
  `precleaned` configuration is an earlier, less filtered extraction provided
41
  for alternative preprocessing and research. The `scored` configuration adds
42
- LASER-based quality scores to the `cleaned` pairs so that users can apply
43
- their own filtering thresholds.
44
 
45
  ## Configurations
46
 
@@ -70,60 +74,43 @@ Fields:
70
 
71
  Fields:
72
 
73
- - `ba_title`
74
- - `ru_title`
75
- - `section`
76
- - `ba`
77
- - `ru`
78
 
79
  ### scored
80
 
81
  - 72,007 sentence pairs — **identical rows to `cleaned`**, nothing added or removed
82
- - three added quality-score columns computed with Meta LASER sentence embeddings
83
- - lets you apply your own filtering threshold instead of trusting a fixed cut
84
-
85
- Added fields:
86
-
87
- - `laser_cos`: cosine similarity between the LASER embeddings of the Bashkir
88
- and Russian sentences (higher = closer translation)
89
- - `laser_margin`: margin score normalized by same-language kNN density
90
- (kept for completeness)
91
- - `laser_margin_xling`: margin score normalized by **cross-lingual** kNN
92
- density in the Artetxe & Schwenk (2018) sense — the recommended filter score
93
-
94
- ## How the scores were computed
95
-
96
- - Bashkir encoder: **LASER3 `bak_Cyrl`** (NLLB distillation), Russian encoder:
97
- **LASER2**; both produce 1024-dim L2-normalized sentence embeddings
98
- (`laser_encoders`, facebookresearch/LASER).
99
- - For every pair `(x, y)` with cosine similarity `cos(x, y)`:
100
- `margin = 2 * cos(x, y) / (mean_{t in kNN(x)} cos(x, t) + mean_{t in kNN(y)} cos(y, t))`
101
- where `kNN(x)` are the k=4 nearest neighbours of `x` among **Russian**
102
- sentences and `kNN(y)` the k=4 nearest neighbours of `y` among **Bashkir**
103
- sentences.
104
- - The margin penalizes sentences that sit in dense near-duplicate clusters.
105
- Such pairs can be perfectly correct yet receive a low score — do not use a
106
- high threshold blindly.
107
-
108
- ## Score distributions (72,007 pairs)
109
 
110
  | score | p01 | p05 | p25 | p50 | p75 | p95 | p99 |
111
  |---|---|---|---|---|---|---|---|
112
  | `laser_cos` | 0.597 | 0.705 | 0.828 | 0.863 | 0.887 | 0.914 | 0.928 |
113
  | `laser_margin_xling` | 0.760 | 0.876 | 0.988 | 1.033 | 1.063 | 1.102 | 1.129 |
114
-
115
- ## Recommended thresholds
116
-
117
- - **Strict (MT training):** drop pairs with
118
- `laser_margin_xling < 0.90 OR laser_cos < 0.70` → removes 6.6% (4,778 pairs),
119
- keeps 67,229.
120
- - **Conservative:** drop pairs with
121
- `laser_margin_xling < 0.85 OR laser_cos < 0.65` → removes 3.8% (2,750 pairs),
122
- keeps 69,257.
123
- - **Research:** keep all rows and analyze the score distribution directly.
124
-
125
- The alignment is automatic and has not been fully verified by human
126
- annotators; the scores make the residual noise auditable rather than hiding it.
127
 
128
  ## Source and Processing
129
 
@@ -132,9 +119,9 @@ articles using the `bawiki-20260801` and `ruwiki-20260801` dumps.
132
 
133
  The cleaned configuration uses article-local sentence indices, numeric
134
  anchors for factual pairs, length-ratio checks, language checks, duplicate
135
- removal and service-fragment filtering. The `scored` configuration adds
136
- multilingual sentence-embedding scores on top of the same alignment without
137
- modifying any row.
138
 
139
  ## License
140
 
@@ -150,13 +137,12 @@ derivative datasets.
150
  from datasets import load_dataset
151
 
152
  cleaned = load_dataset("failed09/bashkir-wikipedia-parallel", "cleaned")
153
- precleaned = load_dataset("failed09/bashkir-wikipedia-parallel", "precleaned")
154
  scored = load_dataset("failed09/bashkir-wikipedia-parallel", "scored")
 
155
 
156
- # strict MT-training filter
157
  df = scored["train"].to_pandas()
158
- keep = (df.laser_margin_xling >= 0.90) & (df.laser_cos >= 0.70)
159
- mt_train = df[keep]
160
  ```
161
 
162
  ## Citation
 
19
  data_files:
20
  - split: train
21
  path: scored/data.parquet
22
+ - config_name: filtered
23
+ data_files:
24
+ - split: train
25
+ path: filtered/data.parquet
26
  tags:
27
  - bashkir
28
  - russian
 
39
  Sentence-level Bashkir-Russian parallel data extracted from the Bashkir and
40
  Russian Wikipedia dumps dated `2026-08-01`.
41
 
42
+ This repository provides four configurations. The default `cleaned`
43
  configuration is recommended for machine translation training. The
44
  `precleaned` configuration is an earlier, less filtered extraction provided
45
  for alternative preprocessing and research. The `scored` configuration adds
46
+ LASER-based quality scores to the `cleaned` pairs. The `filtered`
47
+ configuration applies a conservative two-encoder filter on top of `scored`.
48
 
49
  ## Configurations
50
 
 
74
 
75
  Fields:
76
 
77
+ - `ba_title`, `ru_title`, `section`, `ba`, `ru`
 
 
 
 
78
 
79
  ### scored
80
 
81
  - 72,007 sentence pairs — **identical rows to `cleaned`**, nothing added or removed
82
+ - quality scores computed with Meta LASER sentence embeddings:
83
+ - `laser_cos`: cosine similarity between LASER embeddings of the pair
84
+ - `laser_margin`: margin normalized by same-language kNN density
85
+ - `laser_margin_xling`: margin normalized by **cross-lingual** kNN density
86
+ (Artetxe & Schwenk, 2018) — the recommended LASER filter score
87
+
88
+ Encoders: LASER3 `bak_Cyrl` (NLLB) for Bashkir, LASER2 for Russian,
89
+ 1024-dim L2-normalized embeddings, k=4 neighbours
90
+ (`laser_encoders`, facebookresearch/LASER).
91
+
92
+ ### filtered
93
+
94
+ - **69,706 sentence pairs** (−3.20% from `scored`)
95
+ - conservative two-encoder filter: a pair is removed only when **both**
96
+ scorers place it in their bottom 5%:
97
+ `laser_margin_xling < 0.876 AND labse_margin_xling < 0.723`
98
+ - second encoder: **LaBSE** (Google, 481M parameters, fp16) — independent
99
+ architecture and training data, so its errors are largely uncorrelated
100
+ with LASER's
101
+ - all score columns retained: `laser_cos`, `laser_margin`,
102
+ `laser_margin_xling`, `labse_cos`, `labse_margin_xling`
103
+ - removed pairs are dominated by template mismatch sentences (river-tributary
104
+ stubs with different facts) and cross-article topic matches
105
+
106
+ Score distributions over the full 72,007 pairs:
 
 
107
 
108
  | score | p01 | p05 | p25 | p50 | p75 | p95 | p99 |
109
  |---|---|---|---|---|---|---|---|
110
  | `laser_cos` | 0.597 | 0.705 | 0.828 | 0.863 | 0.887 | 0.914 | 0.928 |
111
  | `laser_margin_xling` | 0.760 | 0.876 | 0.988 | 1.033 | 1.063 | 1.102 | 1.129 |
112
+ | `labse_cos` | 0.206 | 0.408 | 0.698 | 0.789 | 0.859 | 0.932 | 0.963 |
113
+ | `labse_margin_xling` | 0.373 | 0.723 | 1.035 | 1.132 | 1.202 | 1.295 | 1.358 |
 
 
 
 
 
 
 
 
 
 
 
114
 
115
  ## Source and Processing
116
 
 
119
 
120
  The cleaned configuration uses article-local sentence indices, numeric
121
  anchors for factual pairs, length-ratio checks, language checks, duplicate
122
+ removal and service-fragment filtering. The `scored` and `filtered`
123
+ configurations add multilingual sentence-embedding scoring on top of the
124
+ same alignment without modifying any text.
125
 
126
  ## License
127
 
 
137
  from datasets import load_dataset
138
 
139
  cleaned = load_dataset("failed09/bashkir-wikipedia-parallel", "cleaned")
 
140
  scored = load_dataset("failed09/bashkir-wikipedia-parallel", "scored")
141
+ filtered = load_dataset("failed09/bashkir-wikipedia-parallel", "filtered")
142
 
143
+ # strict MT-training subset with your own threshold
144
  df = scored["train"].to_pandas()
145
+ strict = df[(df.laser_margin_xling >= 0.90) & (df.labse_margin_xling >= 1.0)]
 
146
  ```
147
 
148
  ## Citation