A Preliminary Study on Mandarin-Hakka neural machine translation using small-sized data

999

Authors

nan

Abstract

AbstractIn this study, we implemented a machine translation system using the Convolutional Neural Network with Attention mechanism for translating Mandarin to Sixan-accent Hakka. Specifically, to cope with the different idioms or terms used between Northern and Southern Sixan-accent, we analyzed the corpus differences and lexicon definition, and then separated the various word usages for training exclusive models for each accent. Besides, since the collected Hakka corpora are relatively limited, the unseen words frequently occurred during real-world translation. In our system, we selected suitable thresholds for each model based on the model verification to reject non-suitable translated words. Then, by applying the proposed algorithm, which adopted the forced Hakka idioms/terms segmentation and the common Mandarin word substitution, the resultant translation sentences become more intelligible. Therefore, the proposed system achieved promising results using small-sized data. This system could be used for Hakka language teaching and also the front-end of Mandarin and Hakka code-switching speech synthesis systems.

Keywords

nan

Full Content

運用少量語料於漢字轉客文字之類神經機器翻譯系統初步探討 A Preliminary Study on Mandarin-Hakka neural machine translation using small-sized data 洪翌翔 Yi-Hsiang Hung, 黃奕欽 Yi-Chin Huang 國立屏東大學電腦科學與人工智慧學系 Department of Computer Science and Artificial Intelligence National Pingtung University gbaian10@gmail.com, ychuangnptu@mail.nptu.edu.tw 摘要 在本研究中,我們利用注意力機制 (Atten- tion) 與卷積 (Convolution) 模型的架構來 實作一套中文轉四縣腔客文的機器翻譯系 統。其中,為了解決南北四縣腔的常用詞 差異問題,我們透過語料的統計整理與詞 典的定義方式,將兩種腔調的差異用法獨 立出來,並分別訓練翻譯模型。 此外,為了解決客語語料數量稀少而導致 翻譯時遇到未知詞的狀況,在我們的模型 中,透過實驗的驗證尋找適當的閥值以拒 絕掉不適合的翻譯結果,並透過中文詞的 替換以及客文常用詞的強制斷詞方式,讓 最終的翻譯句獲得更佳的結果。最終,本 研究所開發的系統可在少量語料下達到不 錯的翻譯結果,並可應用於在地化的客語 教學以及作為中客文夾雜之語音合成系統 的前端部分。 Abstract In this study, we implemented a machine translation system using the Convolutional Neural Network with Attention mechanism for translating Mandarin to Sixan-accent Hakka. Specifically, to cope with the dif- ferent idioms or terms used between North- ern and Southern Sixan-accent, we ana- lyzed the corpus differences and lexicon definition, and then separated the various word usages for training exclusive models for each accent. Besides, since the collected Hakka corpora are relatively limited, the unseen words fre- quently occurred during real-world transla- tion. In our system, we selected suitable thresholds for each model based on the model verification to reject non-suitable translated words. Then, by applying the proposed algorithm, which adopted the forced Hakka idioms/terms segmentation and the common Mandarin word substitu- tion, the resultant translation sentences be- come more intelligible. Therefore, the pro- posed system achieved promising results using small-sized data. This system could be used for Hakka language teaching and also the front-end of Mandarin and Hakka code-switching speech synthesis systems. 關鍵字:神經機器翻譯、中文翻譯客文、南 北四縣腔 Keywords: Neural Machine Transla- tion, Mandarin to Hakka translation, North- ern/Southern Sixian-accent 1 緒論 一個語言的傳承與推廣可以經由聽、說、讀、 寫四個部份,而類似客家語、閩南語這種地方 方言很容易出現會聽會說但卻不會讀文字或 拼音和完全不會寫的窘境,而這樣就容易導致 一個語言最後容易只能口耳相傳,導致自學不 易。所以如何把一句想說的話從中文轉成客文 並能唸出就是一個問題。本文主要在研究將中 文翻譯成四縣腔客語的方法,並在細分成南四 縣腔與北四縣腔。 客家語是台灣地方方言中使用量第二多的 語言,僅次於閩南語。而台灣客家語又可分 成各種腔調,依照使用比例由高至低分別 為四縣腔、海陸腔、大埔腔、饒平腔、詔安 腔 (WillPete, 2022),其中四縣腔是台灣所有 客家語腔調中使用率最高的,且例如大眾運輸 中的廣播系統使用的客語腔調正是四縣腔,故 母語非客語者通常會選擇四縣腔做第一個選 擇。四縣腔又因各地區不同並隨著時間的發展 差異,又可分為北四縣腔與南四縣腔。北四縣 腔的使用人口主要分佈在苗栗多數鄉鎮,以及 新竹和桃園的部份鄉鎮;南四縣腔的使用人口 主要分佈在高雄和屏東的六堆地區 (臺灣教育 部, 2018)。 雖然南北四縣兩腔調存在在部份使用的詞彙 不同,或者音韻上差異,但基本上兩腔調同屬 四縣腔,所以日常中大致上是可以直接進行溝 通不會有太大問題。此處將舉兩個簡單的句子 當作範例參考兩腔調的用詞差異,如表1。 The 34th Conference on Computational Linguistics and Speech Processing (ROCLING 2022) Taipei, Taiwan, November 21-22, 2022. The Association for Computational Linguistics and Chinese Language Processing 307 中文句子 外面很涼 冬至吃湯圓 北四縣翻譯 外背當涼 冬節食雪圓仔 南四縣翻譯 外背蓋涼 冬至食圓粄仔 Table 1: 南北四縣翻譯差 從表1也可看出南北四縣腔整體句子架構高 度相似,只有部份用詞上有差別,例如上述例 子中的「湯圓」,北四縣翻譯成「雪圓仔」,南 四縣翻譯成「圓粄仔」。除了句子架構相似之 外,南北四縣腔所使用的拼音系統也相同 1, 所以多數語料都是可直接共用,但如果要做出 兩者差異,則必須將兩者不同之處的透過分析 與設計語料,並經由訓練機器翻譯模型使其產 生不同腔調的翻譯。 近年來由於機器學習竄紅,而在機器翻譯領 域中應用這類的方法稱為神經機器翻譯 (Neu- ral Machine Translation,NMT),本論文將利 用神經機器翻譯來處理中文文字轉換為客文文 字的問題。 本篇論文的架構如下:第一章為緒論,描述 研究背景,其中包含南北四縣腔的差異,以及 將使用深度學習方法來解此翻譯問題。第二章 為相關研究,說明在機器翻譯上別人有使用哪 些方法,各有什優缺點。第三章為語料庫,詳 細描述使用了哪些語料庫,各有多少資料量, 並對這些資料分別做了哪些處理以符合自身 研究的要求。第四章為研究方法,說明以使用 Fairseq-CNN 作為基礎,並用何種方法解決在 資料量稀疏的情況下處理未知詞的問題。第五 章為實驗結果分析。第六章為本文的結論。 2 相關研究 機器翻譯是用電腦將文字從一種語言翻譯成 另一種語言的過程,而無需額外的人力。機器 翻譯從過去需要語言學家來制定各種規則來逐 字翻譯,到後來開始使用大量資料來做統計翻 譯,最後演變到現在的神經機器翻譯不再是簡 單的逐字翻譯,機器會分析所有文字元素並識 別字詞間的相互影響方式,並將原始語言透過 神經網路轉換成目標語言。 神經網路機器翻譯通常是基於序列到序 列 (sequence-to-sequence,seq2seq) 做處理, seq2seq 主要就是分成編碼器 (encoder) 和解 碼器 (decoder) 兩部份,編碼器負責將來源語 言編碼成一個具有表示原本句子意義的隱含向 量做訓練,最後在經由解碼器解碼成目標語言 的文字。 1南北四縣腔的聲調都使用去聲 55、陰平 24、陽平 11、上聲 31、陰入 2、陽入 5,其他腔調例如海陸腔則 不同 2.1 機器翻譯 較早期的機器翻譯方法有以下幾種,第一種方 法是基於規則的字對字機器翻譯 (Rule-based Machine Translation,RBMT) (Forcada et al., 2011),這種方法主要預先準備雙語字典、一 些單字的規則 (例如-er、-est 等等字尾含意), 這種翻譯通常蛤需要該語言的專業語言學家 制定各種詳細的規則,但一些語法結構上的 問題依然很容易無法處理很多狀況。例如:臺 灣大學陳信希 (Lin and Chen, 1999) 等老師的 中文到台語翻譯、聯合大學黃豐隆教授 (Lin et al., 2014) 等老師的中文到客語、Charoen- pornsawat 等人的英文到泰文 (Charoenporn- sawat et al., 2002) 都使用此類方法。 譯第 二 種 方 法 是 基 於 例 子 的 機 器 翻 (Example-Based Machine Translation, EBMT) (Somers, 1999), (Chunyu et al., 2002),這種方法主要預先準備好大量已經翻 譯好的句子來提供比對,例如句子「我今天在 學校吃中餐」,如果現在要翻譯的句子成「我 今天在學校吃晚餐」,經過比對後發現與前面 中餐的句子最為相近,只有一個詞有差異,則 將不一樣的詞替換掉後就翻譯完成了。這種 方法的優點在於只要準備好大量已經翻譯好 的句子就能夠更容易翻譯出好的結果,而不用 像 RBMT 一樣設計了多個規則,但還是有無 法處理的狀況,然而此方法若要處理不存在資 料庫中的句子時,依然會出現不合理的翻譯結 果。例如:Ayu (Ayu and Mantoro, 2011) 等 人使用 EBMT 將印尼語翻譯成英語。 第三種方法就是統計機器翻譯 (Statistical Machine Translation,SMT) (Koehn, 2009), 相較於前兩種方式是透過語言學的知識設計 或定義相關的規則,而產生翻譯的結果,統 計式機器翻譯是採用大量語料庫來進行機器 學習,這種方法只要有大量資料就可進行機 器翻譯,這種翻譯可統計詞的用量和基於前 後文字來做的各種不同翻譯,例如 bank 是銀 行還是河岸,可通過前後文來做個推測。而有 不少的統計機器翻譯都是使用基於短語的機 器翻譯 (Zens et al., 2002),例如:Google 在 2006 年 4 月時候的宣佈未來 Google 翻譯將改 使用 SMT 的翻譯系統 2。基於短語 (Phrase- Based) 的翻譯結果相較於較早期的基於規則 (Rule-Based) 的方法已經進步許多,然而因為 是以短語為單位在做翻譯,這些短語拼湊出來 的句子翻譯依然不夠自然。 近年來開始出現神經機器翻譯 (Neural Ma- chine Translation,NMT) (Bahdanau et al., 2https://ai.googleblog.com/2006/04/statistical- machine-translation-live.html The 34th Conference on Computational …

Content truncated to 500 words

Labeled Text

AbstractIn this study, we implemented a machine translation system using the Convolutional Neural Network with Attention mechanism for translating Mandarin to Sixan-accent Hakka. Specifically, to cope with the different idioms or terms used between Northern and Southern Sixan-accent, we analyzed the corpus differences and lexicon definition, and then separated the various word usages for training exclusive models for each accent. Besides, since the collected Hakka corpora are relatively limited, the unseen words frequently occurred during real-world translation. In our system, we selected suitable thresholds for each model based on the model verification to reject non-suitable translated words. Then, by applying the proposed algorithm, which adopted the forced Hakka idioms/terms segmentation and the common Mandarin word substitution, the resultant translation sentences become more intelligible. Therefore, the proposed system achieved promising results using small-sized data. This system could be used for Hakka language teaching and also the front-end of Mandarin and Hakka code-switching speech synthesis systems.

Publication Details

Paper ID:
999
Year:
2022
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan