<!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>Two Models for Named Entity Recognition in Spanish. Submission to the CAPITEL Shared Task at IberLEF 2020</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>ElenaÁlvarez-Mella d</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Information Sciences Institute, University of Southern California</institution>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <fpage>64</fpage>
      <lpage>70</lpage>
      <abstract>
        <p>This paper documents two sequence-labeling models for NER in Spanish: a conditional random field model with handcrafted features and a BiLSTM-CRF model with word and character embeddings. Both models were trained and tested using CAPITEL (an annotated corpus of newswire written in European Spanish) and were submitted to the shared task on Spanish NER at IberLEF 2020. The best result was obtained by the CRF model, which produced an F1 score of 84.39 on the test set and was ranked #6 on the shared task.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Spanish NER</kwd>
        <kwd>CRF</kwd>
        <kwd>BiLSTM-CRF</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction and Previous Work</title>
    </sec>
    <sec id="sec-2">
      <title>2. Models</title>
      <p>In this section we describe the two models that were explored for Spanish NER on the CAPITEL
corpus: a CRF model with handcrafted features and a BiLSTM-CRF model with word and
character embeddings.</p>
      <sec id="sec-2-1">
        <title>2.1. CRF model</title>
        <p>A CRF model was built usingp y c r f s u i t e 1 [9], a Python wrapper focrr f s u i t e 2 [10] that
implements CRF for labeling sequential data. The model also usedTtohk een and S p a n classes from
s p a C y 3 library1[1].</p>
        <sec id="sec-2-1-1">
          <title>2.1.1. Feature engineering</title>
          <p>The following handcrafted binary features were used for the model:
• Bias feature: a feature that is active on every single token to support setting per-class
bias weights.
• Token feature: the string of the token f(e a t u r e s [ t o k e n = “ a g u a ” ] = 1 . 0 ).
• Uppercase feature (y/n): active if all characters in the token are uppercOaNseG(, IBM )
(f e a t u r e s [ i s _ u p p e r c a s e ] = 1 . 0 ).
• Titlecase feature (y/n): active if only the first character of the token is capitalized
(Gobierno, Alcalá) (f e a t u r e s [ i s _ t i t l e c a s e ] = 1 . 0 ).
• Character trigram feature: an active feature for every trigram contained in the token
(f e a t u r e s [ t r i g r a m = “ a g u ” ] = 1 . 0 ).
• Punctuation feature (y/n): active if the token contains any type of punctuation mark
(,-/ ) (f e a t u r e s [ i s _ p u n c t u a t i o n ] = 1 . 0 ).
• Word sufix feature : last three characters of the token</p>
          <p>(f e a t u r e s [ s u f f i x = “ d a d ” ] = 1 . 0 ).
• POS tag feature: part-of-speech tag of the token provided bsyp a C y library
(e s _ c o r e _ n e w s _ m d model) (f e a t u r e s [ p o s t a g = “ V E R B ” ] = 1 . 0 ).
• Digit feature (y/n): active if the token contains a number20(14, salud2)</p>
          <p>(f e a t u r e s [ i s _ d i g i t ] = 1 . 0 ).
• Word shape: shape representation of the token provided sbpya C y library
(e s _ c o r e _ n e w s _ m d model) (f e a t u r e s [ s h a p e = “ X x x x ” ] = 1 . 0 ).
• Lemma feature: lemma of the token provided by thee s _ c o r e _ n e w s _ m d model froms p a C y
(f e a t u r e s [ l e m m a = “ r e í r ” ] = 1 . 0 ).
• Word embedding (see Table1).
1https://github.com/scrapinghub/python-crfsuite
2https://github.com/chokkan/crfsuite
3https://spacy.io/</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>2.1.2. Model tuning</title>
          <p>The model was trained on the training set of the CAPITEL corpus and tuned on the validation
set using grid search. The following hyperparameters were explored during tuning: c1 (L1
regularization coeficient:0.01, 0.05, 0.1, 0.5, 1.0), c2 (L2 regularization coeficient:0.01, 0.05,
0.1, 0.5, 1.0), embedding scaling (scaling factor applied to each dimension of the embedd0i.n5g,:
1.0, 2.0, 4.0), and embedding type (from a set of diferent Spanish word embeddings; see Tabl1e)
[12, 13, 17, 14, 11, 15, 16]. A window of two tokens in each direction was set for the feature
extractor. Optimization was performed using L-BFGS. The threshold for the stopping criterion
delta was set to delta 1=e − 3.</p>
          <p>The best results were obtained with c10=.01, c2 = 0.5, scaling =0.5 and FastText Spanish
embeddings [13] that were trained on the Spanish Unannotated Corp4or[1a8]. These
hyperparameters produced an F1 score of 83.60 on the validation set (precision = 84.23, recall = 83.03).
The lowest F1 result obtained on the validation set during grid search experiments was 78.90,
which illustrates the substantial impact that hyperparameter tuning can have on the model’s
performance.</p>
        </sec>
        <sec id="sec-2-1-3">
          <title>2.1.3. Feature ablation study</title>
          <p>A feature ablation study was then performed on the tuned model by removing one feature at a
time and testing on the validation set. The results obtained during the feature ablation study
were consistently worse than those obtained with the full set of features, which demonstrates
that all features contribute positively to the model’s performance. The embedding feature
seemed to be the one that contributed the most to the result (see Tab2l).e</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. BiLSTM-CRF model</title>
        <p>A BiLSTM-CRF model was also trained for the same task using the CAPITEL corpus. This
neural model was created using the librNaCrRyF++5 [19]. NCRF++ is a PyTorch-based framework
that implements a neural sequence-labeling model in three layers (character sequence layer,
word sequence layer and inference layer). The architecture chosen for our neural NER model
4https://github.com/josecannete/spanish-corpora
5https://github.com/jiesutd/NCRFpp
was a character CNN + word LSTM + CRF model. This neural architecture has previously
demonstrated to be succesful on other NER task7s].[</p>
        <p>For this model, we used FastText Spanish embeddings with 300 dimensions from14[]. The
dimensions of the character embeddings were set to 50. The learning rate was 0.015, the batch
size was 20. L2 regularization coeficient was 1e-08, the number of hidden dimensions was 200,
dropout was 0.5, the optimization algorithm used was SGD. Iterations were set to 100, the best
results on the validation set were obtained at iteration 81, which produced an F1 score of 85.04
(precision = 85.66, recall = 84.42), almost two points higher than the best result obtained by the
non-neural model on the validation set.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Results and Discussion</title>
      <sec id="sec-3-1">
        <title>3.1. Results</title>
        <p>The best performing version of both the CRF and the BiLSTM-CRF model were then run on the
test set of the CAPITEL corpus. The CRF model produced an F1 score of 84.39 on the test set
(precision = 84.75, recall = 84.12, ranked #6 on the shared task), which is almost 1 point higher
than the best result obtained on the validation set. The BiLSTM-CRF model, however, obtained
an F1 score of 83.01 (precision = 84.33, recall = 81.82, ranked #8 on the shared task), two points
lower than the best result obtained on the validation set and 1 point less than the CRF model.
This gap between the neural and non-neural model (the non-neural model outperforming the
neural model) can perhaps be explained by the diferences between the test set and the training
set, but also by the lack of tuning on the BiLSTM-CRF model (as the neural model could have
benefited from a more exhaustive tuning). Either way, both results are modest compared to the
best performing model of the shared task (which produced an F1 score of 90.2300]). [</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Error analysis</title>
        <p>In this subsection we will document some of the errors that were produced by the CRF and the
BiLSTM-CRF model:</p>
        <p>The tag OTHER was behind many of the disagreements in tag selection: for instance, the name
of newspapers and TV channels (such aLsa Vanguardia or TVE) were labeled on the gold
standard asORG when they referred to the institution, but labeledOaTHs when referring to the
actual publication or channel (see guideline 5.4.1.7 from the task annotation guide2l1i]n)e.s [
These subtleties in meaning were not captured by the presented systems, as both models tended
to tag these entities asORG, regardless of the context.</p>
        <p>Similarly, the name of countries, regions and other geopolitical units (that have sometimes
been considered undeGrPE in other annotation schemes2[2, 23]) were a frequent source of
error. According to the annotation guidelines, countries were labeLlOeCdoarsORG depending
on whether the name was referring to the political institution or the geographical location (see
guideline 5.2.1. on the annotation guideline2s1[]). These nuances were not well-captured by
our models and also produced frequent tag selection errors.</p>
        <p>Nested entities also produced some issues, particularly to the CRF moSdemela: na de la Moda
de China was labeled as one singlOeTH entity in the gold standard, but was labeled as two
separate entities by the CRF modelSe(mana de la Moda as OTH, China as LOC).</p>
        <p>The scope of the entities was also a common source of error, as when taggSaintéglite GOES-16
(instead of justGOES-16).</p>
        <p>Additionally, film and book titles (such aLsa llegada o La peste) should have been labeled as
OTH but were consistently ignored by our models (this entities could perhaps have been captured
by the CRF model had a quotation feature been included).</p>
        <p>Finally, person names with unusual shapes were sometimes mislabeled, aEsliBnigotes.
Likewise, the actress and singeIrmperio Argentina (that appeared once in the background set)
was labeled aOsTH by the CRF and asORG by the neural model, and is a good example of the
dificulty that Spanish artistic nicknames can pose to NER systems.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusions</title>
      <p>
        In this paper we have presented two diferent sequence-labeling models for Spanish NER: a CRF
model with handcrafted features and a BiLSTM-CRF model with word and character embeddings.
These models were applied to the CAPITEL corpus, an annotated corpus of journalistic texts
written in European Spanish. Both models were submitted to the CAPITEL shared task on NER
at IberLEF 2020. The CRF model produced an F1 score of 84.39 on the test set and was ranked #6
on the shared task, while the BiLSTM-CRF model obtained an F1 score of 83.01 and was ranked
#8.
[1] E. F. Tjong Kim Sang, F. De Meulder, Introduction to the CoNLL-2003 shared task:
Language-independent Named Entity Recognition, in: Proceedings of the Seventh
Con[19] J. Yang, S. Liang, Y. Zhang, Design challenges and misconceptions in neural sequence
labeling, in: Proceedings of the 27th International Conference on Computational Linguistics
(COLING), 2018. URL: http://aclweb.org/anthology/C18-13.27
[20] R. Agerri, G. Rigau, Projecting Heterogeneous Annotations for Named Entity Recognition,
in: Proceedings of the Iberian Languages Evaluation Forum
        <xref ref-type="bibr" rid="ref12">(IberLEF 2020)</xref>
        , 2020.
[21] J. Porta-Zamorano, J. Romeu Fernández, Esquema de anotación de entidades nombradas
de CAPITEL, 2019.
[22] Linguistic Data Consortium, ACE (Automatic Content Extraction) English annotation
guidelines for entities, Version 5 (2005) 2005–08.
[23] R. Weischedel, S. Pradhan, L. Ramshaw, M. Palmer, N. Xue, M. Marcus, A. Taylor, C.
Greenberg, E. Hovy, R. Belvin, et al., Ontonotes release 4.0, LDC2011T03, Philadelphia, Penn.:
Linguistic Data Consortium (2011).
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <source>ference on Natural Language Learning at HLT-NAACL</source>
          <year>2003</year>
          ,
          <year>2003</year>
          , pp.
          <fpage>142</fpage>
          -
          <lpage>147</lpage>
          . URL:
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          https://www.aclweb.org/anthology/W03-04.19 [2]
          <string-name>
            <given-names>D. M.</given-names>
            <surname>Bikel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Miller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Schwartz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Weischedel</surname>
          </string-name>
          ,
          <article-title>Nymble: a high-performance learn-</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Processing</surname>
          </string-name>
          , Association for Computational Linguistics,
          <year>1997</year>
          , pp.
          <fpage>194</fpage>
          -
          <lpage>201</lpage>
          . [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>McCallum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Freitag</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. C.</given-names>
            <surname>Pereira</surname>
          </string-name>
          , Maximum Entropy Markov models for Information
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <article-title>Extraction and segmentation</article-title>
          , in: ICML, volume
          <volume>17</volume>
          ,
          <year>2000</year>
          , pp.
          <fpage>591</fpage>
          -
          <lpage>598</lpage>
          . [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>McCallum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <article-title>Early results for Named Entity Recognition with Conditional Random</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <source>Conference on Natural Language Learning at HLT-NAACL</source>
          <year>2003</year>
          ,
          <year>2003</year>
          , pp.
          <fpage>188</fpage>
          -
          <lpage>191</lpage>
          . URL:
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          https://www.aclweb.org/anthology/W03-04.30 [5]
          <string-name>
            <given-names>C.</given-names>
            <surname>Sutton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>McCallum</surname>
          </string-name>
          , et al.,
          <article-title>An introduction to Conditional Random Fields</article-title>
          , Foundations
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <source>and Trends in Machine Learning</source>
          <volume>4</volume>
          (
          <year>2012</year>
          )
          <fpage>267</fpage>
          -
          <lpage>373</lpage>
          . [6]
          <string-name>
            <given-names>J. P.</given-names>
            <surname>Chiu</surname>
          </string-name>
          , E. Nichols,
          <article-title>Named entity recognition with bidirectional LSTM-CNNs</article-title>
          , Transac-
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>tions of the Association for Computational Linguistics 4 (</article-title>
          <year>2016</year>
          )
          <fpage>357</fpage>
          -
          <lpage>370</lpage>
          . [7]
          <string-name>
            <given-names>G.</given-names>
            <surname>Lample</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ballesteros</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Subramanian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kawakami</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Dyer</surname>
          </string-name>
          , Neural architectures for
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <article-title>named entity recognition</article-title>
          ,
          <source>in: Proceedings of the 2016 Conference of the North American</source>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Association for Computational</surname>
            <given-names>Linguistics</given-names>
          </string-name>
          , San Diego, California,
          <year>2016</year>
          , pp.
          <fpage>260</fpage>
          -
          <lpage>270</lpage>
          . URL:
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          https://www.aclweb.org/anthology/N16-10.30 [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Porta-Zamorano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Espinosa-Anke</surname>
          </string-name>
          ,
          <source>Overview of CAPITEL Shared Tasks at IberLEF</source>
          <year>2020</year>
          :
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <given-names>Evaluation</given-names>
            <surname>Forum</surname>
          </string-name>
          (IberLEF
          <year>2020</year>
          ),
          <year>2020</year>
          . [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Korobov</surname>
          </string-name>
          , T. Peng, Python-crfsuite,
          <year>2014</year>
          . https://github.com/scrapinghub/
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <article-title>python-crfsuit e</article-title>
          . [10]
          <string-name>
            <given-names>N.</given-names>
            <surname>Okazaki</surname>
          </string-name>
          ,
          <article-title>CRFsuite: a fast implementation of Conditional Random Fields (CRFs</article-title>
          ),
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          http://www.chokkan.org/software/crfsuit.e/ [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Honnibal</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Montani</surname>
          </string-name>
          , spaCy 2:
          <article-title>Natural language understanding with bloom embeddings,</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <article-title>convolutional neural networks and incremental parsing, h20tt1p7s</article-title>
          .://spacy.io/. [12]
          <string-name>
            <given-names>P.</given-names>
            <surname>Bojanowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Grave</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Joulin</surname>
          </string-name>
          , T. Mikolov,
          <article-title>Enriching word vectors with subword</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>information</surname>
          </string-name>
          ,
          <source>Transactions of the Association for Computational Linguistics</source>
          <volume>5</volume>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          135-
          <fpage>146</fpage>
          . [13]
          <string-name>
            <given-names>J.</given-names>
            <surname>Cañete</surname>
          </string-name>
          , Spanish Word Embeddings,
          <year>2019h</year>
          .ttps://doi.org/10.5281/zenodo.325500.1 [14]
          <string-name>
            <given-names>E.</given-names>
            <surname>Grave</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Bojanowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Joulin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Mikolov</surname>
          </string-name>
          ,
          <article-title>Learning word vectors for 157</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Evaluation (LREC</surname>
          </string-name>
          <year>2018</year>
          ),
          <year>2018</year>
          . [15]
          <string-name>
            <given-names>J.</given-names>
            <surname>Pérez</surname>
          </string-name>
          ,
          <source>Fasttext embeddings from SBWC</source>
          ,
          <year>2017</year>
          . Available hattps://github.com/dccuchile/
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <article-title>spanish-word-embeddings#fasttext-embeddings-from-sbw</article-title>
          . c [16]
          <string-name>
            <given-names>J.</given-names>
            <surname>Pérez</surname>
          </string-name>
          ,
          <source>Glove embeddings from SBWC</source>
          ,
          <year>2017</year>
          . Availablehatttps://github.com/dccuchile/
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <article-title>spanish-word-embeddings#glove-embeddings-from-sb w</article-title>
          .c [17]
          <string-name>
            <given-names>C.</given-names>
            <surname>Cardellino</surname>
          </string-name>
          ,
          <source>Spanish Billion Words Corpus and Embeddings</source>
          , 2h0t1t9p.s://crscardellino.
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          github.io/SBWCE/. [18]
          <string-name>
            <given-names>J.</given-names>
            <surname>Cañete</surname>
          </string-name>
          ,
          <source>Compilation of Large Spanish Unannotated Corpora</source>
          ,
          <year>2019</year>
          . UhRtLtp: s://doi.org/
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>10.5281/zenodo.3247731.</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>