Embedding model for
legal retrieval: matches plain-English legal questions to
the passages that answer them, and clause-type descriptions to the contract
clauses that match. Fine-tuned from
nomic-ai/modernbert-embed-base.
Use it for: legal Q&A search, contract clause lookup, RAG over legal corpora.
Supports Matryoshka embeddings — truncate to 512/256/128/64 dims for cheaper
search at modest quality cost.
v2 changes over v1:
hard-negative mining, contract-clause training data, Australian legal QA, and a
general-domain slice to limit domain drift.
Contractual Clause Retrieval (
isaacus) — 45 clause types, 90 clauses:
1from sentence_transformers import SentenceTransformer
2
3model = SentenceTransformer("bugBug04S/legal-embed-modernbert-v2")
4
5query = "search_query: can the client terminate early without cause?"
6docs = [
7 "search_document: Either party may terminate this Agreement upon thirty (30) days prior written notice.",
8 "search_document: The Licensee shall indemnify and hold harmless the Licensor against all claims.",
9]
10q = model.encode(query, normalize_embeddings=True)
11d = model.encode(docs, normalize_embeddings=True)
12print(q @ d.T) # higher = more relevant