File size: 2,842 Bytes
eddae66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- vi
license: mit
task_categories:
- text-generation
- text2text-generation
tags:
- spelling-correction
- grammatical-error-correction
- synthetic-data
- vietnam
size_categories:
- 100K<n<1M
---

# Vietnamese Spelling Correction Dataset

This dataset contains **978,417** pairs of noisy (source) and clean (target) Vietnamese sentences, designed for training spelling correction models.

The dataset was synthetically generated by injecting realistic noise into a clean Vietnamese corpus.

## Dataset Structure

The dataset is divided into training and testing sets:

- **Train**: 880,575 examples
- **Test**: 97,842 examples

### Data Fields

- `source`: The text with injected errors (input).
- `target`: The original clean text (label).

### Sample

| Source (Noisy) | Target (Clean) | Error Type |
| :--- | :--- | :--- |
| Căn **bật** hai của số âm có thể được **ban** luận... | Căn **bậc** hai của số âm có thể được **bàn** luận... | Phonological + Unaccented |
| ...xuất **hien** **thườg** xuyên **trog** **kák**... | ...xuất **hiện** **thường** xuyên **trong** **các**... | Multiple realistic typos |
| ...máy **tín** bỏ túi đều có phím... | ...máy **tính** bỏ túi đều có phím... | Phonological (nh->n) |

## Noise Generation Logic

The noise was generated using a custom script with a **0.5 noise rate** (approx. 50% of tokens affected) and guaranteed at least one error per sample. The errors mimic real-world Vietnamese typing and spelling mistakes:

1.  **Teencode & Lexical Variants** (~40%):
    - Syllable contractions: `ng` $\to$ `g`, `nh` $\to$ `h`, `qu` $\to$ `w`, `yê` $\to$ `i`.
    - Phonetic substitutions: `ph` $\to$ `f`, `gi` $\to$ `j`, `c/k` $\to$ `k`.
    - Dictionary slang: `vợ` $\to$ `vk`, `không` $\to$ `ko`.

2.  **Regional Phonological Errors** (~30%):
    - **North**: `tr` $\leftrightarrow$ `ch`, `s` $\leftrightarrow$ `x`, `r` $\leftrightarrow$ `d` $\leftrightarrow$ `gi`.
    - **South**: `n` $\leftrightarrow$ `ng` (final), `t` $\leftrightarrow$ `c`.

3.  **Typing & Mechanical Errors** (~20%):
    - **Spatial**: Hitting adjacent keys on QWERTY keyboard.
    - **Telex**: Wrong accent codes (`s` $\to$ `d`), double typing (`đ` $\to$ `ddd`).
    - **Operations**: Random insertions, deletions, transpositions.

4.  **Unaccented** (~10%):
    - Removing tone marks (e.g., `trường` $\to$ `truong`).

## Usage

```python
from datasets import load_dataset

dataset = load_dataset("coung21/vi-spelling-correction")

print(dataset["train"][0])
# Output: {'source': '...', 'target': '...'}
```

## Credits

The source data for this dataset was extracted from a **Vietnamese Wikipedia dump**.
The noise was synthetically generated using a custom noise injection pipeline to simulate realistic Vietnamese spelling errors.