<!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>Removing Named Entities to Find Precedent Legal Cases</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ravina More</string-name>
          <email>ravina.m@tcs.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jay Patil</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Abhishek Palaskar</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Aditi Pawde</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>College of Engineering</institution>
          ,
          <addr-line>Pune</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Tata Consultancy Services, Tata Research Development and Design Centre</institution>
          ,
          <addr-line>Pune</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
      </contrib-group>
      <fpage>2</fpage>
      <lpage>7</lpage>
      <abstract>
        <p>In this paper, we present the solution of the team TRDDC Pune for the Artificial Intelligence in Legal Assistance(AILA) track 1 task on Precedent Retrieval in FIRE 2019. The task was to identify relevant legal prior cases for a legal query from a dataset of about 2,914 documents of cases that were judged in the Supreme Court of India. We used Named Entity Recognition to preprocess the case documents and the input query. We then ranked the preceding case documents using TF-IDF and BM25 algorithms. The results of our approach are comparable to the top ranked run on the task leaderboard.</p>
      </abstract>
      <kwd-group>
        <kwd>Legal Analytics</kwd>
        <kwd>Information Retrieval</kwd>
        <kwd>Legal Precedents</kwd>
        <kwd>Named Entity Recognition</kwd>
        <kwd>TF-IDF</kwd>
        <kwd>BM25</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        In the past, substantial work has been done on designing and constructing the corpora
of legal cases for legal retrieval. Ontologies and Natural Language Processing are being
used to extract case factors and participant roles[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Yin et. al[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], demonstrate an
approach to query search engines using a document. Our problem statement is similar to
theirs as it involves querying using a set of sentences. Their approach works on
extracting and scoring key phrases from the query, expanding them with related key phrases
and using these in the search engine to find documents containing these concepts. While
their approach is based on finding noun key phrases in the query, we are more interested
in the overall situation of a given query. We took inspiration from their work to select
interesting portions in the query and perform ranking of case documents based on them.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Problem and Data Description</title>
      <p>Artificial Intelligence for Legal Assistance (AILA) track challenge had 2 subtasks.
Sub-task 1 was about identifying relevant prior cases. The participants were provided
with 2,914 case documents that were judged in the Supreme Court of India. The
participants were provided with 50 legal queries, each describing a situation. The task was to
retrieve the most relevant Precedents among the 2,914 case documents for a given
query.</p>
      <p>
        A set of 2-3 relevant case documents was provided per query for the first 10 queries
as test data. The participants had to perform relevance ranking for the remaining 40
queries. Refer [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for more details. For the submission, each query returned a ranked
set of prior cases that were judged to be relevant to the query. The relevance of a case
document was ranked between 0 to 1 (1 indicating most relevant). The results were
evaluated using trec_eval.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Methodology</title>
      <p>To find the relevant Precedents for a given query we followed the following steps:
Step 1: Pre-process all the case documents to build a search corpus (Section 4.2)
Step 2: Pre-process the query (Section 4.3)</p>
      <p>Step 3: Rank the Precedents from the corpus using the query (Section 4.4)
4.1</p>
      <sec id="sec-4-1">
        <title>Intuition</title>
        <p>The queries and the case documents contained substantial information about names,
places, organizations, currencies, time, etc. that are specific to the case (E.g. ‘Gov.
of Tamil Nadu’, ‘Indian Oil Corporation’, ‘13 Rs.’,
‘January afternoon’, etc.). Such information can be ignored to focus on events such
as ‘murder’, ‘bribery’, ‘stole’, etc. that give primary information about
the situation to perform relevance ranking.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Pre-processing of Case Documents:</title>
        <p>
          As the first step, we prepared the corpus according to our intuition for query extraction.
We used spaCy[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] for preprocessing. We performed the following steps on the 2,914
case documents:
        </p>
      </sec>
      <sec id="sec-4-3">
        <title>1. Paragraph Splitting of case documents:</title>
        <p>A case document can contain 10-40 paragraphs on an average. These paragraphs
give information about the background of the case, the situation and the
judgements. We were interested to compare the results of performing a match on the
whole case document versus on these individual paragraphs. So, we split every
case document into individual paragraphs.
 Improvement after submission: We decided to take the entire case document
without splitting it into paragraphs</p>
      </sec>
      <sec id="sec-4-4">
        <title>2. Tokenization and Named Entity Recognition (NER) of paragraphs:</title>
        <p>We used spaCy’s tokenization to break down the paragraphs into individual
words called tokens. We performed NER on the tokenized sentences to find
named entities such as places, things, person, currency, time, etc.</p>
      </sec>
      <sec id="sec-4-5">
        <title>3. Removal of Named Entities and Stop Words:</title>
        <p>Using the Named Entities identified in the previous step and a predefined list
of stop words by spaCy, we removed the Named Entities and the Stop Words
from the case documents (Fig. 1).
1. These appeals are filed ['1', '', 'these', 'appeals', 'are',
against the order dated 'filed', 'against', 'the', 'order',
'dat29.3.2001 passed by the ed', '29.3.2001', 'passed', 'by', 'the',
Madras High Court allowing 'madras', 'high', 'court', 'allowing',
Crl.O.P. Nos.2418 of 1999. 'crl.o.p.', 'nos.2418', 'of', '1999']
2. The appellant (Indian
Oil Corporation, for short
'IOC') entered into two
contracts, one with the
first respondent (NEPC
India Ltd.) and the other
with its sister company
Skyline NEPC Limited
('Skyline' for short). According
to the appellant, in
respect of the aircraft fuel
supplied under the said
contracts, the first
respondent became due in a
sum of Rs.5,28,23,501 and
Skyline became due in a sum
of Rs.13,12,76,421 as on
29.4.1997.</p>
        <p>['2', 'the', 'appellant', 'indian',
'oil', 'corporation,', 'for', 'short',
'ioc', 'entered', 'into', 'two',
'contracts,', 'one', 'with', 'the', 'first',
'respondent', 'nepc', 'india', 'ltd',
'and', 'the', 'other', 'with', 'its',
'sister', 'company', 'skyline', 'nepc',
'limited', 'skyline', 'for', 'short',
'agreeing', 'to', 'supply', 'to', 'them',
'according', 'to', 'the', 'appellant,',
'in', 'respect', 'of', 'the', 'aircraft',
'fuel', 'supplied', 'under', 'the',
'said', 'contracts,', 'the', 'first',
'respondent', 'became', 'due', 'in', 'a',
'sum', 'of', 'rs.5,28,23,501', 'and',
'skyline', 'became', 'due', 'in', 'a',
'sum', 'of', 'rs.13,12,76,421', 'as',
'on', '29.4.1997.']</p>
        <sec id="sec-4-5-1">
          <title>Before Preprocessing of Case Doc</title>
        </sec>
        <sec id="sec-4-5-2">
          <title>After Preprocessing of Case Doc Fig. 1. Pre-processing of Paragraph</title>
          <p>On reading the queries, we found out that the queries contained information such as
background about the situation, the situation itself, subject of the appeal and
participants. We define Appeal Context as the set of sentences in the query that describe the
appeal. As we were interested in the information of the appeal only, we extracted this
information from the query by finding the Appeal Context and then preprocessing this
context.</p>
          <p>1.</p>
          <p>Extract the Appeal Context:
We observed that most of the queries contained some key-words that help us to
identify the context. We used the following list of appeal related
keywords:['appeal', 'appeals', 'trial', 'hearing', 'plead',
'pleaded', 'appealing', 'cross-appeal', 'quash'].</p>
          <p>We selected 15 sentences per query containing and surrounding these key
words. For queries that did not contain any of these key words or were shorter
than 15 sentences, we selected the entire query as the Appeal Context.
Improvement after submission: We decided to take all the sentences in the
query as the Appeal Context.</p>
        </sec>
      </sec>
      <sec id="sec-4-6">
        <title>Tokenization, Removal of Named Entities and Stop Words:</title>
        <p>We performed tokenization of the selected sentences, remove Named Entities
and Stop Words of the Appeal Context(similar to pre-processing of case
documents).
4.4</p>
      </sec>
      <sec id="sec-4-7">
        <title>Performing Precedent Retrieval</title>
        <p>
          BM25[
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] is ‘bag-of-words’ ranking function that estimates the relevance of documents
provided to a search query. Term Frequency Inverse Document Frequency(TF-IDF)[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]
is a measure that helps to identify words in collection of documents that aid to defining
the topic of the document. We used the gensim[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] implementations of BM25 and
TFIDF. We used the cleaned appeal as query, cleaned case documents as corpus and BM25
and TF-IDF algorithms to rank the case documents.
        </p>
        <p>Using BM25, TF-IDF and an ensemble of BM25-TF-IDF, we found the score for
every paragraph in every case document for a given query. The final score of a case
document for a given query is the mean of the scores of the top 3 paragraphs of the case
document. We ranked the case documents on a scale of 0 (least relevant) to 1 (most
relevant) based on these scores.</p>
        <p> Improvement after submission: We cleaned and used the whole case documents
(without paragraph splitting) and the entire query (without selecting the Appeal
Context) for relevance ranking using BM25 and TF-IDF.
4.3
</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Result and Analysis</title>
      <p>Run ID
HLJIT2019-AILA_task1_2 (1st)</p>
      <p>TFIDF (5th)
Ensemble (7th)</p>
      <p>BM25 (8th)
0.07
0.05
0.04
0.0375</p>
      <p>MAP
After the organizers made the test data public, we performed ablation analysis and
realized that the splitting of case documents to paragraphs and selection of the Appeal
Context were not improving the results, and were in fact deteriorating it. This could be
because narrowing down the query and restricting the query search to just the
paragraphs led to missing out some key information for comparison. In fact, the simple
removal of Named Entities (NE) in both case documents as well as queries improved
the ranking results substantially. Table 2 shows the results.</p>
      <p>F
D
I
F
T
5
2
M
B</p>
      <sec id="sec-5-1">
        <title>Removed</title>
      </sec>
      <sec id="sec-5-2">
        <title>NE from</title>
      </sec>
      <sec id="sec-5-3">
        <title>Case Docs</title>
        <p>TRUE
TRUE
FALSE
FALSE
TRUE
TRUE
FALSE
FALSE</p>
      </sec>
      <sec id="sec-5-4">
        <title>Removed</title>
      </sec>
      <sec id="sec-5-5">
        <title>NE from</title>
      </sec>
      <sec id="sec-5-6">
        <title>Query</title>
        <p>TRUE
FALSE
TRUE
FALSE
TRUE
FALSE
TRUE
FALSE
P_10
MAP
BPREF
0.07
0.07
0.0575
0.0625
0.0575
0.0575
0.05
0.05
0.1743
0.1723
0.1319
0.1644
0.128
0.1261
0.1274
0.1487
0.1535
0.1504
0.1204
0.1468
0.1163
0.1123
0.11
0.1362</p>
      </sec>
      <sec id="sec-5-7">
        <title>Recip.</title>
        <p>Rank
0.2771
0.2738
0.1949
0.2449
0.2424
0.238
0.2545
0.2679
Removal of Named Entities from both query and case helped in making the comparison
more generic. For example, this resulted in all the bribery cases whether they happened
in a police station, bank or some private company to be treated equally. According to
Table 2. TF-IDF as well as BM25 performed the best when the named entities were
removed from the query as well as the case documents. At the same time, TF-IDF
performed better than BM25 in all the cases.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusion and Future Work</title>
      <p>We have presented our approach for finding the relevant Precedents in the Task 1 in
AILA track in FIRE 2019. After improvements, we found out that simply removing the
named entities gave the best results. These results are comparable to the highest ranked
approach on the leaderboard.</p>
      <p>The BM25 and TF-IDF algorithms used in this approach are both word-matching
based algorithms for relevance ranking. As a result, a query containing ‘kill’ does
not get matched to a case document containing ‘murder’. The lack of exact matches
prevented some of the case documents from getting a higher rank in spite of the
situation being the same. In the future, we plan to further improve our technique by
considering the meaning of the words using word vectors while performing relevance
rankings.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgement</title>
      <p>We would like to thank Girish Palshikar, Sachin Pawar, Dr. Kripabandhu Ghosh and
Nitin Ramrakhiyani from TRDDC, Pune for their guidance during our brainstorming
sessions. We also thank Dr. Vahida Attar, HOD, Department of Computer and IT,
COEP, Pune for her support.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>P.</given-names>
            <surname>Bhattacharya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Ghosh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ghosh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Mehta</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. Bhattacharya.</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Majumder</surname>
          </string-name>
          ,
          <article-title>Overview of the Fire 2019 AILA track: Artificial Intelligence for Legal Assistance</article-title>
          .
          <source>In Proc. of FIRE 2019 - Forum for Information Retrieval Evaluation</source>
          , Kolkata, India,
          <source>December 12- 15</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Wyner</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mochales-Palau</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moens</surname>
            <given-names>MF.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Milward</surname>
            <given-names>D.</given-names>
          </string-name>
          (
          <year>2010</year>
          )
          <article-title>Approaches to Text Mining Arguments from Legal Cases</article-title>
          . In: Francesconi E.,
          <string-name>
            <surname>Montemagni</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peters</surname>
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tiscornia</surname>
            <given-names>D</given-names>
          </string-name>
          . (eds) Semantic
          <source>Processing of Legal Texts. Lecture Notes in Computer Science</source>
          , vol
          <volume>6036</volume>
          . Springer, Berlin, Heidelberg
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bansal</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dakka</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ipeirotis</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koudas</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Papadias</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          (
          <year>2009</year>
          ,
          <article-title>February)</article-title>
          .
          <article-title>Query by document</article-title>
          .
          <source>In Proceedings of the Second ACM International Conference on Web Search and Data Mining</source>
          (pp.
          <fpage>34</fpage>
          -
          <lpage>43</lpage>
          ). ACM.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Robertson</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Zaragoza</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          (
          <year>2009</year>
          ).
          <article-title>The probabilistic relevance framework: BM25 and beyond</article-title>
          .
          <source>Foundations and Trends® in Information Retrieval</source>
          ,
          <volume>3</volume>
          (
          <issue>4</issue>
          ),
          <fpage>333</fpage>
          -
          <lpage>389</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Rajaraman</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Ullman</surname>
            ,
            <given-names>J.D.</given-names>
          </string-name>
          (
          <year>2011</year>
          ).
          <source>Data Mining. Mining of Massive Datasets</source>
          . pp.
          <fpage>1</fpage>
          -
          <lpage>17</lpage>
          . doi:
          <volume>10</volume>
          .1017/CBO9781139058452.002. ISBN 978-1-
          <fpage>139</fpage>
          -05845-2.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Rehurek</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Sojka</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          (
          <year>2010</year>
          ).
          <article-title>Software framework for topic modelling with large corpora</article-title>
          .
          <source>In In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks.</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Honnibal</surname>
            , Matthew, and
            <given-names>Ines</given-names>
          </string-name>
          <string-name>
            <surname>Montani</surname>
          </string-name>
          .
          <article-title>"spacy 2: Natural language understanding with bloom embeddings, convolutional neural networks and incremental parsing." To appear 7 (</article-title>
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>