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.
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.
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.
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
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
What I tried
Legal word embeddings (Law2Vec) with soft cosine, for statutes.
What broke
It often put the right statute first, but plain keyword ranking beat it across the full ranking.
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
