somerandomguyontheweb commited on
Commit
ba204f0
·
verified ·
1 Parent(s): 32f1fd3

Add data and readme

Browse files
Files changed (2) hide show
  1. README.md +62 -3
  2. data.csv +0 -0
README.md CHANGED
@@ -1,3 +1,62 @@
1
- ---
2
- license: pddl
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Overview
2
+
3
+ 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):
4
+ - CC: correct translation, natural sentence
5
+ - CB: correct translation, boilerplate or low quality
6
+ - CS: correct translation, short
7
+ - X: incorrect translation
8
+ - WL: wrong language
9
+ - NL: not a language
10
+
11
+ Where appropriate, the labels are accompanied by free-form comments.
12
+
13
+ ## Data sampling
14
+
15
+ In Unix shell, execute:
16
+ ```bash
17
+ sample_sentence_pairs () {
18
+ mkdir -p $1
19
+ cd $1
20
+ wget https://object.pouta.csc.fi/OPUS-$1/$2/moses/be-en.txt.zip
21
+ unzip be-en.txt.zip
22
+ paste $1.be-en.en $1.be-en.be | shuf -n 100 > $1.be-en.sample100.txt
23
+ ls | grep -v sample100 | xargs rm
24
+ cd ..
25
+ }
26
+
27
+ sample_sentence_pairs NLLB v1
28
+ sample_sentence_pairs HPLT v2
29
+ sample_sentence_pairs CCMatrix v1
30
+ sample_sentence_pairs CCAligned v1
31
+
32
+ mv */*.txt .
33
+ rm -r NLLB HPLT CCMatrix CCAligned
34
+ ```
35
+
36
+ Then in Python:
37
+ ```python3
38
+ import csv
39
+
40
+ def to_csv(filename):
41
+ with open(filename) as f:
42
+ data = [line.strip().split("\t") for line in f]
43
+ assert all(len(x) == 2 for x in data)
44
+ with open("processed_%s.csv" % filename, "w") as f:
45
+ csv_writer = csv.writer(f)
46
+ csv_writer.writerow(["en", "be"])
47
+ csv_writer.writerows(data)
48
+
49
+ to_csv("NLLB.be-en.sample100.txt")
50
+ to_csv("HPLT.be-en.sample100.txt")
51
+ to_csv("CCMatrix.be-en.sample100.txt")
52
+ to_csv("CCAligned.be-en.sample100.txt")
53
+ ```
54
+
55
+ ## Labeling results
56
+
57
+ | Dataset | CC | CB | CS | X | WL | NL |
58
+ |-----------|----|----|----|----|----|----|
59
+ | NLLB | 17 | | | 73 | 10 | |
60
+ | HPLT | 41 | 35 | 6 | 17 | 1 | |
61
+ | CCMatrix | 7 | 1 | | 92 | | |
62
+ | CCAligned | 31 | 38 | 8 | 22 | 1 | |
data.csv ADDED
The diff for this file is too large to render. See raw diff