<!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>Code Mixed Cross Script Question Classification</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Anuj Saini Sapient Global Markets Gurgaon</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Haryana asaini</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>@sapient.com</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>With the growth in our society, one of the most affected aspect of our routine life is language. We tend to mix our conversations in more than one language, often mixing up regional language with English language is a lot more common practice. This mixing of languages is referred as code mixing, where we mix different linguistic constituents such as phrases, proper nouns, morphemes etc. to come up code mixed script. With exponential growth of social media, we are using more and more code mixed cross script for our conversation on Facebook, WhatsApp, or Twitter. On the other hand, the language should be understood by the automated question answering system which is one of the most import application of AI. And now the trend is code mixed languages but current work is around a single language. At FIRE 2016, as a part of Shared Task1 CMCS (Code Mixed Cross Script Question Classification), we have worked on the problem of classify a code mixed question into 9 given classes. Shared Task is focused on Indian regional languages, wherein we worked on BengaliEnglish code mixed cross script questions classification. As scripting used in training data is English only, so all Bengali text was also written using English script only. We have used Machine Learning for question classification and used ensemble based Random Forest algorithm. As it's a code-mixed script, so traditional NLP components may not work well, so worked on a custom solution using own set of features for Classification.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Question Answering</kwd>
        <kwd>Machine Learning</kwd>
        <kwd>Code-Mixing</kwd>
        <kwd>Code switching</kwd>
        <kwd>Classification</kwd>
        <kwd>Random Forest</kwd>
        <kwd>TFIDF</kwd>
        <kwd>Stemming</kwd>
        <kwd>Natural Language Processing</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <p>
        According to Census of India of 2001, India has a total of 122
major languages and 1599 other languages [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. And with the
advancement of technologies and social media, languages are now
getting mixed with other languages. A big chunk of population of
India is bilingual or even trilingual wherein Hindi and English
along with Dravidian Languages are most spoken languages.
Code mixing is defined as mixing of more than one language
syntactically, wherein linguistic constituents such as syntax,
morphology, words/phrases etc. are mixed [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        Social media such as WhatsApp, Facebook[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] etc. are
widely used by most of the audience using mobile phone or smart
devices where communication is more often mix of English and
regional language. Even though autocorrect provide by most of
these devices is in English only. So it’s very common as well as
convenient for users to communicate in code mixed which is easy
and fast to use. Eventually English along with regional language
has becomes an integral part of communication for most of social
media users. There are many words which people use in English
only aapka mobile number kya hai, where no one actually knows
what is corresponding Hindi word to mobile. Even google also
supports code mixed queries and is able to translate and return
results.
      </p>
      <p>
        But one of the next generation systems, automated
question answering systems, are still mostly catering one language
such as English or French. One of the first building blocks for any
question answering system is to understand and classify question.
A question could be of many types such as When, Where, What,
Why etc. So it’s important to classify question what kind of
answer is a question looking for. This shared task is about
classifying question in one of these classes. This paper describes
our approach for the subtask 1 in the shared task on Mixed Script
Information Retrieval [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] in FIRE-2016. We have used basic text
preprocessing such Tokenizer, n-grmas, along with and
CountVector and TFIDF vector to generate features and then fed
training data of vectors into Machine Learning algorithms such as
Naïve Bayes, SVM, and Random Forest etc.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. RELATED WORK</title>
      <p>
        A lot of similar work has been done in the past on mixed
languages and question classification on various sources. Khyati
and Manoj [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] did classification of Hindi-English mixed
languages questions. They used SVM based classification with
text preprocessing using transliteration and translation and then
using text features. Language Identification [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is also another
related preprocessing part of this system where one needs to know
language of individual word for better results.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. DATA SET DESCRIPTION</title>
      <p>There were a total of 330 data points in the training set containing
code mixed text of Bengali and English with 9 question classes to
predict from. Each class describes type of answer it is expecting
for subTask1. A detail distribution of classes and its count for
CMCS task is mentioned in Table1.
MNY</p>
      <sec id="sec-3-1">
        <title>TEMP</title>
      </sec>
      <sec id="sec-3-2">
        <title>DIST LOC</title>
        <p>Count
26
61
26</p>
      </sec>
      <sec id="sec-3-3">
        <title>MISC OBJ NUM PER</title>
        <p>.</p>
        <p>PreProcess
Tokenization
bigrams</p>
        <sec id="sec-3-3-1">
          <title>Proper Nouns</title>
          <p>Replacements
Each data point contains a code mixed question and a
corresponding class in training data. Organizers have also
provided a test dataset for evaluation purpose which had only
code mixed questions for which our system have to predict class
having a total of 181 questions.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. FEATURE GENERATION</title>
      <p>As our solution is machine learning based, so we need to convert
out text into some vectors to train our model. Before converting
our text into vectors, we have applied some basic preprocessing
on the raw code mixed text using NLP based custom pipeline.</p>
    </sec>
    <sec id="sec-5">
      <title>4.1 Text Preprocessing</title>
      <p>We have used NLTK tokenizer on all questions to tokenize
sentences into tokens.</p>
      <p>Further, we have also generated bigrams of tokens, as bigrams are
important to identify some important phrases to be used for
feature generation such as koto run.</p>
      <p>Also we analyzed that proper nouns entities such as person names,
locations names were causing a lot of noise, so we have identified
proper nouns and replaced them with XX.</p>
      <p>We did not apply any stemming and stop words removal
knowingly, as we analyzed and tested that stop words like koto,
where, and who etc. are very important features for this
classification task. So we kept all the terms in our vocabulary
along with new set of bigram words.</p>
    </sec>
    <sec id="sec-6">
      <title>4.2 Text Vectors (Features)</title>
      <p>A set of text features has been generated on word and bigrams
level using text to vector conversions. Each feature is assigned a
corresponding numeric value to train model.
4.2.1 Count Vectorizer
Count vector simply counts the frequency of each token
(unigrams and bigrams here) on Code Mixed questions corpus.
This vector produces a sparse representation of the counts and
number of features produced will be equal to the vocabulary size
provided. As we did not filter out any word except replacement of
proper nouns, so in total, 1030 features have been generated by
this vector. Out of which as many as 667 terms had a frequency of
1, so we discarded those features and hence we are left with 363
features to be used. This is also called Term frequency and is
denoted as below</p>
      <p>tf(t,d) = ft,d</p>
      <sec id="sec-6-1">
        <title>Where t is term in document d. A snapshot of features generated by this vectorizer is mentioned in Figure 1.</title>
        <p>toiri
koiti
time
bus
xx te</p>
        <p>run
ache</p>
        <p>r
koto
xx theke
0
50
100
150
4.2.2 TFIDF Vectorizer
This vectorizer takes in all code mixed raw text and generate tf-idf
of all the terms to get importance of all the words and bigrams.
Tfidf is very useful feature generation model in text applications
and is denoted as follows.</p>
        <p>Where idf is inverse document frequency and is denoted as.
We have only used terms having term frequency more than 1 and
hence finally produced 163 features by this vectorizer having
tfidf values for each term. A snapshot of features generated by tfidf
vectorizer is mentioned in Figure 2.
tuleche
quarter</p>
        <p>mela
ghumiye</p>
        <p>capital
sobcheye
masjid</p>
        <p>sera
prepaid</p>
        <p>by
distance</p>
        <p>er
koto
0
2
4
6
Overall we have generated ~500 features using both these vectors
without removing any term as we found stop words relevant for
this task.</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>5. CLASSIFICATION</title>
      <p>Text vectors as generated in section 3.2 has been used as training
data to train classifiers using Python Scikit. A number of different
algorithms with different parameters have been tested before
coming up with the best algorithm and its parameters. Support
Vector Machines (SVM), Logistic Regression, Random Forest,
Gradient Boosting have been tested using Grid Search to come up
with best parameters and model. Finally, Random forest with 100
n_estimators, max_depth of 10, min_samples_leaf of 4 and
min_samples_split of 4, were identified as the best set of
parameters to be used with Random Forest. Overall training time
for model is less than 1 second on quad-core Machine with 8GB
of RAM.</p>
    </sec>
    <sec id="sec-8">
      <title>6. RESULTS</title>
      <p>We have used 10 fold cross validation to compute overall
accuracy for the system. For the subtask 1 CMCS we have got
overall accuracy of 0.8495 with F1 score of 0.84. Detailed
performance matrix of the model is given as below in Table 3 for
all the classes.
59
319
24
23
5
26
45
21
61
55
59
319
0.91
0.97
0.84
Recall
0.83
0.87</p>
      <p>0
0.88
0.89
0.71
0.72
0.91
0.97
0.84
0.88
0.95
0.84
0.85
0.91</p>
      <p>0
0.85
0.91
0.64
0.74
0.88
0.95
0.84</p>
      <sec id="sec-8-1">
        <title>TEMP avg total</title>
      </sec>
      <sec id="sec-8-2">
        <title>DIST</title>
        <p>LOC</p>
      </sec>
      <sec id="sec-8-3">
        <title>MISC</title>
        <p>MNY
NUM
OBJ
ORG
PER
TEMP
avg
total
/
/
0.85
0.93
0.83
0.87
0.95</p>
        <p>0
0.82
0.93
0.58
0.76
0.85
0.93
0.83
24
23
5
26
45
21</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>7. CONCLUSION AND FUTURE SCOPE</title>
      <p>
        In this paper, we have presented our approach for question
classification on code mixing. Question classification is a first
step towards building a question answering system. Moreover
work which has been done in code mixed languages is mostly in
Hindi-English [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] language in India. And as most of the current
work in this domain is around single language which is unrealistic
in countries like India where most of communication on social
media is code mixed. This shared task is a milestone step towards
building such realistic applications for future. Future scope of
Information Retrieval [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] systems is going to be question
answering systems where system could understand question. We
have used very basic set of features here by simply calculating
importance of words/phrases within corpus itself. Using part of
speech tag which is un-touched area in our solution could
definitely add a lot more to the solution. Also using regional
lexical dictionaries like WordNet, e.g. Hindi WordNet for Hindi
code mixed problems will surely help a lot to build more
sophisticated solution.
We would like to thank organizers for conducting this shared task
and also building the training data. We also would like to thank
Sapient Corporation for giving us an opportunity to work and
explore the world of text analytics.
      </p>
    </sec>
    <sec id="sec-10">
      <title>9. REFERENCES</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Vijayanunni</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          (
          <volume>26</volume>
          -
          <issue>29</issue>
          <year>August 1998</year>
          ).
          <article-title>"Planning for the 2001 Census of India based on the 1991 Census"(PDF). 18th Population Census Conference</article-title>
          . Honolulu, Hawaii, USA: Association of National Census and Statistics Directors of America, Asia, and the Pacific.
          <article-title>Archived from the original (PDF) on 19 November 2008</article-title>
          . Retrieved 17
          <string-name>
            <surname>December</surname>
          </string-name>
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Muysken</surname>
          </string-name>
          , Pieter.
          <year>2000</year>
          .
          <article-title>Bilingual Speech: A Typology of Code-mixing</article-title>
          . Cambridge University Press. ISBN 0-521- 77168-4
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Bokamba</surname>
            ,
            <given-names>Eyamba G.</given-names>
          </string-name>
          <year>1989</year>
          .
          <article-title>Are there syntactic constraints on code-mixing?</article-title>
          <source>World Englishes</source>
          ,
          <volume>8</volume>
          (
          <issue>3</issue>
          ),
          <fpage>277</fpage>
          -
          <lpage>292</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Somnath</given-names>
            <surname>Banerjee</surname>
          </string-name>
          , Sudip Kumar Naskar, Paolo Rosso, and
          <string-name>
            <given-names>Sivaji</given-names>
            <surname>Bandyopadhyay</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>The First Cross-Script CodeMixed Question Answering Corpus</article-title>
          .
          <source>In: Modeling, Learning and Mining for Cross/Multilinguality Workshop, 38th European Conference on Information Retrieval (ECIR)</source>
          , pp.
          <fpage>56</fpage>
          -
          <lpage>65</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Khyathi</given-names>
            <surname>Chandu</surname>
          </string-name>
          <string-name>
            <surname>Raghavi</surname>
          </string-name>
          , Manoj Kumar Chinnakotla, and
          <string-name>
            <given-names>Manish</given-names>
            <surname>Shrivastava</surname>
          </string-name>
          .
          <article-title>Answer ka type kya he?: Learning to classify questions in code-mixed language</article-title>
          .
          <source>In Proceedings of the 24th International Conference on World Wide Web Companion</source>
          , pages
          <fpage>853</fpage>
          -
          <lpage>858</lpage>
          . International World Wide Web Conferences Steering Committee,
          <year>2015</year>
          . 6.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Chittaranjan</surname>
          </string-name>
          and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Vyas</surname>
          </string-name>
          .
          <article-title>Word-level Language Identification using CRF: Code-switching Shared Task Report of MSR India System</article-title>
          .
          <source>In EMNLP</source>
          <year>2014</year>
          , page 73.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Bali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. E.</given-names>
            <surname>Banchs</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Choudhury</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Rosso</surname>
          </string-name>
          .
          <article-title>Query Expansion for Mixed-Script Information Retrieval</article-title>
          .
          <source>In SIGIR '14</source>
          , pages
          <fpage>677</fpage>
          -
          <lpage>686</lpage>
          , ACM,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>T.</given-names>
            <surname>Hidayat</surname>
          </string-name>
          .
          <article-title>An analysis of Code Switching used by Facebookers</article-title>
          .
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S.</given-names>
            <surname>Banerjee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Chakma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Naskar</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. Das</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Rosso</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Bandyopadhyay</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Choudhury</surname>
          </string-name>
          .
          <article-title>Overview of the Mixed Script Information Retrieval at FIRE</article-title>
          .
          <source>In Working notes of FIRE 2016 - Forum for Information Retrieval Evaluation</source>
          , Kolkata, India, December 7-
          <issue>10</issue>
          ,
          <year>2016</year>
          ,
          <string-name>
            <given-names>CEUR</given-names>
            <surname>Workshop</surname>
          </string-name>
          <article-title>Proceedings</article-title>
          . CEUR-WS.org,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>