CourtListener Case Law Embeddings: Chunked US Court Opinion Text with 768-Dimensional ModernBERT Vectors for Semantic Legal Search (Free Law Project)

Provider
Free Law Project
License
Public Domain (source)
Format
JSON (in sampled files)
Stored at
Amazon S3, s3://com-courtlistener-storage/embeddings/opinions/freelawproject/modernbert-embed-base_finetune_512 (us-west-2)
Access
Free and public. No account with the data provider is needed.
Category
Natural Language Processing
Source
https://wiki.free.law/c/courtlistener/help/api/bulk-data/bulk-legal-data

About this dataset

Dense vector embeddings of United States court opinions that power CourtListener's semantic search, released by Free Law Project for download. The folder holds one JSON file per opinion, named by the CourtListener opinion id (for example 100.json). Each file has the opinion id and a list of embeddings; every entry gives a chunk_number, the chunk text (a passage of the opinion, starting with the reporter citation, parties and court) and a 768-dimensional float vector. The vectors come from Free Law Project's fine-tuned ModernBERT model, modernbert-embed-base_finetune_512, which names the directory. The whole embeddings tree is about 2 TB; nightly S3 inventory files under embeddings/inventories/ in the same bucket list new and changed files. Opinion ids join to the opinions and opinion-clusters tables in the CourtListener bulk CSV exports (bulk-data/ in the same bucket) for court, date, case name and citations. Used for semantic retrieval over case law, retrieval-augmented generation for legal questions, clustering of judicial opinions and benchmarking legal text embedding models. Read each file with any JSON parser and stack the vectors with NumPy. License: Public Domain Mark 1.0, as Free Law Project states for its bulk data. Cite CourtListener, Free Law Project.

How to access this dataset in Python

import boto3
from botocore import UNSIGNED
from botocore.client import Config
s3 = boto3.client('s3', region_name='us-west-2', config=Config(signature_version=UNSIGNED))
s3.list_objects_v2(Bucket='com-courtlistener-storage', Prefix='embeddings/opinions/freelawproject/modernbert-embed-base_finetune_512/', Delimiter='/')

Lists the files with anonymous access. Runs on any machine, with no cloud account.

Data structure

File types in sampled files: JSON

Files

Example file: embeddings/opinions/freelawproject/modernbert-embed-base_finetune_512/1.json

Analyze this dataset without downloading it

On Scigantic, CourtListener Case Law Embeddings: Chunked US Court Opinion Text with 768-Dimensional ModernBERT Vectors for Semantic Legal Search (Free Law Project) opens in a hosted JupyterLab notebook with the data already mounted, so you can read files where they are stored instead of copying them first. Each notebook includes an AI assistant that can see the mounted files and write and run analysis code. Open the dataset page to launch a notebook, or browse the full catalog.

This page is also available as Markdown and as JSON.

Related Natural Language Processing datasets