{'fraction_non_alphanumeric': 0.031540460772653184, 'fraction_numerical': 0.010484119642306507, 'mean_word_length': 4.794282797345584, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Bilingual dictionaries for all EU languages

Bilingual dictionaries can be automatically generated using the GIZA++ tool. However, these dictionaries contain a lot of noise, because of which the quality of outputs of tools relying on the dictionaries are negatively affected. In this work we present three different methods for cleaning noise from automatically generated bilingual dictionaries: LLR, pivot and translation based approach. We have applied these approaches on the GIZA++ dictionaries -- dictionaries covering official EU languages -- in order to remove noise. Our evaluation showed that all methods help to reduce noise. However, the best performance is achieved using the transliteration based approach. We provide all bilingual dictionaries (the original GIZA++ dictionaries and the cleaned ones) free for download. We also provide the cleaning tools and scripts for free download.


Introduction
Bilingual dictionaries are important for various applications of human language technologies, including crosslanguage information search and retrieval, machine translation and computer-aided assistance to human translators. The GIZA++ (Och and Ney, 2000;Och and Ney, 2003) tool provides an automated way to construct bilingual dictionaries from parallel corpora. However, there are two main problems using this tool to create such bilingual dictionaries. The first problem is that the tool is hard to use and input data preparation is difficult. For technically nonsophisticated users, installing and running GIZA++ is not at all straightforward. Depending on the level of technical ability of the installer, setting the tool up can take several weeks to finish successfully. Additionally, preparation of parallel data to be input to the tool is also time consuming, as any input to GIZA++ must be pre-processed to satisfy certain conditions. Data preparation time is increased if the aim is to generate bilingual dictionaries for many languages. The second problem has to do with noise in the automated bilingual dictionaries. GIZA++ treats every word in the source language as a possible translation for every word in the target language and assigns the pairs probabilities indicating the likelihood of the translations. A word pair with lower probability can be regarded as an "incorrect" translation and a word pair with higher probability as a "correct" translation. However, this is an ideal situation and is not always the case in GIZA++ as pairs of words with high translation probabilities may still be wrong. Due to this problem, any application that makes use of word pair translations only above a probability value threshold is still served with noise. Aker et al. (2012), for instance, use GIZA++ dictionaries as a feature when extracting parallel phrases from comparable corpora and report mistranslated pairs of phrases mainly due to noise in the statistical dictionaries. Although the authors clean their dictionaries by removing every entries that have lower probability values than a man-ually determined threshold, their results show that better cleaning is required. The best way to do this would be to manually filter out all wrong translations. However, this is a labour intensive task, which is not feasible to perform for many language pairs. Another alternative would be an automated approach that, unlike Aker et al. (2012), does not trivially delete all dictionary entries below a probability threshold but instead aims to filter out mistranslations independently from any manually set threshold. In this paper we address both problems. To address the first problem, we pre-generate bilingual dictionaries for all official European languages except Irish and Croatian and provide them for free download. To address the second problem, we describe three different cleaning techniques, two of which are novel. We apply these cleaning techniques on the statistical dictionaries in order to reduce noise. Thus the data we offer for downloading contains several versions of the same bilingual dictionaries -the original GIZA++ output and multiple cleaned versions. We also provide access to our cleaning methods in the form of open source tools for natural language processing-based system developers. In the remainder of the paper, we first describe the data we use to generate the bilingual dictionaries (Section 2). Next, we introduce our cleaning methods (Section 3). In Section 4, we describe our evaluation set-up and provide results that were acquired by performing a manual quality evaluation of the cleaning processes. Section 5 lists the resources that are available for download. Finally, we conclude the paper with Section 6.

Bilingual dictionaries
To obtain the original GIZA++ dictionaries we used the freely available DGT-TM parallel corpus (Steinberger et al., 2012), which provides data for official languages of the European Union. The number of sentence pairs available for each language pair is shown in Table 1 following language pairs: EN-HU, EN-LT, EN-LV and EN-SK. On average, each language pair contains 3.2M sentence pairs. Using these data, we created bilingual dictionaries for 21 language pairs. We exclude English-Irish because the amount of parallel data available in DGT-TM is very small. We exclude also English-Croatian, because DGT-TM does not cover Croatian. Each bilingual dictionary entry has the form s, t i , p i , where s is a source word, t i is the i-th translation of s in the dictionary and p i is the probability that s is translated to t i , the p i 's summing to 1 for each s in the dictionary. We use these original dictionaries and run our cleaning methods on them to remove noise. These methods are the subject of the next section.

Methods
To clean the GIZA++ dictionaries described in Section 2, we apply three different methods as described below.

Statistical approach
The first method we implement is similar to the one reported in Munteanu and Marcu (2006). The method uses LogLikelihood-Ratio (LLR) (Dunning, 1993) as a test to decide whether a pair of source and target words are correct or incorrect translations of each other. Any pair not passing the test is filtered from the dictionary.
To do this, we first align the parallel sentence pairs using the GIZA++ toolkit (Och and Ney, 2000;Och and Ney, 2003) in both directions and then refine the alignments using a "grow-diag-final-and" strategy. The grow-diag-finaland entails for each sentence pair the alignment information between the words. Based on this alignment file we construct the co-occurrence matrix used to compute the LLR: where S is the source word and T is the target word. The aim is to assess whether S and T are translations of each other. S and T represent source and target words other than S and T . The entry k11 is the number of times S and T occurred together (aligned to each other), k12 is the number of times T occurred with S , k21 is the number of times S occurred with T , and k22 is the number of times S and T occurred together. We filter out any pair in the GIZA++ dictionary whose LLR value was below 10.83 (p < 0.001) by looking at the χ 2 significance table. Note that we also skip dictionary entries which start or end with punctuations or symbols. Furthermore, we also delete any dictionary entry whose GIZA++ probability is below 0.001. These filters are applied regardless of the χ 2 statistics.

Transliteration based approach
The second method we have investigated tries to use a transliteration-based approach on filtering the dictionaries. The idea is that simply applying thresholds on probabilistic dictionaries will filter out also good translation equivalents. However, identification of translation equivalents that can be transliterated from one language to the other may allow identifying good pairs below the applied thresholds and thus keep them in the filtered dictionaries. The method filters dictionary entries using the following 7 steps: 1. The first step performs dictionary entry structural validation in order to remove obvious noise. At first, we remove all entries that contain invalid character sequences on either source or target side. Character sequences are considered invalid if according to the Unicode character table they contain control symbols, surrogate symbols or only whitespace symbols. In this step we also identify mismatching character sequences by comparing the source and target sides of a dictionary entry. At first we verify that the source and target token letters are equally capitalised (with an exception of the first letter, which in some languages, e.g., for nouns in German or days of a week in English, is capitalised). Further, we verify whether the letters contained in the source and target sides belong to the source and target language alphabets and whether both tokens contain equal numbers of digits, punctuation marks, and symbols, and whether they are located in similar positions in the source and target words. As the GIZA++ probabilistic dictionaries are statistical representations of token alignments in a parallel corpus, the alignments contain also easily detectable mistakes, such as, words paired with punctuations, incorrectly tokenized strings paired with words, etc. By applying character-based validation rules on the source and target language words we can easily filter out such obvious mistakes in the probabilistic dictionaries.
2. The second step identifies dictionary entries that are transliterations. We apply two different transliteration methods: 1) the language independent (how-   (2013), which transliterates words into English using simple letter substitution rules, and 2) the characterbased statistical machine translation method also proposed by Pinnis (2013). While the first transliteration method is fast, it is not able to capture morphological variations in different languages and it treats each character independently of the context. The second method, however, takes context (character n-grams) into account and is able to transliterate words not only into English, but also to other languages, thus transliterated word identification can be performed bidirectionally (from source to target and from target to source). In order to identify transliterated words, the transliterations (e.g., the source word transliterated into the target language) are compared with the other sides word (e.g., the target language word) using a string similarity measure based on the Levenshtein distance (Levenshtein, 1966). If the maximum similarity score using any of the transliteration methods and directions (source-to-target or target-to-source) is higher than 0.7 (identified as an acceptable threshold through empirical analysis) and the source and target words are not equal (because such pairs are often wrong language pairs), we consider the dictionary entry as transliterated and we pass it through to the filtered dictionary (the further filtering steps are skipped).
3. In the third step we analyse the remaining pairs using reference corpora based inverse document frequency (IDF) scores (Jones, 1972) of the source and target words. We remove all pairs that have a difference of word IDF scores greater than 0.9 (also empirically identified). Such pairs often indicate of functional word (or stop-word) miss-alignment with content words (e.g., in the dictionaries the English "a" is usually paired with almost everything else and the IDF-based filter reliably removes such entries).
4. In the fourth step we apply a translation probability value threshold that is differentiated for (source language) words that were already containing transliteration pairs (i.e., if a dictionary entry containing the source word was identified as a transliteration, then all other translation candidates for the source word are required to have a high probability in order to be accepted as translation equivalents).
5. Then, we remove all pairs that partially contain transliterations. For instance, consider the dictionary entry "monopoly" (in English) and "monopols" (in Latvian). The entry is a transliteration, thus, "monopolsituācijā" (translated as "in the case of a monopoly" would be filtered out as it contains fully the transliterated part. 6. We apply also several heuristic filters that have shown to remove further noise (e.g., rare words miss-aligned with a probability of one if a source word already contains multiple translation hypotheses, equal source and target words if the source word already contains multiple translation hypotheses, etc.).
7. Finally, the pairs that have passed all filter tests are written to the filtered dictionary.
Examples of dictionary entries that were identified using the different filtering steps from the English-Latvian GIZA++ dictionary are given in Table 2.

Pivot language based approach
The pivot language based approach uses the idea of intermediate languages to clean noise from the bilingual dictionaries. The idea of a pivot language is used in related work to overcome the problem of unavailable bilingual dictionaries such as in cross lingual information retrieval (CLIR) (Gollins and Sanderson, 2001;Ballesteros, 2002), in statistical machine translation (Wu and Wang, 2007;Wu and Wang, 2009) and bilingual dictionary generation (Paik et al., 2001;Seo and Kim, 2013). However, our approach differs from related work by adopting the idea of pivot languages to clean noise from existing dictionaries instead of using it for translation purposes. This means that we aim at cleaning an existing dictionary such as for the English-German language pair using intermediate dictionaries such as German-French and French-English. In this case, the pivot language is French. Our approach uses the bilingual dictionary that has to be cleaned as the starting point. In Figure 1, this is the English-German (EN-DE) GIZA++ dictionary. We distinguish between one pivot language and several parallel pivot languages approach. In the one pivot language approach (shown as the blue arrow in Figure 1), our method takes for every source language (i.e., English) word enW its translations in the target (i.e., German) language (deW 1 , ..., deW n ). In the next step, using a DE-FR GIZA++ dictionary, each such German word, deW i , is then translated into French leading to French words f rW i1 , ..., f rW im . Each such French word, f rW ij , is then looked up in an FR-EN GIZA++ dictionary leading to possible translations in English (enW ij1 , ..., enW ijp ). If none of the English words enW ij1 , ..., enW ijp matches enW then the pair < enW, deW i > is removed from the EN-DE dictionary.
Our early experiments showed that using the one pivot language approach many entries from the EN-DE dictionary are removed because the pivot dictionary (DE-FR) does not contain entries for the German words. To overcome this problem we also introduce the several parallel pivot languages approach (shown as the red arrows in Figure 1) where instead of using one pivot language, we perform the cleaning with two pivot dictionaries at the same time. That means when we perform the cleaning of EN-DE using DE-FR-EN (as described in the one pivot language approach), we also perform in parallel the cleaning using another pivot dictionary, such as DE-IT-EN. In Figure 1 the two parallel pivot languages approach is shown using DE-FR-EN and DE-IT-EN. If at least one of these returns an English word enW ijp equal to enW we keep the entry < enW, deW i > in the EN-DE dictionary otherwise the entry is removed. By performing two parallel checks we reduce the chance that the entry < enW, deW i > is removed from the dictionary because of missing entries. Note that similarly to the LLR method within this approach we also skip -independently from the pivot language dictionary look-ups-dictionary entries which contain punctuations or symbols and also entries whose dictionary probability values are below 0.001.

Evaluation
To assess the performance of the different cleaning methods we performed a manual evaluation task by asking humans to judge the translation quality of the remaining dictionary entries. In the evaluation we randomly selected dictionary entries from 8 different sets to assess. The sets are shown in Figure 2. The first set contains all entries from the original GIZA++ dictionary, which do not appear in any of the other 7 sets (i.e. they are not retrieved by any of the three approaches). This set is used to understand whether the  cleaning methods do miss good data or not. The next four sets are the entries in the intersections between the results of the three methods, I-1, I-2, I-3 and All. The All set contains only entries which are also found in the other results. The other intersection sets contain entries between two methods. Finally, we have the LLR, Pivot and Transliteration sets, which do not share any entry with the intersection sets. Figure 3 shows the number of dictionary entries in each of the 8 sets for the English-German language pair. For instance, the Pivot method outputs for the English-German dictionary in total 277,703 entries. However, we divide this set into 4 parts: portion within All intersection (8,987 entries), portion of entries which intersects with the LLR method (I-1, in total 91,924 entries), portion intersecting with the Transliteration based method (I-3, in total 20,605 entries) and finally what is distinct within the Pivot result set (in total 156,187 entries). From each of the 8 sets, we randomly selected 40 entries leading to total 320 entries and showed them to human assessors. Each assessor judged all 320 entries. In the assessment, similar to Aker et al. (2013), we asked human asses-sors to categorize each presented dictionary entry into one of the categories shown in Figure 4. Two German and two Latvian native speakers who were fluent in English took part in this evaluation task. Note that in the evaluation we only used the English to X (i.e. German and Latvian) dictionaries. However, we also provide cleaned version of the dictionaries from language X to English.

Results
The results of the evaluation are shown in Table 3 for English-German and Table 4 for English-Latvian. From the results we can see that the dictionary entries from the original GIZA++ dictionary are very noisy. Only 2%-6% of the entries contain correct translations. Note that these entries are not included in any of the cleaned sets. This means that the cleaning methods are good filters to skip such noisy entries. Furthermore, the results show that the transliteration method performs best compared to the other two cleaning methods for both English-German and English-Latvian language pairs. According to the manual assessors this method achieves around 55%-61% precision. The pivot approach achieves around 40%-42% for both language pairs. The LLR method gets for English-German only 20%, but for the English-Latvian language pair it achieves a similar figure as the pivot approach. However, these figures are based on the entries not included in the intersection sets. If we look at the intersection sets we see that the precision figures go higher. If All intersections are considered then the precision results are just below 90% for both English-German and English-Latvian language pairs. Among the intersection sets the lowest precision results are achieved when the pivot method is intersected with the LLR approach (set I-1). The high precision scores in the intersection sets show that the cleaning methods commonly identify "good" translations and the highest figure in the All set suggests to combine the different cleaning methods and apply them together on the original GIZA++ dictionaries. We also computed the agreement rates between the assessors. The German assessors had an agreement in 79.69% of all evaluated dictionary entries and the Latvian assessors agreed in 80.31% of all entries. We computed the agreement based on the number of agreed votes over the three categories and the 8 sets (see the second half of the Tables  3 and 4) divided by the total number of votes (in this case 320).

Resources for download
We have prepared the dictionaries as well as the cleaning methods for download: • Original GIZA++ dictionaries: These are the dictionaries we obtained using the GIZA++ alignment tool. We do not apply any cleaning technique on these statistical dictionaries. The dictionaries can be found here: http://www.taas-project.eu/. For the purpose of the pivot approach we also created GIZA++ dictionaries for DE-XX and FR-XX where XX represents any of the other languages. These dictionaries can also be downloaded from the same link.
• Cleaned bilingual dictionaries: These are the cleaned versions of the original dictionaries. These dictionaries are also available through the same link as the original ones.

Conclusion
In this paper we have described three different methods for cleaning bilingual dictionaries: LLR, pivot, and the transliteration based approach. We have applied these methods on GIZA++ dictionaries covering 22 official EU languages. We also performed manual evaluation using English-German and English-Latvian dictionaries. Our evaluation shows that all methods help reducing noise, i.e., the dictionary entries not taken by the three methods are mainly judged by the assessors as noise. The best performance is achieved using the transliteration approach.
We have also seen that the results in the intersection sets were higher than in the other sets. This showed that the cleaning methods do commonly identify what is a correct translation. We provide all bilingual dictionaries (the original GIZA++ dictionaries and the cleaned versions) free for download. We also provide the cleaning tools and scripts for free download. For future work we aim to combine the different approaches using some machine learning techniques and apply them together on the cleaning task. Furthermore, we plan to work on other language pairs where English is not involved and provide them for free download. We plan to upload any additional dictionary to http://www.taas-project.eu/.

Acknowledgments
The research within the project TaaS leading to these results has received funding from the European Union Seventh Framework Programme (FP7/2007(FP7/ -2013, Grant Agreement no 296312. We would like to thank the assessors who took part in our manual evaluation.  Table 3: Results of the EN-DE manual evaluation by two annotators. The second half of the table shows figures where we ignored the cases for which there was a disagreement. The precision figure in each row is computed by dividing the figure in column Eq with the sum of the figures of the columns Eq to Wrong of that row.