<!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>Towards Grad-CAM Based Explainability in a Legal Text Processing Pipeline</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>sz Górski</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Shashishekar Ramakrishna</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Je˛drzej M. Nowosielski</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>EY - AI Labs</institution>
          ,
          <addr-line>Bangalore</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Freie Universität Berlin</institution>
          ,
          <addr-line>Berlin</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Interdisciplinary Centre for Mathematical and Computational Modelling, Univ. of Warsaw</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Explainable AI (XAI) is a domain focused on providing interpretability and explainability of a decision-making process. In the domain of law, in addition to system and data transparency, it also requires the (legal-) decision-model transparency and the ability to understand the model's inner working when arriving at the decision. This paper provides the first approaches to using a popular image processing technique, Grad-CAM, to showcase the explainability concept for legal texts. With the help of adapted Grad-CAM metrics, we show the interplay between the choice of embeddings, its consideration of contextual information, and their effect on downstream processing.</p>
      </abstract>
      <kwd-group>
        <kwd>Legal Knowledge Representation</kwd>
        <kwd>Language Models</kwd>
        <kwd>Grad-CAM</kwd>
        <kwd>HeatMaps</kwd>
        <kwd>CNN</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Advancements in the domain of AI and Law have brought additional considerations
regarding models development, deployment, updating and their interpretability. This can
be seen with the advent of machine-learning-based methods, which naturally exhibit a
lower degree of explainability than traditional knowledge-based systems. Yet,
knowledge representation frameworks that handle legal information, irrespective of their
origin, should cover the pragmatics or context around a given concept and this
functionality should be easily demonstrable.</p>
      <p>
        Explainable AI (XAI), is a domain which has focused on providing interpretability
and explainability to a decision making process. In the domain of law, interpretability
and explainability are more than dealing with information/data transparency or system
transparency [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] (henceforth referred to as ontological view). It additionally requires
the (legal-) decision-model transparency, the ability to understand the model’s inner
working when arriving at the decision (epistemic view). In this paper, we aim to present
the system’s user and architect with a set of tools that facilitate the discovery of inputs
that contribute to convolutional neural network’s (CNN’s) output to the greatest degree,
by adapting the Grad-CAM method, which originated from the field of computer vision.
We adapt this method to the legal domain and show how it can be used to achieve a
better understanding of a given system’s state and explain how different embeddings
contribute to end result as well as to optimize this system’s inner workings. While this
work is concerned with the ontological perspective, we aim this as a stepping stone
for another related perspective, where the legally-based positions are connected with
explanation thus providing the ability to explain the decisions to its addressee. This
paper addresses mainly the technical aspects, showing how Grad-CAMs can be applied
to the legal texts, describing the text processing pipeline - taking this as a departing point
for deeper analyses in future work. We aim to present this technical implementation as
well as the quantitative comparison metrics as the main contribution of the paper.
      </p>
      <p>The paper is structured as follows. State-of-the-art is described in Section 2. Section
3 describes the methodology, which includes the metrics used for results quantification.
The architecture used for experiments is described in Section 4. Section 5 talks about
the different datasets used and the experimental setup. The outcomes are described in
Section 6. Finally, Section 7 provides a conclusion and future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        The feasibility of using different - contextual (e.g. BERT) and non-contextual (e.g.
word2vec) - embeddings was already studied outside the domain of law. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], it was
found that the usage of more sophisticated, context-aware methods is unnecessary in
the domains where labelled data and simple language are present. As far as the area of
law is concerned, the feasibility of using the domain-specific vs. general embeddings
(based on word2vec) for the representation of Japanese legal texts was investigated,
with the conclusion that general embeddings have an upper hand [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The feasibility of
using BERT in the domain of law was also already put under scrutiny as well. In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] its
generic pretrained version was used for embeddings generation and it was found that
large computational requirements may be a limiting factor for domain-specific
embedding creation. The same paper concluded that the performance of the generic version is
lower when compared with law-based non-contextual embeddings. On the other hand,
in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], BERT versions trained on legal judgments corpus (of 18000 documents) were
used and it was found that training on in-domain corpus does not necessarily offer better
performance compared to generic embeddings. In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] contradictory conclusions were
reached: the system’s performance significantly improves when using pre-trained BERT
on a legal corpus. Those results suggest that introduction of XAI-based methods might
be a condition sine qua non for a proper understanding of general language embeddings
and their feasibility in the domain.
      </p>
      <p>
        Grad-CAMs are explainability method originating from computer vision [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. It is
a well established post-hoc explainability technique when CNNs are concerned.
Moreover, Grad-CAM method passed independent sanity checks [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Whilst it is mainly
connected with the explanations of deep learning networks used with image data, it
has already been adapted for other areas of application. In particular, CNN architecture
for text classification was described in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], and there exists at least one
implementation which extends this work with Grad-CAM support for explainability [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
GradCAMs were already used in the NLP domain, for (non-legal) document retrieval [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
Herein we build upon this work and investigate the feasibility of using this method for
the legal domain, in particular allowing for the visualisation of context-dependency of
various word embeddings. Legal language is a special register of everyday language
and deservers investigation on its own. The evolution of legal vocabulary can be
precisely traced to particular statutes and precedential judgments, where it is refined and its
boundaries are tested [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Many terms have thus a particular legal meaning and efficacy
and tools that can safeguard final black-box models’ adherence to the particularities of
legal language are valuable.
      </p>
      <p>
        The endeavours aimed at using XAI methods in the legal domain, similar to this
paper, have already been undertaken recently. In [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] an Attention Network was used
for legal decision prediction - coupling it with attention-weight-based text highlighting
of salient case text (though this approach was found to be lacking). The possibility of
explaining the BERT’s inner workings was already investigated by other authors, and
it was already subject to static as well as dynamic analyses. An interactive tool for
the visualisation of its learning process was implemented in [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
Machine-learningbased evaluation of context importance was performed in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]; therein it was found that
accounting for the content of a sentence’s context greatly improves the performance of
legal information retrieval system.
      </p>
      <p>However, the results mentioned hereinbefore do not allow for direct and easily
interpretable comparison of different types of embeddings and we aim to explore an easy
plug-in solution facilitating this aim.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Methodology</title>
      <p>We study the interplay between the choice of embeddings, its consideration of
contextual information, and its effect on downstream processing. For this work, a pipeline
for comparison was prepared, with the main module being the embedder,
classification CNN and metric-based evaluator. All the parts are easily pluggable, allowing for
extendibility and further testing of a different combinations of modules.</p>
      <p>
        The CNN used in the pipeline was trained for classification. We use two different
datasets for CNN training (as well as testing) 4:
1. The Post-Traumatic Stress Disorder (PTSD) [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] dataset [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], where rhetorical
roles of sentences are classified.
2. Statutory Interpretation - Identifying Particular (SIIP) dataset [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], where the
sentences are classified into four categories according to their usefulness for a legal
provision’s interpretation.
      </p>
      <p>
        Whilst many methods have already been used for the analysis of aforementioned
datasets (including regular expressions, Naive Bayes, Logistic Regression, SVMs [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ],
or Bi-LSTMs [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]), we are unaware of papers that use (explainable) CNNs for this
tasks. On the other hand, usage of said CNN should not be treated as the main
contribution of this paper, as the classification network is treated only as an exemplary
application, warranting conclusions regarding the paper’s main contribution, i.e. the
context-awareness of various embeddings when used in the legal domain.
      </p>
      <sec id="sec-3-1">
        <title>4 Section 5.1, provides a detailed discussion on the considered datasets</title>
        <p>
          Further down the line, the embeddings are used to transform CNN input sentences
into vectors, with vector representation for each word in a sentence concatenated. Herein
our implementation is based on the prior work [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
3.1
        </p>
        <sec id="sec-3-1-1">
          <title>Comparison metrics</title>
          <p>
            Grad-CAM heatmaps are inherently visual tools for data analysis. In computer vision,
they are commonly used for qualitative determination of input image regions that
contribute to the final prediction of the CNN. While they are an attractive tool for a
qualitative analysis of a single entity, they should be supplemented with other tools for easy
comparison of multiple embeddings [
            <xref ref-type="bibr" rid="ref19">19</xref>
            ] and to facilitate quantitative analysis. Herein
the following metrics are introduced and adapted to the legal domain:
          </p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>1. Fraction of elements above relative threshold t (F (v; t))</title>
        <p>2. Intersection over union with relative thresholds t1 and t2 (I (v1; v2; t1; t2))</p>
        <p>The first metric, F (t), is designed to measure the CNN network attention spread
over words present in the given input, i.e, what portion of the input is taken into account
by CNN in the case of a particular prediction. It is defined as a number of elements in
a vector that are larger than the relative threshold t multiplied by the maximum vector
value divided by the length of this vector.</p>
        <p>The second metric, I (v1; v2; t1; t2), helps to compare two predictions of two
different models given the same input sentence. It answers the question of whether two
models, when given the same input sentence, ‘pay attention’ to the same or different
chunk(s) of the input sentence. It takes as arguments two Grad-CAM heatmaps (v1 and
v2), binarizes them using relative thresholds (t1 and t2) and finally calculates standard
intersection over union. It quantifies the relative overlap of words considered important
for the prediction by each of two models.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>System Architecture</title>
      <p>The architecture, as shown in Fig 1, is designed to implement the methodology
described in 3 and comprises four main modules, i.e.: preprocessing module, embedding
module, classification module and visualization module. The pre-processing module
uses some industry de facto standard text processing libraries for spelling correction,
sentence detection, irregular character removal, etc., enhanced with our own
implementations which make them better-suited for legal texts. The embedding module houses
a plug-in system to handle different variants of embeddings, in particular BERT and
word2vec. The classification module houses simple 1D CNN which facilitates
explainability method common in computer vision i.e. Grad-CAM. The visualization module
is used for heatmap generation and metric computation.</p>
      <p>
        The output from the pre-processing module is fed into the embeddings module.
The embeddings used are based on variants of BERT and word2vec. In addition to
the pre-trained ones, raw data from CourtListener [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] dataset was used for training
embeddings creation.
      </p>
      <p>
        Within the frame of the classification module, the output from the embeddings
module is fed into a 1D convolutional layer followed by an average pooling layer and
fullyconnected layers with dropout and softmax [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Although CNN architectures stem from
computer vision where an image forms the input of the network, the use of CNN for
the sequence of word vectors as an input is reasonable. In a sentence relative positions
of words convey meaning. It is similar to an image where relative positions of pixels
convey information, with the difference being about dimensionality. Standard image is
2D while a sentence is a 1D sequence of words, therefore we use the 1D CNN for the
task of sentence classification.
      </p>
      <p>With Grad-CAM technique it is possible to produce a class activation map (heatmap)
for a given input sentence and predicted class. Each element of the class activation map
corresponds to one token and indicates its importance in terms of the score of the
particular (usually the predicted) class. The class activation map gives information on how
strongly the particular tokens present in the input sentence influence the prediction of
the CNN.</p>
      <p>
        The software stack used for the development of this system was instrumented under
Anaconda 4.8.3 (with Python 3.8.3). Tensorflow v. 2.2.0 was used for CNN
instrumentation and Grad-CAMs calculations (with the code itself expanding prior
implementation available at [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). Spacy 2.1.8 and blackstone 0.1.15 were used for CourtListener
text cleaning. Various BERT implementations and supporting codes were sourced from
Huggingface libraries: transformers v. 3.1.0, tokenizers v. 0.8.1rc2, nlp v. 0.4.0. Two
computing systems available at ICM University of Warsaw were exploited for the
experiments. Text cleaning was performed using the okeanos system (Cray XC40) and
main calculations were run on rysy GPU cluster (4x Nvidia Tesla V100 32GB GPUs).
      </p>
    </sec>
    <sec id="sec-5">
      <title>Experiments</title>
      <sec id="sec-5-1">
        <title>Datasets</title>
        <p>
          As stated in Section 3, we use two different datasets for experiments. The PTSD dataset
is from the U.S. Board of Veterans’ Appeals (BVA) from 2013 through 2017. The
dataset deals with the decisions from adjudicated disability claims by veterans for
service-related post-traumatic stress disorder (PTSD) [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ]. The dataset itself is
wellknown and has already been studied by other authors. It annotates a set of sentences
originating from 50 decisions issued by the Board according to their function in the
decision [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ] [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ]. The classification consists of six elements: Finding Sentence,
Evidence Sentence, Reasoning Sentence, Legal-Rule Sentence, Citation Sentence, Other
Sentence.
        </p>
        <p>
          The SIIP dataset pertains to the United States Code 5 § 552a(a)(4) provision and
aims to annotate the judgments that are most useful for interpretation of said provision.
The seed information for annotation is collected from the court decisions retrieved from
the Caselaw access project data. The sentences are classified into four categories
according to their usefulness for the interpretation: High Value, Certain Value, Potential
Value, No Value [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ].
5.2
        </p>
      </sec>
      <sec id="sec-5-2">
        <title>Embeddings/Language Modeling</title>
        <p>
          We use pre-trained models as well as we train domain-specific models for the purpose of
vector representation of texts. Many flavours of word2vec and BERT embedders were
tested. The paper does not go into any details on the comparison of these pre-trained
models (or other similar models) based on performance. This has been addressed in
several other papers [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ] [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ].
        </p>
        <p>
          For the word2vec a (slimmed down) GoogleNews model was used, with a
vocabulary of 300000 words [
          <xref ref-type="bibr" rid="ref25">25</xref>
          ]. In addition, Law2vec embeddings were also employed,
which were trained on a large freely-available legal corpus, with 200 dimensions [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ].
For BERT, bert-base-uncased model was used, a transformer model consisting of 12
layers, 768 hidden units, 12 attention heads and 110M parameters. In addition to that,
a slimmed-down version of BERT, DistilBERT was also tried, due to its accuracy
being on the par with vanilla BERT, yet offering better performance and smaller memory
footprint.
        </p>
        <p>
          In addition to pretrained models, we have also tried training our own word2vec and
BERT models. For this aim, a CourtListener [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ] database was sourced. However, due
to the large computational requirements of BERT training, a small subset of this dataset
was chosen, consisting of 180MiB of judgments. Moreover, while several legal projects
provide access to a vast database of US case-laws, it was found that the judgments
available therein need to be further processed, as the available textual representations
usually contain unnecessary elements, such as page numbers or underscores, that hinder
their machine processing. Our hand-written parser joined hyphenated words, removed
page numbers and artifacts that were probably introduced by OCR-ing; furthermore, the
text was split into sentences using spacy-based blackstone-parser. In line with other
authors [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ], we have found it to be imperfect and failing in segmenting the sentences that
contained period-delimited legal abbreviations (e.g. Fed. - Federal). Thus it was
supplemented with our own manually-curated list of abbreviations. The training was
performed using DistilBERT model (for ca. 36 hours), as well as word2vec in two flavours,
200-dimensional (in line with the dimensionality of Law2Vec) and 768-dimensional (in
line with BERT embeddings dimensionality).
        </p>
        <p>As far as the BERT-based embeddings go, there is a number of ways in which they
can be extracted from the model. One of the ways is taking embeddings for special CLS
token, which prefixes any sentence fed into BERT; another technique that was studied
in the literature amounted to concatenating the model’s final layer’s values. The optimal
technique is dependent on the task and the domain. Herein we have found the latter to
offer better accuracy for downstream CNN training. The features for CNN processing
consisted of tokenized sentences, together with embeddings for special BERT tokens
(their absence would cause a slight drop in accuracy as well).
6
6.1</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Results</title>
      <sec id="sec-6-1">
        <title>Metric-based heatmap comparison</title>
        <p>A sample heatmap can be referenced in Fig. 2 and Fig. 3, with a colorbar defining
the mapping between the colors and values. Fig 2 clearly shows the area of CNN’s
attention, which can be quantified further down the line. This picture shows a properly
classified sentence, a statement of evidence, defined by the PTSD dataset’s authors as
a description of a piece of evidence. CNN pays most attention to the phrase "medical
records", which is in line with PTSD’s authors’ annotation protocols, where this kind
of sentence describes a given piece of evidence (e.g. the records of testimony). We
have found the sentence in Fig. 3 to be hard to classify for ourselves and it prima
facie seemed for us to be an example of evidentiary sentence. In the case of CNN, no
distinctive activations can be spotted.</p>
        <p>
          Yet, we did not perform any detailed analyses of such images. Instead, we focus
on two types of comparison using metrics defined in section 3.1. The comparisons are
designed to capture differences between different embeddings, particularly in terms of
context handling. First, for a given embedding we calculate CNN network attention
spread over words quantified by metric F (t) averaged over all input sentences
contained in the test set. Then we can compare the mean fraction of words (tokens) in the
input sentences which contribute to prediction in the case of various embeddings.
Criterion deciding if a particular word contributes to the prediction is, in fact, arbitrary and
depends on class activation map (heatmap) binarization threshold. This is why we test
a few thresholds, including 0:15 as suggested in [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] for weakly supervised localization.
Essentially high value of the fraction F (t) indicates that most word vectors in input
sentence are taken into account by CNN during inference. Conversely, the low value of
the fraction F (t) indicates that most word vectors in the input sentence are ignored by
CNN during inference. The comparison results for the PTSD dataset are shown in
Table 1 and Table 2 (SIIP dataset was omitted for brevity and due to the similarity with the
presented PTSD dataset). The outstanding similarity between word2vec and Law2Vec
can be spotted in Table 2, due to both of those models belonging to the same class, as
exhibited by the high value of I metric.
6.2
        </p>
      </sec>
      <sec id="sec-6-2">
        <title>Grad-CAM guided context extraction</title>
        <p>The analysis of heatmaps and metrics presented hereinbefore proves that only a part of
a given sentence contributes to a greater extent to final results. We have hypothesized
that it is possible to decrease the amount of CNN’s input data to those important parts
without compromising the final prediction. In this respect, Grad-CAM was treated as a
helpful heuristic that allows to identify the most important words for a given CNN in its
training phase. For this experiment, the value of F , for the threshold of 0:15 was used
to select a percentage of the most important words from a given training example. This
in turn was used to compose a vocabulary (or white-list) of the most important words
that were encountered during the training. Further down the line, this white-list was
used during the inference and only the words present on the list were passed as input to
the CNN. Nevertheless, the number of white-listed words allowed coherent sentences
to be still passed into CNN (for example, the PTSD sentence However, this evidence
does not make it clear and, before white-listing amounted to However, this evidence
does not make it clear and unmistakable.).</p>
        <p>We have managed to keep accuracy up to the bar of an unmodified dataset using this
procedure (e.g. 0.7 for PTSD-word2vec(GoogleNews) and 0.85 for PTSD-DistilBERT
(distilbert-base-uncased).
7</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Conclusion &amp; Future Work</title>
      <p>We presented the first approach to using a popular image processing technique,
GradCAMs to showcase the explainability concept for legal texts. Few conclusions which
we can be drawn from the presented methodology are:
– The mean value of F (t) is higher in the case of DistilBERT embedding than in
the cases of word2vec and Law2vec embeddings. It suggests that CNN trained and
utilised with this embedding tends to take into account a relatively larger chunk of
input sentence while making prediction.
– Described metrics and visualizations provide a peek into the complexity of context
handling aspects embedded in a language model.
– It enables an user to identify and catalog attention words in a sentence type for data
optimization in downstream processing tasks.</p>
      <p>
        Some issues which need further investigation are:
– Training of these domain-specific models requires time and resources. Apart from
algorithmic optimization, data optimization also plays an important role.
Extension of methodology presented herein can be used to remove tokens that do not
contribute to the final outcome of any downstream processing tasks. A systematic
analysis of the method presented in Section 6.2 is warranted.
– Mapping of metrics from our methodology to standard machine learning metrics
could allow us to infer the quality of language models in a given domain (i.e. legal
domain). This could allow to measure the quality of a model when there is not
sufficient gold data which can be used for effective training of models (inline to the
concept of semi-supervised learning).
– An extension of our approach could become a part of some argumentation
systems. Lets consider the argumentation schemes proposed by Walton et al. [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ] and
Douglas [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ], which deal with base premise identification, similarity premise and
conclusion. Regarding the base premise identification, our method could be used
for analysis of context-drift (a phenomenon in which a change in concept used
induces more or less radical changes to context and thus changes the target concept
inferred) [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ]. Thus, minimizing such drift would help to build better arguments to
start with. Regarding the similarity premise, which is based on concept semantic
similarity technique, it would help in identifying instances where the source case
argument is similar to the target case argument thereby helping in drawing a similar
conclusion.
      </p>
    </sec>
    <sec id="sec-8">
      <title>Acknowledgment</title>
      <p>This research was carried out with the support of the Interdisciplinary Centre for
Mathematical and Computational Modelling (ICM), University of Warsaw, under grant no
GR81-14.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Adrien</given-names>
            <surname>Bibal</surname>
          </string-name>
          , Michael Lognoul, Alexandre de Streel, and
          <string-name>
            <given-names>Benoît</given-names>
            <surname>Frénay</surname>
          </string-name>
          .
          <article-title>Legal requirements on explainability in machine learning</article-title>
          .
          <source>Artificial Intelligence and Law</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>21</lpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Simran</given-names>
            <surname>Arora</surname>
          </string-name>
          , Avner May, Jian Zhang, and
          <string-name>
            <given-names>Christopher</given-names>
            <surname>Ré</surname>
          </string-name>
          .
          <article-title>Contextual embeddings: When are they worth it</article-title>
          ?,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Linyuan</given-names>
            <surname>Tang</surname>
          </string-name>
          and
          <string-name>
            <given-names>Kyo</given-names>
            <surname>Kageura</surname>
          </string-name>
          .
          <article-title>An examination of the validity of general word embedding models for processing japanese legal texts</article-title>
          .
          <source>In Proceedings of the Third Workshop on Automated Semantic Analysis of Information in Legal Texts</source>
          , Montreal, QC, Canada, June 21,
          <year>2019</year>
          , volume
          <volume>2385</volume>
          <source>of CEUR Workshop Proceedings</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Charles</given-names>
            <surname>Condevaux</surname>
          </string-name>
          , Sébastien Harispe, Stéphane Mussard, and
          <string-name>
            <given-names>Guillaume</given-names>
            <surname>Zambrano</surname>
          </string-name>
          .
          <article-title>Weakly supervised one-shot classification using recurrent neural networks with attention: Application to claim acceptance detection</article-title>
          .
          <source>In JURIX</source>
          , pages
          <fpage>23</fpage>
          -
          <lpage>32</lpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Julien</given-names>
            <surname>Rossi</surname>
          </string-name>
          and
          <string-name>
            <given-names>Evangelos</given-names>
            <surname>Kanoulas</surname>
          </string-name>
          .
          <article-title>Legal search in case law and statute law</article-title>
          .
          <source>In JURIX</source>
          , pages
          <fpage>83</fpage>
          -
          <lpage>92</lpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Emad</given-names>
            <surname>Elwany</surname>
          </string-name>
          , Dave Moore, and
          <string-name>
            <given-names>Gaurav</given-names>
            <surname>Oberoi</surname>
          </string-name>
          .
          <article-title>Bert goes to law school: Quantifying the competitive advantage of access to large legal corpora in contract understanding</article-title>
          .
          <source>arXiv preprint arXiv:1911.00473</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ramprasaath</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Selvaraju</surname>
          </string-name>
          , Michael Cogswell,
          <string-name>
            <surname>Abhishek Das</surname>
          </string-name>
          ,
          <string-name>
            <surname>Ramakrishna Vedantam</surname>
            , Devi Parikh, and
            <given-names>Dhruv</given-names>
          </string-name>
          <string-name>
            <surname>Batra</surname>
          </string-name>
          .
          <article-title>Grad-cam: Visual explanations from deep networks via gradientbased localization</article-title>
          .
          <source>International Journal of Computer Vision</source>
          ,
          <volume>128</volume>
          (
          <issue>2</issue>
          ):
          <fpage>336</fpage>
          -
          <lpage>359</lpage>
          ,
          <year>Oct 2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Julius</given-names>
            <surname>Adebayo</surname>
          </string-name>
          , Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and
          <string-name>
            <given-names>Been</given-names>
            <surname>Kim</surname>
          </string-name>
          .
          <article-title>Sanity checks for saliency maps</article-title>
          . In S. Bengio,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wallach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Larochelle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Grauman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Cesa-Bianchi</surname>
          </string-name>
          , and R. Garnett, editors,
          <source>Advances in Neural Information Processing Systems</source>
          , volume
          <volume>31</volume>
          , pages
          <fpage>9505</fpage>
          -
          <lpage>9515</lpage>
          . Curran Associates, Inc.,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Yoon</given-names>
            <surname>Kim</surname>
          </string-name>
          .
          <article-title>Convolutional neural networks for sentence classification</article-title>
          .
          <source>In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP)</source>
          , pages
          <fpage>1746</fpage>
          -
          <lpage>1751</lpage>
          , Doha, Qatar,
          <year>October 2014</year>
          .
          <article-title>Association for Computational Linguistics</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <article-title>Grad-cam for text</article-title>
          . https://github.com/HaebinShin/grad-cam-text.
          <source>Accessed: 2020-08-05.</source>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Jaekeol</surname>
            <given-names>Choi</given-names>
          </string-name>
          , Jungin Choi, and
          <string-name>
            <given-names>Wonjong</given-names>
            <surname>Rhee</surname>
          </string-name>
          .
          <article-title>Interpreting neural ranking models using grad-cam</article-title>
          . arXiv preprint arXiv:
          <year>2005</year>
          .05768,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Edwina L Rissland</surname>
          </string-name>
          ,
          <string-name>
            <surname>Kevin D Ashley</surname>
          </string-name>
          , and Ronald Prescott Loui.
          <article-title>Ai and law: A fruitful synergy</article-title>
          .
          <source>Artificial Intelligence</source>
          ,
          <volume>150</volume>
          (
          <issue>1-2</issue>
          ):
          <fpage>1</fpage>
          -
          <lpage>15</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>L</given-names>
            <surname>Karl Branting</surname>
          </string-name>
          , Craig Pfeifer, Bradford Brown, Lisa Ferro, John Aberdeen, Brandy Weiss, Mark Pfaff, and
          <string-name>
            <given-names>Bill</given-names>
            <surname>Liao</surname>
          </string-name>
          .
          <article-title>Scalable and explainable legal prediction</article-title>
          .
          <source>Artificial Intelligence and Law</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>26</lpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Benjamin</surname>
            <given-names>Hoover</given-names>
          </string-name>
          , Hendrik Strobelt, and
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Gehrmann</surname>
          </string-name>
          .
          <article-title>exbert: A visual analysis tool to explore learned representations in transformers models</article-title>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Jaromir</surname>
            <given-names>Savelka</given-names>
          </string-name>
          , Huihui Xu, and
          <string-name>
            <given-names>Kevin D</given-names>
            <surname>Ashley</surname>
          </string-name>
          .
          <article-title>Improving sentence retrieval from case law for statutory interpretation</article-title>
          .
          <source>In Proceedings of the Seventeenth International Conference on Artificial Intelligence and Law</source>
          , pages
          <fpage>113</fpage>
          -
          <lpage>122</lpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. Victoria Hadfield Moshiashwili.
          <article-title>The downfall of auer deference: Veterans law at the federal</article-title>
          circuit in
          <year>2014</year>
          .,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Vern R. Walker</surname>
          </string-name>
          , Krishnan Pillaipakkamnatt,
          <string-name>
            <surname>Alexandra M. Davidson</surname>
            , Marysa Linares, and
            <given-names>Domenick J.</given-names>
          </string-name>
          <string-name>
            <surname>Pesce</surname>
          </string-name>
          .
          <article-title>Automatic classification of rhetorical roles for sentences: Comparing rule-based scripts with machine learning</article-title>
          .
          <source>In Proceedings of the Third Workshop on Automated Semantic Analysis of Information in Legal Texts</source>
          , Montreal, QC, Canada, June 21,
          <year>2019</year>
          , volume
          <volume>2385</volume>
          <source>of CEUR Workshop Proceedings</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>S. R.</given-names>
            <surname>Ahmad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Harris</surname>
          </string-name>
          ,
          <string-name>
            <surname>and I. Sahibzada.</surname>
          </string-name>
          <article-title>Understanding legal documents: Classification of rhetorical role of sentences using deep learning and natural language processing</article-title>
          .
          <source>In 2020 IEEE 14th International Conference on Semantic Computing (ICSC)</source>
          , pages
          <fpage>464</fpage>
          -
          <lpage>467</lpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19. David Krakov and Dror G Feitelson.
          <article-title>Comparing performance heatmaps</article-title>
          .
          <source>In Workshop on Job Scheduling Strategies for Parallel Processing</source>
          , pages
          <fpage>42</fpage>
          -
          <lpage>61</lpage>
          . Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Free Law Project. Courtlistener</surname>
          </string-name>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Vern R. Walker</surname>
            , Ji Hae Han,
            <given-names>Xiang</given-names>
          </string-name>
          <string-name>
            <surname>Ni</surname>
            , and
            <given-names>Kaneyasu</given-names>
          </string-name>
          <string-name>
            <surname>Yoseda</surname>
          </string-name>
          .
          <article-title>Semantic types for computational legal reasoning: Propositional connectives and sentence roles in the veterans' claims dataset</article-title>
          .
          <source>ICAIL '17, page 217-226</source>
          , New York, NY, USA,
          <year>2017</year>
          .
          <article-title>Association for Computing Machinery</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Jaromír</surname>
            <given-names>Savelka</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vern R. Walker</surname>
            , Matthias Grabmair, and
            <given-names>Kevin D.</given-names>
          </string-name>
          <string-name>
            <surname>Ashley</surname>
          </string-name>
          .
          <article-title>Sentence boundary detection in adjudicatory decisions in the united states</article-title>
          .
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Louis</surname>
            <given-names>Martin</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Benjamin Muller</surname>
          </string-name>
          , Pedro Javier Ortiz Suárez, Yoann Dupont, Laurent Romary, Éric de la Clergerie, Djamé Seddah, and Benoît Sagot.
          <article-title>CamemBERT: a tasty French language model</article-title>
          .
          <source>In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics</source>
          , pages
          <fpage>7203</fpage>
          -
          <lpage>7219</lpage>
          , Online,
          <year>July 2020</year>
          .
          <article-title>Association for Computational Linguistics</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Victor</surname>
            <given-names>Sanh</given-names>
          </string-name>
          , Lysandre Debut, Julien Chaumond, and Thomas Wolf.
          <article-title>Distilbert, a distilled version of bert: smaller, faster, cheaper</article-title>
          and lighter,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <article-title>Word2vec-slim</article-title>
          . https://github.com/eyaler/word2vec-slim.
          <source>Accessed: 2020-09- 21.</source>
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26. Law2vec:
          <article-title>Legal word embeddings</article-title>
          . https://archive.org/details/Law2Vec. Accessed:
          <fpage>2020</fpage>
          -09-21.
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Euirim</surname>
            <given-names>Choi</given-names>
          </string-name>
          , Gillian Brassil, Katie Keller, Jessica Ouyang, and
          <string-name>
            <given-names>Kate</given-names>
            <surname>Wang</surname>
          </string-name>
          .
          <article-title>Bankruptcy map: A system for searching and analyzing us bankruptcy cases at scale</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Douglas</surname>
            <given-names>Walton</given-names>
          </string-name>
          , Christopher Reed, and
          <string-name>
            <given-names>Fabrizio</given-names>
            <surname>Macagno</surname>
          </string-name>
          .
          <source>Argumentation Schemes</source>
          . Cambridge University Press,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <given-names>Douglas</given-names>
            <surname>Walton</surname>
          </string-name>
          .
          <source>Legal reasoning and argumentation</source>
          , pages
          <fpage>47</fpage>
          -
          <lpage>75</lpage>
          . 07
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <string-name>
            <given-names>Gerhard</given-names>
            <surname>Widmer</surname>
          </string-name>
          and
          <string-name>
            <given-names>Miroslav</given-names>
            <surname>Kubat</surname>
          </string-name>
          .
          <article-title>Learning in the presence of concept drift and hidden contexts</article-title>
          .
          <source>Mach</source>
          . Learn.,
          <volume>23</volume>
          (
          <issue>1</issue>
          ):
          <fpage>69</fpage>
          -
          <lpage>101</lpage>
          ,
          <year>April 1996</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>