CoolFace
Datasetpublic

NoeFlandre/fineweb-legal-pilot

⚖️ FineWeb-Legal-Pilot 66.8M words of the finest legal domain data the 🌐 web has to offer. Repo: GitHub | Report: Technical Report What is it? FineWeb-Legal-Pilot is a pilot dataset consiting of 52k high-quality legal documents filtered from the 10-billion-token sample of 🍷 FineWeb. To enhance FineWeb's utility for legal AI domain adaptation, we draw inspiration from the FineWeb-Edu methodology: creating a legal quality classifier using annotations… See the full description on the dataset page: https://huggingface.co/datasets/NoeFlandre/fineweb-legal-pilot.

sourceHugging Facemitupdated 9mo agoView on Hugging Face
6likes72downloads
Dataset Card

⚖️ FineWeb-Legal-Pilot

<center> <img src="https://raw.githubusercontent.com/NoeFlandre/fineweb-legal/main/assets/logo.png" alt="FineWeb-Legal: The finest collection of legal content the web has to offer" width="400"/> </center>

66.8M words of the finest legal domain data the 🌐 web has to offer.

Repo: GitHub | Report: Technical Report

What is it?

FineWeb-Legal-Pilot is a pilot dataset consiting of 52k high-quality legal documents filtered from the 10-billion-token sample of 🍷 FineWeb.

To enhance FineWeb's utility for legal AI domain adaptation, we draw inspiration from the FineWeb-Edu methodology: creating a legal quality classifier using annotations generated by Mistral-Medium. We then used this classifier to score and retain only the most legally significant web pages (case law, statutes, filings).

This pilot release serves as a validation step before scaling the pipeline to the full 44TB FineWeb corpus.

What is being released?

Along with the dataset, we are releasing the legal classifier model used for filtering, as well as the training code and annotation pipeline:

How to load the dataset

You can load the full dataset (default) or one of the specialized high-quality subsets.

Configurations

ConfigMin ScoreTrain (docs)Test (docs)Total DocsTotal WordsAvg Score
default≥ 3.046,9185,21452,13266.9M4.21
high_quality≥ 4.029,1013,23432,33546.9M4.60
supreme≥ 4.814,9711,66416,63529.4M4.98
  • —default: All identified legal documents. Broadest coverage.
  • —high_quality: Strong legal content. Case law, statutes, contracts.
  • —supreme: Gold Standard. Supreme Court opinions, primary legislation.

Using datasets

python
from datasets import load_dataset

# Load the "Supreme" Gold Standard configuration
ds = load_dataset("NoeFlandre/fineweb-legal-pilot", "supreme", split="train")

# Load the default configuration
ds_default = load_dataset("NoeFlandre/fineweb-legal-pilot", "default")

Dataset Curation

We adopted the synthetic data annotation approach pioneered by FineWeb-Edu.

Annotation

We used Mistral-Medium to score 6,500 FineWeb samples on a scale of 0 to 5, based on their legal value.

ScoreLabelDescriptionExamples
0Noise/SpamNavigation, ads, gibberishCookie notices, site menus
1General/MarketingLaw firm ads, generic news"Call our lawyers today!"
2Basic InfoWikipedia summaries, Reddit questionsELI5 legal questions
3UsefulDetailed legal news, government guidesIRS guidelines, legal blogs
4High ValueCase text, statutes, contractsCourt filings, legislation
5Gold StandardSupreme Court opinions, law journalsAcademic legal research

Classifier Training

We fine-tuned a Gemma-Embedding-300m model using LoRA adapters on these annotations. The model achieves:

  • —Binary F1@3: 97.99%
  • —Validation Accuracy: 88.8%

The training process took ~2 hours on a single RTX 3090.

Filtering Results

We filtered the FineWeb 10BT sample (approx 143k candidates pre-filtered by heuristics) using this classifier.

  • —Input: 143,379 documents (extracted by heuristics from the original FineWeb 10BT subset)
  • —Output: 52,132 documents (Score ≥ 3.0)
  • —Top domains include openjurist.org, findacase.com, and federalregister.gov.

Considerations for Using the Data

Social Impact

Access to high-quality legal training data is currently restricted to proprietary databases (Westlaw, LexisNexis). By releasing FineWeb-Legal, we aim to democratize access to legal AI research, enabling the community to train open legal LLMs.

Biases

The dataset reflects the bias of the web and Common Crawl. While heavily filtered for legal content, it may still contain historical legal documents with outdated or offensive terminology typical of their era.

Limitations

This is a Pilot release derived from only 10 billion tokens. It is not yet large enough for full pre-training but is ideal for:

  • —Domain adaptation (fine-tuning)
  • —Evaluation benchmarks
  • —Training retrieval (RAG) embeddings

Additional Information

Licensing

The dataset is released under the MIT License and adheres to the Open Data Commons Attribution License (ODC-By) v1.0 of the parent FineWeb dataset.

Citation

bibtex
@misc{fineweb-legal-2026,
    author       = { Noé Flandre },
    title        = { FineWeb-Legal-Pilot: High-Quality Legal Text from the Web },
    year         = 2026,
    url          = { https://github.com/NoeFlandre/fineweb-legal },
    publisher    = { Hugging Face }
}