<!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>Recognai's Working Notes for CANTEMIST-NER Track</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>David Carreto Fidalgo</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Vila-Suero</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francisco Aranda Montes</string-name>
        </contrib>
      </contrib-group>
      <fpage>352</fpage>
      <lpage>357</lpage>
      <abstract>
        <p>These working notes describe the two Named Entity Recognition (NER) systems designed by Team Recognai for the CANTEMIST (CANcer TExt Mining Shared Task - tumor named entity recognition) NER track. While the first system tries to maximise the performance with respect to the F1-score, the second system tries to maximise its eficiency with respect to model size and speed while maintaining acceptable performance.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Data preprocessing</title>
      <p>
        Our data preprocessing was minimal and consisted of two major steps:
1. As a first step we transformed the given brat annotations2of the train, dev1 and dev2
data sets to commonly used BILOU tags[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. For this we used spaCy3and a customised
tokenizer from spaCy’s "es" language model.
2. After the tokenization and the transformation to BILOU tags, we used spaCy’s sentence
splitter to divide the train, dev1 and dev2 data into sentences. Our two systems were
trained and evaluated based on sentences, hence the maximum context our models can
take into account is on a sentence level.
      </p>
      <p>We used the same spaCy sentence splitter for splitting the test and background data into
sentences and feed them to our models to obtain the submitted predictions.</p>
      <p>No data augmentation or external data was used for the training of our systems.</p>
    </sec>
    <sec id="sec-3">
      <title>3. XLM-R System</title>
      <sec id="sec-3-1">
        <title>3.1. Architecture</title>
        <p>
          The goal of this system was to maximise its performance with respect to the F1-score.
To achieve the goal of maximal performance, we use a pretrained transformer-based masked
language model provided by the Huggingface Transformers library[
          <xref ref-type="bibr" rid="ref2">2</xref>
          ].
        </p>
        <p>
          The XLM-RoBERTa[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] (XLM-R) model, trained on one hundred languages and outperforming
multilingual BERT on NER, seemed to be the most appropriate choice for our task. We opted
for its xlm-roberta-base implementation by Huggingface, after verifying that the bigger
xlm-roberta-large variant yielded no significant improvement.
        </p>
        <p>We introduce this model in our embedding layer to obtain contextualized word embeddings.
Since XLM-R applies subword tokenization, we simply sum up the subword vectors when
necessary to end up with embeddings at word level.</p>
        <p>To facilitate the model’s identification of words that are likely entities regardless their context
(like technical names of cancer types), we extend our embeddings with character features.
Another reason to add character features in general, is to make the model more robust against
typographical errors.</p>
        <p>The character feature consists of the last hidden outputs of a bidirectional Gated Recurrent
Unit (GRU) that is fed with the characters of the respective word.</p>
        <p>The stacked embeddings are then passed on to the bidirectional LSTM layer in which we
seek after a task specific contextualization of our embeddings.</p>
        <p>The hidden states of the LSTM layer are finally fed into a token classification head. This head
consists of a linear transformation of the hidden dimension of the LSTM layer to the number of
1https://www.recogn.ai/biome-text
2http://brat.nlplab.org
3https://spacy.io
possible BILOU tags, and a subsequent Conditional Random Field (CRF) model that predicts the
sequence of BILOU tags for the input.</p>
        <p>The single components of the system and there approximate sizes in terms of number of
parameters are summarised in Table 1.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Training</title>
        <p>Experimenting and optimisation of some hyperparameters were done with the train and dev1
data set. We used the AdamW algorithm implemented in Pytorch for optimising all parameters
of our model with a learning rate of 10−5.</p>
        <p>For an estimation of the model performance we used the train and dev1 data set as training
data and the dev2 set as validation data. For the final submitted predictions we trained our
model on the combined set of train, dev1 and dev2. We stopped the final training after 10 epochs,
a number estimated from previous training runs, to prevent overfitting.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. FastText System</title>
      <p>The goal of this system was to maximise the model’s eficiency with respect to the model size
and speed while maintaining acceptable performance.</p>
      <sec id="sec-4-1">
        <title>4.1. Architecture</title>
        <p>
          In contrast to our XLM-R system, we opted for a more light-weight solution regarding the
pretrained component. For this reason we chose the pretrained Spanish word vectors provided
by FastText[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. These vectors encompass 2 million words that were trained on Common Crawl4
and Wikipedia with an embedding dimension of 300.
        </p>
        <p>To assure a well generalised word vocabulary, we only add words to it that appear at least 2
times in our training data set.</p>
        <p>Furthermore we add character features to our embeddings to make our model more robust
against typos. The character feature consists of the last hidden outputs of a bidirectional GRU
that is fed with the characters of the respective word.</p>
        <p>The stacked embeddings are then passed on to the bidirectional LSTM layer in which we
seek after the contextualization of our embeddings.</p>
        <p>The hidden states of the LSTM layer are finally fed into a token classification head. This head
consists of a linear transformation of the hidden dimension of the LSTM layer to the number of
possible BILOU tags, and a subsequent CRF model that predicts the sequence of BILOU tags for
the input.</p>
        <p>The single components of the system and there approximate sizes in terms of number of
parameters are summarised in Table 2.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Training</title>
        <p>
          Experimenting and optimisation of hyperparameters were done with the train and dev1 data set
and performing Hyperparameter Optimization of both architecture parameters (e.g., encoder
hidden sizes) and training hyperparameters (e.g., learning rate). For hyperparameter
optimization, we used the integration of biome.text with the Ray Tune library[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] to perform random
hyperparameter search with the ASHA trial scheduler[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. We used the AdamW [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] algorithm
implemented in Pytorch for optimising all parameters of our model with a learning rate of
3.9 × 10−3.
        </p>
        <p>For an estimation of the model performance we used the train and dev1 data set as training
data and the dev2 set as validation data. For the final submitted predictions we trained our
model on the combined set of train, dev1 and dev2. We stopped the final training after 4 epochs,
a number estimated from previous training runs, to prevent overfitting.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Results</title>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work was supported by the Spanish Ministerio de Ciencia, Inonvacion y Universidades
through its Ayuda para contratos Torres Quevedo 2018 program with the reference number
PTQ2018-009909.</p>
    </sec>
    <sec id="sec-7">
      <title>A. Online Resources</title>
      <p>A GitHub repository was created at https://github.com/recognai/cantemist-ner that contains
the data sets as well as the data preparation, training and evaluation notebooks.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Ratinov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Roth</surname>
          </string-name>
          ,
          <article-title>Design challenges and misconceptions in named entity recognition</article-title>
          ,
          <source>in: Proceedings of the Thirteenth Conference on Computational Natural Language Learning (CoNLL-2009)</source>
          ,
          <article-title>Association for Computational Linguistics</article-title>
          , Boulder, Colorado,
          <year>2009</year>
          , pp.
          <fpage>147</fpage>
          -
          <lpage>155</lpage>
          . URL: https://www.aclweb.org/anthology/W09-1119.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>T.</given-names>
            <surname>Wolf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Debut</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Sanh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Chaumond</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Delangue</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Moi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Cistac</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Rault</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Louf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Funtowicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Davison</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Shleifer</surname>
          </string-name>
          , P. von Platen, C. Ma,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Jernite</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Plu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. Le</given-names>
            <surname>Scao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gugger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Drame</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Lhoest</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. M.</given-names>
            <surname>Rush</surname>
          </string-name>
          ,
          <article-title>HuggingFace's Transformers: State-of-the-art Natural Language Processing</article-title>
          , arXiv e-prints (
          <year>2019</year>
          ) arXiv:
          <year>1910</year>
          .03771. arXiv:
          <year>1910</year>
          .03771.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Conneau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Khandelwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Goyal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Chaudhary</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Wenzek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Guzmán</surname>
          </string-name>
          , E. Grave,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ott</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Zettlemoyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Stoyanov</surname>
          </string-name>
          , Unsupervised Cross-lingual
          <source>Representation Learning at Scale</source>
          , arXiv e-prints (
          <year>2019</year>
          ) arXiv:
          <year>1911</year>
          .02116. arXiv:
          <year>1911</year>
          .02116.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <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>
          ,
          <source>Learning Word Vectors for 157 Languages</source>
          , arXiv e-prints (
          <year>2018</year>
          ) arXiv:
          <year>1802</year>
          .06893. arXiv:
          <year>1802</year>
          .06893.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Liaw</surname>
          </string-name>
          , E. Liang,
          <string-name>
            <given-names>R.</given-names>
            <surname>Nishihara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Moritz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. E.</given-names>
            <surname>Gonzalez</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Stoica</surname>
          </string-name>
          ,
          <article-title>Tune: A Research Platform for Distributed Model Selection and Training</article-title>
          , arXiv e-prints (
          <year>2018</year>
          ) arXiv:
          <year>1807</year>
          .05118. arXiv:
          <year>1807</year>
          .05118.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>L.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Jamieson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rostamizadeh</surname>
          </string-name>
          , E. Gonina,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hardt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Recht</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Talwalkar</surname>
          </string-name>
          ,
          <article-title>A System for Massively Parallel Hyperparameter Tuning</article-title>
          , arXiv e-prints (
          <year>2018</year>
          ) arXiv:
          <year>1810</year>
          .05934. arXiv:
          <year>1810</year>
          .05934.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <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, arXiv e-prints (
          <year>2017</year>
          ) arXiv:
          <fpage>1711</fpage>
          .05101. arXiv:
          <volume>1711</volume>
          .
          <fpage>05101</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>