File size: 2,089 Bytes
4980f1f
 
 
 
 
 
 
 
 
 
ba204f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4980f1f
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
---
license: pddl
task_categories:
- translation
language:
- be
- en
size_categories:
- n<1K
---
## Overview

This is a small dataset of English-Belarusian sentence pairs sampled from the largest parallel corpora in [OPUS](https://opus.nlpl.eu/results/en&be/corpus-result-table) (100 random instances from each of the following: NLLB, HPLT, CCMatrix, CCAligned) and manually labeled for correctness by a speaker of Belarusian. The taxonomy of labels follows [Kreutzer et al. 2022](https://doi.org/10.1162/tacl_a_00447):
- CC: correct translation, natural sentence
- CB: correct translation, boilerplate or low quality
- CS: correct translation, short
- X: incorrect translation
- WL: wrong language
- NL: not a language

Where appropriate, the labels are accompanied by free-form comments.

## Data sampling

In Unix shell, execute:
```bash
sample_sentence_pairs () {
    mkdir -p $1
    cd $1
    wget https://object.pouta.csc.fi/OPUS-$1/$2/moses/be-en.txt.zip
    unzip be-en.txt.zip
    paste $1.be-en.en $1.be-en.be | shuf -n 100 > $1.be-en.sample100.txt
    ls | grep -v sample100 | xargs rm
    cd ..
}

sample_sentence_pairs NLLB v1
sample_sentence_pairs HPLT v2
sample_sentence_pairs CCMatrix v1
sample_sentence_pairs CCAligned v1

mv */*.txt .
rm -r NLLB HPLT CCMatrix CCAligned
```

Then in Python:
```python3
import csv

def to_csv(filename):
    with open(filename) as f:
        data = [line.strip().split("\t") for line in f]
    assert all(len(x) == 2 for x in data)
    with open("processed_%s.csv" % filename, "w") as f:
        csv_writer = csv.writer(f)
        csv_writer.writerow(["en", "be"])
        csv_writer.writerows(data)

to_csv("NLLB.be-en.sample100.txt")
to_csv("HPLT.be-en.sample100.txt")
to_csv("CCMatrix.be-en.sample100.txt")
to_csv("CCAligned.be-en.sample100.txt")
```

## Labeling results

| Dataset   | CC | CB | CS | X  | WL | NL |
|-----------|----|----|----|----|----|----|
| NLLB      | 17 |    |    | 73 | 10 |    |
| HPLT      | 41 | 35 | 6  | 17 | 1  |    |
| CCMatrix  | 7  | 1  |    | 92 |    |    |
| CCAligned | 31 | 38 | 8  | 22 | 1  |    |