<!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>On the Behaviour of BERT's Attention for the Classification of Medical Reports</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luca Putelli</string-name>
          <email>luca.putelli1@unibs.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alfonso E. Gerevini</string-name>
          <email>alfonso.gerevini@unibs.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alberto Lavelli</string-name>
          <email>lavelli@fbk.eu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tahir Mehmood</string-name>
          <email>tahir.mehmood@unibs.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ivan Serina</string-name>
          <email>ivan.serina@unibs.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Fondazione Bruno Kessler</institution>
          ,
          <addr-line>Povo (TN)</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Università degli Studi di Brescia</institution>
          ,
          <addr-line>Brescia</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <abstract>
        <p>Since BERT and the other Transformer-based models have been proved successful in many NLP tasks, several studies have been conducted to understand why these complex deep learning architectures are able to reach such remarkable results. Such studies have focused on visualising and analysing the behaviour of each self-attention mechanism and are often conducted with large, generic and annotated datasets for the English language, using supervised probing tasks in order to test specific linguistic capabilities. However, in several practical contexts there are some dificulties: probing tasks may not be available, the documents can contain a strict technical lexicon, and the datasets can be noisy. In this work we analyse the behaviour of BERT in a specific context, i.e. the classification of radiology reports collected from an Italian hospital. We propose (i) a simplified way to classify head patterns without relying on probing tasks or manual observations, and (ii) an algorithm for extracting the most relevant relations among words captured by each self-attention. Combining these techniques with manual observations, we present several examples of linguistic information that can be extracted from BERT in our application.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Language models based on Transformer [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] like BERT (Bidirectional Encoder Representations
from Transformer) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], have obtained remarkable results in Natural Language Processing (NLP)
tasks like machine translation or text classification, reaching a new state of the art. Intuitively,
these models are composed by several encoders that progressively learn information about
words and how they are related to each other. Encoders are made (among other components)
by several parallel self-attention mechanisms called heads. For each word, a head calculates
a probability distribution representing how much this word is related to every other word
contained in the document.
      </p>
      <p>
        The results and the complexity of BERT lead several research groups [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to study how these
language models capture the structure of the language [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], grammatical knowledge [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">5, 6, 7</xref>
        ]
or task specific information [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. These analyses are conducted focusing on the embedded
representation provided by each encoder [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] or on the self-attention mechanism in each head
[
        <xref ref-type="bibr" rid="ref10 ref11 ref12">10, 11, 12</xref>
        ]. Similarly to other deep learning techniques such as LSTM Neural Networks [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ],
BERT has been proven efective for extracting information from clinical narrative texts [
        <xref ref-type="bibr" rid="ref14 ref15">14, 15</xref>
        ].
Therefore, this technology could improve the eficacy and quality of patients’ care. However, in
this environment it is very important to assure the physicians that the system is correct and to
expose the reasoning behind its decisions [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
      </p>
      <p>
        Moreover, according to works like [
        <xref ref-type="bibr" rid="ref13 ref17 ref18">13, 17, 18</xref>
        ], the Attention Mechanism can be used for
highlighting the most important sections in a document and exploit them for interpretability,
simply extracting the weights assigned by the Attention Mechanism, which can be seen as an
indicator of the importance of each word for the predictive task. However, the self-attention
used in BERT assigns a weight representing how much two words are related to each other.
Moreover, while in LSTM-based models there is usually a single attention mechanism, in BERT
there are more than 100 heads to consider. Therefore, deriving a single and straightforward
indication of the importance of words for the classification task is definitely more challenging.
      </p>
      <p>
        Furthermore, the studies in [
        <xref ref-type="bibr" rid="ref10 ref12">10, 12</xref>
        ] show that heads can be grouped according to a few
distinct patterns; for instance, there are heads that always connect a word with the previous
one or that distribute the attention weights across several words. This grouping process
can be done by inspecting the heads manually [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] or with clustering techniques [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. Both
alternatives present some issues, such as the necessity of human intervention if the inspection
is done manually, while in the second alternative the variability of the results depends on
which clustering algorithm is selected and its hyper-parameters. These works usually show
and verify the head behaviour on benchmark datasets in English and they use probing tasks,
i.e., supervised classification tasks that focus on the capability of the self-attention weights to
encode linguistic knowledge, without explicitly extracting the connection between words with
the highest weights. This is not a trivial task given the diferences among the heads.
      </p>
      <p>In this work, we apply BERT in the context of the classification of radiology reports written in
Italian and collected from the radiology department of Spedali Civili di Brescia. Then, we analyse
the behaviour of BERT’s Attention, presenting a schematic grouping process for the heads
that does not require human inspection or clustering algorithms. Moreover, we propose an
algorithm for extracting the most important word pairs according to the self-attention weights
provided by each head. We then verify how these procedures can be exploited in our context
for extracting useful information and their relation to the interpretability of BERT.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Background and Related work</title>
      <p>
        2.1. BERT
BERT [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] is an architecture based on Transformer [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] composed by several encoding layers
which progressively analyse a sequence of tokens (i.e., words or parts of a word) in order to
capture their meaning. Each layer applies multiple self-attention mechanisms (called heads) in
parallel. Considering a sequence of tokens  of length  , this mechanism produces a matrix
 , ∈ ℝ × , where  is the number of the encoding layer and  is the head number. For each
token  ∈  , the vector   ∈  , contains the attention weights that represent how much  is
related to the other tokens in  .
      </p>
      <p>In order to calculate these weights, in each head the input representation of the token sequence
 ∈ ℝ  × is projected into three new representations called key ( ), query ( ) and value ( )
with three matrices   ,   and   :
 =  × 
 ,  =  × 
 ,  =  × 

(1)
(2)
Then, the attention weights are calculated using a scaled dot-product between  and  and
applying the softmax function. The new token representation  is calculated by multiplying
the attention weights for  .</p>
      <p>
        =  (
 × 
√
),  =  × 
where  is the length of the input representation of each token. Given that in each encoding
layer there are multiple heads, in order to create a representation provided by the multi-head
attention mechanism the result of each head is concatenated and then fed to a feed-forward
layer. As described in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the multi-head attention mechanism is followed by a feed-forward
layer and residual connections. The output of an encoding layer is the input of the next one.
      </p>
      <p>Exploiting a large collection of documents, BERT is trained for two tasks: language modeling,
where BERT learns to predict a percentage (usually 15%) of tokens from context, and next
sentence prediction, which is a binary classification task where BERT has to predict if a sequence
of two sentences is correct or not. For the latter task, BERT introduces two special tokens:
[CLS], whose representation is used for the binary classification task and represents the whole
sequence, and [SEP] which separates the two sentences. Learning these two tasks allows BERT
to create a meaningful representation of each token and also to summarise the most important
information in a sentence. Once the model is trained, it can be adapted using smaller datasets
for specific NLP tasks like Named Entity Recognition, text classification, sentiment analysis, etc.</p>
      <sec id="sec-2-1">
        <title>2.2. Related work</title>
        <p>
          In the last few years, several studies have been conducted in order to understand the reasons
behind its success and which linguistic and world knowledge is stored in a BERT model [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
We can group these studies into two main categories, simply considering if they analyse the
embedding representations or the head’s behaviour. From the former category, the works in
[
          <xref ref-type="bibr" rid="ref20 ref6">6, 20</xref>
          ] show how linguistic information (a total of 68 features such as Part-of-speech tags, verb
inflection, depth of the dependency tree, etc.) is encoded in the BERT embeddings produced
by each layer. Testing semantic roles, semantic dependencies (such as coreference between
nouns and pronouns), entities and relations like in the classical NLP pipeline is the focus of [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
Similar tests were conducted in [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] and [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], with a particular focus on subject-verb agreement.
An aspect that regards all these works is that they require datasets annotated with the linguistic
phenomena they are examining with their probing tasks. Unfortunately, in the clinical domain
it is much more dificult to find this kind of annotations [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], and there are many challenges
related to the quality of the text, with abbreviations, typos and ungrammatical language [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
Therefore the use of probing tasks is quite limited, especially for the Italian language.
        </p>
        <p>
          The latter category regards the analysis of the head’s behaviour. Since the introduction of
the first visualization tools, like BertViz [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ], it has been possible to note how heads behave
accordingly to some recognizable patterns. The work in [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] presents some interesting results,
manually selecting heads that give attention broadly, to the next token, or to [SEP]. The authors
use probing tasks in order to show that certain heads target specific linguistic information,
such as coreference, direct objects, relations between possessive pronouns and nouns, etc. In
[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], similar patterns were presented and other probing tasks were executed. For instance,
given a pair of tokens with a specific linguistic relation, they detect which heads assign a high
weight to such pair. Our work difers from these ones because we propose a way of grouping
heads according to their pattern with a quantitative approach. Moreover, while these works use
probing tasks in order to find meaningful relations between pair of tokens without explicitly
extracting them, we propose an algorithm specifically designed for this extraction, simplifying
the subsequent analyses. In [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ], the authors exploit clustering algorithms to automatically
group heads into categories, and discuss their importance. A drawback of this approach is that
clustering algorithms can produce very diferent results according to their implementation,
their hyper-parameters and the number of selected clusters.
        </p>
        <p>
          Evaluating the interpretability of deep learning systems for NLP, in terms of highlighting the
most important snippets in order to justify the model output, is a very active research field [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ].
While several studies focused on whether the attention weights could lead or not to an insight
of the reasoning of the model [
          <xref ref-type="bibr" rid="ref24 ref25 ref26">24, 25, 26</xref>
          ], the research regarding BERT is still ongoing. In [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ],
the embedding representations are analysed in the context of a Question Answering task. In [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ],
the authors show that the words receiving most of the attention belong to the specific lexicon of
the document subject. We have performed the same analysis in our context but with no results.
In our opinion, this may depend on the fact that our radiology reports mostly share the same
lexicon, with just small diferences.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Methodology</title>
      <p>In this section, we show the techniques used for identifying the heads’ pattern and for extracting
the most relevant relations between words, according to the attention weights distribution. Our
goal is to find interesting information encoded in the attention weights for each head. However,
given that this information is not labelled in our corpus of reports, first we want to assess the
behaviour of each head, potentially selecting the most promising ones. Therefore, first we
propose a simple method for identify the behaviour of each head and to group them accordingly.
Next, we propose an algorithm for extracting the relation between word pairs with the highest
weights that works regardless the diference between the heads’ behaviours.</p>
      <sec id="sec-3-1">
        <title>3.1. Metrics for the Head Grouping</title>
        <p>Given a document made by  tokens, as described in Section 2.1, the head (, ) , where  is
the number of the encoding layer and  is the head number in its multi-head self-attention
mechanism, we call  , ∈ ℝ × the matrix of the attention weights produced by (, ) . For
each token  ,  , contains a vector   ∈ ℝ which is a probability distribution representing its
connections with all  tokens (itself included).</p>
        <p>
          As reported in [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], when the attention is only on the special token [SEP], which is not used
in the classification process but only for marking the end of the document, it can be seen as a
null operation, or no-op. Therefore, first of all we want to evaluate how much   is close to a
where
        </p>
        <p>
          is the Jensen-Shannon Divergence, which is a standard statistical method for
evaluating the similarity between two probability distributions. The Jensen-Shannon Divergence is
bounded between 0 and 1, and it is 0 when the two distributions are identical, 1 when they are
completely diferent. Please note that this metric is not calculated for evaluating the behaviour
of the entire head, instead it is designed for a single token. We can describe a token  as
operative if   &gt; 0.5, otherwise we call it not operative. Using this metric, we can introduce a
ifrst categorization of the heads. As reported in [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], if a head executes a specific function, such
as connecting a verb with its direct object, then those tokens onto which the function cannot
be applied are usually connected to [SEP]. Therefore, we can specify two categories of head
patterns: General if more than 50% tokens are operative and Mixed otherwise.
        </p>
        <p>Considering the General heads, if the attention weights are distributed uniformly across the
tokens, then no particular information could be extracted from them. Therefore, we evaluate
how much   is similar with respect to a standard uniform distribution, using the Focus Metric
 , which we can define as:
  =  (
 || ),  [] =</p>
        <p>∀ ∈ [1,  ]

1</p>
        <p>Moreover, in several examples, we have observed a small number of heads where most tokens
basically give high attention to themselves. Given their peculiar behaviour, we design a specific
metric for identifying them: the Self Metric  . We evaluate the diference between 
one-hot vector, where the 1 is in the same position of  in the document. More formally,
 and a
(3)
(4)
(5)
no-op. Ideally, if all the attention is directed to [SEP], the probability distribution of the weights
is a one-hot vector where the 1 is present in the index of [SEP]. In Equation 3, we refer to it as
 . In order to calculate how much   focuses on tokens diferent from [SEP], we calculate the
No-Op Metric  as:
  =  (
 ||), [] =
{
  =  (
 ||  ),   [] = {
0   [] ≠ 
1   [] =</p>
        <p>
          In order to capture the behaviour of each head, we calculate the average of  and  across all
the tokens in a document. Observing the pattern varying the average of  , we can group the
general heads into four sub-categories:
• Broadcast, with an average  lower than 0.4. These heads distribute their attention
broadly across all tokens, with no particular criteria. This group resembles the Dense
cluster described in [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ];
• Ofset , with an average  higher than 0.7. These heads usually focus their attention on
the previous/subsequent tokens without specific linguistic patterns. This group strongly
resembles the Diagonal group observed in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ];
• Local, with an average  between 0.4 and 0.7, and  below 0.6. These heads mostly give
attention to other tokens in the same sentence, with variable distance and behaviour
depending on the analysed token. While some of these heads can be associated with
        </p>
        <p>
          the Block group defined in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] and the Dense&amp;Vertical group defined in [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ], a strong
correlation with other groups has not been observed;
• Not Local, with an average  between 0.4 and 0.7, and  higher than 0.6. These heads give
attention mostly to the token itself, other occurrences of the same word or other similar
words, regardless if they are in the same sentence or not. To the best of our knowledge,
this pattern is not present in the literature. A more detailed description, with examples
and numerical results taken from our case study, can be seen in Section 5.2.
        </p>
        <p>
          For the Mixed heads, given that the majority of the tokens is connected to [SEP], discovering
which function they are trying to implement is a much more dificult process without probing
tasks [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] and a general classification has not been proposed yet. For instance, the works in [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]
and [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] group them into a category called Vertical, which basically highlights that the majority
of tokens are connected to [SEP] with no further analysis. In Figure 1, we show the main flow
of our categorisation process. Although our metrics are calculated for a single document, we
have observed that there are no important diferences in the behaviour of a head for diferent
documents.
        </p>
        <p>
          An important note about the thresholds used for the described metrics is that they have
been set with a bottom-up approach, observing the behaviour of diferent heads using several
documents in our corpus and deriving a general rule. Although these values are apt for our
context and they show a remarkable resemblance with other grouping techniques showed in
diferent contexts [
          <xref ref-type="bibr" rid="ref10 ref11 ref19">10, 11, 19</xref>
          ], our method could require a diferent setting if other BERT models,
language or datasets are considered. We are currently studying a method for recognising these
thresholds in an automatic way with an unsupervised approach.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Mean Shift Linker Algorithm</title>
        <p>
          In [
          <xref ref-type="bibr" rid="ref10 ref12">10, 12</xref>
          ] the connections between pairs of tokens are simply shown with visualization
techniques, with lines of diferent thickness on the basis of the attention weights. However, with
relatively long documents with 400 or 500 words the amount of connections increases drastically,
making the visualization less understandable and very complex to compute. Therefore, our
approach is to directly extract the most important connections among tokens from a specific
head. This could help the understanding of the function performed by the head, and simplify
the visualization process.
        </p>
        <p>Our algorithm for automatically finding these connections is based on Mean Shift [ 28], a
clustering algorithm suitable for density functions and one-dimensional clustering [29]. Given
a distribution of attention weights   = [ 1,  2 …   ] for a token  , the diferent   ∈   are
grouped into several clusters depending on their value. In our system, we considered the
implementation provided by the standard Machine Learning library Scikit-Learn1[30]. Since
our clusters are composed by just a few tokens (even just one) and all the tokens needs to be
analysed, we set the minimum bin frequency at 1 and the  _ parameter to    . All
the other hyperparameters were set to the default values. As we introduced in Section 3.1,
one of the most important diferences among the head patterns is how the attention weights
are distributed across diferent tokens. For instance, in the Ofset heads, a token is connected
only to another one. Instead, in the Local heads, the attention can be distributed across several
tokens with diferent degrees of importance. Given that in Mean Shift the number of clusters
is defined automatically and it is not selected by the user, this algorithm can easily adapt to
such diferences. As highlighted in the example showed in Figure 2, on the left we can see how
the algorithm selects only two clusters for Ofset heads (on the left) and more clusters for the
Local heads (on the right). A drawback of this approach is that while the last cluster can be
easily discarded as irrelevant and the first considered as important, the role of the intermediate
clusters is not immediately understandable. A more detailed analysis of these aspects is going
to be conducted as future work.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Classification of Radiology Reports</title>
      <p>In this section, we describe the real-world context into which we applied BERT, namely the
classification of radiology reports. We analyse chest tomography reports, focusing in particular
on the possible presence of neoplastic lesions. The potential advantages of a reliable automatic
classification of both old and new reports concern diverse areas such as logistics, health care
management, monitoring the frequency of follow-up examinations, and collecting cases for
research or teaching purposes. The proposed system for report classification is based on a
schema defined in strict collaboration with the radiologists [ 31]. This schema is composed
by three levels, that correspond to the main aspects considered by the physicians during the
1https://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html</p>
      <p>Accuracy
96.1
87.4
73.6</p>
      <p>F-Score
95.9
84.1
71.6
1. Exam Type (First Exam or Follow-Up);
2. Result (Suspect or Negative);
3. Lesion Nature (Neoplastic, or lesion with an Uncertain Nature). This third level is specified
only for the Suspect reports.</p>
      <p>The dataset is composed by 5,752 classified computed tomography reports. Our reports
contain a description (typically without verbs) of what the physicians have seen in the TC
images (nodules, lesions, etc.), their relation to previous visits (for instance, if the dimensions are
the same with respect to the previous exam) or excluding the presence of specific symptoms or
abnormalities. Similarly to other clinical texts, our reports are characterized by a non-standard
language, with abbreviations, ungrammatical language, acronyms and typos. This is due to
the fact that reports are often written in haste or dictated to a speech recognition software. In
addition, abbreviations and acronyms are sometimes idiosyncratic to the specific hospital or
department.</p>
      <p>In order to see if BERT is efective also in this complex context, we performed the
classification task, we adapted the BERT-base Italian model provided by the HuggingFace library2
by performing the Masked Language Model and Next Sentence Prediction tasks on 10, 000
unclassified reports and next we fine-tune it with our supervised training set. We used Adam as
optimizer with learning rate 2 ∗ 10−5 and batch size 8 for 4 epochs. Performance is evaluated in
10-fold cross validation, therefore training 10 versions of the models using diferent training and
tests and computing the average results. In Table 1, we show the results obtained by our model.
For the first two classification levels, the results are higher than 85% in terms of accuracy. For
the third level, the performance does not reach the same level of accuracy. This is due mainly
to two issues. First, as described in [31], there is no strong agreement among the physicians
for identifying Uncertain Nature cases and not mistaking them with Negative or Neoplastic
reports. We speculate that these reports contain the most sensible information, therefore their
language is the most ambiguous and cryptic. Moreover, it is also probable that some reports
can be evaluated as both Uncertain or Negative depending on the doctor’s opinion. Secondly,
the third level is only specified for the non negative reports, therefore limiting the number
of reports (less than 2000) available for fine-tuning the BERT model. Overall, comparing the
results obtained by BERT with the LSTM-based model presented in [31], we can see a small
improvement in terms of accuracy and F-Score.
2https://huggingface.co/dbmdz/bert-base-italian-cased
(a)
(b)</p>
    </sec>
    <sec id="sec-5">
      <title>5. Experimental Results</title>
      <p>
        The pre-trained model we used for our classification task has 12 encoding layers and each of
which has 12 heads. Thus, we can represent the category of every head in the model as a 12 × 12
matrix. As mentioned in Section 3.1, our metrics are calculated considering a specific document
and therefore some heads (especially in the proximity of the thresholds) may vary their category
depending on the document. However, they are a small minority (between 10 and 15) with
respect to the total. Analysing Figure 3a we can see some characteristics of the model and
our results are quite similar to the ones showed in [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. First of all, the first 2 encoding layers
contain mostly Broadcast heads, which progressively diminish. Instead, the intermediate layers
contain mostly Local heads and the last ones are made by a majority of Mixed heads. Ofset and
Not Local heads are sparse across the model.
      </p>
      <p>In order to select some interesting linguistic characteristics detected by the Italian BERT
model in its Local and Not Local heads, we adopted the following approach. First, we calculated
the operative tokens, and inspected them searching for interesting patterns. For these tokens, we
executed the Mean Shift Linker algorithm, and considered only the first cluster, which contains
the highest weights and therefore, it is supposed to highlight the most important relation
between pairs of tokens. Finally, on the basis of these results, we formulated an hypothesis on
the main linguistic function implemented by the head, and manually annotated some instances
of such function. This approach radically difers from the typical probing tasks, where every
head is tested with some predefined datasets. In the following sections, we highlight some
interesting information that can be extracted from a selection of heads. Please note that we
focused our analysis mostly on medical terms, which often are not present in the original
vocabulary of the BERT model. Although this does not seem to have a negative impact on our
analysis, as future work we will try to perform the same tasks in other domains with a less
specific lexicon and evaluate if there are significant diferences.
(9,6)</p>
      <p>Association Support
no (nodules) → bilateral 494
portion → ca (caudal) 113
local → recur (recurrence) 118
pulmonary → artery 1090</p>
      <sec id="sec-5-1">
        <title>5.1. Adjectives</title>
        <p>Considering head (7, 4), i.e., the fourth head of the seventh encoding layer, we have found a
significant pattern that connects noun with adjectives. On the top of Figure 3b, we show how
the first token of the word noduli (nodules, in English) is connected to the first token of the
adjective aspecifici (aspecific) and the word bilaterali (bilateral). Please note that the adjective
millimetrici (millimetric) is not recognised by the head, which is perhaps due to the fact that
the adjective precedes the noun, which is quite uncommon in the Italial language.</p>
        <p>On the contrary, head (9, 6) finds connections between adjective and nouns. On the bottom of
Figure 3b, we show how the adjective locale (local) is connected with the first token of rediciva
(recurrence).</p>
        <p>In order not to limit our analysis only to qualitative examples, we have manually annotated
several instances of such correlations and tested how these two heads behave. From our corpus
of reports, we annotated the relations between nodules and bilateral, portion and caudal, local
and recurrence and pulmonary and artery. In Table 2, we report the results we obtained. For the
relation between local and recurrence, we have that 98% of the 118 instances annotated were
recognised by head (9, 6). For head (7, 4), the relation between nodules and bilateral has an
accuracy of 78.5% across 494 instances. Other relations are recognised with some dificulties,
such as the one between artery and pulmonary or portion and caudal. These probably sufer
from the fact that the words involved are very specific to the medical lexicon, which could not
be learned properly due to the limited amount of reports in our dataset.</p>
      </sec>
      <sec id="sec-5-2">
        <title>5.2. Semantic Field</title>
        <p>While Local or Mixed heads perform mostly grammatical connections, and therefore concentrate
the attention between tokens not so distant from each other, Not Local heads show a completely
diferent behaviour. Given also the fact that they are a minority with respect of the total
144 heads (as can be seen in Figure 3a observing the blue squares), we have inspected them
closely. In heads (2, 1), (3, 11) and (4, 6) tokens are mostly connected to themselves or to other
occurrences of the same word. This is particularly evident for the word Non (not, in English)
which appears several times in a report. Usually, each appearance is connected to all the others.
There are a few notable exceptions, where very similar tokens are connected, such as locale
and locali (singular and plural versions of the adjective local). Moreover, head (2, 1) is quite
noisy and shows random and local connections without any recognisable logic. On the other
hand, heads (12, 1) and (12, 5) are very precise, and the vast majority of the tokens points only
to themselves, regardless if similar words or other occurrences are present.</p>
        <p>Association Support
lesions → no (nodule) 938
texture → paren (parenchyma) 228
artery → ##orta (aorta) 606
pulmonary → chest 3661
inferior → superior 5332
segments → portion 131
left → right 1784</p>
        <p>The most interesting phenomenon that we observed regards head (6, 10). Its behaviour can
be summarised as follows. If token  is present more than once in the document or there
are tokens with very small variations (like singular and plural diferences such as nodule and
nodules), then the attention is distributed across all the other occurrences (or little variations)
of  . Otherwise, most of the attention is concentrated on synonyms, antonyms or words in
the same semantic field of  , like the ones in Table 3. If the two previous conditions are not
satisfied,  is connected only to itself.</p>
        <p>We investigated further the capability of head (6, 10) to find synonyms or words in the same
semantic field. Considering our reports, we analysed the first cluster extracted by the Linker
algorithm for each token and discarded when it is connected to itself, or when there are only
small variations in terms of characters between the words. In Table 3, we report our results
in which we can see some important connections. For instance, the connection between the
word lesions and the first token of nodule (which is a particular kind of lesion) is captured
almost every time it appears (99.98% accuracy) over more than 900 instances. In our opinion,
the relation between texture and the first token of parenchyma (with an accuracy of 92.54%)
is particularly important, especially given the fact that parenchyma is a very specific word in
the anatomy lexicon, describing a particular type of texture. Simple antonyms like inferior and
superior or left and right are also captured with an high accuracy.</p>
      </sec>
      <sec id="sec-5-3">
        <title>5.3. Negations</title>
        <p>
          We also studied a specifc kind of relations which can be particularly useful in our analysis. In fact,
when radiologists evaluate the conditions of a patient, they often write a sentence excluding the
presence of something, especially lesions. Sentences like “No focal lesions traceable to secondary
locations” are a strong evidence of a negative result of the report, and their individuation could
be an important factor in terms of interpretability. Manually inspecting the Local heads, we
have identified two of them that can be used to find these patterns: (9, 8) and (7, 12). There
is however an important diference: head (9, 8) connects the negative particle with the word
which has been denied, while head (7, 12) does the opposite. Nevertheless, instead of a very
specific behaviour like the ones showed by [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], when a negation is not present, these heads also
can connect adjectives or other tokens, instead of directing the attention into [SEP]. While we
cannot straightforwardly claim that these heads are specialised into identifying the negations,
we checked if at least they can be used for extracting specific information. Therefore, we
annotated the relation between Non and lesioni (no lesions) and calculated the accuracy of these
heads of recognising; we found that for more than 800 instances, head (9, 8) has an accuracy of
67.9% and (7, 12) reaches 86.0%.
        </p>
        <p>However, while in our context negations are expressed simply with the term “Non” or “nè”
(neither), in general negations can be expressed in many diferent forms, and their detection is
a complex task that can require specific models [ 32]. Moreover, the identification of negations
could be limited by the presence of the term no not only for introducing a negation but also as
the first token of nodulo or other similar words. Thus, while the result of head (7, 12) is quite
good in this particular case, a more detailed evaluation of the capability of specific heads to
detect a negation will be conducted as future work.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions and Future work</title>
      <p>We presented an application of fine-tuning the Italian-base BERT model in the context of the
classification of radiology reports written in Italian. After verifying its eficacy, we have
investigated how its heads behave, and we have proposed to group heads according to their behaviour.
An important characteristic of our approach is that it relies only on simple mathematical metrics
based on the Jensen-Shannon Divergence, instead of relying on manual observations or
clustering. We have also proposed an algorithm based on clustering for automatically extracting the
most important connection between words, simplifying the understanding of the characteristics
of each head.</p>
      <p>Combining these automatic procedures with manual observations, we have found and
experimentally evaluated some relevant patterns that can improve the interpretability of BERT for the
classification of radiology reports. For instance, in our application it is not suficient to identify
the most important findings or concepts but also to correlate them with their characteristics.
For instance, a nodule can be associated with a neoplastic lesion if its margins are irregular or
spiculated and not round. Therefore, finding the heads that connect nouns (like margin) and
adjectives (like round) could be efectively used for the classification process and its explanation.
At the same time, finding that a particular condition is excluded by a negation could be crucial
information. Moreover, we have found a head that identifies words in the same semantic
ifeld with remarkable accuracy. Although this does not lead to an immediate application for
interpretability, this characteristic is another proof of the ability of BERT to capture language
properties.</p>
      <p>While we have studied and analysed the behaviour of BERT’s heads in the radiology context,
our techniques are general, and can be easily adapted to other contexts. However, our metrics
relies on specific thresholds that could vary on the basis of the document length or its
characteristics. As future work, we want to test our techniques more extensively in other applications
and using other datasets.
analysis of transformer representations, in: Proceedings of the 28th ACM International
Conference on Information and Knowledge Management, CIKM ’19, Association for
Computing Machinery, New York, NY, USA, 2019, p. 1823–1832.
[28] D. Comaniciu, P. Meer, Mean shift: A robust approach toward feature space analysis, IEEE</p>
      <p>Transactions on pattern analysis and machine intelligence 24 (2002) 603–619.
[29] Y. A. Ghassabeh, On the convergence of the mean shift algorithm in the one-dimensional
space, CoRR abs/1407.2961 (2014). a r X i v : 1 4 0 7 . 2 9 6 1 .
[30] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel,
P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher,
M. Perrot, E. Duchesnay, Scikit-learn: Machine learning in Python, Journal of Machine
Learning Research 12 (2011) 2825–2830.
[31] L. Putelli, A. E. Gerevini, A. Lavelli, M. Olivato, I. Serina, Deep learning for classification
of radiology reports with a hierarchical schema, in: Knowledge-Based and Intelligent
Information &amp; Engineering Systems: Proceedings of the 24th International Conference
KES-2020, Virtual Event, 16-18 September 2020, volume 176 of Procedia Computer Science,
Elsevier, 2020, pp. 349–359.
[32] A. Khandelwal, S. Sawant, NegBERT: A transfer learning approach for negation detection
and scope resolution, in: Proceedings of The 12th Language Resources and Evaluation
Conference, LREC 2020, Marseille, France, May 11-16, 2020, European Language Resources
Association, 2020, pp. 5739–5748.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <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>
          , L. u. Kaiser,
          <string-name>
            <surname>I. Polosukhin</surname>
          </string-name>
          ,
          <article-title>Attention is all you need</article-title>
          ,
          <source>in: Advances in Neural Information Processing Systems</source>
          , volume
          <volume>30</volume>
          ,
          <string-name>
            <surname>Curran</surname>
            <given-names>Associates</given-names>
          </string-name>
          , Inc.,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</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>
          ,
          <article-title>BERT: 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, NAACL-HLT 2019, Minneapolis</article-title>
          , MN, USA, June 2-7,
          <year>2019</year>
          , Volume
          <volume>1</volume>
          (Long and Short Papers),
          <source>Association for Computational Linguistics</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>4171</fpage>
          -
          <lpage>4186</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Rogers</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Kovaleva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rumshisky</surname>
          </string-name>
          ,
          <article-title>A primer in BERTology: What we know about how BERT works</article-title>
          ,
          <source>Trans. Assoc. Comput. Linguistics</source>
          <volume>8</volume>
          (
          <year>2020</year>
          )
          <fpage>842</fpage>
          -
          <lpage>866</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>G.</given-names>
            <surname>Jawahar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Sagot</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Seddah</surname>
          </string-name>
          ,
          <article-title>What does BERT learn about the structure of language?</article-title>
          ,
          <source>in: Proceedings of the 57th Conference of the Association for Computational Linguistics</source>
          ,
          <string-name>
            <surname>ACL</surname>
          </string-name>
          <year>2019</year>
          , Florence, Italy,
          <source>July 28- August 2</source>
          ,
          <year>2019</year>
          , Volume
          <volume>1</volume>
          :
          <string-name>
            <given-names>Long</given-names>
            <surname>Papers</surname>
          </string-name>
          ,
          <source>Association for Computational Linguistics</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>3651</fpage>
          -
          <lpage>3657</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Goldberg</surname>
          </string-name>
          ,
          <article-title>Assessing BERT's syntactic abilities</article-title>
          , CoRR abs/
          <year>1901</year>
          .05287 (
          <year>2019</year>
          ). URL: http://arxiv.org/abs/
          <year>1901</year>
          .05287.
          <article-title>a r X i v : 1 9 0 1 . 0 5 2 8 7</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Miaschi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Brunato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Dell'Orletta</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Venturi, Linguistic profiling of a neural language model</article-title>
          ,
          <source>in: Proceedings of the 28th International Conference on Computational Linguistics</source>
          ,
          <string-name>
            <surname>COLING</surname>
          </string-name>
          <year>2020</year>
          , Barcelona, Spain (Online),
          <source>December 8-13</source>
          ,
          <year>2020</year>
          ,
          <source>International Committee on Computational Linguistics</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>745</fpage>
          -
          <lpage>756</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>I.</given-names>
            <surname>Tenney</surname>
          </string-name>
          ,
          <string-name>
            <surname>D. Das</surname>
            ,
            <given-names>E. Pavlick,</given-names>
          </string-name>
          <article-title>BERT rediscovers the classical NLP pipeline</article-title>
          ,
          <source>in: Proceedings of the 57th Conference of the Association for Computational Linguistics</source>
          ,
          <string-name>
            <surname>ACL</surname>
          </string-name>
          <year>2019</year>
          , Florence, Italy,
          <source>July 28- August 2</source>
          ,
          <year>2019</year>
          , Volume
          <volume>1</volume>
          :
          <string-name>
            <given-names>Long</given-names>
            <surname>Papers</surname>
          </string-name>
          ,
          <source>Association for Computational Linguistics</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>4593</fpage>
          -
          <lpage>4601</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garcia-Silva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Gomez-Perez</surname>
          </string-name>
          ,
          <article-title>Classifying scientific publications with BERT - is self-attention a feature selection method?</article-title>
          ,
          <source>in: Advances in Information Retrieval</source>
          , Springer International Publishing, Cham,
          <year>2021</year>
          , pp.
          <fpage>161</fpage>
          -
          <lpage>175</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>H.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Shu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. S.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <article-title>Understanding pre-trained BERT for aspect-based sentiment analysis</article-title>
          ,
          <source>in: Proceedings of the 28th International Conference on Computational Linguistics</source>
          ,
          <string-name>
            <surname>COLING</surname>
          </string-name>
          <year>2020</year>
          , Barcelona, Spain (Online),
          <source>December 8-13</source>
          ,
          <year>2020</year>
          ,
          <source>International Committee on Computational Linguistics</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>244</fpage>
          -
          <lpage>250</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>K.</given-names>
            <surname>Clark</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Khandelwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Levy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. D.</given-names>
            <surname>Manning</surname>
          </string-name>
          ,
          <article-title>What does BERT look at? an analysis of BERT's attention</article-title>
          ,
          <source>in: Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, BlackboxNLP@ACL</source>
          <year>2019</year>
          , Florence, Italy,
          <source>August</source>
          <volume>1</volume>
          ,
          <year>2019</year>
          , Association for Computational Linguistics,
          <year>2019</year>
          , pp.
          <fpage>276</fpage>
          -
          <lpage>286</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>O.</given-names>
            <surname>Kovaleva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Romanov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rogers</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rumshisky</surname>
          </string-name>
          ,
          <article-title>Revealing the dark secrets of BERT</article-title>
          , in
          <source>: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLPIJCNLP</source>
          <year>2019</year>
          ,
          <string-name>
            <given-names>Hong</given-names>
            <surname>Kong</surname>
          </string-name>
          , China, November 3-
          <issue>7</issue>
          ,
          <year>2019</year>
          , Association for Computational Linguistics,
          <year>2019</year>
          , pp.
          <fpage>4364</fpage>
          -
          <lpage>4373</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Vig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Belinkov</surname>
          </string-name>
          ,
          <article-title>Analyzing the structure of attention in a transformer language model</article-title>
          ,
          <source>in: Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, BlackboxNLP@ACL</source>
          <year>2019</year>
          , Florence, Italy,
          <source>August</source>
          <volume>1</volume>
          ,
          <year>2019</year>
          , Association for Computational Linguistics,
          <year>2019</year>
          , pp.
          <fpage>63</fpage>
          -
          <lpage>76</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>J.</given-names>
            <surname>Mullenbach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Wiegrefe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Duke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Eisenstein</surname>
          </string-name>
          ,
          <article-title>Explainable prediction of medical codes from clinical text</article-title>
          ,
          <source>in: Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</source>
          , Volume
          <volume>1</volume>
          (
          <string-name>
            <surname>Long</surname>
            <given-names>Papers)</given-names>
          </string-name>
          ,
          <source>Association for Computational Linguistics</source>
          , New Orleans, Louisiana,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Y.-M. Kim</surname>
            ,
            <given-names>T.-H.</given-names>
          </string-name>
          <string-name>
            <surname>Lee</surname>
          </string-name>
          ,
          <article-title>Korean clinical entity recognition from diagnosis text using BERT, BMC Medical Informatics and Decision Making 20 (</article-title>
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>9</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Si</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Roberts</surname>
          </string-name>
          ,
          <article-title>Enhancing clinical concept extraction with contextual embeddings</article-title>
          ,
          <source>Journal of the American Medical Informatics Association</source>
          <volume>26</volume>
          (
          <year>2019</year>
          )
          <fpage>1297</fpage>
          -
          <lpage>1304</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>R.</given-names>
            <surname>Leaman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Khare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Lu</surname>
          </string-name>
          ,
          <article-title>Challenges in clinical NLP for automated disorder normalization</article-title>
          ,
          <source>Journal of Biomedical Informatics</source>
          <volume>57</volume>
          (
          <year>2015</year>
          )
          <fpage>28</fpage>
          -
          <lpage>37</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>L.</given-names>
            <surname>Putelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. E.</given-names>
            <surname>Gerevini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Lavelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Maroldi</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Serina</surname>
          </string-name>
          ,
          <article-title>Attention-based explanation in a deep learning model for classifying radiology reports</article-title>
          ,
          <source>in: Artificial Intelligence in Medicine - 19th International Conference on Artificial Intelligence in Medicine, AIME</source>
          <year>2021</year>
          ,
          <string-name>
            <given-names>Virtual</given-names>
            <surname>Event</surname>
          </string-name>
          , June 15-18,
          <year>2021</year>
          , Proceedings, volume
          <volume>12721</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2021</year>
          , pp.
          <fpage>367</fpage>
          -
          <lpage>372</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Dyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. J.</given-names>
            <surname>Smola</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. H.</given-names>
            <surname>Hovy</surname>
          </string-name>
          ,
          <article-title>Hierarchical Attention Networks for Document Classification</article-title>
          ,
          <source>in: NAACL HLT</source>
          <year>2016</year>
          ,
          <article-title>The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, The Association for Computational Linguistics</article-title>
          ,
          <year>2016</year>
          , pp.
          <fpage>1480</fpage>
          -
          <lpage>1489</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Guan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Leng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <article-title>How far does BERT look at: Distance-based clustering and analysis of BERT's attention</article-title>
          ,
          <source>in: Proceedings of the 28th International Conference on Computational Linguistics</source>
          ,
          <string-name>
            <surname>COLING</surname>
          </string-name>
          <year>2020</year>
          , Barcelona, Spain (Online),
          <source>December 8-13</source>
          ,
          <year>2020</year>
          ,
          <source>International Committee on Computational Linguistics</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>3853</fpage>
          -
          <lpage>3860</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>A.</given-names>
            <surname>Miaschi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Sarti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Brunato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Dell'Orletta</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Venturi, Italian transformers under the linguistic lens</article-title>
          ,
          <source>in: Proceedings of the Seventh Italian Conference on Computational Linguistics</source>
          , CLiC-it
          <year>2020</year>
          , Bologna, Italy, March 1-
          <issue>3</issue>
          ,
          <year>2021</year>
          , volume
          <volume>2769</volume>
          <source>of CEUR Workshop Proceedings, CEUR-WS.org</source>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Meng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Liu</surname>
          </string-name>
          , E. Shareghi,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Su</surname>
          </string-name>
          , C. Collins,
          <string-name>
            <given-names>N.</given-names>
            <surname>Collier</surname>
          </string-name>
          ,
          <article-title>Rewire-then-probe: A contrastive recipe for probing biomedical knowledge of pre-trained language models</article-title>
          ,
          <source>CoRR abs/2110</source>
          .08173 (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>J.</given-names>
            <surname>Vig</surname>
          </string-name>
          ,
          <article-title>A multiscale visualization of attention in the transformer model</article-title>
          ,
          <source>in: Proceedings of the 57th Conference of the Association for Computational Linguistics</source>
          ,
          <string-name>
            <surname>ACL</surname>
          </string-name>
          <year>2019</year>
          , Florence, Italy,
          <source>July 28 - August 2</source>
          ,
          <year>2019</year>
          , Volume
          <volume>3</volume>
          :
          <string-name>
            <given-names>System</given-names>
            <surname>Demonstrations</surname>
          </string-name>
          ,
          <source>Association for Computational Linguistics</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>37</fpage>
          -
          <lpage>42</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>A.</given-names>
            <surname>Jacovi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Goldberg</surname>
          </string-name>
          ,
          <article-title>Towards faithfully interpretable NLP systems: How should we define and evaluate faithfulness?</article-title>
          ,
          <source>in: Proceedings of the 58th Annual Meeting of the ACL, ACL</source>
          <year>2020</year>
          ,
          <year>2020</year>
          , pp.
          <fpage>4198</fpage>
          -
          <lpage>4205</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>S.</given-names>
            <surname>Jain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. C.</given-names>
            <surname>Wallace</surname>
          </string-name>
          ,
          <article-title>Attention is not explanation</article-title>
          ,
          <source>in: Proc. of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</source>
          , Volume
          <volume>1</volume>
          ,
          <year>2019</year>
          , pp.
          <fpage>3543</fpage>
          -
          <lpage>3556</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>S.</given-names>
            <surname>Serrano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N. A.</given-names>
            <surname>Smith</surname>
          </string-name>
          , Is attention interpretable?,
          <source>in: Proc. of the 57th Annual Meeting of the Association for Computational Linguistics</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>2931</fpage>
          -
          <lpage>2951</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>S.</given-names>
            <surname>Wiegrefe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Pinter</surname>
          </string-name>
          ,
          <article-title>Attention is not not explanation</article-title>
          , in: K. Inui,
          <string-name>
            <given-names>J.</given-names>
            <surname>Jiang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Ng</surname>
          </string-name>
          ,
          <string-name>
            <surname>X.</surname>
          </string-name>
          Wan (Eds.),
          <source>Proceedings of the EMNLP-IJCNLP</source>
          <year>2019</year>
          ,
          <string-name>
            <given-names>Hong</given-names>
            <surname>Kong</surname>
          </string-name>
          , China, November 3-
          <issue>7</issue>
          ,
          <year>2019</year>
          ,
          <year>2019</year>
          , pp.
          <fpage>11</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <surname>B. van Aken</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Winter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Löser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. A.</given-names>
            <surname>Gers</surname>
          </string-name>
          ,
          <article-title>How does BERT answer questions? a layer-wise</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>