<!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>IIITV@INLI-2018 : Hyperdimensional Computing for Indian Native Language Identi cation?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ashish Patel</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pratik Shah</string-name>
          <email>pratikg@iiitvadodara.ac.in</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Gujarat</institution>
          ,
          <country country="IN">India</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Indian Institute of Information Technology</institution>
          ,
          <addr-line>Vadodara</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Native Language Identi cation (NLI) is the task of determining user's native language based on their second language. NLI is an important task that has applications in di erent areas such as social media analysis, authorship identi cation, second language acquisition, and forensic investigation. In this paper, we propose to use Hyperdimensional Computing (HDC) as supervised learning for identifying Indian Native Languages from the user's social media comments written in English. HDC represents language features as high dimensional vectors called hypervectors. Initially, comments are broken in character bi-grams and tri-grams which are used for generating comment hypervectors. These hypervectors are further combined to create di erent language pro le vectors. Pro le hypervectors are then used for classi cation of test comments. The proposed approach was validated on 70% of training instances with 65.13% of accuracy. The accuracy of classi cation on the test set for bi-gram and tri-gram based feature encoding is 29.2% and 31.5% respectively.</p>
      </abstract>
      <kwd-group>
        <kwd>Native Language Identi cation puting</kwd>
        <kwd>n-gram</kwd>
        <kwd>Indian Languages</kwd>
        <kwd>Hyperdimensional Com-</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>The diversity of languages used in India has given rise to a large number of
challenging problems, both for the linguist and for the computer scientist. The
2001 Indian census recorded 30 languages which were spoken by more than a
million native speakers in India. English plays prominent role in every sector
especially in higher education in India. It is certainly the most preferred
language for reading and in o cial communication. The number of second or third
language speakers of English is increasing day by day. In uence of their regional
and native languages is observed in their usage of English. It is possible to
identify the native speaker based on their English pronunciation and accent. But,
? Indian Native Language Identi cation (INLI) is a shared task held in conjunction
with FIRE 2018. Aim of the task is to identify Indian language from user's social
media comments written in English.
it is challenging to identify the native users based on their written comments
in their non-native language. Native Language Identi cation (NLI) is important
for a number of applications, such as authorship identi cation, forensic
analysis, tracing linguistic in uence in multi-author texts, and to support Second
Language Acquisition research. It can also be used in educational applications
such as developing grammatical error correction systems. The extensive use of
social media and online interactions can be a reason of violent threat, which is
a common issue faced by commenters. If a comment or a post poses any type
of threat, then identifying the native language of the person will be one of the
signi cant feature in nding the source.</p>
      <p>
        In the INLI track [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the task is to identify the native language of the user,
based on their social media comments in the English language. Six Indian
languages namely Tamil (TA), Hindi (HI), Kannada (KA), Malayalam (MA),
Bengali (BE) and Telugu (TE) are considered for this shared task.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        NLI challenge has gained a lot of attention and has been part of shared tasks
in various events [
        <xref ref-type="bibr" rid="ref2 ref3 ref4">2, 3, 4</xref>
        ] worldwide. This challenge can be broken into two
subtasks: feature selection and classi cation. Di erent techniques are used to extract
features from non-native language in terms of topic biases, spelling usage, and
frequency of word usage, etc. Most of the researcher have considered unigrams,
bigrams, and character n-grams [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], POS-tagged n-grams [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] as features.
Current state-of-the-art uses Support Vector Machine (SVM) [
        <xref ref-type="bibr" rid="ref6 ref7">6, 7</xref>
        ], Multinomial
Bayes [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], Random Forest [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], Logistic Regression [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and feed-forward neural
network [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] for classi cation. Authors in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] have discussed a possible use of
HDC for language identi cation.
2.1
      </p>
      <p>
        Hyperdimensional Computing
The architecture of a computer that is in use since last 70 years, has been a
milestone in mechanizing arithmetic of symbols. E orts are reported in the form
of architectural proposals starting from the representation of entities, memory,
and processing units for computing [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Convenience and robustness of two value
(binary) systems, in terms of realization, has been instrumental in its widespread
use. It has been agreed upon that in the current state of evolution of the human
brain, adding or multiplying large numbers is a di cult task, barring a few
exceptions. At the same time, recognizing objects, using language to communicate
and being able to reason are some tasks in which humans are e cient at [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In
contrast, the computer is good at the former task whereas it needs considerable
e orts and hand-holding to perform the later ones. The human brain contains
large circuits having billions of neurons and synapses. It is believed that the
concepts and entities are being stored distributively in such circuits [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Inspired
by the architecture of the brain, arti cial neural networks have been designed
and have gained considerable recognition in the eld of machine learning [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>
        Properties of High dimensional spaces such as holistic representation,
oneshot learning, and robustness against noise show similarity with the brain
behavior. Instead of computing with numbers, brain-inspired hyperdimensional
computing (HDC) emulates computing with hypervectors. In HDC the entities
are represented using high dimensional vectors called hypervectors. In
literature, there are di erent representation schemes proposed for HDC, for example
HRR [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], BSC [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], Bipolar Spatter Code [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], MBAT [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] etc. In this paper, we
have used Bipolar spatter code hypervectors typically comprises of randomly
distributed +1's and -1's. Basic algebraic operations on hyperdimensional vectors
are binding (multiplication), superposition (addition) and rotation ( ). Binding
of two hypervectors is an element-wise multiplication where as superposition is
an element-wise addition. The addition preserves the similarity between added
hypervectors and resultant hypervector. Multiplication binds two hypervectors
in one and maps it to a hypervector in hyperspace which is nearly orthogonal
to multiplied hypervectors. Rotation also generates a nearly orthogonal vector.
Usually the similarity between two hypervectors is calculated by using cosine
distance.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Task Description</title>
      <p>INLI is a multiclass classi cation task. INLI@FIRE2018 shared task focuses
on identifying native languages namely Bengali, Hindi, Kannada, Malayalam,
Tamil, and Telugu, from XML les. Table 1 describes the training data that is
used for the task. Training XML les are annotated as per their native language.
These XML les contain extracted social media comments in English.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Proposed Approach</title>
      <p>
        For Indian native language identi cation task, training instances of six languages
are available. For each language, the number of training instances (user
comments) are mentioned in Table 1. It is assumed that the comments are from
non-native English users. Since the comments are scribed in English (Latin)
alphabets, a preprocessing step sets rid of special characters. Preprocessing
involves removal of non-English characters, special characters and converting
the text in lowercase (alphabets). This ensures that the resulting string will
contain twenty-seven di erent symbols in total, i.e. `a,...,z' and a ` ' - blank
space. Each of these 27 symbols is assigned a hypervector, i.e. a bipolar
spatter code. Each hypervector is a random string of +1's and -1's of length 10000.
It is easy to show that with very high probability the generated 10k
dimensional hypervector will have equal number of +1's and -1's. Moreover the mean
of bitwise distance between any two randomly generated hypervectors will be
5000 bits. So the generated 27 hypervectors are all almost equidistant from
each other with almost same number of 1's and -1's For more on bipolar
spatter codes, refer to [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. In the training phase, we scan through comments
sequentially and create a pro le hypervector for a given language class. For a
given comment, we nd out overlapping character tri-grams (or bi-grams) and
for each of the tri-gram, we generate a hypervector from the character
hypervectors as shown in the Fig. 1. Let H : fa; b; : : : ; z; g ! f 1; 1g10000, be a
function that maps a symbol to the hyperdimensional space and, the rotation
: f 1; 1g10000 ! f 1; 1g10000 be de ned as a function corresponding to a left
circular shift operation on strings. Given a trigram \xyz", the corresponding
trigram hypervector is H(x) H(y) z, where is called the binding operation
which in case of bipolar spatter code is element-wise multiplication. Finally, all
the tri-gram hypervectors of a given class are superimposed to generate a class
pro le vector (language hypervector). Superposition of hypervectors is de ned
as the element-wise addition operation. For more details on the bipolar spatter
codes and related algebra, refer to [
        <xref ref-type="bibr" rid="ref15 ref17">15,17</xref>
        ]. In this proposed approach HDC works
as supervised learning algorithm and considers bi-grams/tri-grams as features.
The occurrence of bi-grams/tri-grams in a language is a reasonable feature of
that language. The language hypervector is a superposition (addition) of all
bigram/tri-gram hypervectors occurring in the language and it is similar to all
hypervectors added together.
      </p>
      <p>Algorithm 1 shows the training procedure, which takes comments (training
set) as input, computes hypervectors for tri-grams and generates a class
hypervector for each language. Tri-gram hypervector is generated by adding twice
rotated hypervector of rst character, once rotated hypervector of second
character and third character's hypervectors. Similarly we can create class hypervector
using bi-gram.</p>
      <p>Algorithm 2 is used for predicting the class of test instances. The query
hypervector (Q) is generated by similar process as the language hypervector is
generated, i.e. superposition of tri-gram hypervectors corresponding to test/query
instance. This query hypervector is compared with all the language
hypervectors. The similarity between bipolar hypervectors is calculated using the cosine
of the angle between them. The language which has the highest similarity (lowest
angle) with query hypervector is written in the output le with the test dataset
name.</p>
    </sec>
    <sec id="sec-5">
      <title>Results and Discussion</title>
      <p>For validation of classi cation algorithm, we have considered 70% as training
and 30% as validation instances for given training dataset. Fig. 2. shows the
normalized confusion matrix corresponding validation dataset. Data is
crossvalidated 10 times and average accuracy reported is 65.13%.</p>
      <p>Normalized confusion matrix
BE 0.48 0.25 0.00 0.16 0.07 0.05</p>
      <p>Run1 and Run2 results are corresponding to the bi-gram and the tri-gram
language pro le vectors respectively. The results are presented in Table 2 and
Table 3 in which Table 2 and 3 represent result of TestSet-1 and TestSet-2.
TestSet-1 is used for comparing results with previous year's shared task. In
Run1 (bi-gram) 32.4% and Run2 (tri-gram) 32.1% accuracy is reported. For
Run1 and Run2 for Testset-2 accuracy is 29.2% and 31.5% respectively. These
experiments are conducted on 3.6 GHz Intel Core i7 PC with 4 GB of RAM. The
python implementation of 3-gram training algorithm recorded 2.81667 minutes.
The validation results di er from test results primarily due to the presence of
unseen tri-gram (bi-gram) in the test data while training phase.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>In this paper, we have proposed HDC approach for Indian Native Language
Identi cation. The results are encouraging and can be enhanced further. Features
selected for classi cation are tri (bi)-grams which are easy to aggregate. Since
the e orts were put on proof of concept of HDC based classi cation, the other
aspects of feature selection and e cient implementations were not addressed in
this work. We believe that by deleting or rewriting lexical terms such as pls
(please), u (you), y (why), r (are), sry (sorry), fyi (for your information), etc.
will improve the accuracy of the system. We also believe that punctuation marks
may have a role to play in natural language identi cation. In future, we would
like to include such features in HDC framework. We also would like to compare
the proposed approach with state of the art methods in term of training e ort,
precision, recall and accuracy.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Anand</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Barathi</given-names>
            <surname>Ganesh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Soman</surname>
          </string-name>
          <string-name>
            <surname>K</surname>
          </string-name>
          , P.:
          <article-title>Overview of the INLI@FIRE2018 Track on Indian Native Language Identi cation</article-title>
          .
          <source>In: In workshop proceedings of FIRE</source>
          <year>2018</year>
          , FIRE-2018, Gandhinagar, India, December 6-9,CEUR Workshop Proceedings.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Joel</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Daniel</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aoife</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>A report on the rst native language identi cation shared task</article-title>
          .
          <source>In: In Proceedings of the Eighth Workshop on Innovative Use of NLP for Building Educational Applications</source>
          . (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Malmasi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Evanini</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aoife</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tetreault</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pugh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hamill</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Napolitano</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qian</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>A Report on the 2017 Native Language Identi cation Shared Task</article-title>
          .
          <source>In: Proceedings of the 12th Workshop on Building Educational Applications Using NLP</source>
          , Copenhagen, Denmark, Association for Computational Linguistics (
          <year>September 2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Anand</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Barathi</given-names>
            <surname>Ganesh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Singh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Soman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Rosso</surname>
          </string-name>
          ,
          <string-name>
            <surname>P.</surname>
          </string-name>
          :
          <article-title>Overview of the INLI PAN at FIRE-2017 track on indian native language identi cation</article-title>
          .
          <source>CEUR Workshop Proceedings</source>
          ,
          <year>2036</year>
          ,pp.
          <fpage>99</fpage>
          -
          <lpage>105</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Mathur</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Misra</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Budur</surname>
          </string-name>
          , E.:
          <article-title>LIDE: language identi cation from text documents</article-title>
          .
          <source>CoRR abs/1701</source>
          .03682 (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Nicolai</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Islam</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Greiner</surname>
          </string-name>
          , R.:
          <article-title>Native language identi cation using probabilistic graphical models</article-title>
          .
          <source>In: 2013 International Conference on Electrical Information and Communication Technology (EICT)</source>
          .
          <article-title>(</article-title>
          <year>2014</year>
          ) 1{
          <fpage>6</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ulmer</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Walsh</surname>
          </string-name>
          , N.:
          <article-title>Native language identi cation from i-vectors and speech transcriptions</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Sari</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fatchurrahman</surname>
            ,
            <given-names>M.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dwiastuti</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>A shallow neural network for native language identi cation with character n-grams</article-title>
          .
          <source>In: Proceedings of the 12th Workshop on Innovative Use of NLP for Building Educational Applications</source>
          . (
          <year>2017</year>
          )
          <volume>249</volume>
          {
          <fpage>254</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Joshi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Halseth</surname>
            ,
            <given-names>J.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kanerva</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Language geometry using random indexing</article-title>
          . In de Barros,
          <string-name>
            <given-names>J.A.</given-names>
            ,
            <surname>Coecke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Pothos</surname>
          </string-name>
          , E., eds.: Quantum Interaction, Cham, Springer International Publishing (
          <year>2017</year>
          )
          <volume>265</volume>
          {
          <fpage>274</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>L.N.D.</given-names>
          </string-name>
          :
          <article-title>Fundamentals of Natural Computing: Basic Concepts, Algorithms,</article-title>
          and Applications. Chapman and Hall/CRC (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Kahneman</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          : Thinking, Fast and
          <string-name>
            <surname>Slow. FARRAR STRAUS</surname>
          </string-name>
          &amp;
          <article-title>GIROUX (</article-title>
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Vapnik</surname>
            ,
            <given-names>V.N.</given-names>
          </string-name>
          :
          <article-title>Statistical Learning Theory</article-title>
          . Wiley-Interscience (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Plate</surname>
            ,
            <given-names>T.A.</given-names>
          </string-name>
          :
          <article-title>Holographic reduced representations</article-title>
          .
          <source>IEEE Transactions on Neural Networks</source>
          <volume>6</volume>
          (
          <issue>3</issue>
          ) (May
          <year>1995</year>
          )
          <volume>623</volume>
          {
          <fpage>641</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Kanerva</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Binary spatter-coding of ordered k-tuples</article-title>
          .
          <source>In: Arti cial Neural Networks | ICANN 96</source>
          . Springer Berlin Heidelberg (
          <year>1996</year>
          )
          <volume>869</volume>
          {
          <fpage>873</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Gayler</surname>
          </string-name>
          , R.W.:
          <article-title>Multiplicative binding</article-title>
          ,
          <source>representation operators &amp; analogy (workshop poster)</source>
          (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Gallant Stephen</surname>
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>O.T.W.</surname>
          </string-name>
          :
          <article-title>Representing objects, relations, and sequences</article-title>
          .
          <source>Neural Comput</source>
          .
          <volume>25</volume>
          (
          <issue>8</issue>
          ) (
          <year>August 2013</year>
          )
          <year>2038</year>
          {
          <fpage>2078</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Kanerva</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Hyperdimensional computing: An introduction to computing in distributed representation with high-dimensional random vectors</article-title>
          .
          <source>Cognitive Computation</source>
          <volume>1</volume>
          (
          <issue>2</issue>
          ) (
          <year>2009</year>
          )
          <volume>139</volume>
          {
          <fpage>159</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>