<!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>unimelb: Spanish Text Normalisation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Bo Han</string-name>
          <email>hanb@student.unimelb.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Paul Cook</string-name>
          <email>paulcook@unimelb.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Timothy Baldwin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computing and Information Systems, The University of Melbourne</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>NICTA Victoria Research Lab</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes a lexicon-based text normalisation approach for Spanish tweets. We rst compare English and Spanish text normalisation, and hypothesise that an approach previously proposed for English can be adapted to Spanish. A corpus-derived normalisation lexicon is built using distributional similarity, and is combined with existing lexicons (e.g., containing Spanish Internet slang). These lexicons enable a very fast, look-up based approach to text normalisation. Experimental results indicate that the corpus-derived lexicon complements existing lexicons, but that the approach could be improved through better handling of certain word types, such as named entities.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        A tremendous amount of user-generated text
is produced on social media sites such as
Twitter and Facebook, and can be
leveraged for natural language processing (NLP)
tasks such as sentiment analysis
        <xref ref-type="bibr" rid="ref5">(Jiang et
al., 2011)</xref>
        and event detection
        <xref ref-type="bibr" rid="ref2 ref9">(Weng and
Lee, 2011)</xref>
        . However, this user-generated text
is noisy, and contains various non-standard
words, e.g., jajaja (\ja") and queee (\que").
These non-standard words are not recognised
by o -the-shelf NLP tools, and may
consequently degrade the utility of NLP on
social media. One way to tackle this
challenge is text normalisation | restoring these
non-standard words to their canonical forms,
e.g., transforming jajaja to \ja" and queee
to \que"
        <xref ref-type="bibr" rid="ref1 ref4">(Eisenstein, 2013; Han, Cook, and
Baldwin, 2013)</xref>
        .
      </p>
      <p>This paper proposes a lexicon-based
approach to Spanish text normalisation. In
particular, we adapt the method of Han, Cook,
and Baldwin (2012) to build a
normalisation lexicon that maps non-standard words
to their standard forms relative to a
vocabulary, i.e., out-of-vocabulary (OOV) words are
mapped deterministically to in-vocabulary
(IV) words. This enables a very fast, look-up
based approach to text normalisation. In our
approach an OOV word is rst looked up in
an automatically-derived normalisation
lexicon that is complemented with entries from
Spanish Internet slang dictionaries and the
development data. If the OOV word is found
in this lexicon it is normalised according to its
entry, otherwise it is left unchanged. During
this normalisation step, OOV words and the
resulting normalisations are down-cased, so
a nal case restoration step is performed to
appropriately capitalise the lowercased
normalisations.</p>
    </sec>
    <sec id="sec-2">
      <title>Comparing English and</title>
    </sec>
    <sec id="sec-3">
      <title>Spanish Text Normalisation</title>
      <p>The lexicon-based normalisation approach of
Han, Cook, and Baldwin (2012) was
evaluated on English tweets. In this section we
consider the plausibility of adapting their
method from English to Spanish, and
identify the following key factors:
Orthography: if we consider diacriticised
letters as single characters, Spanish has more
characters than English, and diacritics can
lead to di erences in meaning, e.g., mas
means \more", and mas means \but". The
method of Han, Cook, and Baldwin (2012)
uses Levenshtein distance to measure string
similarity. We simply convert all characters
to fused Unicode code points (treating a and
a as di erent characters) and compute
Levenshtein distance over these forms.</p>
      <p>Word segmentation: Spanish and
English words both largely use whitespace
segmentation, so similar tokenisation strategies
can be used.</p>
      <p>Morphophonemics: Phonetic modeling
of words | a component of the method
of Han, Cook, and Baldwin (2012) | is
available for Spanish using an o -the-shelf
Double Metaphone implementation.1
Lexical resources: A lexicon and slang
dictionary | key resources for the method of
Han, Cook, and Baldwin (2012) | are
available for Spanish.</p>
      <p>Overall, English and Spanish text share
important features, and we hypothesise that
adapting a lexicon-based English
normalisation system to Spanish is feasible.</p>
      <p>One important component of this Spanish
normalisation task is case restoration: e.g.,
maria as a name should be normalised to
\Maria". Most previous English Twitter
normalisation tasks have focused on lowercase
words and ignored capitalisation.
3</p>
    </sec>
    <sec id="sec-4">
      <title>System Description</title>
      <p>The system consists of two steps: (1)
downcase all OOVs and normalise them based on
a normalisation lexicon which combines
entries from existing lexicons (Section 3.1) and
entries automatically learnt from a Twitter
corpus (Section 3.2); (2) restore case for
normalised words (Section 3.3).</p>
      <p>1https://github.com/amsqr/
Spanish-Metaphone
3.1</p>
      <sec id="sec-4-1">
        <title>Resources</title>
        <p>
          Our normalisation transforms OOV forms to
IV words, and thus a Spanish lexicon is
required to determine what is OOV. To this
end, we use the Freeling 3.0 Spanish
dictionary
          <xref ref-type="bibr" rid="ref3 ref6 ref8">(Padro and Stanilovsky, 2012)</xref>
          which
contains 669k words.
        </p>
        <p>We collected 146 Spanish Internet slang
expressions and cell phone abbreviations
from the web (Slang lexicon).2 We
further extracted normalisation pairs from the
development data (Dev Lexicon).</p>
        <p>Analysing the development data we
noticed that many person names are not
correctly capitalised. We formed Name
Lexicon from a list of 277 common Spanish
names.3 This lexicon maps lowercase person
names to their correctly capitalised forms.
3.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Corpus-derived Lexicon</title>
        <p>The small, manually-crafted normalisation
lexicons from Section 3.1 have low coverage
over non-standard words. To improve
coverage, we automatically derive a much larger
normalisation lexicon based on distributional
similarity (Dist Lexicon) by adapting the
method of Han, Cook, and Baldwin (2012).</p>
        <p>
          We collected 283 million Spanish tweets
via the Twitter Streaming API4 from
21/09/2011{28/02/2012. Spanish tweets
were identi ed using langid.py
          <xref ref-type="bibr" rid="ref3 ref6 ref8">(Lui and
Baldwin, 2012)</xref>
          . The tweets were tokenised
using a simpli ed English Twitter tokeniser
          <xref ref-type="bibr" rid="ref7">(O'Connor, Krieger, and Ahn, 2010)</xref>
          .
Excessive repetitions of characters (i.e., 3)
in words are shortened to one character to
ensure di erent variations of the same
pattern are merged. To improve coverage, we
removed the restriction from the original work
that only OOVs with 4 letters were
considered as candidates for normalisation.
        </p>
        <p>For a given OOV, we de ne its confusion
set to be all IV words with Levenshtein
distance 2 in terms of characters or 1 in
terms of Double Metaphone code. We rank
the items in the confusion set according to
their distributional similarity to the OOV.
Han, Cook, and Baldwin (2012) considered
many con gurations of distributional
similarity for normalisation of English tweets. We
2http://goo.gl/wgCFSs and http://goo.gl/
xsYkDe, both accessed on 26/06/2013</p>
        <p>3https://en.wikipedia.org/wiki/Spanish_
naming_customs
4https://dev.twitter.com
use the same settings they selected:
context is represented by positionally-indexed
bigrams using a window size of 2 tokens;
similarity is measured using KL divergence.
An entry in the normalisation dictionary then
consists of the OOV and its top-ranked IV.</p>
        <p>From development data, we observe that
in many cases when a correct normalisation
is identi ed, there is a large di erence in
KL divergence between the rst- and
secondranked IVs. Conversely, if the KL divergence
of the rst- and second-ranked normalisation
candidates is similar, the normalisation is
often less reliable. As shown in Table 3.2,
callendo (\cayendo") is a correctly-derived
(OOV, IV) pair, but guau (\y") is not.</p>
        <p>Motivated by this observation, we lter
the derived (OOV, IV) pairs by the KL
divergence ratio of the rst- and second-ranked
IV words for the OOV. Setting a high
threshold on this KL divergence ratio increases the
reliability of the derived lexicon, but reduces
its coverage. This ratio was tested for values
from 1.0 to 3.0 with a step size of 0.1 over the
development data and Slang Lexicon. As
shown in Figure 1, the best precision (94.0%)
is achieved when the ratio is 1.9.5 We directly
use this setting to derive the nal lexicon,
instead of further re-ranking the (OOV,IV)
pairs using string similarity.</p>
        <p>5Here precision is de ned as #correct normalisations .
#normalisations
Lexicon
Combined Lexicon</p>
        <p>Slang Lexicon
Dev Lexicon
Dist Lexicon</p>
        <p>Name Lexicon
+ Edit distance
Baseline
Accuracy
We set the case of each token that was
normalised in the previous step (which is
down-cased at the current stage) to its
mostfrequent casing in our corpus of Spanish
tweets. We also capitalise all normalised
tokens occurring at the beginning of a tweet, or
following a period or question mark.
4</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Results and Discussion</title>
      <p>We evaluated the lexicons using classi cation
accuracy, the o cial metric for this shared
task, on the tweet-norm test data. This
metric divides the number of correct proposals |
OOVs correctly normalised or left unchanged
| by the number of OOVs in the collection.
This is termed \precision" by the task
organisers, but a true measure of precision would
be based on the number of OOVs that were
actually normalised. We therefore use the
term \accuracy" here.</p>
      <p>We submitted two runs for the task. The
rst, Combined Lexicon (Table 4), uses
only the combination of lexicons from Section
3, and achieves an accuracy of 0.52. The
second run builds on Combined Lexicon but
incorporates normalisation based on
character edit distance for words with many
repeated characters. We observed that such
words are often non-standard, and tend not
to occur in the lexicons because of their
relatively low frequency. For words with 3
repeated characters, we remove all but one of
the repeated characters, and then select the
most similar IV word according to
characterbased Levenshtein distance. The accuracy of
this run is 0.54 (+ Edit distance, Table 4).</p>
      <p>
        We further consider an ablative analysis of
the component lexicons of Combined
Lexicon. As shown in Table 4, when Slang
Lexicon ( Slang Lexicon) or Name
Lexicon ( Name Lexicon) are excluded,
accuracy declines only slightly. Although this
suggests that existing resources play only a
minor role in the normalisation of Spanish
tweets, this is likely due in part to the
relatively small size of Slang Lexicon, which is
much smaller than similar English resources
that have been e ectively exploited in
normalisation | i.e., 145 Spanish entries versus
5k English entries used by
        <xref ref-type="bibr" rid="ref2">Han and Baldwin
(2011)</xref>
        . Furthermore, Slang Lexicon might
have little impact due to di erences between
Spanish Twitter and SMS, the latter being
the primary focus of Slang Lexicon.
      </p>
      <p>
        On the other hand, normalisation
lexicons derived from tweets | whether based
on the development data (Dev Lexicon) or
automatically learnt (Dist Lexicon) |
substantially impact on accuracy ( Dev
Lexicon and Dist Lexicon). These ndings
for the automatically derived Dist Lexicon
are in line with previous ndings for English
Twitter normalisation
        <xref ref-type="bibr" rid="ref3 ref6 ref8">(Han, Cook, and
Baldwin, 2012)</xref>
        that indicate that such lexicons
can substantially improve recall with little
impact on precision.
      </p>
      <p>We considered an experiment in which we
used Combined Lexicon, but ignored case
in the evaluation; the accuracy was 0.56.
This corresponds to the upper-bound on
accuracy if our system performed case
restoration perfectly, and suggests that improving
the case restoration of our system would not
lead to substantial gains in accuracy.</p>
      <p>In the nal row of Table 4 we show
results for a baseline method which makes no
attempt to normalise the input. All
lexiconbased methods improve substantially over
this baseline.</p>
      <p>To further analyse our lexicon-based
normalisation approach, we categorise the errors
for both false positives (OOVs that were
normalised, but incorrectly so) and false
negatives (OOVs that were not normalised, but
should have been). As shown in Table 4, 37%
of false positives are incorrect lexical forms,
e.g., algerooo is normalised to \algero" and
not its correct form \alegra". Further
examination shows that 23% of these cases are
incorrectly normalised to \que", suggesting
that distributional similarity alone is insu
cient to capture normalisations for some
nonstandard words.</p>
      <p>Surprisingly, we found some OOVs
included in the test data, but excluded from
the gold-standard annotations (due to tweet
Error type
Incorrect lexical form
Not available
Accent error
Case error
One to many
Annotation error
Number</p>
      <p>Percentage
deletions), or present in the test data, but not
found in the tweets, and excluded in the gold
standard. These error types are denoted as
\Not available" in Table 4, and account for
the second largest source of false positives.</p>
      <p>Incorrect accents and casing account for
17% and 8% of false positives, respectively.
In both of these cases, contextual
information, which is not incorporated in the
proposed approach, could be helpful. Finally,
we identi ed two one-to-many normalisations
(which are outside the scope of our
normalisation system), and one case we judged to be
an annotation error.</p>
      <p>We analysed a random sample of 20 of the
280 false negatives, and found irregular
character repetitions and named entities to be the
main sources of errors, e.g., uajajajaa (\ja")
and Pedroo (\Pedro").6 The lexicon-based
approach could be improved, for example, by
using additional regular expressions to
capture repetitions of character sequences.
Errors involving named entities reveal the
limitations of using the Freeling 3.0 Spanish
dictionary as the IV lexicon, as it has limited
coverage of named entities. A corpus-derived
lexicon (e.g., from Wikipedia) could help
improve the coverage.
5</p>
    </sec>
    <sec id="sec-6">
      <title>Summary</title>
      <p>In this paper, we applied a lexicon-based
approach to normalise non-standard words in
Spanish tweets. Our analysis suggests that
the corpus-derived lexicon based on
distributional similarity improves accuracy, but that
this approach is limited in terms of exibility
(e.g., to capture accent variation) and
lexicon coverage (e.g., of named entities). In
future work, we plan to expand the IV
lexicon, and incorporate contextual information
to improve normalisation involving accents
and casing.</p>
      <p>6Pedro is not in our collected list of Spanish names.</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgements</title>
      <p>NICTA is funded by the Australian
government as represented by Department of
Broadband, Communication and Digital
Economy, and the Australian Research
Council through the ICT centre of Excellence
programme. The authors would like to thank
the anonymous reviewers for their valuable
feedback and language expertise.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Eisenstein</surname>
          </string-name>
          , Jacob.
          <year>2013</year>
          .
          <article-title>What to do about bad language on the internet</article-title>
          .
          <source>In Proceedings of the</source>
          <year>2013</year>
          <article-title>Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL HLT</article-title>
          <year>2013</year>
          ), pages
          <fpage>359</fpage>
          {
          <fpage>369</fpage>
          ,
          <string-name>
            <surname>Atlanta</surname>
          </string-name>
          , USA.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Han</surname>
            , Bo and
            <given-names>Timothy</given-names>
          </string-name>
          <string-name>
            <surname>Baldwin</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Lexical normalisation of short text messages: Makn sens a #twitter. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies (ACL HLT</article-title>
          <year>2011</year>
          ), pages
          <fpage>368</fpage>
          {
          <fpage>378</fpage>
          ,
          <string-name>
            <surname>Portland</surname>
          </string-name>
          , Oregon, USA.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Han</surname>
            ,
            <given-names>Bo</given-names>
          </string-name>
          , Paul Cook, and
          <string-name>
            <given-names>Timothy</given-names>
            <surname>Baldwin</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Automatically constructing a normalisation dictionary for microblogs</article-title>
          .
          <source>In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning</source>
          , pages
          <volume>421</volume>
          {
          <fpage>432</fpage>
          ,
          <string-name>
            <surname>Jeju</surname>
            <given-names>Island</given-names>
          </string-name>
          , Korea. Association for Computational Linguistics.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Han</surname>
            ,
            <given-names>Bo</given-names>
          </string-name>
          , Paul Cook, and
          <string-name>
            <given-names>Timothy</given-names>
            <surname>Baldwin</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Lexical normalisation of short text messages</article-title>
          .
          <source>ACM Transactions on Intelligent Systems and Technology</source>
          ,
          <volume>4</volume>
          (
          <issue>1</issue>
          ):5:
          <issue>1</issue>
          { 5:
          <fpage>27</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Jiang</surname>
            , Long,
            <given-names>Mo</given-names>
          </string-name>
          <string-name>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <surname>Ming Zhou</surname>
            , Xiaohua Liu, and
            <given-names>Tiejun</given-names>
          </string-name>
          <string-name>
            <surname>Zhao</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Targetdependent Twitter sentiment classi cation</article-title>
          .
          <source>In Proceedings of the 49th Annual</source>
          <article-title>Meeting of the Association for Computational Linguistics: Human Language Technologies (ACL HLT</article-title>
          <year>2011</year>
          ), pages
          <fpage>151</fpage>
          {
          <fpage>160</fpage>
          ,
          <string-name>
            <surname>Portland</surname>
          </string-name>
          , Oregon, USA.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Lui</surname>
            , Marco and
            <given-names>Timothy</given-names>
          </string-name>
          <string-name>
            <surname>Baldwin</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>langid.py: An o -the-shelf language identi cation tool</article-title>
          .
          <source>In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (ACL</source>
          <year>2012</year>
          )
          <article-title>Demo Session</article-title>
          , pages
          <volume>25</volume>
          {
          <fpage>30</fpage>
          ,
          <string-name>
            <surname>Jeju</surname>
          </string-name>
          , Republic of Korea.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>O'Connor</surname>
            , Brendan,
            <given-names>Michel</given-names>
          </string-name>
          <string-name>
            <surname>Krieger</surname>
            , and
            <given-names>David</given-names>
          </string-name>
          <string-name>
            <surname>Ahn</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>TweetMotif: Exploratory search and topic summarization for Twitter</article-title>
          .
          <source>In Proceedings of Fourth International AAAI Conference on Weblogs and Social Media</source>
          , pages
          <volume>384</volume>
          {
          <fpage>385</fpage>
          , Washington, USA.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Padro</surname>
            , Llu s
            <given-names>and Evgeny</given-names>
          </string-name>
          <string-name>
            <surname>Stanilovsky</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>Freeling 3.0: Towards wider multilinguality</article-title>
          .
          <source>In Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC-2012)</source>
          , pages
          <fpage>2473</fpage>
          {
          <fpage>2479</fpage>
          , Istanbul, Turkey.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Weng</surname>
            , Jianshu and
            <given-names>Bu-Sung</given-names>
          </string-name>
          <string-name>
            <surname>Lee</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Event detection in Twitter</article-title>
          .
          <source>In Proceedings of the Fifth International AAAI Conference on Weblogs and Social Media</source>
          , Barcelona, Spain.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>