<!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>Hierarchical classification for Multilingual Language Identification and Named Entity Recognition</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Rajesh Kumar EE</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
          <xref ref-type="aff" rid="aff4">4</xref>
          <xref ref-type="aff" rid="aff5">5</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jaipur Rajasthan-</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
          <xref ref-type="aff" rid="aff4">4</xref>
          <xref ref-type="aff" rid="aff5">5</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>rkumar.ee@gmail.com</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
          <xref ref-type="aff" rid="aff4">4</xref>
          <xref ref-type="aff" rid="aff5">5</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Anshul Mittal EE, MNIT</institution>
          ,
          <addr-line>Jaipur Rajasthan-302017</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Jatin Verma EE, MNIT</institution>
          ,
          <addr-line>Jaipur Rajasthan-302017</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Saatvik Shah CSE, MNIT</institution>
          ,
          <addr-line>Jaipur Rajasthan-302017</addr-line>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Sarthak Jain ECE, MNIT</institution>
          ,
          <addr-line>Jaipur Rajasthan-302017</addr-line>
        </aff>
        <aff id="aff4">
          <label>4</label>
          <institution>Shubham Tripathi EE, MNIT</institution>
          ,
          <addr-line>Jaipur Rajasthan-302017</addr-line>
        </aff>
        <aff id="aff5">
          <label>5</label>
          <institution>Vaibhav Jain CSE, MNIT</institution>
          ,
          <addr-line>Jaipur Rajasthan-302017</addr-line>
        </aff>
      </contrib-group>
      <fpage>33</fpage>
      <lpage>36</lpage>
      <abstract>
        <p>This paper describes the approach for Subtask-1 of the FIRE2015 Shared Task on Mixed Script Information Retrieval. The subtask involved multilingual language identi cation (including mixed words and anomalous foreign words), named entity recognition (NER) and subclassi cation. The proposed methodology starts with cleaning the data and then extracting structural and contextual features from the text for further processing. A subset of these features is selected (based on validation) for training supervised classi ers, separately for language identi cation and NER. Finally, they are applied hierarchically to annotate the entire text. The detected named entities are further subclassi ed by a novel unsupervised technique based on query re nement and keyword based scoring. The proposed approach on the testing dataset of the shared task showed promising results with a weighed F-measure of 0.8082. However, it is worth noting that the classi ers have been sub-optimal with respect to discriminating between certain linguistically similar languages (for e.g., Gujarati in Hindi and Gujarati pairs). The proposed approach is exible and robust enough to handle additional languages for identi cation as well as anomalous foreign or extraneous words. The implementation of the approach has also been shared for the purpose of future research usage.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <p>The ubiquitous use of indigenous languages in social
media and search engines has led to the increasing need for
techniques to tackle mixed script information retrieval. In
such an environment, language and named entity identi
cation has become both a necessary and challenging task. At
this juncture, the shared task for mixed script information
retrieval for the FIRE workshop serves as an excellent source
to obtain multiple insights to the solution to such a
problem. This research paper addresses language identi cation
(LI) and Named Entity Recognition (NER) for text in social
media. Such kind of text could involve, for example,
switching of language in between a sentence (code switching), or
even include words of mixed languages (code mixing). In
addition to this, people also use phonetic typing and
irregular spellings in social media (`2nyt' in place of `tonight' or
`y' in place of `why'). All these challenges make the correct
identi cation of language in data from social media a tough
task.</p>
      <p>The task required rigorous preprocessing of both the
training (validation) as well as testing dataset. Section 2
describes, in detail, the approach followed for it. Rest of the
paper is organized as follows. Section 3 describes all the
features extracted. Section 4,5 and 6 describe the
hierarchical classi cation approach that we implemented for
tagging of tokens into their respective categories. Section 7
and 8 cover the Results and Conclusion. A Web Tool has
been developed for the implemented approach and can be
accessed at https://mixscian.herokuapp.com. The source
code has been shared on the link, https://github.com/
saatvikshah1994/hline for future research purposes.
2.</p>
    </sec>
    <sec id="sec-2">
      <title>PREPROCESSING</title>
      <p>During training, the following steps were performed to
achieve preprocessing:
1. Began preparing the data by skipping all the X's present
in the Input le, which are punctuation, numerals,
emoticons, mentions (words starting with @), hashtags
(words starting with #) and acronyms; with respect to
the given annotation le directly.
2. Then Unicode based cleanup of words was performed,
to bring Unicode characters to their closest matching
ASCII representatives. (Eg. \ZineTM" to ZineTM)
3. After that, each utterance was formatted to remove
any punctuation marks in between letters.
4. Finally, erroneous utterances (with unequal number of
words and labels) were discarded.
During testing, the process started with performing
Unicode based cleanup, followed by removal of punctuations or
any other invalids in between letters from tokens.
3.</p>
    </sec>
    <sec id="sec-3">
      <title>FEATURE EXTRACTION</title>
      <p>
        The proposed technique uses a comprehensive set of
features [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for both language identi cation and NER. These
are explained in brief below:
1. Word Context: Word Context features that can be
extracted from a token (word) being labeled and its
surrounding context. Considering w0 as current token,
we took Subset of all features for upto 2 context words,
both in the left and right (w-2, w-1, w0, w+1, w+2).
2. Pre x and Su x: Pre x and su x, de ned as
variable length character sequences (here, 3 and 2), are
stripped from each token and used as the features of
classi er.
3. Stemming/Lemmatization: A step applying
stemming or lemmatization of input tokens or both before
extracting features was added to the feature extraction
pipeline and tested.
4. Character level n-gram: Character n-gram is a
contiguous sequence of n character extracted from a given
word. We extract character n-grams of length two
(bigram) and three (trigram), quad(four), penta( ve) and
use these as features.
5. POS tags: POS tagging(or grammatical tagging),
marks part of speech of a word present in corpus based
on both de nition and context.
6. Relative Position:The relative position of speci c
token in its utterance was considered and added as a
feature.
7. Word Normalization: Word Normalization is done
to capture similarity between two words with
common properties like "HahaHHa123" is normalized to
"AaaaAAa000", with "A" denoting a capital, "a"
denoting non capital and "0" denoting a numerical character.
8. Compressed Word Normalization: The output of
Word Normalization is compressed to remove
repetitions of similar characters appearing together. For
example "AaaaAAa000" becomes "AaAa0".
9. Composition features:A feature was de ned whose
value depended upon the presswork of the word. The
following four values were possible:
      </p>
      <p>AllCaps (if the current word is made up of all
capitalized letters),
AllSmall (word is constructed with only lowercase
characters),
WordDigit (word contains digits and alphabets
both)
InitCaps (whether the rst character is in
uppercase) and
These features, having variable length for every token under
consideration, had to be further processed into a
Bag-OfWords formation. Term Frequency Matrix was computed
for the same, resulting in the formation of sparse matrices,
which were nally passed onto the classi ers.
4.</p>
    </sec>
    <sec id="sec-4">
      <title>PUNCTUATION (X) RECOGNITION</title>
      <p>This section describes the methodology used for tagging
Xs, or tags which are punctuation marks, numerals,
mentions, hashtags, acronyms or emoticons. The process begin
by a rule based approach for isolating the hashtags,
mentions, and numerals. This is done by checking for tokens
that start with `@', or `#', or tokens that are composed
entirely of digits. Then, the tokens are checked for web URLs
or email addresses, and punctuations. A regular expression
based classi cation was implemented to search for tokens
starting with `http://' or `https://', or any token of the
format `abc@pqr.xyz'. Also, any tokens that are
composed only of punctuation marks are isolated and tagged as
X. Another regular expression check is applied to catch any
emoticon such as `:-)', `;)', `:g', etc. A dictionary based
approach is then applied to check for any token to exist in a list
of popular acronyms. If there is a match, the corresponding
token is also classi ed as an X. Once these 'X's have been
ltered out, a cleaning operation was performed on the
remaining tokens. Cleaning is de ned as converting Unicode
characters to the nearest matching ASCII characters. For
example, converting \ZineTM" to ZineTM. After this
preprocessing, these `cleaned' tokens are sent for Named Entity
Recognition.
5.</p>
    </sec>
    <sec id="sec-5">
      <title>NAMED ENTITY RECOGNITION</title>
      <p>
        This task focuses on tagging those tokens as named entity
which can be names of persons, locations, organizations etc
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] in the given text. For each named-entity, we can:
      </p>
      <sec id="sec-5-1">
        <title>1. Classify it as fNEg, OR 2. Sub-classify it as fNE L, NE P, NE O, NE PA,</title>
        <p>NE LA, NE OA, NE Ls, NE X, NE XAg
Methodology: Tagging of named entities has been divided
into two steps:(1)Supervised approach for binary classi
cation and (2)Unsupervised approach for sub-classi cation.
5.1</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Supervised Approach</title>
      <p>
        The Supervised approach includes training of Classi ers
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], namely, Linear-kernel SVM(using liblinear), Logistic
Regression and Random Forest Model on the extracted
features explained in section 3. The input data for
training included this year's training data along with dataset of
FIRE 2014. All these were implemented by use of
Transform Pipelines containing Clean Transform(to clean data)
and Feature Extractor. Finally, the use of Term Frequency
Matrix was done to obtain numeric features. Based on
individual feature cross-validation, the most important features
that contributed in identifying the Named Entities were:
Word(and Compressed) Normalization
Local Context(with a smaller window)
Relative Position
Pre x/Su x
POS Tags.
      </p>
      <p>Composition Features.</p>
      <p>An Ensemble Model of NER was developed which
performed a "LOGIC OR" on the predicted results of each
classi er to decide the nal tag for a particular token. One(1)
was used to denote a token being a named entity and Zero(0)
for non-named entity.</p>
      <p>T agout = 0 OR (T agclassi er 1) OR (T agclassi er 2)::::
OR (T agclassi er n) (1)
where
Tagout is the predicted result for each token,
Tagclassi er k is the predicted tag by classi er k, and
n is number of classi ers used.
5.2</p>
    </sec>
    <sec id="sec-7">
      <title>Unsupervised Approach</title>
      <p>
        An Unsupervised approach based on parsing Wikipedia
to nd out whether the predicted named entity is a
person, location or organization was employed [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Searching
the Wikipedia page of a named entity provides information
comprising of the title of the Wikipedia Page, the summary,
the section headings, the infobox contents, the categories
section, etc. indicating whether it is a person, location or
organization. The prediction is done using three reference
sets each containing some keywords that are commonly used
in the context of a person, location or organization. For
a person, keywords can be `born', `Education', `President',
etc.; for a location, they can be `place', `nation', etc.; for an
organization, they can be `party', `company', etc. While
parsing the Wikipedia page of `Narendra Modi', we will
surely get across the word `President' declaring `Narendra
Modi' as `NE P' or person. However, it was found that
for some named entities like AAP, Mark, etc., it displays a
disambiguation page whereas some named entities like
Sonia, Pradep, etc. didn't even have a Wikipedia page. Thus,
a systematic approach overcoming all the shortcomings of
only Wikipedia parsing was formulated which is described
in the following paragraph.
      </p>
      <p>Assuming the named entity to be of one word, let the
named entity that is to be sub-classi ed be denoted by a
variable token. The following procedure
prevails:1. First of all, any of the punctuation marks, numerals or
special characters are removed from token.
2. The token is searched using Wikipedia API for python
that returns an object containing the information about
token extracted from its Wikipedia page.
3. Using the object, all the above-mentioned
information is concatenated to form a single string denoted
by wiki-extract. For convenience, the information is
rst converted into lowercase, and any of the
punctuation marks, numerals, Unicode characters, etc. are
removed. Each of the words in wiki-extract is
lemmatized, and to counter the internet dependence and
decrease the processing time, the nal wiki-extract is
cached in a le with the corresponding token against
it.
4. The reference set keywords are searched in wiki-extract.</p>
      <p>The number of times a keyword is spotted in
wikiextract will be the score of the subclass (`NE P', `NE L'
or `NE O') to which the keyword belongs.
5. After each of the keywords' search is completed, we get
a nal score for each subclass. If the di erence between
the scores of the subclass with the maximum score and
that with the second maximum score is greater than or
equal to a con dence threshold (5 in this paper), then
token is annotated as the subclass with the maximum
score, otherwise it is annotated as `en'. If the nal
scores of all the subclasses is zero, it is marked as `en'.</p>
      <p>If in the 2nd step, Wikipedia shows disambiguation error,
then token is searched on Bing using its API for python
named `py bing search'. As long as the data under process
belongs to social networking sites including popular topics
like politics, movies, etc., the results by Bing will help in
nding out the most popular/probable meaning of token out
of many ambiguous cases. Steps to be followed
are:i Using `py bing search', token appended with the word
`Wikipedia' (for e.g. `AAP wikipedia') is searched on
Bing so that it returns URLs of Wikipedia pages at
top priority. Only rst three URLs are considered.
ii Only those URLs that point towards a Wikipedia page
except disambiguation pages are considered.
iii As soon as the desired URL is obtained, the proper
term that would not cause disambiguation error and
could replace token is extracted out of that URL. For
e.g. if the token was `AAP'. Bing will return a URL
`https://en.wikipedia.org/wiki/Aam Aadmi Party' for
this token and then the term `Aam Aadmi Party'
extracted out from this URL will replace token.
iv Now, rest of the steps of searching the new token on</p>
      <p>Wikipedia are same as step 2 to step 5 discussed above.</p>
      <p>If, among the three URLs, none of them satis es the
condition of being a Wikipedia page except disambiguation pages,
then under disambiguation error there is an option to fetch
the options o ered by Wikipedia disambiguation page. Only
rst ve options are considered in this paper. These ve
options are concatenated to form wiki-extract and rest of the
procedure is same as step 3 to step 5 keeping the con dence
threshold zero.</p>
      <p>If in the 2nd step, Wikipedia shows page error, then to
replace token with a proper term that would not cause page
error, Bing search is used again. Hence, the steps to be
followed are same as step i to iv. Again, if among the three
URLs obtained from `py bing search', none of them satis es
the condition of being a Wikipedia page except
disambiguation pages, then the token is annotated as `en'.</p>
      <p>Apart from the above algorithm, it is constantly sought
that if the term succeeding token also comes out to be named</p>
      <p>P
R
F-S
0.878
0.966
0.838
0.958
0.848
0.9
0.097
0.5
0.163
0.817
0.74
0.776
0.575
0.829
0.679
0.394
0.752
0.517
0.705
0.79
0.745
0.937
0.708
0.806
0.431
0.687
0.529
0.961
0.966
0.964
0.368
0.528
0.433
0.722
0.124
0.214
0.2121
0.25
0.229
entity, provided that token is not positioned last in the
current utterance, then they are treated as a single entity and
then searched on Wikipedia. For e.g. the tokens are `White'
`House' which are marked as named entity. If we search
`White' on Wikipedia we won't get desired results. But if
we search `White House', we may surely get it as a
location, and thus both `White' and `House' are annotated as
`NE L'. If the tokens are misspelled or ambiguous, then
Wikipedia may cause page or disambiguation error. In that
case, the combined token is rst searched on Bing to nd
out the term that could replace the combined token. If this
results in failure in nding out a Wikipedia page except
disambiguation pages, then the process is reverted and the two
tokens are searched individually again following the
procedure discussed earlier.</p>
    </sec>
    <sec id="sec-8">
      <title>LANGUAGE IDENTIFICATION</title>
      <p>
        This section addresses the problem of identi cation of
language of origin of a query term in the code-mixed query [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
For Language Identi cation, linear-kernel SVM(using
liblinear) classi er was used with important features being:
Word n-grams(bi-grams, tri-grams, quad-grams and
penta-grams)
Local Knowledge
Part of Speech Tags
      </p>
      <p>
        Composition Features
Parameter optimization was performed using parameter
tuning based on cross-validation. Supervised approach[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] was
implemented with the classi er being trained on current
year's training dataset and previous year's dataset. A
similar transform pipeline as used for NER was implemented
for the training of classi ers. A multilevel classi cation was
performed with possible tags for each token:
1. One of Languages in L=f(en), (hi), (bn), (gu), (ka),
(ml), (mr), (ta), (te)g
2. Token made of two languages fMIXg and its
subcategory fMIX Lr Lsg where r and s are the language
of root and su x respectively
      </p>
      <sec id="sec-8-1">
        <title>3. None of the above fOg</title>
        <p>For the purpose of training, the datasets were cleaned and
tokens annotated as NE or its subcategories and X's were
removed. The trained classi er was then applied on testing
set to get the prediction for each token.</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>RESULTS</title>
      <p>In this section, results are reported to proposed
experiments. To investigate and nd the most e ective
methods as described in upper sections, results are initially
obtained by development(Training) set and nally, the model
was selected using 4-fold cross validation. Thereafter, a
run was submitted for Subtask-1. The overall performance
was measured in terms of Utterance, Token and NE
accuracies along with precision, recall and F-measure scores for
individual languages and sub-divided NE. The Average
Fmeasure and Weigthed F-measure scores obtained was
0.654 and 0.808 respectively. While generally the Mean
Average F-measure, Weigthed F-measure score was
0.5395, 0.6990 and Max Average F-measure, Weigthed
F-measure score was 0.6917, 0.8299.</p>
    </sec>
    <sec id="sec-10">
      <title>CONCLUSION</title>
      <p>In this paper, a system was described for Subtask-1 i.e.
Query Word Labelling in FIRE Shared Task 2015 on Mixed
Script Information Retrieval. The validation procedure
indicated that the context of a token, its POS tag, its structure
and normalization play key roles in both NER and Language
identi cation. It is interesting to note that the performance
on linguistically dissimilar languages such as English and
Bengali has been top notch. On the other hand,
performance on similar language pairs such as Hindi and Marathi
have invariably lead to the classi er getting confused. The
use of Search engines to re ne query terms followed by use
of publically available encyclopedias such as Wikipedia for
subclassifying named entities is a newly proposed technique
that has given promising results.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>D. K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kumar</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Ekbal</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <article-title>Machine Learning Approach for Language Identi cation</article-title>
          &amp;
          <source>Transliteration: Shared Task Report of IITP-TS.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Abhinaya</surname>
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Neethu</surname>
            <given-names>John</given-names>
          </string-name>
          , Dr. M. Anand Kumar,
          <string-name>
            <surname>Dr. K.P. Soman</surname>
          </string-name>
          (
          <year>2014</year>
          ).
          <article-title>Amrita @ FIRE-2014: Named Entity Recognition for Indian Languages</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Dubey</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goel</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prabhakar</surname>
            ,
            <given-names>D. K.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Pal</surname>
            ,
            <given-names>S. ISM</given-names>
          </string-name>
          @ FIRE-2014:
          <article-title>Named Entity Recognition Indian Languages</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>King</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Abney</surname>
            ,
            <given-names>S. P.</given-names>
          </string-name>
          (
          <year>2013</year>
          , June).
          <article-title>Labeling the Languages of Words in Mixed-Language Documents using Weakly Supervised Methods</article-title>
          .
          <source>In HLT-NAACL</source>
          (pp.
          <fpage>1110</fpage>
          -
          <lpage>1119</lpage>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Das</surname>
          </string-name>
          and
          <string-name>
            <surname>B. Gamback.</surname>
          </string-name>
          (
          <year>2014</year>
          ).
          <article-title>Code-Mixing in Social Media Text:The Last Language Identi cation Frontier? Traitement Automatique des Langues (TAL): Special Issue on Social Networks and NLP</article-title>
          , TAL Volume
          <volume>54</volume>
          no 3
          <issue>/2013</issue>
          , Pages
          <fpage>41</fpage>
          -
          <lpage>64</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Nothman</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ringland</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Radford</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Murphy</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Curran</surname>
            ,
            <given-names>J. R.</given-names>
          </string-name>
          (
          <year>2013</year>
          ).
          <article-title>Learning multilingual named entity recognition from Wikipedia</article-title>
          .
          <source>Arti cial Intelligence</source>
          ,
          <volume>194</volume>
          ,
          <fpage>151</fpage>
          -
          <lpage>175</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>