<!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>Vicomtech at CAPITEL 2020: Facing Entity Recognition and Universal Dependency Parsing of Spanish News Articles with BERT Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>AitorGarcía-Pablo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Montse Cuadros</string-name>
          <email>cuadros@vicomtech.org</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>ElenaZotova</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>SNLT group at Vicomtech Foundation, Basque Research and Technology Alliance (BRTA)</institution>
          ,
          <addr-line>Mikeletegi Pasealekua 57, Donostia/San-Sebastián, 20009</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <fpage>52</fpage>
      <lpage>59</lpage>
      <abstract>
        <p>These working notes describe the participation of Vicomtech NLP team in the CAPITEL task, which is part of the IberLEF 2020. CAPITEL task included two sub-tasks: Named Entity Recognition and Classification (NERC) and Universal Dependency (UD) Parsing for Spanish news articles. A specific system has been designed for each task based on BERT architectures. Both systems have been tested with diferent settings, where the best ones have been selected for being submitted to the shared task. The resulting systems show robust and competitive systems in both tasks with simple architectures.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;NERC</kwd>
        <kwd>dependency parsing</kwd>
        <kwd>deep learning</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>(NEs) in Spanish news articles. The following NE categories will be evaluated: Person (PER),
Location (LOC), Organization (ORG) and Other (OTH). The metrics used for the evaluation will
be Precision, Recall, and F-measure (Micro and Macro average).</p>
      <p>Universal Dependency Parsing sub-task aims to challenge participants to apply their
systems or solutions to the problem of Universal Dependency parsing of Spanish news articles.
The metrics used for the evaluation would be the Unlabelled Attachment Score (UAS) and
Labelled Attachment Score (LAS). UAS stands for the percentage of words that have the correct
head and LAS, the percentage of words that have the correct head and dependency label.</p>
      <p>We have participated in both sub-tasks with two diferent systems making use of simple
architectures with BERT at their base.</p>
      <p>These working notes are organised as follows: Sect1iodnescribes the systems presented in
both tasks, with all the details concerning architecture and training setup. Se2cstihoonws the
results obtained in the participation of both tasks and Sect3iodnraws some conclusions and
future work.</p>
    </sec>
    <sec id="sec-2">
      <title>1. System description</title>
      <p>This section provides a description of the systems that we have developed to participate in
CAPITEL’s task. In the face of the widespread success of Transformer-based architectu2r]es [
in virtually all Natural Language Processing (NLP) tasks, Vicomtech has implemented both
systems, one that learns to recognise and classify entities and other to establish relations between
sentence elements, based on BERT3[]. The first task, NERC, is approached using a traditional
sequence-labelling approach relying on BERT contextual representation for words. The second
task, syntactic dependency parsing, is also based on BERT at its core, combining the semantic
representation of the tokens to detect the syntactic relations among them. We have tried the
same architecture with diferent pre-trained BERT models.</p>
      <sec id="sec-2-1">
        <title>1.1. Architecture for the NERC system</title>
        <p>The NERC system is a Deep Learning model based on BERT (Bidirectional Encoder
Representation of Transformers). The model is the simplest approach in which BERT can be used to
perform NERC. It makes use of BERT to encode the input, obtaining a contextual embedding for
each input token. These contextual embeddings are the input to a fully connected feed-forward
layer that helps to classify each token as one of the possible output tags. Fi1gusrheows a
diagram with the architecture.</p>
        <p>We have experimented with two diferent pre-trained BERT models in our experiments. On the
one hand, we have used the BERT-Base Multilingual Casehdttp(s://github.com/google-research/
bert/blob/master/multilingual.m) dshared by Google. On the other hand, we have used BET4O],[
a BERT-base architecture pre-trained only using Spanish texts.</p>
      </sec>
      <sec id="sec-2-2">
        <title>1.2. Architecture for the dependency parsing system</title>
        <p>The dependency parsing system is, again, a Deep Learning model relying on BERT. The model
uses BERT to encode the input, obtaining contextual embeddings. Then, a tensor operation is
performed over the contextual embeddings to obtain an all-vs-all combination of token vectors.
This generates ×  combined embeddings that represent all the possible token pa irbse,ing
the length of the input sequence.</p>
        <p>The resulting token-pair representations are then passed to several classification layers
to make predictions about the relation between the tokens in each pair. First, the pairs are
categorised by a binary classifier that decides whether the tokens that form the pair are connected
by a relation (an arc of the dependency tree). The logits resulting from the relation classifier
are concatenated with each token-pair embeddings. The resulting representation is passed to a
ifnal classification layer to obtain the type of relation for each token pair among the Universal
Dependencies types.</p>
        <p>Note that this all-vs-all token combination strategy has an exponential computational cost
w.r.t. the length of the sequence. This approach could not be applied to full documents.
However, the scope of dependency parsing is limited to individual sentences, and since the only
operations with the all-vs-all pairs consist of concatenation and a simple matrix multiplication
(the feed-forward classification layer) the overall computational cost is feasible.</p>
        <p>Figure2 shows a diagram of the described architecture.</p>
        <p>Similar to the NERC task, we have experimented with the BERT multilingual pre-trained
model, and with its Spanish pre-trained counterpart, BETO.</p>
      </sec>
      <sec id="sec-2-3">
        <title>1.3. Input and output handling</title>
        <p>The input for the task comes already tokenized. However, these tokens are not equivalent to
what a BERT model expects. Each pre-trained BERT model needs the tokens as they are obtained
after using its own tokenizer. Otherwise the input would be meaningless to the pre-trained
model. This poses the additional challenge of keeping the alignment between the resulting
tokens and the provided labels.</p>
        <p>For that, each original token is retokenized with the corresponding BERT tokenizer. This
results in additional tokens, since BERT uses WordPiece tokenization that breaks words into
word-pieces (e.g. ”Jim Henson” would become ”Jim Hen ##son”). The provided labels are
mapped to the head of each token (i.e. the first piece of a sub-word) and the rest of the
subtokens are assigned with an special label ’X’. A mapping indicating the correspondence between
head subwords and original tokens is stored, so the original token space can be rebuilt at the
end of the process, resulting in a token and label sequences of the same length than the original.</p>
        <sec id="sec-2-3-1">
          <title>1.3.1. BETO vocabulary issues</title>
          <p>While using BETO, we realised than the special ’[UNK]’ token was being hit too often. This
token is the default representation used for out of vocabulary values (OOV). When using
more traditional tokenization approaches it is usual to encounter OOVs in NLP tasks, due to
the limited size of the whole-word vocabularies. But with modern tokenization approaches
like WordPiece or BPE this is less common. We discovered that BETO tokenizer’s WordPiece
vocabulary was missing some common punctuation marks like semicolon ’;’, or percentage
symbol ’%’. Also, we noticed that any word containing certain diacritic marks, like ’cigüeña’,
’piragüista’ or ’Düsseldorf’, were automatically marked as unknown. The same happened with
the words containing the character ’Ç’, rather common in Catalan or French nouns.</p>
          <p>Having so many unknown values is inconvenient because that means that all the occurrences
of such words will share the same vector representation. The contextual information coming
from the surrounding tokens may alleviate the problem, but relevant information is being lost.</p>
          <p>In order to deal with these issues we manually added missing punctuation marks and symbols
to the BETO vocabulary, using the unused slots of the vocabulary that are reserved for the
addition of new words. The newly added symbols would have a randomly initialised value
because they were not part of the BETO pre-training, but at least this gives them the chance of
learning a meaningful representation during the fine-tuning of the model for the downstream
task. The problem with the diacritics was solved replacing the ofending characters by their
diacritics-free counterparts, e.g. ’Düsseldorf’ was converted into ’Dusseldorf’.</p>
        </sec>
        <sec id="sec-2-3-2">
          <title>1.3.2. Post-processing IOBES tagging</title>
          <p>The gold labels for the NERC task follo wIOaBES tagging scheme, which indicates if a token
is at theBeginning, I nside, Outside orEnd of a named entity, or if it is an entity spanning a
Single token.</p>
          <p>This means that for each given entity type , there are four possible label−s:   ,
 −   ,  −   or −   . Sometimes the model selects a tag that correctly predict the
entity type, but it is incorrect with respect the IOBES tagging. Some of these mistakes can be
corrected with a simple post-processing step.</p>
          <p>A  must be followed by a n tag or an tag, otherwise it becomes an d tag. If an tag is
followed by a n tag, then the must become an  tag, and vice versa.</p>
        </sec>
      </sec>
      <sec id="sec-2-4">
        <title>1.4. Training setup</title>
        <p>
          We have experimented with two diferent pre-trained BERT models as the core for the
semantic representation of the input tokens: BERT-Base Multilingual Cashetdtp(s://github.com/
google-research/bert/blob/master/multilingual).m(mdBERT) and BETO [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], a BERT model
pre-trained on Spanish text. We have used the implementations from the HuggingFace
Transformers libraryh(ttps://huggingface.co/transformer.s/We did not perform any in-domain
language model fine-tuning for the base models. In this sense, the approach is general and
domain-agnostic. The only resource used for fine-tuning the whole system is the training data
provided for the tasks. For the NERC task the training data consisted in 22,647 sentences with a
validation set of 7,549 sentences, while for the UD task the training set contained 7,086 sentences
with a validation set of 2,362 sentences.
        </p>
        <p>The training of the diferent variants was carried out on 2 Nvidia GeForce RTX 2080 GPUs
with ∼11GB of memory. We applied the AdamW optimiser5[] with a base learning rate of
2−5 , combined with a linear LR scheduling to warm-up the learning rate during the first 5,000
training steps.</p>
        <p>For each trained model, the training monitored the weighted F1-score for the model
predictions against the development set (i.e. the entity tags for the NERC system, and the syntactic
dependency relations for the dependency parsing system). They were run for a maximum of 500
epochs with an early-stopping patience of 150 epochs. Finally, we chose the model checkpoints
that had the best development metrics.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>2. Results</title>
      <p>Regarding UD task, Tabl2e shows the top-results of the UD task evaluated on the test set and
the results of our training evaluated on the development set. Our system achieves the second
position in this task out of four diferent submissions. The results show very similar scores in
both metrics, UAS and LAS compared to the winner of the task (0.06 points less in LAS). Again,
as for the NERC task, our submitted system is based on BETO instead of mBERT because it
achieved better results in the development set.</p>
    </sec>
    <sec id="sec-4">
      <title>3. Conclusions</title>
      <p>In these working notes we have described our participation in the CAPITEL shared task, for
the two available subtasks: NERC and dependency parsing based on Universal Dependencies
(UD). We have presented the deep-learning-based architecture of our systems, which rely on
pre-trained BERT models as the base for semantic representation of the texts. We have tried
diferent pre-trained BERT models, multilingual-BERT and Spanish-BERT (BETO). Despite the
presented systems are simple and domain agnostic they obtain high scores. For the NERC
subtask our system is the 4th best performing submission, and our team achieves the 2nd
position among five participants. For the UD subtask our system ranks the 2nd achieving only
0.06 points less than the best performing system.</p>
      <p>The described systems can almost be considered baselines based on BERT. As future work,
we may experiment with other novel transformer architectures, and additional in-domain
pre-training or more sophisticated pre-training objectives. We would also experiment with
additional layer on top of these basic architectures (from the well-known CRF for NERC to
additional self-attention layers). Also, in particular for the NERC model, researching and
designing an extensible way of injecting world-knowledge about existing entities would be
very interesting.
This work has been supported by Vicomtech and partially funded by the project DeepReading
(RTI2018-096846-B-C21, MCIU/AEI/FEDER,UE).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <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>
          ,
          <article-title>Overview of CAPITEL Shared Tasks at IberLEF 2020: NERC and Universal Dependencies Parsing</article-title>
          ,
          <source>in: Proceedings of the Iberian Languages Evaluation Forum (IberLEF</source>
          <year>2020</year>
          ),
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Vaswani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Shazeer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Parmar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Uszkoreit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Jones</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. N.</given-names>
            <surname>Gomez</surname>
          </string-name>
          , Ł. Kaiser,
          <string-name>
            <surname>I. Polosukhin</surname>
          </string-name>
          , Attention Is All You Need,
          <source>in: Proceedings of the Thirty-first Conference on Advances in Neural Information Processing Systems (NeurIPS</source>
          <year>2017</year>
          ),
          <year>2017</year>
          , pp.
          <fpage>5998</fpage>
          -
          <lpage>6008</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , BERT:
          <article-title>Pre-training of Deep Bidirectional Transformers for Language Understanding, in: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</article-title>
          , Volume
          <volume>1</volume>
          (Long and Short Papers),
          <year>2019</year>
          , pp.
          <fpage>4171</fpage>
          -
          <lpage>4186</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Cañete</surname>
          </string-name>
          , G. Chaperon,
          <string-name>
            <given-names>R.</given-names>
            <surname>Fuentes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pérez</surname>
          </string-name>
          ,
          <article-title>Spanish Pre-Trained BERT Model and Evaluation Data</article-title>
          ,
          <source>in: Proceedings of the Practical ML for Developing Countries Workshop</source>
          at the Eighth International Conference on Learning
          <source>Representations (ICLR</source>
          <year>2020</year>
          ),
          <year>2020</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>9</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>I.</given-names>
            <surname>Loshchilov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Hutter</surname>
          </string-name>
          , Decoupled Weight Decay Regularization,
          <source>in: Proceedings of the Seventh International Conference on Learning Representations (ICLR</source>
          <year>2019</year>
          ),
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>R.</given-names>
            <surname>Agerri</surname>
          </string-name>
          , G. Rigau,
          <article-title>Projecting Heterogeneous Annotations for Named Entity Recognition</article-title>
          ,
          <source>in: Proceedings of the Iberian Languages Evaluation Forum (IberLEF</source>
          <year>2020</year>
          ),
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
            <surname>Sánchez-León</surname>
          </string-name>
          ,
          <article-title>Combining Diferent Parsers and Datasets for CAPITEL UD Parsing</article-title>
          ,
          <source>in: Proceedings of the Iberian Languages Evaluation Forum (IberLEF</source>
          <year>2020</year>
          ),
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>