This dataset is created from the opinions-metadata, and used for training the Free Law Project Semantic Search models, including Free-Law-Project/modernbert-embed-base_finetune_512.
- Curated by: Free Law Project
- Language(s) (NLP): English
The dataset is curated by Free Law Project by selecting the train split from the opinions-metadata dataset.
The dataset is created for finetuning encoder models for semantic search, with 512 context window. The data is split to train vs dev ensuring no overlap between the two splits in opinion_id, cluster_id, docket_id, and docket_number.
Each opinion is split to chunks with at most 480 tokens (tokenized using the bert-base-cased tokenizer) with 2 sentence overlap. The number of tokens is just shy of the 512 context window limit to account for tokenization variation between the different encoder models for experiments.
Each chunk is provided to GPT-4o with below system prompt to generate both the relevant and irrelevant queries. The digits before _ in the chunk_id represent the opinion_id and the digits after _ represent the chunk_id within the opinion. For example, an opinion with 600 tokens will be represented with 2 chunks.
SYSTEM_PROMPT = """
Given a case law opinion, generate two search queries. Both queries should be phrased as natural language questions that a user might enter into a search engine.
- The **user does not have prior access** to the opinion, so the queries should be **general** rather than referring to specific case details.
- The opinion should be the **best possible answer** to the **relevant** query.
- The opinion should be **insufficient** or **unrelated** to answering the **irrelevant** query.
### Query Types:
1. **Relevant Query**: A question where the given opinion is both **highly relevant** and **sufficient** to provide an answer.
2. **Irrelevant Query**: A question where the given opinion is **not relevant** and **not sufficient** to provide an answer.
### Output Format:
Return the queries in JSON format:
json
{
"relevant": "What are the legal standards for self-defense in criminal cases?",
"irrelevant": "How does bankruptcy law apply to small businesses?"
}
"""
The dataset is created for semantic search finetuning.
If you use this data, please cite with the following entry:
@misc{Free Law Project,
title={Free law project: Making the legal ecosystem more equitable and competitive.},
url={https://free.law/},
author={Free Law Project}}