<!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>Everything Transformers: Recognition, Classi cation and Normalisation of Professions and Family Relations</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Universitat Politecnica de Catalunya</institution>
          ,
          <addr-line>Campus Nord, Carrer de Jordi Girona, 1, 3, 08034 Barcelona</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This document describes the system submitted by TALP team for IberLEF 2021's MEDDOPROF Shared Task. The joint occupation mention identi cation and family relation classi cation model is composed of a pre-trained DistilBERT architecture followed by a Bidirectional LSTM layer. Occupation normalisation uses Sentence-BERT pre-trained for Semantic Text Similarity (STS) to map the ESCO and SNOMED-CT categories as well as the mentions of occupations from the documents to a vectorial space. K-nearest neighbours is then used to nd the most likely category assignments.</p>
      </abstract>
      <kwd-group>
        <kwd>NER</kwd>
        <kwd>SNOMED-CT Normalisation</kwd>
        <kwd>DistilBERT</kwd>
        <kwd>Sentence-BERT</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        We present the work carried out by the TALP Team in the context of IberLEF
2021's MEDDOPROF Shared Task [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The system is composed of two
independent sub-systems: a Named Entity Recognition and Classi cation (NERC)
model that handles the occupation mention detection (Track 1 -
MEDDOPROFNER) as well as the family relation classi cation (Track 2 -
MEDDOPROFCLASS) tasks, and a sentence-embedding model that tackles the normalization
task (Track 3 - MEDDOPROF-NORM). An in-depth description of these two
models can be found in Section 2.
      </p>
      <p>
        Due to the provided training dataset being relatively small for some
occupation classes such as activities and also fairly unbalanced compared to professions,
we also use a simple data augmentation algorithm. Similarly to the rare word
substitution approach from Fadaee et Al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], we up-sample these entities by
replacing other entities and hence adding more contexts. These new examples
are then scored by using a general-purpose BERT Language Model to discard
unlikely examples.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Systems Description</title>
      <p>As already mentioned in Section 1, our system is comprised of two independent
components. In this section, we give an in-depth look at them and describe the
data augmentation approach that we followed.</p>
      <p>We reserved a 10% of the documents from the shared tasks' training set
for validation and the remaining 90% for training, using the same split for all
three sub-tasks. The batch-wise evaluation for Tracks 1 and 2 was performed at
the level of tokens rather than entities, since it is simpler and more e cient to
compute in GPU. A full entity-wise evaluation was performed after the training
process had ended.
2.1</p>
      <p>Occupation Identi cation and Family Relation Classi cation
Even though the Shared Task splits the occupation mention identi cation and
family relation classi cation into two di erent tracks, we approached these two
tasks as a single joint task. We considered two alternatives: either using a
single output whose set of labels is the result from the cross-concatenation of the
occupation classes and the family relation classes or using two independent
outputs for occupations and family relations. We used binary cross-entropy as the
loss function for all outputs. In the two output case, the combined loss was
computed as an average of the two independent output losses. After some
preliminary evaluations, we discarded the single output model, since the increased
number of classes led to a degradation of around 10% in token-wise F1 score.
Output Encoding As for output encoding, we considered In-Out (IO) and
Begin-In-Out (BIO) encodings. We didn't see any noticeable improvements in
the two-output model when using BIO, so we opted for using IO encoding.
Similarly, and due to the fact that BERT uses word-piece encodings, that is, a
sub-word representation of the tokens; very few input sequences were only one
word-piece in length, so we also discarded other widely-used output encodings
such as Begin-In-Out-Unitary (BIOU).</p>
      <p>
        Model Structure Our NERC model structure is shown in Figure 1. Input text
is encoded using word-piece embeddings and then fed to the input transformer
of a DistilBERT model [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The output of the last tranformer layer of the
DistilBERT model is then fed to a Bidirectional LSTM layer. Up to this point, the
architecture is common to the occupation mention identi cation and relation
classi cation tasks. The outputs from the BiLSTM layer are then fed to two
independent time-distributed fully connected layers, one for each output.
      </p>
      <p>
        We initialise the weights of the DistilBERT layers from a pre-trained
generalpurpose multi-lingual model from Huggingface (distilbert-base-multilingual-cased
pre-trained model, a distilled version of bert-base-multilingual-cased with 6
layers, 768 dimensions per layer, 12 attention heads and 134M parameters.). We
opted for DistilBERT instead of the original BERT [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] model because in our
tests there was no visible degradation in F1 score yet it greatly reduced training
time.
      </p>
      <p>Training and Fine-tuning As for the training process, we explored several
strategies that are worth mentioning.</p>
      <p>First of all, we added con guration options to tweak the balance between
positive, that is, sequences containing at least one valid entity; and negative,
sequences with no entities. Note that even though all documents contain
entities, due to computational limitations, we split the documents into overlapped
sequences of up to 128 tokens. We saw that no matter the learning rate, training
solely with positive examples led to very low precision while training with the
raw documents led to low recall especially for under-represented classes. Our
nal training strategy was to interleave epochs limited to positive examples with
full epochs while decreasing the learning rate each epoch.</p>
      <p>As it was mentioned in Section 2.1, we initialise the weights from a
pretrained DistilBERT model. We also explored several alternatives for ne-tuning
these weights to our task. More in particular, we froze a number of these layers
during all or some training epochs. In our nal submission, we included two
options: either no ne-tuning or full ne-tuning of all DistilBERT weights.
Data Augmentation The labels in the training corpus for Track 1 of the
MEDDOPROF Shared Task are fairly unbalanced: 2528 entities for
PROFESION, 1011 for SITUACION LABORAL status and just 122 for ACTIVIDAD.
In order to improve F1 score for the under-represented class, we decided to double
that amount by taking examples in the training set and replacing their entities
by other activities that are less common in the training set. In order not to add
grammatically or semantically incorrect examples such as replacing "Aunque
acud a con frecuencia al gimnasio, y practicaba fundamentalmente pesas."
by "Aunque tocar la guitarra, y practicaba fundamentalmente pesas" (real
example from the dataset), we used a general purpose BERT Language Model to
compute a likelihood score so as to rank the synthetic examples (The default
bert-base-multilingual-cased pre-trained model.).
2.2</p>
      <p>Occupation Normalization
Our occupation normalization system is based on Semantic Text Similarity
(STS) between sentences. The general idea is to put every occupation in a generic
context and embed the whole sentence using a language model pre-trained for
STS. These sentence embeddings are then associated with their respective ESCO
or SNOMED-CT identi er. The inference is then performed by mapping the
candidate occupation to the aforementioned vectorial space and then assigning the
closest pre-mapped point's identi er. A visual representation of the inference
process is shown in Figure 2.</p>
      <p>We used both the provided meddoprof valid codes.tsv le and examples from
the gold-standard training corpus as pre-mapped points in the vectorial space.
We also added additional points computed as the centroid of subsets of
occupation descriptions that were mapped to the same identi er. For example,
"operador de centrifugadora", "operaria de centrifugado" and "responsable de
centrifugacion" are all associated to the identi er 8160.14 so in addition to all
three points, their geometric center is also added.</p>
      <p>We de ned two generic contexts in which the occupation descriptions are
introduced: "Trabaja de OCUPACION." y "Se dedica a OCUPACION.", where
OCUPACION is replaced by the occupation's description.</p>
      <p>
        Among all the publicly available pre-trained STS models, we opted for
DistilUSE (We used the pre-trained distiluse-base-multilingual-cased-v2
multilingual model) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], a lightweight distilled version of the Universal Sentence Encoder
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>Task Results</title>
      <p>We submitted three models for evaluation at the MEDDOPROF Shared Task:
default, with full ne-tuning of DistilBERT's weights but no data augmentation;
extended, with the same parameters as the former but adding examples from data
augmentation; and no ne tune, with data augmentation but no ne-tuning. We
used the same occupation normalization system for all three submissions.</p>
      <p>In our tests with the training and validation split described in Section 2, the
best performing model of the three was extended, which achieved 0:72 in F1 score
for Track 1, compared to default 's 0:705. This advantage funnels to Tracks 2 and
3. The results in test corpus show a di erent picture though: default achieves
0:698, outperforming extended by 0:027 (0:671).</p>
      <p>If we look at precision and recall, we can see that extended balances precision
and recall (0:671 and 0:671 respectively) whereas default favours precision over
performance (0:761 and 0:645). This was to be expected, as adding synthetic
examples often leads to the inclusion of noisy examples.</p>
      <p>Sadly, at the time of writing this system description paper, the competition's
nal results have not yet been made public and no competitive comparisons can
be made. We will then explore those results at a later date.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>This paper describes the participation of the TALP team in IberLEF 2021's
MEDDOPROF Shared Task. Our system makes extensive use of BERT-like
language models for all three tracks of the challenge. We present e ective strategies
to deal with the dataset's data imbalance either with training scheduling or
data augmentation, although this might not be re ected in the nal score as the
Shared Task's evaluation framework does not provide independent evaluation of
the classes. This data augmentation strategy not only bene ts under-represented
occupation classes but also makes our system more balanced with regards to
precision and recall.</p>
      <p>It has not been possible to do a qualitative analysis of our system compared
to the rest of the participants, nor an in-depth error analysis of our system due
to the tight schedule. However, we strongly believe that the simple approach
presented in this document has clear potential and could be improved and extended
upon for the next iterations of this Shared Task.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This contribution has been funded by the Spanish Ministry of Science and
Innovation (MICINN) (PID2019-106942RB-C33).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Devlin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chang</surname>
            ,
            <given-names>M.W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toutanova</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Bert: Pre-training of deep bidirectional transformers for language understanding</article-title>
          . arXiv preprint arXiv:
          <year>1810</year>
          .
          <volume>04805</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Fadaee</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bisazza</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Monz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Data augmentation for low-resource neural machine translation</article-title>
          .
          <source>arXiv preprint arXiv:1705.00440</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Lima-Lopez</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Farre-Maduell</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Miranda-Escalada</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Briva-Iglesias</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krallinger</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Nlp applied to occupational health: Meddoprof shared task at iberlef 2021 on automatic recognition, classi cation and normalization of professions and occupations from medical texts</article-title>
          .
          <source>Procesamiento del Lenguaje Natural</source>
          <volume>67</volume>
          (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Reimers</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gurevych</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Making monolingual sentence embeddings multilingual using knowledge distillation</article-title>
          . arXiv preprint arXiv:
          <year>2004</year>
          .
          <volume>09813</volume>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Sanh</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Debut</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chaumond</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter</article-title>
          . arXiv preprint arXiv:
          <year>1910</year>
          .
          <volume>01108</volume>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cer</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahmad</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Law</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Constant</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abrego</surname>
            ,
            <given-names>G.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yuan</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tar</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sung</surname>
            ,
            <given-names>Y.H.</given-names>
          </string-name>
          , et al.:
          <article-title>Multilingual universal sentence encoder for semantic retrieval</article-title>
          . arXiv preprint arXiv:
          <year>1907</year>
          .
          <volume>04307</volume>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>