CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review
Paper โข 2103.06268 โข Published
How to use sindhisalam/minilm-contracts-ft with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sindhisalam/minilm-contracts-ft")
sentences = [
"That is a happy person",
"That is a happy dog",
"That is a very happy person",
"Today is a sunny day"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]all-MiniLM-L6-v2 fine-tuned to retrieve clause passages from commercial contracts (12 CUAD clause types). It is the retriever of the ContractLens project (measured retrieval and grounded answering on CUAD). This is a research/portfolio model, not legal advice.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sindhisalam/minilm-contracts-ft")
emb = model.encode(["Which state's or country's law governs this contract?"], normalize_embeddings=True)
| Retriever (dense, original question) | Recall@1 | Recall@5 | MRR@10 |
|---|---|---|---|
| base all-MiniLM-L6-v2 | 0.439 | 0.774 | 0.583 |
| this model | 0.765 | 0.950 | 0.848 |
Paired difference in Recall@1: +0.325 (95% CI +0.273 to +0.383, bootstrap over contracts). On two held-out phrasings never used in training, Recall@1 gains were +0.181 and +0.247.
Data: CUAD, Hendrycks et al., arXiv:2103.06268, CC BY 4.0. Base model: sentence-transformers/all-MiniLM-L6-v2.
Base model
nreimers/MiniLM-L6-H384-uncased