Skip to content
All work

Legal precedent search

Legal precedent search that ranked #1 on precision at FIRE 2020

Given one court judgment, can a system find the earlier cases and laws a lawyer would cite? As first author at FIRE 2020, an international search benchmark, I worked on exactly that. Our mix of topic and keyword search ranked first on precision in the top ten results.

Kind
Published research, first author
My role
First author
Team
Four people at Lawnics, with Tanay Patankar, Alay Shah and Shubham Joshi
Scale
~3,260 past judgments and 197 statutes, scored on 10 unseen queries
Built for
Lawyers looking for the past cases and laws that apply to a new case
Techniques
information retrieval, Top2Vec, BM25, hybrid search, legal NLP, published research

Results

  • precision in the top ten, for finding past cases
  • a ranking-quality score, for finding the right laws
  • FIRE 2020 working notes, CEUR-WS

The problem

Before a hearing, lawyers read through thousands of long judgments for cases like theirs. The benchmark asked whether a system could do that first pass.

The four decisions behind itIllustrative data: the query, topic mix and judgments are invented to show the idea.
  1. Start from the whole judgment.

    Every query was a full judgment, long and noisy, because that’s where a lawyer starts.

    The call

    Match the way lawyers actually search, from the case in front of them.

  2. Strip out names, dates and places.

    Named entities and noise were removed before any matching.

    The call

    Two unrelated cases can share a city or a party’s name, and a naive matcher calls them similar.

  3. Match on topics, then check with exact words.

    Top2Vec turns each judgment into a mix of topics, and BM25 checks that the facts match.

    The call

    A judgment is never about one thing, so topics find the kind of case and keywords confirm the facts. The blend had the best P@10 in the track.

    Techniques: Top2Vec, BM25, hybrid search

  4. For short statutes, use exact words.

    Plain keyword ranking won for statutes and placed second on BPREF.

    The call

    Fit the method to the text. Short, precise statutes reward exact words.

What lost

  1. What I tried

    Legal word embeddings (Law2Vec) with soft cosine, for statutes.

  2. What broke

    It often put the right statute first, but plain keyword ranking beat it across the full ranking.

  3. What changed

    Keyword ranking for statutes, topics plus keywords for judgments.

In hindsight

Add a reranker, learn the weights between the two signals, and push for more than ten test queries.

Ask me about

  • Why topics won for judgments and lost for statutes
  • What I’d change with today’s rerankers
Let’s talk