Linguistic-family-specific Encoders and Decoders for Multilingual Spoken Machine Translation Master Thesis submitted to the Faculty of the Escola T`ecnica d’Enginyeria de Telecomunicaci´o de Barcelona Universitat Polit`ecnica de Catalunya by Haoru Qin In partial fulfillment of the requirements for the master in ADVANCED TELECOMMUNICATION TECHNOLOGIES Advisor: Carlos Escolano Peinado, Jos´e Adri´an Rodr´ıguez Fonollosa Barcelona, May 2022
Contents List of Figures 4 List of Tables 4 1 Introduction 8 1.1 Statementofpurpose.............................. 8 1.2 Requirements and specifications . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 Workplanwithtasks.............................. 9 1.4 Deviations from the initial plan . . . . . . . . . . . . . . . . . . . . . . . . 9 2 State of the art 10 2.1 Natural Language Processing (NLP) . . . . . . . . . . . . . . . . . . . . . 10 2.2 MachineTranslation .............................. 12 2.3 Spoken Language Translation . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 Tools and datasets used in the project 15 3.1 Fairseq...................................... 15 3.2 United Nations Parallel Corpus . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2.1 CorpusSelection ............................ 15 3.2.2 UNPCDataFormat .......................... 16 3.3 MuST-C..................................... 17 3.3.1 CorpusSelection ............................ 17 3.3.2 MuST-C Data Format . . . . . . . . . . . . . . . . . . . . . . . . . 18 4 Methodology / project development 19 4.1 Text-to-textModel ............................... 20 4.1.1 DataPreparation............................ 20 4.1.2 Data Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.1.3 Training................................. 22 4.2 Speech-to-textModel.............................. 22 4.2.1 DataPreparation............................ 22 4.2.2 Data Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2.3 Training................................. 23 4.3 Experimental Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3.1 Baseline Models Training . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3.2 Fine-tuning ............................... 24 4.3.3 Zero-shot Translation . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3.4 Visualization .............................. 25 4.4 Architecture of Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.4.1 Language-Specific Encoders-Decoders . . . . . . . . . . . . . . . . . 25 4.4.2 Speech-Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.4.3 SLT Model Architecture . . . . . . . . . . . . . . . . . . . . . . . . 27 5 Results 29 2
5.1 Text-to-text Machine Translation System . . . . . . . . . . . . . . . . . . . 29 5.2 Speech Translation System . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.3 Fine-tuning ................................... 31 5.4 Zero-shotTranslation.............................. 31 5.5 Principal Component Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 32 6 Conclusions and future development: 34 References 35 Appendices 39 3
List of Figures 1 Model architecture of Transformer. . . . . . . . . . . . . . . . . . . . . . . 11 2 General relation between all the models built in this project. . . . . . . . . 19 3 Architecture of the NMT model trained with UNPC dataset. . . . . . . . . 26 4 Pre-trained ASR model (Speech encoder). . . . . . . . . . . . . . . . . . . 26 5 Model architecture of Speech Transformer. . . . . . . . . . . . . . . . . . . 27 6 Architecture of the SLT models trained with MuST-C and UNPC. . . . . . 28 7 Principal Component Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 32 List of Tables 1 Number of sentences consisted in UNPC dataset per language pair. . . . . 15 2 Example of the English-Spanish parallel data. . . . . . . . . . . . . . . . . 16 3 Number of sentences and speech audio length for different language pairs ofMuST-Cdataset................................ 17 4 Abbreviation for all used languages in this project. . . . . . . . . . . . . . 29 5 The BLEU scores for the UNPC text-to-text NMT system. . . . . . . . . . 29 6 Average performance for each L language as source (L–>X) and target (X–>L) ..................................... 30 7 The BLEU scores of SLT system along with baseline models’ scores. . . . . 30 8 The BLEU scores of fine-tuned SLT system. . . . . . . . . . . . . . . . . . 31 9 The BLEU scores of Zero-shot translation SLT system. . . . . . . . . . . . 32 4
Revision history and approval record Revision Date Purpose 0 28/03/2022 Document creation 1 30/04/2022 Document revision 2 06/05/2022 Document revision 3 14/05/2022 Document revision DOCUMENT DISTRIBUTION LIST Name e-mail Haoru Qin
[email protected] Carlos Escolano Peinado
[email protected] Jos´e Adri´an Rodr´ıguez Fonollosa
[email protected] Written by: Reviewed and approved by: Date 28/03/2022 Date 14/05/2022 Name Haoru Qin Name Carlos Escolano Peinado Jos´e Adri´an Rodr´ıguez Fonollosasa Position Project Author Position Project Supervisor 5
Abstract This project provides a spoken language translation system trained with UN Parallel Corpus and MuST-C, aiming at study the correlation between languages of different linguistic families and the performance of the translation tasks. This SLT system consists of a text-to-text Neural Machine Translation model, whose dataset includes six languages from five linguistic families, and a Automated Speech Recognition model, using dataset that contains four languages from four linguistic families. The combined SLT system is an end2end system, which is a relatively new task, and in this project, the idea is to analyze how would different linguistic families perform when training under the same conditions. Apart from measuring the performance using BLEU score system, this project also performs fine-tuning and zero-shot translation tasks. In general, the obtained BLEU scores are good and similar to original baseline models studies in UNPC and MuST-C papers. Finetuning and zero-shot translation experiments also obtained reasonable results, proving the hypothesized positive correlation between the closeness of languages and the performances of the translation tasks. 6
Acknowledgements At the point of writing this, I’m greatly thankful to all of you who have helped me during this journey. And this page is dedicated to you all. First of all, I truly appreciate all the help from my advisors, Carlos and Adri´an, who always help and support me. Especially Carlos, who is always there when I needed him. Also to my ex-advisor Marta, who although couldn’t stay with me until the end, but gave me this opportunity and idea to start with this project. I want to thank my mom for supporting me, believing in me that I can do well on this. Even though she is not by my side, I am grateful of her love and support. And I’d like to give my special thanks to Jin, who is always by my side encouraging me, walking with me through the darkest moment with my negative emotions, taking care of me and pulling me out of it. This work once brought me into self-negation, when the tasks were at a point too difficult to perform. But fortunately, I did not choose to give up and continued with all these love, support and help, which led to the completion of this project. I have learned a lot during this project, both technically and personally. 7
1 Introduction In the recent 20 years, Machine Translation as a new technology is rising rapidly and getting closer and closer to our daily life. At the meanwhile, speech recognition techniques is developing quickly as well. The Spoken Language Translation (SLT) task is a popular task of recent years which adopts the concept of both Machine Translation (MT) and speech recognition (ASR). Traditionally, the SLT systems consist of a pipeline that contains an MT system and an ASR system, combining the data of these two tasks. Recently, it is the trend to build end-to-end MT models that can learn directly from SLT data, but at the moment these data dedicated to SLT tasks are usually smaller comparing to the data for MT and ASR tasks. To solve this problem, some studies tried to make the use of data of MT and ASR tasks to obtain the result, such as the study of Escolano et al. [24]. A study by Xian Li et al. [1], published in 2020 , presents the state-of-art of the zero-shot translation, a machine translation solution when no training data is available. In this study, pre-trained models are used to perform zero-shot translation between language pairs that do not posses any training data or are trained for different tasks. 1.1 Statement of purpose Not many studies have been done for multilingual machine translation, which we propose in this project. Among the existing studies, most are based on European languages or trained with small quantity of data of non-European languages. In this project, the main purpose is to build a multilingual SLT system using data from different tasks with non-European languages, and doing related experiments to study the correlation between the distance of linguistic families and the speech translation accuracy when trained under the same data conditions. The base idea is that the closer two linguistic families are, the better the common language representation will the system have when doing speech translation tasks. For this, the architecture is evaluated from three aspects. Firstly, Zero-Shot, to study how the differences in learned representations add noise to translations for language pairs that are not jointly trained. Secondly, Transfer Learning, to observe how the learned knowledge of a language transfers when is used as the base to train another pair of languages. Lastly, Representation Learning, to visualize the differences in representations of different languages. 1.2 Requirements and specifications To successfully perform described objectives, these following requirements are essential: 1. CALCULA Computing Services, allow users to access super computing servers in order to perform heavy calculating tasks in an Ubuntu environment. Helps in the stability of training calculation and other tasks. 8
2. Python, one of the main programming language used in this project. It is one of the most widely used languages in deep learning neural network training and applications. 3. Fairseq toolkit [28], providing many powerful state-of-art neural machine translation architectures and functions to help researchers and developers about different text generation tasks. 4. United Nations Parallel Corpus (UNPC) [16], a parallel text-to-text corpus designed for machine translation tasks. 5. Multilingual Speech-to-Text Corpus (MuST-C) [19], a parallel speech-to-text corpus designed for spoken language translation tasks. 1.3 Work plan with tasks During this project, several tasks are planned to be done in this following order: 1. Selection of suitable datasets, for both text-to-text MT tasks and SLT tasks. 2. Text-to-text dataset preparation and pre-processing. 3. Training NMT model using pre-processed dataset. 4. Speech-to-text dataset preparation and pre-processing. 5. Training SLT models using pre-processed dataset and previously trained NMT model. 6. Obtaining and analysing results, doing experiment about fine-tuning, and performing zero-shot translation task. 7. Writing this master degree thesis. 8. Preparing and presenting the final oral presentation. 1.4 Deviations from the initial plan At the beginning of performing the SLT task, instead of MuST-C, CoVoST 2 [30] was chosen as the corpus for training the model. But due to the difference of format, adapting CoVoST 2 dataset to MuST-C data format, which is exactly the needed format of the training process, was quite a heavy task, and unknown error caused the converted CoVoST 2 data unusable. Therefore, after hundreds of hours put into CoVoST 2 data processing and training, we had to change to MuST-C to be able to finish planned tasks. 9
area of the contents, and size of the data are important points to compare. At last, the United Nations Parallel Corpus v1.0 (UNPC) [16], which contains all language pairs from different linguistic families that the architecture needs to use, is chosen. Table 1 shows the number of sentences each language pair contains. Being parallel corpus, the translating direction does not matter, and the two directions share the same text data, therefore having the same number of sentences. 3.2.2 UNPC Data Format UNPC has 6 languages: Arabic, Chinese, English, French, Russian, and Spanish, which are mostly from different linguistic family and meets the needs. There are bidirectional language pairs between each two languages, in total, there are 15 pairs. The only problem of this corpus is that it is too large for a limited train, so we choose a subset to work with. Each pair has an more-than-enough large amount of phrases to start with, so the final corpus are the first 20 million phrases for each pair. The UNPC raw data for each pair come with one textual file for both language. Both files ends with the abbreviation of the language, and each line of the files are the same phrase (same meaning) in the specific language. Table 2 shows an example of the parallel corpus English-Spanish, where each corresponding line has the same meaning in corresponding language. English Spanish File Name en-es.en en-es.es Line i Not only had control measures been made more effective, but 17 countries had acceded to the Protocol since June 1990. No s´olo se hab´ıa dado mayor efectividad a las medidas de control, sino que 17 pa´ıses se hab´ıan adherido al Protocolo desde junio de 1990. Line j There were few examples in the history of diplomacy where so many nations had agreed solidly to address a common concern. Existen pocos ejemplos en la historia de la diplomacia en que tantas naciones hayan acordado firmemente abordar un problema com´un. Table 2: Example of the English-Spanish parallel data. This data formation is the same as the data used as input to the system, so minimal modification needs to be made to adapt to the system. Also, UNPC comes with its own test set and validation set for all pairs, which makes the tasks easier. 16
3.3 MuST-C 3.3.1 Corpus Selection For the speech-to-text machine translation part, as for the text-to-text part, we compared various corpus. Languages are important to consider, which is optimal if the languages corresponding to the same linguistic family as the ones used in the text-to-text part. Apart from that, hours of speech and speech content are also considered. Among a few corpus, we chose MuST-C [19] for this project, a multilingual speech-to-text corpus using hundreds of hours of English TED talks, their transcriptions, and the translations for many different languages. It is also the original corpus which the speech-to-text pre-processing script is designed for. The table 3 presents the number of sentences consisted in different language pairs, as well as the speech audio length. The information is grouped by language pairs, which are used in this project. English speech to Arabic Split Number of sentences Speech length train 212085 463h15m44s dev 1073 2h28m34s test 2019 4h04m39s English speech to Spanish Split Number of sentences Speech length train 265625 496h20m09s dev 1316 2h33m31s test 2502 4h10m07s English speech to Russian Split Number of sentences Speech length train 265477 481h30m57s dev 1317 2h32m54s test 2513 4h09m30s English speech to Chinese Split Number of sentences Speech length train 184801 436h36m06s dev 890 2h22m25s test 1824 4h00m18s Table 3: Number of sentences and speech audio length for different language pairs of MuST-C dataset. 17
3.3.2 MuST-C Data Format The corpus has a specific format. Here is an example of the file structure of MuST-C: train wav filename1.wav filename2.wav ... txt train.yaml train.langA train.langB h5 train.h5 This example shows the train folder for a pair of language langA and langB. There are other two folders dev and tst-COMMON which have the exactly same structure as the shown train folder, but for validation and test dataset correspondingly. There is also a tst-HE folder which is not used in this project. The wav folder contains all the audio clips that belongs to the split (train, validation, test) of the language pair. MuST-C corpus provides audio clips that each clip has various segmentations. In txt folder, there is a textual file that contains parallel phrases for both languages, and the files have extensions indicating the language. There is also a yaml file, each line has four essential information of a segmentation aligned with the transcription and translation files: duration,offset,speaker id, and wav. Since each audio clip contains more than one segmentation, it is important to know the duration of each segmentation and from which second of the audio the segmentation begins (offset). In h5 folder, there is a Hierarchical Data Format version 5 file (HDF5) with extension .h5. It contains the log Mel 40-dimensional filter-bank features extracted from the segmented audio. 18
4 Methodology / project development This section describes the data preparation, data pre-processing, and finally the training for the multilingual spoken language translation system. To complete this task, most of the process has to be described as two separated part: text-to-text part and speech-to- textFair-swqA multilingual machine translation system [22] is created using Fairseq. The system focuses on jointly training language-specific encoders and decoders. Each encoder and each decoder works on only one specific language. But after training the system, all languages’ intermediate representations share the same space, and all decoders should be able to work with all the other decoders in the system. Parallel data between all the languages is required to train this representation. The described shared space allows adding new languages to the system by forcing the new encoder/decoder to learn the same representation space. Once it is trained it works with any other language in the system, follows the concept of zero-shot translation [23]. Figure 2: General relation between all the models built in this project. There is also a speech model [24] following the same principle. As implied, this work is 19
based on these two systems designed by Escolano. et al. Therefore, the data we use in this work need to be adapt to data format the described systems have used. Figure 2 presents a general idea about the relation between every model used in this project, which will be described and explained with more details during this section. 4.1 Text-to-text Model To complete the spoken language translation system, first, a multilingual text system need to be trained so that the trained system has already learned the common representation space. After adapting the data to the format we need to train the model for the text system, it can be trained to learn the common representation space so that it can be used in the spoken part. 4.1.1 Data Preparation All data preparation is done usinng the Fairseq toolkit. This tool is designed for languages that use Latin alphabet, which shares a common characteristic that words are separated with space. In order to meet the requirements, we use scripts from Moses library [32], an open source toolkit for SMT, to prepare data before processing the data into the system. First step is to tokenize the phrases by separating each word and punctuation marks. If a phrase is too long or too short, it is probably that the same phrase in different languages are not actually the same phrase or one of them has more information that is not in the other one. Therefore, after tokenization, the data needs to be cleaned by removing any phrases that is considered too long or too short. After cleaning, the filtered phrases need to be truecased. To truecase means to convert the initial word of each phrase to the most probable case, uppercase or lowercase, depending on the frequency. And for truecasing, a truecaser needs to be trained. For training split, after all these three steps, it is ready for pre-processing. The trained truecaser then is applied to validation and test splits, so that both of them follows the exact rules how the training split is truecased. Russian language uses a different alphabet but shares the similar characteristic, therefore, for English, French, Russian, and Spanish, the existed scripts can be used directly. But Arabic and Chinese required to be prepared in a different fashion. 4.1.1.1 Arabic For the Arabic language, which uses a consonantal alphabet, texts are written from right to left, which is very different from any other languages’ written system. As a consonantal alphabet, Arabic script uses optional diacritics to mark vowels on base consonant letters, and diacritics can connect to other diacritics to enrich the meaning of the base word. Undiacritized standard Arabic written language out of context is very ambiguous even for human beings. 20
For example the letter ¬, which has the pronunciation corresponding to latin letter f, can be added by different diacritics to represent different pronunciations: ¬= f, ¬= fu, ¬ = fi, ¬= fa Another example can be for the incomplete sentence: If we romanize the sentence, it should be “klm >Hmd ...”, where all the vowels are unknown. To complete the sentence, words need to be added, which here two examples are provided. Both of the sentences are added diacritizations as well. The romanization is attached after the original sentences correspondingly. kal∼ama >aHomadN Sadiyqahu (1) kalama >aHomadN Eaduw∼ahu (2) The sentence (1) means “Ahmad talked to his friend”, while the sentence (2) means “Ahmad wounded his enemy”. The difference comes from the first word that without diacritizations it could mean both talk and wound. A word in standard arabic has an average of 6.8 diacritizations. Therefore, to prepare Arabic for the system, it is essential to be able to automatically diacritize standard written language. It in general is a very complex linguistic system and requires a specific tokenization system. CAMeL Tools [17] is suite of Arabic natural language processing tools developed by the CAMeL Lab at New York University Abu Dhabi and we use it to tokenize our Arabic textual data. 4.1.1.2 Chinese For Chinese language, on the other hand, each word is not separated by space. Words attach to each other until the end of the phrase. While it is easy for a native speaker to know where the word boundary is, for a machine, there are thousands of combinations for a single phrase, knowing that Chinese words can be combination of characters of any length. An easy example can be: Unsegmented standard sentence: 美好的一天从清晨开始 Segmented sentence: 美好的\一天\从\清晨\开始 Based on the linguistic characteristics of Chinese language, a segmentation tool for Chinese: Jieba [18], is used to segment words in phrases in order to tokenize the phrases. Also, truecasing is not needed for Chinese data, since there is no different casing or presenting form for a word depending on the position of the word in a sentence. 21
4.1.2 Data Pre-processing The results after all these steps are used in pre-processing. To be able to be used in training, the data need to be pre-processed by doing BPE so that phrases can be analyzed in smaller segments or subwords which is useful to analyze unknown words using subwords. The idea of using subwords is to be able to represent any word without increasing the vocabulary. If a word that is not in the vocabulary, instead of register it, it can be represented as a combination of subwords. The BPE process generates dictionaries for all the languages, a codes file per language pair which contains all the subwords, also a bpe file showing the data content with words substitute by subwords per split and per language pair. By the end of pre-processing, by binarization, an index file and a content file for both source and target languages per split and per language pair are generated. 4.1.3 Training After all data is prepared and pre-processed, they are ready to be trained for the NMT model. In order to perform various different tasks as transfer learning and zero-shot using the SLT system we are going to train in later steps, this NMT model needs to be trained with the 6 languages of UNPC (Arabic, English, Spanish, French, Russian, and Chinese) bidirectionally with each other, so that the system can learn a shared representation of the languages. For example, Arabic-English and English-Arabic are two different pairs. In total, there are 30 combinations, which means 30 different source-target language pairs. As mentioned before, training scripts are adapted from Fairseq toolkit, and training parameters is attached at the end of the thesis as appendices. The architecture of this trained NMT model is shown in the architecture section in 4.4.1. 4.2 Speech-to-text Model Once the ML model is trained, speech is to be added. Same as for the text-to-text model, we can select a dataset/subset of the languages that has enough hours to train and represents the different families that we have on the system. This way we can compare the performance of the different languages according to the linguistic family they are performing zero-shot translation with. 4.2.1 Data Preparation Here for MuST-C data, only transcriptions and translations need to be prepared in the similar way as we did for UNPC corpus. These textual data need to be tokenized, which Arabic and Chinese transcriptions and translations are prepared using the same tools CaMeL and Jieba, and then truecased, except Chinese, which does not require truecasing. The only difference here is that for these data, no cleaning is applied. We do not want to eliminate any sentence, even it is too long or too short, because every sentence is needed as they are already aligned with audio segments. 22
4.2.2 Data Pre-processing For audio pre-processing, we need to use the prepared text-to-text data. Instead of generating new BPE codes and dictionaries, the codes files and dictionaries generated using UNPC data are used, so that all the subwords will be using the same embedding as they do in UNPC. Together with the provided HDF5 files, the pre-processing can be done in two step for each language pair: firstly, the source language speech data with the target language text data (translations), then, the source language speech data with the source language text data (transcriptions). And now, all the data are ready to be trained. To create an efficient and useful model, the data preparation and processing are indispensable. A good-quality dataset often leads to a better results. For a speech-to-text system, both text-to-text and speech-to-text parts have to be carefully prepared, one after another. Though it is quite time consuming, during the process, there are always little details that need to be tend to, and these works result in that the obtained dataset works well for further training. 4.2.3 Training After all these works, it is time to train the SLT model using not only the preprocessed MuST-C dataset, but also the trained text-to-text NMT model. First of all, we have to train an ASR model using the speech sequences and the corresponding transcriptions so that the model learns to produce transcriptions for audio segments. The idea comes from the Speech-Transformer of Di Gangi et al.[35], which we will explain in the section of architectures. SLT data usually are too small to train a transformer from the beginning. Therefore, training firstly the encoder in ASR helps in obtaining a better initialization for all the parameters. After that, training with the trained ASR encoder will provide better results even with the small amount of data that we have for this project. For these experiments, all the speech data being English. Four English ASR models are trained, each one using the provided data for a different language pair, which later will be used again in the next training step for their own pair correspondingly. For example, all these models are from English speech to English transcription, but for the pair English- Spanish, we use audio segments from English-Spanish dataset, and its corresponding English transcription, while for the pair English-Arabic, we use audios from English-Arabic dataset and its transcription. The reason why four different models are trained is to compare how the target language affect the representations after learning and the results of zero-shot, which with different trained models we can observe the differences easily. The trained models in this step are used for the next step as encoders. Despite of the fact that all the ASR models are for producing English transcriptions from English speech, the results are slightly different due to having slightly different data and test examples. Each trained ASR model is used as encoder of the corresponding final language-pair-specific SLT model, and the trained UNPC NMT model is used as decoder, using different language pairs from UNPC. For these models, decoders are not modified during training to preserve the representation from the UNPC NMT system. On the other 23
hand, baseline models combine the trained ASR encoder with a new randomly initialized decoder. Both baseline encoder and decoder are trained using only provided data from the same MuST-C dataset. The motivation for using UNPC decoder is that in addition to the translation direction trained, it will allow us to do zero-shot translation among all languages in UNPC. The relation between every trained models are as shown in figure 2, which is included at the beginning of the whole section. For example, to obtain the English-Arabic SLT model, we use the ASR model trained with English-Arabic data as encoder, and the frozen Arabic decoder the UNPC model as decoder. In total, four final SLT model are trained for these language pairs, with speech as input, and text as output: English-Arabic, English-Spanish, English-Russian, and English- Chinese. 4.3 Experimental Framework After the models are trained, some experiments are done to study how different languages impact the results. 4.3.1 Baseline Models Training To assess the quality of our systems we trained 4 baseline systems, one for each language. These systems are trained on MUST-C data only and follow the same architecture as our proposed systems. The pre-trained ASR models are used as encoders, and then uses the transcription-translation of MuST-C data as decoders to train the baseline models. For comparison, we also provide the results from the original MUST-C paper [19]. 4.3.2 Fine-tuning One of the experiment of this project is fine-tuning using already trained models between languages that belong to different linguistic families and use different scripts. Through this experiment, we observe the performance of transfer learning between languages from different linguistic families. The hypothesis of this experiment is that closer languages learn better shared representations, and therefore serve as better initialization for other languages. In order to measure knowledge transfer between language families we propose the following experiment. For each of the four SLT models trained as described in sections 4.2.3, we train new SLT models for the other three remaining languages using its encoder as initialization of the new systems. As decoders, we use the frozen UNPC NMT model decoders for each language. These all add up to 12 fine-tuned models. One example can be using the trained SLT English-Arabic model as encoder, and the pair of Arabic-Spanish of UNPC NMT model as decoder. The fine-tuned model is English- Spanish SLT model, and the results can be studied and compared to the English-Spanish SLT model trained on English-Spanish data only. 24
4.3.3 Zero-shot Translation Zero-shot Translation is an ability of a NMT system of translating language pairs that have not been trained. In our case, we are using the same pairs as in the experiment of fine-tuning. But this time, without being trained one more time, we generate the results directly using trained SLT models to translate to another language. We hypothesize that languages from closer families will learn better common representations, and perform better on zero-shot translation. As an example, results of a zero-shot English-Spanish translation are generated with the English-Arabic trained SLT model, along with the trained UNPC text-to-text model indicating the language pair as Arabic-Spanish. In this example, the obtained results are not coming from a trained English-Spanish model, but from a trained English-Arabic model, whose results then translated into Spanish. 4.3.4 Visualization For better understanding of the results of the experiments, it is essential to visualize them, and we choose Principal Component Analysis (PCA) to perform this visualization. The hypothesis here is that languages from closer linguistic families learn more similar representations. 4.4 Architecture of Models In this section, the architecture of various models mentioned before will be shown and explained with a little more details. 4.4.1 Language-Specific Encoders-Decoders Figure 3 shows the NMT model trained with all the languages of UNPC, which consists of 6 encoders and 6 decoders. The combination of encoders and decoders makes the model flexible and useful in translating between the 6 languages. The model is based on the paper of Escolano et al.[22],and no parameters are shared between languages. For each encoder and decoder, there are 6 attention layers, which use 8 heads for multi-head attention. The embedding and input/output vectors have dimension of 512. 25
Pair BLEU Encoder Decoder Zero-shot BLEU ens-ar 8.98 ens-es es-ar 1.60 ens-ru ru-ar 1.01 ens-zh zh-ar 0.38 ens-es 18.09 ens-ar ar-es 6.44 ens-ru ru-es 6.34 ens-zh zh-es 3.09 ens-ru 9.2 ens-ar ar-ru 2.65 ens-es es-ru 4.00 ens-zh zh-ru 2.07 ens-zh 4.08 ens-ar ar-zh 2.14 ens-es es-zh 2.06 ens-ru ru-zh 1.30 Table 9: The BLEU scores of Zero-shot translation SLT system. 5.5 Principal Component Analysis Figure 7: Visual presentation of Principal Component Analysis. The figure 7 shows the visualization of a Principal Component Analysis (PCA) of the SLT system we have trained in this project. For being able to compare the result, same 32
sentences for every language are used. From the obtained PCA we can observe that Spanish and Russian have a higher similarity. For both Spanish and Russian we observe closer representations to the English text representations (in red) while Arabic and Chinese are both represented farther and spread over a bigger region of the space. These results correspond to our expectation from previous experiments, showing that translating between similar languages reduces noise between representations, which may lead to better transfer-learning and zero-shot translation. 33
6 Conclusions and future development: The purpose of this project is to study how linguistic families affects the performance of Spoken Language Translation models. The first hypothesis was that the closer two linguistic families are, the better will the system performs. From obtained results, it is clear that this hypothesis is approved. Among the four non- English languages used in the SLT models, with English speech audios, Russian and Spanish have more linguistic similarities than with Arabic and Chinese. Besides of that, Spanish has the highest similarity to English, the source language of all the models, therefore, it is convincing that English-Spanish SLT model obtains the best results among all trained models. Fine-tuning results are as expected, which proves the other hypothesis this project had. By fine-tuning, the system perform better for almost every model and language pair. But on the other hand, as the hypothesis of this project implies that with languages in linguistic families of further distances will impact the result negatively, the final zero-shot results are low on BLEU scores, which is correct according to the hypothesis. PCA visualization proves that the language families with smaller distance have more similar representations, and this can explain the results we obtained in other experiments. This project aims at studying how different target languages affect the representation of a single source language. In a future work, adding more speech data of different languages will be a great objective. Also, it will be very beneficial if more languages per linguistic family are used to perform the tasks. 34
References [1] Xian Li, Changhan Wang, Yun Tang, Chau Tran, Yuqing Tang, Juan Pino, Alexei Baevski, Alexis Conneau, and Michael Auli. Multilingual speech translation with efficient finetuning of pretrained models, 2020. [2] J J Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proceedings of the National Academy of Sciences, 79(8):2554–2558, 1982. [3] D. E. Rumelhart, J. L. McClelland, and PDP Research Group, editors. Parallel Distributed Processing. Volume 1: Foundations. MIT Press, Cambridge, MA, 1986. [4] Sepp Hochreiter and J¨urgen Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [5] Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and Christian Janvin. A neural probabilistic language model. J. Mach. Learn. Res., 3:1137–1155, March 2003. [6] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013. [7] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [8] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017. [9] Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2, NIPS’14, page 3104–3112, Cambridge, MA, USA, 2014. MIT Press. [10] Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1700–1709, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. [11] Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715– 1725, Berlin, Germany, August 2016. Association for Computational Linguistics. [12] I. Made Agus Dwi Suarjaya. A new algorithm for data compression optimization. 2012. [13] KH Davis, R Biddulph, and Stephen Balashek. Automatic recognition of spoken digits. Journal of the Acoustical Society of America, 24(6):637–642, 1952. 35
[14] L. E. Baum and T. Petrie. Statistical inference for probabilistic functions of finite state Markov chains. Annals of Mathematical Statistics, 37:1554–1563, 1966. [15] Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, and Andrew Y. Ng. Deep speech: Scaling up end-to-end speech recognition, 2014. cite arxiv:1412.5567. [16] Micha l Ziemski, Marcin Junczys-Dowmunt, and Bruno Pouliquen. The united nations parallel corpus v1.0. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC’16), pages 3530–3534, Portoroˇz, Slovenia, May 2016. European Language Resources Association (ELRA). [17] Ossama Obeid, Nasser Zalmout, Salam Khalifa, Dima Taji, Mai Oudah, Bashar Alhafni, Go Inoue, Fadhl Eryani, Alexander Erdmann, and Nizar Habash. CAMeL tools: An open source python toolkit for Arabic natural language processing. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 7022– 7032, Marseille, France, May 2020. European Language Resources Association. [18] J Sun. Jieba chinese word segmentation tool, 2012. [19] Mattia A. Di Gangi, Roldano Cattoni, Luisa Bentivogli, Matteo Negri, and Marco Turchi. MuST-C: a Multilingual Speech Translation Corpus. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 2012–2017, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. [20] Hirofumi Inaguma, Yosuke Higuchi, Kevin Duh, Tatsuya Kawahara, and Shinji Watanabe. Non-autoregressive end-to-end speech translation with parallel autoregressive rescoring, 2021. [21] Graham Neubig, Matthias Sperber, Xinyi Wang, Matthieu Felix, Austin Matthews, Sarguna Padmanabhan, Ye Qi, Devendra Sachan, Philip Arthur, Pierre Godard, John Hewitt, Rachid Riad, and Liming Wang. XNMT: The eXtensible neural machine translation toolkit. In Proceedings of the 13th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Track), pages 185–192, Boston, MA, March 2018. Association for Machine Translation in the Americas. [22] Carlos Escolano, Marta R. Costa-juss`a, Jos´e A. R. Fonollosa, and Mikel Artetxe. Multilingual machine translation: Closing the gap between shared and languagespecific encoder-decoders. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 944– 948, Online, April 2021. Association for Computational Linguistics. [23] Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Vi´egas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s Multilingual Neural Machine Translation System: Enabling Zero-Shot Translation. Transactions of the Association for Computational Linguistics, 5:339–351, 10 2017. 36
[24] Carlos Escolano, Marta Ruiz Costa-juss`a, Jos´e A. R. Fonollosa, and Carlos Segura. Enabling zero-shot multilingual spoken language translation with language-specific encoders and decoders. ArXiv, abs/2011.01097, 2020. [25] Alex Graves, Santiago Fern´andez, Faustino Gomez, and J¨urgen Schmidhuber. Connectionist temporal classification: Labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd International Conference on Machine Learning, ICML ’06, page 369–376, New York, NY, USA, 2006. Association for Computing Machinery. [26] William Chan, Navdeep Jaitly, Quoc Le, and Oriol Vinyals. Listen, attend and spell: A neural network for large vocabulary conversational speech recognition. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 4960–4964, 2016. [27] Alex Graves. Sequence transduction with recurrent neural networks, 2012. [28] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019. [29] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alch´e-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. [30] Changhan Wang, Anne Wu, and Juan Pino. Covost 2: A massively multilingual speech-to-text translation corpus, 2020. [31] Minh-Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation, 2015. [32] Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondrej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open source toolkit for statistical machine translation. In John A. Carroll, Antal van den Bosch, and Annie Zaenen, editors, ACL. The Association for Computational Linguistics, 2007. [33] Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. Multi-way, multilingual neural machine translation with a shared attention mechanism, 2016. [34] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: A method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, ACL ’02, page 311–318, USA, 2002. Association for Computational Linguistics. 37
[35] Mattia A. Di Gangi, Matteo Negri, and Marco Turchi. Adapting Transformer to End- to-End Spoken Language Translation. In Proc. Interspeech 2019, pages 1133–1137, 2019. 38
Appendices Training parameters of the UNPC NMT model: –arch interlingua transformer –optimizer adam –adam-betas (0.9, 0.98) –clip-norm 0 –lr-scheduler inverse sqrt –warmup-init-lr 1.00E-07 –warmup-updates 4000 –lr 0.001 –min-lr 1.00E-09 –dropout 0.3 –weight-decay 0 –criterion label smoothed cross entropy –label-smoothing 0.1 –max-tokens 1000 –update-freq 32 –save-interval-updates 30000 –task interlingua nodistance translation –encoder embed dim 512 –encoder ffn embed dim 2048 –encoder attention heads 8 –encoder layers 6 –decoder embed dim 512 –decoder ffn embed dim 2048 –decoder attention heads 8 –decoder layers 6 39
Training parameters of machine-transcribing models: –arch speech interlingua transformer big 3conv –optimizer adam –max-sentences 8 –clip-norm 20 –lr-scheduler inverse sqrt –warmup-init-lr 3.00E-04 –warmup-updates 4000 –lr 5.00E-03 –min-lr 1.00E-08 –dropout 0.1 –distance-penalty log –criterion label smoothed cross entropy –label-smoothing 0.1 –audio-features 40 –max-tokens 12000 –update-freq 64 –adapter-size 4096 –adapter-attn-layers 0 –task speech interlingua translation –encoder embed dim 512 –encoder ffn embed dim 2048 –encoder attention heads 8 –encoder layers 6 –decoder embed dim 512 –decoder ffn embed dim 2048 –decoder attention heads 8 –decoder layers 6 40
Training parameters of SLT models: –arch speech interlingua transformer big 3conv –optimizer adam –max-sentences 8 –clip-norm 20 –lr-scheduler inverse sqrt –warmup-init-lr 3.00E-04 –warmup-updates 4000 –lr 0.0001 –min-lr 1.00E-08 –dropout 0.1 –distance-penalty log –criterion label smoothed cross entropy –label-smoothing 0.1 –audio-features 40 –max-tokens 12000 –update-freq 64 –adapter-size 4096 –adapter-attn-layers 0 –task speech interlingua translation –encoder embed dim 512 –encoder ffn embed dim 2048 –encoder attention heads 8 –encoder layers 6 –decoder embed dim 512 –decoder ffn embed dim 2048 –decoder attention heads 8 –decoder layers 6 41