WIKIMATRIX: MINING 135M PARALLEL SENTENCES
Year: 2019

Abstract:
We present an approach based on multilingual sentence embeddings to automatically extract parallel sentences from the content of Wikipedia articles in 85 languages, including several dialects or low-resource languages. We do not limit the extraction process to alignments with English, but systematically consider all possible language pairs. In total, we are able to extract 135M parallel sentences for 1620 different language pairs, out of which only 34M are aligned with English. This corpus of parallel sentences is freely available.1 To get an indication on the quality of the extracted bitexts, we train neural MT baseline systems on the mined data only for 1886 languages pairs, and evaluate them on the TED corpus, achieving strong BLEU scores for many language pairs. The WikiMatrix bitexts seem to be particularly interesting to train MT systems between distant languages without the need to pivot through English.

text: To get an indication on the quality of the extracted bitexts, we train neural MT baseline systems on the mined data only for 1886 languages pairs, and evaluate them on the TED corpus, achieving strong BLEU scores for many language pairs. The WikiMatrix bitexts seem to be particularly interesting to train MT systems between distant languages without the need to pivot through English.

heading: 1 INTRODUCTION
text: Most of the current approaches in Natural Language Processing (NLP) are data-driven. The size of the resources used for training is often the primary concern, but the quality and a large variety of topics may be equally important. Monolingual texts are usually available in huge amounts for many topics and languages. However, multilingual resources, typically sentences in two languages which are mutual translations, are more limited, in particular when the two languages do not involve English. An important source of parallel texts are international organizations like the European Parliament (Koehn, 2005) or the United Nations (Ziemski et al., 2016). These are professional human translations, but they are in a more formal language and tend to be limited to political topics. There are several projects relying on volunteers to provide translations for public texts, e.g. news commentary (Tiedemann, 2012), OpensubTitles (Lison & Tiedemann, 2016) or the TED corpus (Qi et al., 2018)
Wikipedia is probably the largest free multilingual resource on the Internet. The content of Wikipedia is very diverse and covers many topics. Articles exist in more than 300 languages. Some content on Wikipedia was human translated from an existing article into another language, not necessarily from or into English. Eventually, the translated articles have been later independently edited and are not parallel any more. Wikipedia strongly discourages the use of unedited machine translation,2 but the existence of such articles can not be totally excluded. Many articles have been written independently, but may nevertheless contain sentences which are mutual translations. This makes Wikipedia a very appropriate resource to mine for parallel texts for a large number of language pairs. To the best of our knowledge, this is the first work to process the entire Wikipedia and systematically mine for parallel sentences in all language pairs. We hope that this resource will be useful for several research areas and enable the development of NLP applications for more languages.
In this work, we build on a recent approach to mine parallel texts based on a distance measure in a joint multilingual sentence embedding space (Schwenk, 2018; Artetxe & Schwenk, 2018b). For this, we use the freely available LASER toolkit3 which provides a language agnostic sentence encoder which was trained on 93 languages (Artetxe & Schwenk, 2018a). We approach the computational
1Anonymized for review 2https://en.wikipedia.org/wiki/Wikipedia:Translation 3https://github.com/facebookresearch/LASER
challenge to mine in almost six hundred million sentences by using fast indexing and similarity search algorithms.
The paper is organized as follows. In the next section, we first discuss related work. We then summarize the underlying mining approach. Section 4 describes in detail how we applied this approach to extract parallel sentences from Wikipedia in 1620 language pairs. To asses the quality of the extracted bitexts, we train NMT systems for a subset of language pairs and evaluate them on the TED corpus (Qi et al., 2018) for 45 languages. These results are presented in section 5. The paper concludes with a discussion of future research directions.

heading: 2 RELATED WORK
text: There is a large body of research on mining parallel sentences in collections of monolingual texts, usually named “comparable coprora”. Initial approaches to bitext mining have relied on heavily engineered systems often based on metadata information, e.g. (Resnik, 1999; Resnik & Smith, 2003). More recent methods explore the textual content of the comparable documents. For instance, it was proposed to rely on cross-lingual document retrieval, e.g. (Utiyama & Isahara, 2003; Munteanu & Marcu, 2005) or machine translation, e.g. (Abdul-Rauf & Schwenk, 2009; Bouamor & Sajjad, 2018), typically to obtain an initial alignment that is then further filtered. In the shared task for bilingual document alignment (Buck & Koehn, 2016), many participants used techniques based on n-gram or neural language models, neural translation models and bag-of-words lexical translation probabilities for scoring candidate document pairs. The STACC method uses seed lexical translations induced from IBM alignments, which are combined with set expansion operations to score translation candidates through the Jaccard similarity coefficient (Etchegoyhen & Azpeitia, 2016; Azpeitia et al., 2017; 2018). Using multilingual noisy web-crawls such as ParaCrawl4 for filtering good quality sentence pairs has been explored in the shared tasks for high resource (Koehn et al., 2018) and low resource (Koehn et al., 2019) languages.
In this work, we rely on massively multilingual sentence embeddings and margin-based mining in the joint embedding space, as described in (Schwenk, 2018; Artetxe & Schwenk, 2018b;a). This approach has also proven to perform best in a low resource scenario (Chaudhary et al., 2019; Koehn et al., 2019). Closest to this approach is the research described in España-Bonet et al. (2017); Hassan et al. (2018); Guo et al. (2018); Yang et al. (2019). However, in all these works, only bilingual sentence representations have been trained. Such an approach does not scale to many languages, in particular when considering all possible language pairs in Wikipedia. Finally, related ideas have been also proposed in Bouamor & Sajjad (2018) or Grégoire & Langlais (2017). However, in those works, mining is not solely based on multilingual sentence embeddings, but they are part of a larger system. To the best of our knowledge, this work is the first one that applies the same mining approach to all combinations of many different languages, written in more than twenty different scripts.
Wikipedia is arguably the largest comparable corpus. One of the first attempts to exploit this resource was performed by Adafre & de Rijke (2006). An MT system was used to translate Dutch sentences into English and to compare them with the English texts. This method yielded several hundreds of Dutch/English parallel sentences. Later, a similar technique was applied to the Persian/English pair (Mohammadi & GhasemAghaee, 2010). Structural information in Wikipedia such as the topic categories of documents was used in the alignment of multilingual corpora (Otero & López, 2010). In another work, the mining approach of Munteanu & Marcu (2005) was applied to extract large corpora from Wikipedia in sixteen languages (Smith et al., 2010). Otero et al. (2011) measured the comparability of Wikipedia corpora by the translation equivalents on three languages Portuguese, Spanish, and English. Patry & Langlais (2011) came up with a set of features such as Wikipedia entities to recognize parallel documents, and their approach was limited to a bilingual setting. Tufis et al. (2013) proposed an approach to mine parallel sentences from Wikipedia textual content, but they only considered high-resource languages, namely German, Spanish and Romanian paired with English. Tsai & Roth (2016) grounded multilingual mentions to English wikipedia by training cross-lingual embeddings on twelve languages. Gottschalk & Demidova (2017) searched for parallel text passages in Wikipedia by comparing their named entities and time expressions. Finally, Aghaebrahimian (2018) propose an approach based on bilingual BiLSTM sentence encoders to mine German, French and Persian parallel texts with English. Parallel data consisting of aligned
4http://www.paracrawl.eu/
Wikipedia titles have been extracted for twenty-three languages5. Since Wikipedia titles are rarely entire sentences with a subject, verb and object, it seems that only modest improvements were observed when adding this resource to the training material of NMT systems.
We are not aware of other attempts to systematically mine for parallel sentences in the textual content of Wikipedia for a large number of languages.

heading: 3 DISTANCE-BASED MINING APPROACH
text: The underling idea of the mining approach used in this work is to first learn a multilingual sentence embedding, i.e. an embedding space in which semantically similar sentences are close independently of the language they are written in. This means that the distance in that space can be used as an indicator whether two sentences are mutual translations or not. Using a simple absolute threshold on the cosine distance was shown to achieve competitive results (Schwenk, 2018). However, it has been observed that an absolute threshold on the cosine distance is globally not consistent, e.g. (Guo et al., 2018). The difficulty to select one global threshold is emphasized in our setting since we are mining parallel sentences for many different language pairs.

heading: 3.1 MARGIN CRITERION
text: The alignment quality can be substantially improved by using a margin criterion instead of an absolute threshold (Artetxe & Schwenk, 2018b). In that work, the margin between two candidate sentences x and y is defined as the ratio between the cosine distance between the two sentence embeddings, and the average cosine similarity of its nearest neighbors in both directions:
margin(x, y) = cos(x, y)∑
z∈NNk(x)
cos(x, z)
2k + ∑ z∈NNk(y) cos(y, z) 2k
(1)
where NNk(x) denotes the k unique nearest neighbors of x in the other language, and analogously for NNk(y). We used k = 4 in all experiments.
We follow the “max” strategy as described in (Artetxe & Schwenk, 2018b): the margin is first calculated in both directions for all sentences in language L1 and L2. We then create the union of these forward and backward candidates. Candidates are sorted and pairs with source or target sentences which were already used are omitted. We then apply a threshold on the margin score to decide whether two sentences are mutual translations or not. Note that with this technique, we always get the same aligned sentences, independently of the mining direction, e.g. searching translations of French sentences in a German corpus, or in the opposite direction. The reader is referred to Artetxe & Schwenk (2018b) for a detailed discussion with related work.
The complexity of a distance-based mining approach is O(N ×M), where N and M are the number of sentences in each monolingual corpus. This makes a brute-force approach with exhaustive distance calculations intractable for large corpora. Margin-based mining was shown to significantly outperform the state-of-the-art on the shared-task of the workshop on Building and Using Comparable Corpora (BUCC) (Artetxe & Schwenk, 2018b). The corpora in the BUCC corpus are rather small: at most 567k sentences.
The languages with the largest Wikipedia are English and German with 134M and 51M sentences, respectively, after pre-processing (see Section 4.1 for details). This would require 6.8×1015 distance calculations.6 We show in Section 3.3 how to tackle this computational challenge.

heading: 3.2 MULTILINGUAL SENTENCE EMBEDDINGS
text: Distance-based bitext mining requires a joint sentence embedding for all the considered languages. One may be tempted to train a bi-lingual embedding for each language pair, e.g. (España-Bonet
5https://linguatools.org/tools/corpora/wikipedia-parallel-titles-corpora/ 6Strictly speaking, Cebuano and Swedish are larger than German, yet mostly consist of template/machine
translated text https://en.wikipedia.org/wiki/List_of_Wikipedias
et al., 2017; Hassan et al., 2018; Guo et al., 2018; Yang et al., 2019), but this is difficult to scale to thousands of language pairs present in Wikipedia. Instead, we chose to use one single massively multilingual sentence embedding for all languages, namely the one proposed by the open-source LASER toolkit (Artetxe & Schwenk, 2018a). Training one joint multilingual embedding on many languages at once also has the advantage that low-resource languages can benefit from the similarity to other language in the same language family. For example, we were able to mine parallel data for several Romance (minority) languages like Aragonese, Lombard, Mirandese or Sicilian although data in those languages was not used to train the multilingual LASER embeddings.
The underlying idea of LASER is to train a sequence-to-sequence system on many language pairs at once using a shared BPE vocabulary and a shared encoder for all languages. The sentence representation is obtained by max-pooling over all encoder output states. Figure 1 illustrates this approach. The reader is referred to Artetxe & Schwenk (2018a) for a detailed description.

heading: 3.3 FAST SIMILARITY SEARCH
text: Fast large-scale similarity search is an area with a large body of research. Traditionally, the application domain is image search, but the algorithms are generic and can be applied to any type of vectors. In this work, we use the open-source FAISS library7 which implements highly efficient algorithms to perform similarity search on billions of vectors (Johnson et al., 2017). An additional advantage is that FAISS has support to run on multiple GPUs. Our sentence representations are 1024-dimensional. This means that the embeddings of all English sentences require 153 · 106× 1024× 4 = 513 GB of memory. Therefore, dimensionality reduction and data compression are needed for efficient search. In this work, we chose a rather aggressive compression based on a 64-bit product-quantizer (Jégou et al., 2011), and portioning the search space in 32k cells. This corresponds to the index type “OPQ64,IVF32768,PQ64” in FAISS terms.8 Another interesting compression method is scalar quantization. A detailed comparison is left for future research. We build and train one FAISS index for each language.
The compressed FAISS index for English requires only 9.2GB, i.e. more than fifty times smaller than the original sentences embeddings. This makes it possible to load the whole index on a standard GPU and to run the search in a very efficient way on multiple GPUs in parallel, without the need to shard the index. The overall mining process for German/English requires less than 3.5 hours on 8 GPUs, including the nearest neighbor search in both direction and scoring all candidates

heading: 4 BITEXT MINING IN WIKIPEDIA
text: For each Wikipedia article, it is possible to get the link to the corresponding article in other languages. This could be used to mine sentences limited to the respective articles. One one hand, this local mining has several advantages: 1) mining is very fast since each article usually has a few hundreds of sentences only; 2) it seems reasonable to assume that a translation of a sentence is more likely to be found in the same article than anywhere in the whole Wikipedia. On the other hand, we
7https://github.com/facebookresearch/faiss 8https://github.com/facebookresearch/faiss/wiki/Faiss-indexes
hypothesize that the margin criterion will be less efficient since one article has usually few sentences which are similar. This may lead to many sentences in the overall mined corpus of the type “NAME was born on DATE in CITY”, “BUILDING is a monument in CITY built on DATE”, etc. Although those alignments may be correct, we hypothesize that they are of limited use to train an NMT system, in particular when they are too frequent. In general, there is a risk that we will get sentences which are close in structure and content.
The other option is to consider the whole Wikipedia for each language: for each sentence in the source language, we mine in all target sentences. This global mining has several potential advantages: 1) we can try to align two languages even though there are only few articles in common; 2) many short sentences which only differ by the name entities are likely to be excluded by the margin criterion. A drawback of this global mining is a potentially increased risk of misalignment and a lower recall.
In this work, we chose the global mining option. This will allow us to scale the same approach to other, potentially huge, corpora for which document-level alignments are not easily available, e.g. Common Crawl. An in depth comparison of local and global mining (on Wikipedia) is left for future research.

heading: 4.1 CORPUS PREPARATION
text: Extracting the textual content of Wikipedia articles in all languages is a rather challenging task, i.e. removing all tables, pictures, citations, footnotes or formatting markup. There are several ways to download Wikipedia content. In this study, we use the so-called CirrusSearch dumps since they directly provide the textual content without any meta information.9 We downloaded this dump in March 2019. A total of about 300 languages are available, but the size obviously varies a lot between languages. We applied the following processing:
• extract the textual content; • split the paragraphs into sentences; • remove duplicate sentences; • perform language identification and remove sentences which are not in the expected lan-
guage (usually, citations or references to texts in another language).
It should be pointed out that sentence segmentation is not a trivial task, with many exceptions and specific rules for the various languages. For instance, it is rather difficult to make an exhaustive list of common abbreviations for all languages. In German, points are used after numbers in enumerations, but numbers may also appear at the end of sentences. Other languages do not use specific symbols to mark the end of a sentence, namely Thai. We are not aware of a reliable and freely available sentence segmenter for Thai and we had to exclude that language. We used the freely available Python tool10 which is based on Moses scripts. Regular expressions were used for most of the Asian languages, falling back to English for the remaining languages. This gives us 879 million sentences in 300 languages. The margin criterion to mine for parallel data requires that the texts do not contain duplicates. This removes about 25% of the sentences.11
9https://dumps.wikimedia.org/other/cirrussearch/ 10https://pypi.org/project/sentence-splitter/ 11The Cebuano and Waray Wikipedia were largely created by a bot and contain more than 65% of duplicates.
LASER’s sentence embeddings are totally language agnostic. This has the side effect that the sentences in other languages (e.g. citations or quotes) may be considered closer in the embedding space than a potential translation in the target language. Table 2 illustrates this problem. The algorithm would not select the German sentence although it is a perfect translation. The sentences in the other languages are also valid translations which would yield a very small margin. To avoid this problem, we perform language identification (LID) on all sentences and remove those which are not in the expected language. LID is performed with fasttext12 (Joulin et al., 2016). Fasttext does not support all the 300 languages present in Wikipedia and we disregarded the missing ones (which typically have only few sentences anyway). After deduplication and LID, we dispose of 595M sentences in 182 languages. English accounts for 134M sentences, and German with 51M sentences is the second largest language. The sizes for all languages are given in Tables 4 and 6.

heading: 4.2 THRESHOLD OPTIMIZATION
text: Artetxe & Schwenk (2018b) optimized their mining approach for each language pair on a provided corpus of gold alignments. This is not possible when mining Wikipedia, in particular when considering many language pairs. In this work, we use an evaluation protocol inspired by the WMT shared task on parallel corpus filtering for low-resource conditions (Koehn et al., 2019): an NMT system is trained on the extracted bitexts – for different thresholds – and the resulting BLEU scores are compared. We choose newstest2014 of the WMT evaluations since it provides an N -way parallel test sets for English, French, German and Czech. We favoured the translation between two morphologically rich languages from different families and considered the following language pairs: German/English, German/French, Czech/German and Czech/French. The size of mined bitexts is in the range of 100k to more than 2M (see Table 3 and Figure 1). We did not try to optimize the architecture of the NMT system to the size of the bitexts and used the same architecture for all systems: the encoder and decoder are 5-layer transformer models as implemented in fairseq (Ott et al., 2019). The goal of this study is not to develop the best performing NMT system for the considered languages pairs, but to compare different mining parameters.
The evolution of the BLEU score in function of the margin threshold is given in Figure 1. Decreasing the threshold naturally leads to more mined data – we observe an exponential increase of the data size. The performance of the NMT systems trained on the mined data seems to change as expected, in a surprisingly smooth way. The BLEU score first improves with increasing amounts of available training data, reaches a maximum and than decreases since the additional data gets more and more noisy, i.e. contains wrong translations. It is also not surprising that a careful choice of the margin threshold is more important in a low-resource setting. Every additional parallel sentence is important. According to Figure 1, the optimal value of the margin threshold seems to be 1.05 when many sentences can be extracted, in our case German/English and German/French. When less parallel data is available, i.e. Czech/German and Czech/French, a value in the range of 1.03–1.04 seems to be a better choice. Aiming at one threshold for all language pairs, we chose a value of 1.04. It seems to be a good compromise for most language pairs. However, for the open release of this corpus, we provide all mined sentence with a margin of 1.02 or better. This would enable end users
12https://fasttext.cc/docs/en/language-identification.html
to choose an optimal threshold for their particular applications. However, it should be emphasized that we do not expect that many sentence pairs with a margin as low as 1.02 are good translations.
For comparison, we also trained NMT systems on the Europarl corpus V7 (Koehn, 2005), i.e. professional human translations, first on all available data, and then on the same number of sentences than the mined ones (see Table 3). With the exception of Czech/French, we were able to achieve better BLEU scores with the automatically mined bitexts in Wikipedia than with Europarl of the same size. Adding the mined text to the full Europarl corpus, also leads to further improvements of 1.1 to 3.1 BLEU. We argue that this is a good indicator of the quality of the automatically extracted parallel sentences.

heading: 5 RESULT ANALYSIS
text: We run the alignment process for all possible combinations of languages in Wikipedia. This yielded 1620 language pairs for which we were able to mine at least ten thousand sentences. Remember that mining L1 → L2 is identical to L2 → L1, and is counted only once. We propose to analyze and evaluate the extracted bitexts in two ways. First, we discuss the amount of extracted sentences (Section 5.1). We then turn to a qualitative assessment by training NMT systems for all language pairs with more than twenty-five thousand mined sentences (Section 5.2).

heading: 5.1 QUANTITATIVE ANALYSIS
text: Due to space limits, Table 4 summarizes the number of extracted parallel sentences only for languages which have a total of at least five hundred thousand parallel sentences (with all other languages at a margin threshold of 1.04). Additional results are given in Table 6 in the Appendix.
There are many reasons which can influence the number of mined sentences. Obviously, the larger the monolingual texts, the more likely it is to mine many parallel sentences. Not surprisingly, we observe that more sentences could be mined when English is one of the two languages. Let us point out some languages for which it is usually not obvious to find parallel data with English, namely Indonesian (1M), Hebrew (545k), Farsi (303k) or Marathi (124k sentences). The largest mined texts not involving English are Russian/Ukrainian (2.5M), Catalan/Spanish (1.6M), between the Romance languages French, Spanish, Italian and Portuguese (480k–923k), and German/French (626k).
It is striking to see that we were able to mine more sentences when Galician and Catalan are paired with Spanish than with English. On one hand, this could be explained by the fact that LASER’s multilingual sentence embeddings may be better since the involved languages are linguistically very similar. On the other, it could be that the Wikipedia articles in both languages share a lot of content, or are obtained by mutual translation.
Services from the European Commission provide human translations of (legal) texts in all the 24 official languages of the European Union. This N-way parallel corpus enables training of MT system to directly translate between these languages, without the need to pivot through English. This is
Under review as a conference paper at ICLR 2020
IS O
N am
e L
an gu
ag e
Fa m
ily si
ze az
ba be
bg bn
bs ca
cs da
de el
en eo
es et
eu fa
fi fr
gl he
hi hr
hu id
is it
ja kk
ko lt
m k
m l
m r
ne nl
no oc
pl pt
ro ru
sh si
sk sl
sq sr
sv sw
ta te
tl tr
tt uk
vi zh
to ta
l
ar A
ra bi
c A
ra bi
c 65
16 17
15 11
54 40
34 94
67 53
99 66
99 9
37 17
4 40
24 58
53 16
3 50
68 38
38 60
90 18
12 3
83 11
48 33
52 32
32 12
73 58
9 74
15 7
71 12
5 35
32 32
39 30
49 58
13 27
27 18
69 14
70 93
86 44 35 az A ze rb ai ja ni Tu rk ic 18 73 7 3 14 8 9 15 17 11 34 10 71 9 31 10 7 16 14 29 10 12 9 10 15 17 4 25 23 6 11 9 8 5 4 2 22 13 2 22 25 14 47 9 3 9 8 9 10 19 5 11 5 2 42 8 19 10 19 88 5 ba B as hk ir Tu rk ic 53 6 2 14 4 9 17 16 13 27 10 28 9 28 8 6 9 12 29 12 9 4 10 12 12 3 26 13 4 5 7 9 1 1 1 21 15 3 19 24 15 42 10 1 10 10 7 10 20 4 3 1 1 11 8 15 7 10 69 7 be B el ar us ia n Sl av ic 16 90 16 4 7 16 14 9 20 8 33 9 28 7 5 5 10 24 9 10 3 9 11 9 3 24 12 2 5 7 8 2 2 1 14 10 2 19 23 13 16 1 8 2 8 7 5 10 16 2 3 2 1 8 2 80 8 8 80 3 bg B ul ga ri an Sl av ic 33 27 38 34 76 79 53 13 2 62 35 7 40 12 2 43 25 37 61 11 7 43 58 30 47 68 60 17 10 2 71 11 38 42 86 29 35 13 84 58 9 96 11 4 69 27 0 41 31 43 46 26 65 63 12 21 23 21 56 12 12 6 60 60 37 70 bn B en ga li In do -A ry an 14 12 21 41 47 33 70 36 28 0 27 81 26 14 20 37 68 27 34 21 23 41 36 8 64 38 4 20 21 23 7 8 3 50 35 4 52 76 46 62 20 8 25 26 17 25 54 6 12 8 4 33 37 31 31 19 91 bs B os ni an Sl av ic 10 60 44 43 32 71 33 21 0 24 70 25 16 20 36 60 32 30 16 16 4 39 38 11 52 36 6 22 23 39 19 20 8 45 36 6 48 62 37 59 17 8 16 25 34 19 13 0 38 7 15 12 13 33 8 39 38 31 23 48 ca C at al an R om an ce 83 32 10 0 86 18 0 90 12 05 81 15 80 54 77 44 83 49 0 26 8 84 37 57 92 10 7 23 31 6 10 3 12 52 45 61 45 56 17 14 4 10 2 57 12 1 35 8 11 0 16 9 52 52 50 57 34 67 10 2 14 30 35 31 77 16 98 10 6 90 80 47 cs C ze ch Sl av ic 76 34 75 23 3 70 51 9 75 18 1 62 36 45 95 18 5 54 72 38 63 10 5 78 23 16 1 10 5 15 53 55 51 36 41 15 13 9 86 11 17 6 15 3 82 18 6 50 37 47 4 64 30 63 97 15 31 34 25 75 14 10 4 74 80 53 25 da D an is h G er m an ic 28 81 18 0 54 43 6 39 14 0 45 26 29 75 14 2 44 55 25 43 69 63 20 11 5 76 9 37 35 39 30 35 12 11 0 30 3 8 89 12 3 70 10 9 37 32 39 40 23 43 16 8 11 20 21 23 55 11 62 68 57 40 06 de G er m an G er m an ic 50 94 4 95 15 73 18 6 41 8 10 6 53 66 16 3 62 6 80 10 9 57 87 19 2 10 7 34 38 8 21 7 23 82 78 64 51 58 21 47 2 20 7 17 28 5 29 4 12 9 36 8 68 50 94 10 6 51 81 21 6 20 58 57 32 12 7 23 16 5 10 7 13 4 96 92 el G re ek H el le ni c 32 11 62 0 39 14 5 41 23 35 55 13 7 48 56 26 43 64 73 15 11 9 69 6 35 34 52 27 32 9 76 60 8 77 14 4 78 11 4 38 31 35 46 28 52 62 11 16 18 20 56 9 68 75 62 37 28 en E ng lis h G er m an ic 13 44 31 29 8 33 77 24 3 11 9 30 3 37 5 27 57 44 6 54 5 23 1 25 9 48 8 10 19 85 21 26 85 1 20 30 6 15 7 39 5 71 12 4 15 79 6 63 6 37 66 8 24 61 63 1 16 61 22 4 11 5 17 8 31 8 18 0 39 5 54 6 51 95 91 75 47 7 32 68 1 10 73 78 63 43 21 eo E sp er an to co ns tr uc te d 23 71 14 9 31 25 23 46 13 4 46 39 22 29 57 46 15 10 1 48 7 26 28 30 28 28 9 81 47 9 77 91 43 81 26 28 41 32 19 36 53 8 16 19 17 37 8 50 42 39 28 17 es Sp an is h R om an ce 25 20 2 89 15 4 83 15 5 90 5 61 0 15 3 71 94 16 7 19 8 42 67 1 21 9 26 10 8 76 92 65 98 25 27 2 18 1 35 23 5 92 3 18 3 39 3 81 84 81 93 53 10 7 18 1 21 57 71 48 14 7 26 18 7 20 6 17 41 49 80 et E st on ia n U ra lic 23 03 22 24 70 85 32 39 20 33 56 41 14 75 57 6 29 35 32 20 21 8 72 49 7 73 76 48 96 27 19 34 35 18 34 58 9 16 16 15 43 7 56 40 44 25 11 eu B as qu e Is ol at e 22 59 14 33 65 43 25 13 21 35 27 10 54 33 5 18 19 19 11 10 5 44 29 6 43 58 30 47 19 9 20 20 12 21 38 6 13 11 8 29 5 30 25 23 16 99 fa Fa rs i Ir an ia n 39 54 34 71 25 36 20 24 39 46 9 64 46 8 26 20 27 11 10 6 49 32 4 50 77 40 72 21 9 21 24 17 30 42 8 21 12 7 42 9 41 38 42 21 22 fi Fi nn is h U ra lic 74 28 15 6 47 64 28 48 90 63 22 13 1 87 9 43 47 40 29 30 10 12 6 86 10 11 9 13 1 69 13 9 39 27 50 46 25 46 12 6 12 23 24 21 72 10 76 60 64 39 98 fr Fr en ch R om an ce 34 49 4 15 4 13 6 60 85 16 4 16 1 38 74 4 21 4 24 89 71 83 62 83 25 33 1 16 6 12 4 25 5 55 8 20 6 41 0 72 74 83 86 48 92 18 6 19 56 65 42 13 0 26 17 0 16 5 15 71 24 41 gl G al ic ia n R om an ce 22 21 41 21 33 50 56 14 12 0 50 9 28 27 35 29 39 11 66 52 17 65 22 7 56 84 30 36 29 33 20 39 54 8 15 17 22 43 12 51 58 46 39 69 he H eb re w Se m iti c 69 62 28 41 65 63 17 12 1 82 7 43 35 42 26 25 9 86 64 8 84 13 3 67 13 1 35 21 36 38 23 45 67 10 21 25 13 54 8 73 66 62 36 66 hi H in di In do -A ry an 13 53 21 33 31 7 56 35 3 18 16 24 6 11 12 40 27 4 44 63 35 56 17 6 18 21 14 22 40 7 13 18 3 29 4 33 26 30 17 81 hr C ro at ia n Sl av ic 22 29 58 47 14 80 48 8 27 31 52 24 24 10 65 48 7 71 85 51 85 66 6 19 35 53 21 20 5 56 9 16 16 17 42 9 55 46 42 36 29 hu H un ga ri an U ra lic 77 02 70 20 14 6 99 11 49 48 47 27 28 10 12 1 75 10 12 6 14 8 87 14 9 46 26 56 55 27 53 88 13 29 30 20 75 9 83 74 75 43 57 id In do ne si an M al ay oPo ly ne si an 38 99 16 14 6 77 8 45 33 55 25 23 10 10 1 83 8 93 20 4 94 12 7 43 23 37 46 32 56 79 13 24 19 21 79 11 73 14 6 83 47 43 is Ic el an di c G er m an ic 48 8 31 18 2 9 12 12 6 5 3 27 22 3 27 35 20 30 13 4 13 13 9 13 28 4 7 5 5 16 3 18 16 14 99 5 it It al ia n R om an ce 21 02 5 17 9 24 83 62 73 58 78 24 24 0 15 0 20 21 9 48 0 16 1 30 3 67 68 72 81 48 83 15 3 19 44 58 41 11 2 23 14 4 14 3 13 71 00 84 ja Ja pa ne se Ja po ni c 31 61 4 14 22 2 47 48 21 23 8 12 3 81 9 12 8 17 5 79 19 6 40 19 48 50 28 51 96 12 37 31 12 84 12 92 75 26 7 53 82 kk K az ak h Tu rk ic 16 84 6 5 6 2 2 1 18 11 1 17 22 12 32 8 1 8 7 6 8 16 3 3 1 1 10 4 14 6 9 58 1 ko K or ea n K or ea ni c 54 00 23 26 10 10 4 56 41 5 63 93 47 89 23 9 25 26 17 29 51 7 17 13 5 47 5 48 49 57 25 39 lt L ith ua ni an B al tic 20 31 28 16 16 6 57 39 6 70 64 39 10 7 25 15 30 30 16 29 46 8 13 11 12 36 6 57 33 35 20 91 m k M ac ed on ia n Sl av ic 14 87 21 22 9 53 46 6 56 93 56 88 52 19 29 39 25 10 6 48 9 14 15 16 43 8 57 57 45 27 61 m l M al ay al am D ra vi di an 27 2 3 1 41 32 7 41 58 35 46 21 2 22 21 13 20 44 6 4 3 1 16 2 26 15 17 13 88 m r M ar at hi In do -A ry an 50 3 1 46 35 5 47 86 47 50 22 3 25 25 13 19 56 4 5 3 1 17 1 26 14 17 16 48 ne N ep al i In do -A ry an 23 5 17 13 4 17 21 14 19 10 1 10 10 6 9 17 3 1 1 7 1 11 6 6 58 4 nl D ut ch G er m an ic 14 09 1 13 3 13 17 7 21 8 96 19 9 53 42 66 64 34 61 15 1 16 37 35 29 90 18 10 4 84 88 63 64 no N or w eg ia n G er m an ic 13 64 9 10 3 16 1 74 12 1 42 28 43 51 26 47 27 0 12 24 23 24 61 13 69 79 63 47 71 oc O cc ita n R om an ce 47 2 13 24 11 14 6 5 6 6 4 7 12 2 3 3 3 7 3 9 8 7 70 6 pl Po lis h Sl av ic 16 27 0 20 0 97 28 5 56 40 81 68 35 69 12 1 16 39 42 28 92 16 17 2 84 92 60 35 pt Po rt ug ue se R om an ce 13 35 4 17 7 31 2 74 76 71 85 47 10 1 15 5 20 42 54 45 14 0 23 15 6 21 3 16 51 09 32 ro R om an ia n R om an ce 35 04 13 6 44 43 42 49 30 58 75 15 23 27 29 72 13 82 96 74 45 15 ru R us si an Sl av ic 32 53 7 70 42 85 78 44 11 4 14 0 17 54 55 29 11 9 25 24 86 12 2 14 81 13 11 sh Se rb oC ro at ia n la ng ua ge s So ut h Sl av ic 20 69 17 27 46 19 37 3 46 8 14 13 17 35 9 45 42 36 33 37 si Si nh al a In do -A ry an 32 0 22 22 10 15 48 4 4 4 2 15 1 21 14 16 14 64 sk Sl ov ak Sl av ic 19 04 36 17 34 51 8 14 15 16 37 9 51 38 38 27 26 sl Sl ov en ia n Sl av ic 18 36 19 47 50 9 15 16 17 39 8 50 48 42 26 23 sq A lb an ia n A lb an ia n 74 0 25 31 6 13 10 10 27 29 30 24 15 15 sr Se rb ia n Sl av ic 42 26 51 9 19 18 14 43 8 71 56 45 35 10 sv Sw ed is h G er m an ic 17 90 6 16 33 39 35 72 17 82 74 73 51 07 sw Sw ah ili N ig er - C on go 23 5 6 3 4 12 12 10 11 65 2 ta Ta m il D ra vi di an 16 29 6 2 29 5 30 19 27 13 15 te Te lu gu D ra vi di an 15 09 1 21 1 30 16 20 13 15 tl Ta ga lo g M al ay oPo ly ne si an 31 2 12 1 16 17 10 10 15 tr Tu rk is h Tu rk ic 40 67 10 67 77 69 36 98 tt Ta ta r Tu rk ic 44 9 11 7 10 60 3 uk U kr ai ni an Sl av ic 12 87 1 73 72 70 43 vi V ie tn am es e V ie tic 67 27 89 46 60 zh C hi ne se C hi ne se 12 30 6 44 15
Ta bl
e 4:
W ik
iM at
ri x:
nu m
be r
of ex
tr ac
te d
se nt
en ce
s fo
r ea
ch la
ng ua
ge pa
ir (i
n th
ou sa
nd s)
, e.
g. E
sJa
=2 19
co rr
es po
nd s
to 21
9, 26
0 se
nt en
ce s
(r ou
nd ed
). T he co lu m n “s iz e” gi ve s th e nu m be ro fl in es in th e m on ol in gu al te xt s af te rd ed up lic at io n an d L ID .
usually not the case when translating between other major languages, for example in Asia. Let us list some interesting language pairs for which we were able to mine more than hundred thousand sentences: Korean/Japanese (222k), Russian/Japanese (196k), Indonesian/Vietnamese (146k), or Hebrew/Romance languages (120–150k sentences).
Overall, we were able to extract at least ten thousand parallel sentences for 85 different languages.13 For several low-resource languages, we were able to extract more parallel sentences with other languages than English. These include, among others, Aragonse with Spanish, Lombard with Italian, Breton with several Romance languages, Western Frisian with Dutch, Luxembourgish with German or Egyptian Arabic and Wu Chinese with the respective major language.
Finally, Cebuano (ceb) falls clearly apart: it has a rather huge Wikipedia (17.9M filtered sentence), but most of it was generated by a bot, as for the Waray language14. This certainly explains that only a very small number of parallel sentences could be extracted. Although the same bot was also used to generate articles in the Swedish Wikipedia, our alignments seem to be better for that language.

heading: 5.2 QUALITATIVE EVALUATION
text: Aiming to perform a large-scale assessment of the quality of the extracted parallel sentences, we trained NMT systems on the extracted parallel sentences. We identified a publicly available data set which provide test sets for many language pairs: translations of TED talks as proposed in the context of a study on pretrained word embeddings for NMT15 (Qi et al., 2018). We would like to emphasize that we did not use the training data provided by TED – we only trained on the mined sentences from Wikipedia. The goal of this study is not to build state-of-the-art NMT system for for the TED task, but to get an estimate of the quality of our extracted data, for many language pairs. In
1399 languages have more than 5,000 parallel sentences. 14https://en.wikipedia.org/wiki/Lsjbot 15https://github.com/neulab/word-embeddings-for-nmt
particular, there may be a mismatch in the topic and language style between Wikipedia texts and the transcribed and translated TED talks.
For training NMT systems, we used a transformer model from fairseq (Ott et al., 2019) with the parameter settings shown in Figure 2 in the appendix. For preprocessing, the text was tokenized using the Moses tokenizer (without true casing) and a 5000 subword vocabulary was learnt using SentencePiece (Kudo & Richardson, 2018). Decoding was done with beam size 5 and length normalization 1.2.
We evaluate the trained translation systems on the TED dataset (Qi et al., 2018). The TED data consists of parallel TED talk transcripts in multiple languages, and it provides development and test sets for 50 languages. Since the development and test sets were already tokenized, we first detokenize them using Moses. We trained NMT systems for all possible language pairs with more than twentyfive thousand mined sentences. This gives us in total 1886 language pairs in 45 languages. We train L1 → L2 and L2 → L1 with the same mined bitexts L1/L2. Scores on the test sets were computed with SacreBLEU (Post, 2018). Table 5 summarizes all the results. Due to space constraints, we are unable to report BLEU score for all language combinations in that table. Some additional results are reported in Table 7 in the annex. 23 NMT systems achieve BLEU scores over 30, the best one being 37.3 for Brazilian Portuguese to English. Several results are worth mentioning, like Farsi/English: 16.7, Hebrew/English: 25.7, Indonesian/English: 24.9 or English/Hindi: 25.7 We also achieve interesting results for translation between various non English language pairs for which it is usually not easy to find parallel data, e.g. Norwegian↔ Danish ≈33, Norwegian↔ Swedish ≈25, Indonesian ↔ Vietnamese ≈16 or Japanese / Korean ≈17. Our results on the TED set give an indication on the quality of the mined parallel sentences. These BLEU scores should be of course appreciated in context of the sizes of the mined corpora as given in Table 4. Obviously, we can not exclude that the provided data contains some wrong alignments even though the margin is large. Finally, we would like to point out that we run our approach on all available languages in Wikipedia, independently of the quality of LASER’s sentence embeddings for each one.

heading: 6 CONCLUSION
text: We have presented an approach to systematically mine for parallel sentences in the textual content of Wikipedia, for all possible language pairs. We use a recently proposed mining approach based on massively multilingual sentence embeddings (Artetxe & Schwenk, 2018a) and a margin criterion (Artetxe & Schwenk, 2018b). The same approach is used for all language pairs without the need of a language specific optimization. In total, we make available 135M parallel sentences in 85 languages, out of which only 34M sentences are aligned with English. We were able to mine more than ten thousands sentences for 1620 different language pairs. This corpus of parallel sentences is freely available.16 We also performed a large scale evaluation of the quality of the mined sentences by training 1886 NMT systems and evaluating them on the 45 languages of the TED corpus (Qi et al., 2018).
This work opens several directions for future research. The mined texts could be used to first retrain LASER’s multilingual sentence embeddings with the hope to improve the performance on low-resource languages, and then to rerun mining in Wikipedia. This process could be iteratively repeated. We also plan to apply the same methodology to other large multilingual collections. The monolingual texts made available by ParaCrawl or CommonCrawl17 are good candidates.
We expect that the WikiMatrix corpus has mostly well-formed sentences and it should not contain social media language. The mined parallel sentences are not limited to specific topics like many of the currently available resources (parliament proceedings, subtitles, software documentation, . . .), but are expected to cover many topics of Wikipedia. The fraction of unedited machine translated text is also expected to be low. We hope that this resource will be useful to support research in multilinguality, in particular machine translation.
16Anonymized for review 17http://commoncrawl.org/

heading: A APPENDIX
text: Table 6 provides the amounts of mined parallel sentences for languages which have a rather small Wikipedia. Aligning those languages obviously yields to a very small amount of parallel sentences. Therefore, we only provide these results for alignment with high resource languages. It is also likely that several of these alignments are of low quality since the LASER embeddings were not directly trained on most these languages, but we still hope to achieve reasonable results since other languages of the same family may be covered.
Table 2 gives the detailed configuration which was used to train NMT models on the mined data in Section 5.
Finally, Table 7 gives the BLEU scores on the TED corpus when translating into and from English for some additional languages.

Review summaries:
The paper creates a large dataset for machine translation, called WikiMatrix, that contains 135M parallel sentences in 1620 language pairs from Wikipedia. The paired sentences from different languages are mined based on the sentence embeddings. Training NMT systems based on the mined dataset, and comparing with those trained based on existing dataset, the authors claim that the quality of the dataset is good. The effect of thresholding values of similarity scores for selecting parallel sentences is studied. Since the data is huge, dimension reduction and data compression techniques are used for efficient mining. The study is the first one that systematically mine for parallel sentences of Wikipedia for a large number of languages. The results are solid and the dataset is valuable for research in multilinguality.