<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>NMT based Tamil Translation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>IIIT Bhubaneswar</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>India</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>DTU Delhi</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>India</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>IIIT Delhi</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>India adityapathak.cse@gmail.com</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>himanshuchoudhary bt</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>@dtu.ac.in</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>rajivratn@iiitd.ac.in</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>A huge amount of valuable resources is available on the web in English, which are often translated into local languages to facilitate knowledge sharing among local people who are not much familiar with English. However, translating such content manually is very tedious, costly, and time-consuming process. To this end, machine translation is an e cient approach to translate text without any human involvement. Neural machine translation (NMT) is one of the most recent and e ective translation technique amongst all existing machine translation systems. In this paper, we apply NMT for English-Tamil and Hindi-Tamil language pair. We propose a novel neural machine translation technique using pre-trained subword embeddings (BPEmb) to develop an e cient translation system that overcomes the OOV (Out Of Vocabulary) problem for languages which do not have much translations available online. We use the BLEU score for evaluating the system performance. We got the 26.97% Precision,37.98% Recall for English to Tamil and 25.18% Precision and 27.24% Recall for Tamil to Hindi respectively.</p>
      </abstract>
      <kwd-group>
        <kwd>Neural Networks</kwd>
        <kwd>Machine Translation</kwd>
        <kwd>Attention mech- anism</kwd>
        <kwd>Word Embeddings</kwd>
        <kwd>Byte-Pair-Encodding</kwd>
        <kwd>BPEmb</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Big countries such as India and China have several languages which change by
regions. For instance, India has 23 constitutionally recognized o cial languages
(e.g., Hindi, Tamil, and Panjabi) and several hundreds uno cial local languages.
Despite Indian population is approximately 1.3 billion, only approximately 10%
of them English speak English. Some studies say that out of these 10% English
speakers only 2% can speak, write, and read English well, and rest 8% can merely
understand simple English and speak broken English with an amazing variety
of accents [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Considering a signi cant amount of valuable resources is available
on the web in English and most people in India can not understand it well, it
is essential to translate such content in to local languages to facilitate people.
Sharing information between people is necessary not only for business purposes
but also for sharing their feelings, opinions, and acts. To this end, translation
plays an important role in minimizing the communication gap between di erent
people. Considering the vast amount of information, it is not feasible to translate
the content manually. Hence, it is essential to translate text from one language
(say, English) to another language (say, Tamil) automatically. This process is
also known as machine translation.
      </p>
      <p>There are many challenges in machine translation for Indian languages. For
instance, (i) the size of parallel corpora and (ii) di erences amongst languages,
mainly the morphological richness and word order di erences due to syntactical
divergence are two of the major challenges. Indian languages (IL) su er both of
these problems, especially when they are being translated from English. There
are only a few parallel corpora for English and Indian languages. Moreover,
Indian languages such as Tamil di er from English in word order as well as in
morphological complexity. For instance, English has Subject-Verb-Object (SVO)
whereas Tamil has Subject-Object-Verb (SOV). Moreover, English is a fusional
whereas Tamil is agglutinative languages. While syntactic di erences contribute
to di culties of translation models, morphological di erences contribute to data
sparsity. We attempt to address both issues in this paper. Since both the
languages (Tamil and Hindi) are known for its morphologically richness, that makes
the task much more di cult to work.</p>
      <p>
        Though much work is being done on machine translation for foreign and
Indian languages but apart from foreign languages most of works on Indian
languages are limited to conventional machine translation techniques. We observe
that the techniques like word-embedding along with Byte-pair-encoding (BPE)
are not applied on many Indian languages which have shown a great
improvement in natural language processing. Thus, in this paper, we apply a neural
machine translation technique (torch implementation) with pre-trained subword
embeddings [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Especially, we work on English-Tamil and Tamil-Hindi language
pair as these are the most di cult language pair [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] to translate due to
morphologically richness of Tamil and Hindi language. We obtain the data from VPT-IL
and evaluate using precision and recall we believe that we got better results than
conventional machine translation techniques on Hindi and Tamil language. Our
work can also be applied to other Indian language pairs too.
      </p>
      <p>Main contributions of our work are as follows:
{ This is the rst work to apply BPE along with pre trained word embedding
on Indian language pair English-Tamil and Hindi-Tamil with NMT
technique.
{ We achieve comparable accuracy with a simpler model in less training time
rather then training on deep and complex neural network which requires
much time to train.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Methodology</title>
      <p>In this study, we present a neural machine translation technique using
BytePair-Encoding along with pre trained word embedding to develop an e cient
translation system, called MIDAS translator that overcomes the OOV (Out Of
Vocabulary) problem for languages which do not have much translations
available online. Thus, rst, we provide an overview of neural machine translation,
attention model, word embedding, and Byte Pair Encoding. Next, we present
the framework of our MIDAS translator.
2.1</p>
      <sec id="sec-2-1">
        <title>Neural Machine Translation Overview</title>
        <p>
          Neural Machine translation is a technique that is based on neural networks and
the conditional probability of translated sentence from the source language to
target sentences [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. In the following sub-sections we will provide an overview
of sequence to sequence architecture and attention model that are used in our
proposed MIDAS translator.
        </p>
        <p>Sequence to Sequence Architecture Sequence to sequence architecture is
basically used for response generation whereas in machine translation models it
is used to nd the relationship between two di erent language pairs. It consists
of two parts, an encoder and a decoder. The encoder takes the input from source
and the decoder generates the output based on encoding vector and previously
generated words. Assume A be the source sentence and B be a target sentence.
The encoder converts the source sentence a1; a2; a3:::; an into vector of xed
dimensions and the decoder outputs word by word using conditional probability.
Here, A1; A2; :::; AM in the equation are the xed size encoded vectors. Using
chain rule, the Eq. 1 is converted to the Eq. 2.</p>
        <p>P (B=A) = P (BjA1; A2; A3; :::; AM )</p>
        <p>
          P (BjA) = P (bijb0; b1; b2; :::; bi 1; a1; a2; a3; :::; am)
While decoding, next word is predicted using previously predicted word vectors
and source sentence vectors in Eq. 1. Each term in the distribution is represented
with a softmax over all the words in the vocabulary.
(1)
(2)
Attention Model In a basic encoder-decoder architecture, encoder reads the
whole sentence, memorizes it and store it in the nal activation layer, then the
decoder network generates the target translation. This architecture works quite
well for short sentences, so we might achieve a relatively high BLEU score,
but for very long sentences, maybe longer than 30 or 40 words, the performance
degrades. Using attention1 mechanism with a basic encoder-decoder architecture
is a solution for that. It translates similar to humans by looking at part of the
sentence at a time. The mechanism decides how much attention should be paid
to a particular word while translating the sentence. The mechanism is shown
in Fig. 2. The Encoder generates the attention vectors h1; h2; h3::::::ht from the
inputs A1; A2; A3At. Then, context vector Ci is calculated using concatenation
of these vector for each output time step. Then Using the context vector Ci
hidden state Si and previously predicted words, decoder generates the softmax
output Bi.
Word Embedding Word embedding is a way of representing words on a vector
space where the words having same meaning have similar vector representations.
Each word from vocabulary is represented in hundreds of dimensions. Normally
pre-trained word embeddings are used and with the help of transfer learning
words from vocabulary are converted to vector [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. In our model, we also tried
1 https://hackernoon.com/attention-mechanism
FastText word vectors2 to convert English, Tamil and Hindi vocabulary into a
300-dimensional vector.
        </p>
        <p>
          Byte Pair Encoding BPE [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] is a simple data compression technique. It
replaces most frequent pair bytes in a sequence with single unused byte. We use
this algorithm for word segmentation. By merging frequent pairs of bytes we
merge charters or character sequences [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. NMT symbols interpretative as
subwords units and networks can translate and make the new word on the basis of
sub-words.
        </p>
        <p>BPEmb Subword embeddings is collection of both Byte-Pair-encodding and
Word embeddings.In our model we used pre-trained subword embeddings which
was trained on Wikipedia. Subwords allow guessing the meaning of unknown
/ out-of-vocabulary words and Byte-Pair Encoding gives a subword
segmentation that is often good enough, without requiring tokenization or morphological
analysis. We used BPEmb with 2000 merge operations and 50 dimension vectors
and then apply it on train test and validation data for both source and target.
BPE helped in compound splitting and su x, pre x separation which is used
for creating new words of English Tamil and Hindi language.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>MIDAS Translator</title>
        <p>We tried various models to get a better intuition on how parameter tuning
along with di erent techniques a ects on Indian language pair. Our rst model
architecture consists of 2 layer Bi-directional LSTM encoder and 2 layers LSTM
decoder of 50 dimensions for both source and target. First we tried SGD
optimization method, Luong attention with a dropout (regularization) of 0.3, and
learning rate 1.0. Secondly, we changed the optimization method to Adam and
attention to Bahdanau with the learning rate of 0.001. We got our best
results with a BPE vocabulary size of 2000 with 2 Layer Bi-directional
encoderdecoder, Adam optimization with a learning rate of 0.001, Bahdanau attention,
and BPEmb with the dimension of 50. We used GPU (Nvidia GeForce GTX
1080) for the training of di erent models which increase the computation speed.
3
3.1</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Evaluation</title>
      <sec id="sec-3-1">
        <title>Evaluation Metric</title>
        <p>The BLEU score or bilingual evaluation under study is a method to measure the
di erence between machine and human translations 8. The approach works by
counting and matching n-grams in result translation to n-grams in the reference
text, where unigram would be each token and a bigram comparison would be
each word pair and so on. The comparison is made regardless of word order.
This method is a modi cation of a simple precision method.
2 https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md</p>
      </sec>
      <sec id="sec-3-2">
        <title>Precision and Recall</title>
        <p>In pattern recognition, information retrieval and binary classi cation, precision
(also called positive predictive value) is the fraction of relevant instances among
the retrieved instances, while recall (also known as sensitivity) is the fraction
of relevant instances that have been retrieved over the total amount of relevant
instances. Both precision and recall are therefore based on an understanding and
measure of relevance.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Dataset</title>
        <p>We used the datasets obtained from VPT-IL. After preprocessing and splitting
it to train and validation, our nal dataset contains 1223 English-Tamil training
corpus and 200 validation corpus. For Hindi to tamil we used 1772 training
corpus and 200 validation corpus as provided by the VPT-IL organization. The
data used is encoded in UTF-8 format.
3.4</p>
      </sec>
      <sec id="sec-3-4">
        <title>Results</title>
        <p>We got the following results after training on the 1223 English-Tamil training
corpus with 200 validation corpus which were splitted from 1443 corpus and 1772
Hindi to tamil training corpus and 200 validation corpus which were splitted from
1992 corpus as provided by the VPT-IL Organization.</p>
        <p>Model % Precision % Recall
English-Tamil 26.97 37.98
Tamil-Hindi 25.18 27.24</p>
        <p>Table 1. Test Score for Our Model
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Related Work</title>
      <p>The similar work is given in the paper 9. In this paper the Phrase-based and
Hierarchical models trained after morphological preprocessing using neural machine
translation. In paper 10 model is trained after su x separation and Compound
Splitting. Di erent models were also tried for the same task and achieved a good
result on their respective dataset as given in 11. We analyze that morphological
preprocessing, su x separation and compound splitting can be overpass by
using Byte-Pair-Encoding and produce similar or even better translation without
making the model complex.</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion &amp; Future Work</title>
      <p>In this paper, we applied NMT to two most di cult language pairs
EnglishTamil and Tamil-Hindi. Since amount of data highly a ects the neural network
models, hence we got the comparable results. We believe that our model will
perform much better on larger datasets and pre-trained subword embeddings
will performs better than complex translation techniques on Indian languages.
We can explore the possibility of using above techniques for various English
Indian language translation. In future, we would also like to employ machine
translation in detecting o ensive languages from code-switched languages too
12.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>1. What percentage of people in India speak English ? https://tinyurl.com/indianlanguageStats</mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Zdenek</surname>
            <given-names>abokrtsk</given-names>
          </string-name>
          ,
          <source>LoganathanRamasamy OndrejBojar</source>
          .
          <article-title>Morphological processing for English-Tamil statistical machine translation</article-title>
          .(
          <year>2012</year>
          ):
          <fpage>113</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Benjamin</given-names>
            <surname>Heinzerling</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Michael</given-names>
            <surname>Strube</surname>
          </string-name>
          .
          <article-title>Toward the next generation of recommender systems: BPEmb: Tokenization-free Pre-trained Subword Embeddings in 275 Languages</article-title>
          .
          <source>Proceedings of the Eleventh International Conference on Language Resources and Evaluation</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Revanuru</surname>
          </string-name>
          , Karthik and Turlapaty, Kaushik and Rao,
          <source>Shrishas: Neural Machine Translation of Indian Languages.Proceedings of the 10th Annual ACM India Compute Conference on ZZZ</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>11</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Cho</surname>
          </string-name>
          , Kyunghyun and Van Merrienboer, Bart and Bahdanau, Dzmitry and Bengio, Yoshua,
          <year>2014</year>
          , December.
          <source>On the properties of neural machine translation: Encoder-decoder approaches: arXiv preprint arXiv:1409.1259 technology.</source>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Gage</surname>
          </string-name>
          , Philip.,
          <year>1994</year>
          .
          <article-title>A new algorithm for data compression. The C Users Journal</article-title>
          , p.
          <fpage>23</fpage>
          -
          <lpage>38</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Sennrich</surname>
            , Rico and Haddow, Barry and Birch,
            <given-names>Alexandra.,</given-names>
          </string-name>
          <article-title>Neural machine translation of rare words with subword units:</article-title>
          ,
          <source>arXiv preprint arXiv:1508.07909</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Papineni</surname>
          </string-name>
          , Kishore and Roukos, Salim and Ward, Todd and Zhu,
          <string-name>
            <surname>Wei-Jing</surname>
          </string-name>
          ,
          <year>2002</year>
          .
          <article-title>BLEU: a method for automatic evaluation of machine translation:, Proceedings of the 40th annual meeting on association for computational linguistics</article-title>
          ,pp.
          <fpage>311</fpage>
          -
          <lpage>318</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Hans</surname>
            , Krupakar and Milton,
            <given-names>RS</given-names>
          </string-name>
          ,
          <year>2016</year>
          ,
          <string-name>
            <surname>Neural</surname>
          </string-name>
          <article-title>Machine Translation for Low Resource Languages using Bilingual Lexicon Induced from Comparable Corpora</article-title>
          .
          <source>Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Student Research Workshop</source>
          (pp.
          <fpage>112</fpage>
          -
          <lpage>1197</lpage>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Patel</surname>
          </string-name>
          , Raj Nath and Pimpale, Prakash B and others,
          <year>2017</year>
          , . MTIL17:
          <article-title>English to Indian Langauge Statistical Machine Translation</article-title>
          .
          <source>arXiv preprint arXiv:1708</source>
          .
          <fpage>07950</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Pathak</surname>
          </string-name>
          , Amarnath and Pakray, Partha.,
          <year>2017</year>
          .:
          <article-title>Neural Machine Translation for Indian Languages</article-title>
          .
          <source>Journal of Intelligent Systems.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Mathur</surname>
          </string-name>
          , Puneet and Shah, Rajiv and Sawhney, Ramit and Mahata, Debanjan.,
          <year>2018</year>
          .
          <article-title>Detecting O ensive Tweets in Hindi-English Code-Switched Language</article-title>
          .
          <source>Proceedings of the International Workshop on Natural Language Processing for Social Media</source>
          , pp.
          <fpage>18</fpage>
          -
          <lpage>26</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>