<!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>Character Embeddings PoS Tagger vs HMM Tagger for Tweets</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Giuseppe Attardi</string-name>
          <email>attardi@di.unipi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Maria Simi Dipartimento di Informatica</string-name>
          <email>simi@di.unipi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Università di Pisa Largo B. Pontecorvo</institution>
          ,
          <addr-line>3 I-56127 Pisa</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>English. The paper describes our submissions to the task on PoS tagging for Italian Social Media Texts (PoSTWITA) at Evalita 2016. We compared two approaches: a traditional HMM trigram Pos tagger and a Deep Learning PoS tagger using both character-level and word-level embeddings. The character-level embeddings performed better proving that they can provide a finer representation of words that allows coping with the idiosyncrasies and irregularities of the language in microposts.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Italiano. Questo articolo descrive la
nostra partecipazione al task di PoS
tagging for Italian Social Media Texts
(PoSTWITA) di Evalita 2016. Abbiamo
confrontato due approcci: un PoS tagger
tradizionale basato su HMM a trigrammi
e un PoS Tagger con Deep Learning che
usa embeddings sia a livello di caratteri
che di parole. Gli embedding a caratteri
hanno fornito un miglior risultato,
dimostrando che riescono a fornire una
rappresentazione più fine delle parole che
consente di trattare le idiosincrasie e
irregolarità del linguaggio usato nei
micropost.
The PoS tagging challenge at Evalita 2016 was
targeted to the analysis of Italian micropost
language, in particular the language of Twitter
posts. The organizers provided an annotated
training corpus, obtained by annotating a
collection of Italian tweets from the earlier Evalita
2014 SENTIPOLC corpus. The annotations
follow the guidelines proposed by the Universal
Dependencies (UD) project for Italian1, in
particular with respect to tokenization and tag set, with
minor changes due to the specificity of the text
genre. A few specific tags (EMO, URL, EMAIL,
HASHTAG and MENTION), have been in fact
added for typical morphological categories in
social media texts, like emoticons and emoji’s,
web URL, email addresses, hashtags and
mentions.</p>
      <p>The challenge for PoS tagging of microposts
consists in dealing with misspelled, colloquial or
broken words as well as in overcoming the lack
of context and proper uppercasing, which
provide helpful hints when analysing more standard
texts.</p>
      <p>We conducted preparatory work that consisted
in customizing some available lexical and
training resources for the task: in section 2 and 3 we
will describe such a process.</p>
      <p>
        We decided to address the research question of
comparing the relative performance of two
different approaches to PoS tagging: the traditional
word-based approach, based on a Hidden
Markov Model PoS tagger, with a Deep Learning
approach that exploits character-level
embeddings
        <xref ref-type="bibr" rid="ref2 ref5">(Ma and Hovy, 2016)</xref>
        . Section 4 and 5
describe the two approaches in detail.
2
      </p>
      <p>
        Building a larger training resource
The gold training set provided for the task
consists in a collection of 6,640 Italian tweets from
the Evalita 2014 SENTIPOLC corpus
(corresponding to 127,843 word tokens). Given the
relative small size of the resource, we extended it
by leveraging on existing resources. We used the
corpus previously used in the organization of the
Evalita 2009 task on PoS Tagging
        <xref ref-type="bibr" rid="ref1">(Attardi and
1http://universaldependencies.org/it/pos/index.html
Simi 2009)</xref>
        , consisting in articles from the
newspaper “La Repubblica”, some articles from the
Italian Wikipedia, and portions of the Universal
Dependencies Italian corpus and a small
collection of annotated Italian tweets. Table 1 provides
details of the composition of the training
resource.
      </p>
      <p>Resource
repubblica.pos
extra.pos
quest.pos
isst_tanl.pos
tut.pos
it-twitter.pos
Evalita 2016
Total</p>
      <p>The tag set was converted to the Universal
Dependencies schema taking into account the
variants introduced in the task (different tokenization
of articulated prepositions and introduction of
ADP_A).</p>
      <p>During development, the gold dataset
provided by the organizers was split into two parts: a
subset of about 105,300 tokens was used for
training, while the remaining tokens were used as
validation set (~22,500 tokens).
3</p>
      <p>Normalization of URLs, emoticons
and emoji’s
In order to facilitate the tagging of
morphological categories specifically introduced for social
media texts, we applied a pre-processing step for
normalizing the word forms. This was done by
means of a set of rewriting rules based on regular
expressions.</p>
      <p>These rules are quite straightforward for
URLs, hashtags, emails and mentions, while the
identification of emoticons and emoji’s required
a set of carefully handcrafted rules because of
their variety and higher degree of ambiguity.
4</p>
      <p>The traditional approach: the TANL
tagger
Linear statistical models, such as Hidden Markov
Models (HMM) or Conditional Random Fields
(CRF) are often used for sequence labeling (PoS
tagging and NER).</p>
      <p>In our first experiment, we used the Tanl Pos
Tagger, based on a second order HMM.</p>
      <p>
        The Tanl PoS tagger is derived from a
rewriting in C++ of Hun
        <xref ref-type="bibr" rid="ref4">Pos (Halácsy, et al. 2007</xref>
        ), an
open source trigram tagger, written in OCaml.
The tagger estimates the probability of a
sequence of labels t1…tT for a sequence of words
w1…wT from the probabilities of trigrams:
argmax (
…
| )
( |
,
) ( |
, )
The trigram probabilities are estimated
smoothing by linear interpolation the probabilities of
unigrams, bigrams and trigrams:
( | , ) =
( )
( | )
( |
)
where
      </p>
      <p>are maximum likelihood estimates and
1 + 2 + 3 = 1.</p>
      <p>An approximate Viterbi algorithm is used for
finding the sequence of tags with highest
probability, which exploit beam search to prune
unlikely alternative paths.</p>
      <p>The tagger uses a suffix guessing algorithm
for dealing with unseen words. The tagger
computes the probability distribution of tags for each
suffix, by building a trie from the suffixes, up to
a maximum length (default 10), of words
appearing less than n (default 10) times in the training
corpus. Actually two suffix tries are built: one
for words beginning with uppercase, one for
lowercase words. A word at the beginning of a
sentence is looked up in its lowercase variant.</p>
      <p>Special handling is provided for numbers and
HTML entities.</p>
      <p>The tagger can also be given a file with a list
of possible tags and lemmas for each word, in
order to initialize its lexicon. In our experiments
we used a lexicon of 130 thousands Italian
words.
5</p>
    </sec>
    <sec id="sec-2">
      <title>Character-level Embeddings</title>
      <p>Traditional techniques of statistical machine
learning usually require, to perform best, task
specific selection and tuning of hand-crafted
features as well as resources like lexicons or
gazetteers, which are costly to develop.</p>
      <p>Recently, end-to-end approaches based on
Deep Learning architectures have proved to be
equally effective, without the use of handcrafted
features or any data pre-processing, exploiting
word embeddings as only features.</p>
      <p>In order to deal with sequences, Collobert et al.
(2011) proposed a Convolutional Neural
Networks (CNN), trained to maximize the overall
sentence level log-likehood of tag sequences,
which was able to achieve state of the art
accuracy on English PoS tagging. More recently,
Recursive Neural Networks (RNN) have been
proposed.</p>
      <p>The word embeddings exploited as features in
these systems proved suitable to represent words
in well formed texts like the news articles used in
the CoNNL PoS tagging benchmarks.</p>
      <p>We conjectured that dealing with the noisy
and malformed texts in microposts might require
features at a finer level than words, i.e. to use
character-level embeddings. Hence we devised
an experiment to explore the effectiveness of
combining both character-level and word-level
embeddings in PoS tagging of tweets.</p>
      <p>We based our experiments on the work by Ma
and Hovy (2016), who propose an approach to
sequence labeling using a bi-directional
longshort term memory (BiLSTM) neural network, a
variant of RNN. On top of the BiLSTM, a
sequential CRF layer can be used to jointly decode
labels for the whole sentence.</p>
      <p>The implementation of the BiLSTM network
is done in Lasagne 2 , a lightweight library for
building and training neural networks in
Theano3.</p>
      <p>
        For training the BiLSTM tagger we used word
embeddings for tweets created using the fastText
utility4
        <xref ref-type="bibr" rid="ref2">(Bojanowski et al., 2016)</xref>
        on a collection of
141 million Italian tweets retrieved over the period
from May to September 2016 using the Twitter
API. Selection of Italian tweets was achieved by
using a query containing a list of the 200 most
common Italian words.
      </p>
      <p>The embeddings were created with dimension
100, using a window of 5 and retaining words
with a minimum count of 100, for a total of 245
thousands words.
6</p>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>The following table reports the top 9 official
scores obtained by participant systems.</p>
    </sec>
    <sec id="sec-4">
      <title>Submission</title>
      <p>Team1
Team2
Team3_UNOFFICIAL
Team4
Team3
Team5
Accuracy
0.9319
0.9285
0.9279
0.9270
0.9245
0.9224</p>
      <p>Correct
4435
4419
4416
4412
4400
4390</p>
    </sec>
    <sec id="sec-5">
      <title>2 https://github.com/Lasagne 3 https://github.com/Theano/Theano 4 https://github.com/facebookresearch/fastText.git</title>
    </sec>
    <sec id="sec-6">
      <title>Team5_UNOFFICIAL</title>
      <p>UNIPI
UNIPI_UNOFFICIAL</p>
      <p>After submission we performed another
experiment with the BiLSTM tagger, increasing the
dimension of word embeddings from 100 to 200
and obtained an accuracy of 92.50%
(4402/4759).</p>
      <p>To further test the ability of the character-level
embeddings to deal completely autonomously
with the original writings of tweets, we
performed a further experiment where we supply the
original text of tweets without normalization.
This experiment achieved an accuracy of 91.87%
(4372/4759), proving that indeed the RNN
character-level approach is capable of learning by
itself even unusual tokens, recognizing quite well
also emoticons and emoji’s, without any need of
preconceived linguistic knowledge, encoded in
an ad-hoc rule system.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Discussion</title>
      <p>While the results with the two approaches, used
in the official and unofficial run, are strikingly
close (a difference of only two errors), the two
taggers differ significantly on the type of errors
they make.
7.1</p>
    </sec>
    <sec id="sec-8">
      <title>Error analysis</title>
      <p>Table 3 reports a breakdown of the errors over
PoS categories, for both systems, in order to
appreciate the difference in behaviour. Note that a
single PoS mismatch is counted twice, once for
each PoS involved. Three cases of misspelled
PoS in the gold test were corrected before this
analysis.</p>
    </sec>
    <sec id="sec-9">
      <title>BiLSTM HMM URL EMO</title>
      <p>As previously mentioned, social media specific
tags are not the most difficult problem. To be
fair, we noticed that the official BiLSTM run is
plagued by a suspicious high number of errors in
identifying EMO’s. However, by checking the
steps in the experiment, we discovered that this
poor performance was due to a mistake in the
normalization step.</p>
      <p>Confusion between NOUN and PROPN
represents the largest source of errors. In the official
run there are 66 errors (35 PROPN tagged as
NOUN, 33 NOUN tagged as PROPN),
corresponding to nearly 17% of all the errors. The
traditional unofficial run does even worse: 19% of
the errors are due to this confusion.</p>
      <p>Both taggers are weak in dealing with
improper use of case (lower case proper names and
all caps texts), which is very common in Twitter
posts. This could be because the training set is
still dominated by more regular texts where the
case is a strong indication of proper names. In
addition, the annotation style chosen for long
titles, not fully compliant with UD, makes the
task even more difficult. For example the event
“Settimana della moda femminile/Women
fashion week” or “Giornata mondiale vittime
dell’amianto/World Day of the victims of the
asbestos” are annotated as a sequence of PROPN in
the gold test set as opposed to using the normal
grammatical conventions, as specified in the UD
guidelines.</p>
      <p>The traditional system is slightly more
accurate in predicting the distinction between VERB
(main verbs) and AUX (auxiliary and modal
verbs): 19 errors against 26.</p>
    </sec>
    <sec id="sec-10">
      <title>Conclusions</title>
      <p>We explored using both a traditional HMM
trigram PoS tagger and a Deep Learning PoS
Tagger that uses both character and word-level
embeddings, in the analysis of Italian tweets.</p>
      <p>The latter tagger uses embeddings as only
features and no lexicon nor other linguistic resource.
The tagger performs surprisingly well, with an
unofficial run that ranks among the top 5. This
confirms our conjecture that character-level
embeddings are able of coping with the
idiosyncrasies and irregular writings in microposts.</p>
    </sec>
    <sec id="sec-11">
      <title>Acknowledgments</title>
      <p>We gratefully acknowledge the support by the
University of Pisa through project PRA and by
NVIDIA Corporation through a donation of a
Tesla K40 GPU used in the experiments.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <given-names>Giuseppe</given-names>
            <surname>Attardi</surname>
          </string-name>
          and
          <string-name>
            <given-names>Maria</given-names>
            <surname>Simi</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>Overview of the EVALITA</article-title>
          .
          <article-title>Part-of-Speech Tagging Task</article-title>
          .
          <source>Proceedings of Workshop Evalita</source>
          <year>2009</year>
          ,
          <string-name>
            <given-names>Reggio</given-names>
            <surname>Emilia</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <given-names>Piotr</given-names>
            <surname>Bojanowski</surname>
          </string-name>
          , Edouard Grave, Armand Joulin, and
          <string-name>
            <given-names>Tomas</given-names>
            <surname>Mikolov</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Enriching Word Vectors with Subword Information</article-title>
          . https://arxiv.org/abs/1607.04606
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <given-names>Ronan</given-names>
            <surname>Collobert</surname>
          </string-name>
          , JasonWeston, Léon Bottou, Michael Karlen, Koray Kavukcuoglu,
          <string-name>
            <given-names>Pavel</given-names>
            <surname>Kuksa</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Natural Language Processing (Almost) from Scratch</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          <volume>12</volume>
          .
          <fpage>2461</fpage>
          -
          <lpage>2505</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <given-names>Péter</given-names>
            <surname>Halácsy</surname>
          </string-name>
          , András Kornai and
          <string-name>
            <given-names>Csaba</given-names>
            <surname>Oravecz</surname>
          </string-name>
          .
          <year>2007</year>
          .
          <article-title>HunPos - an open source trigram tagger</article-title>
          .
          <source>Proceedings of the Demo and Poster Sessions of the 54th Annual Meeting of the ACL</source>
          , pp.
          <fpage>209</fpage>
          -
          <lpage>212</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <given-names>Xuezhe</given-names>
            <surname>Ma</surname>
          </string-name>
          and
          <string-name>
            <given-names>Eduard</given-names>
            <surname>Hovy</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>End-to-end Sequence Labeling via Bi-directional LSTM-CNNsCRF</article-title>
          .
          <article-title>Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL</article-title>
          <year>2016</year>
          ), pp.
          <fpage>1064</fpage>
          -
          <lpage>1074</lpage>
          , Berlin, Germany.
          <source>August</source>
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>