Loading…
Loading…
sentence-transformers/all-MiniLM-L6-v2
fine-tuned for searching wealth-management client files: an adviser types a short query
("evidence of residence", "where does the client's money come from", "pension") and should get
the matching documents (utility bills, bank statements, payslips, pension statements, ...).
General-purpose embedding models lack this domain knowledge: for "address proof" they rank a passport above a utility bill. This model was trained to close that gap while keeping general finance retrieval intact. Same size and output as the base model (6 layers, 384-dim, ~23M parameters), so it is a drop-in replacement and runs fast on CPU.
Built for the search API in nevis-search-api.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("UmbrellaMalware/all-MiniLM-L6-v2-wealth")
docs = ["British Gas bill\nElectricity and gas charges for 14 Elm Grove, Manchester ...",
"Passport scan\nBiographical page of a British passport ..."]
query = model.encode("evidence of residence", normalize_embeddings=True)
scores = model.encode(docs, normalize_embeddings=True) @ query
Encode documents as "<title>\n<content>". Use cosine similarity (normalised embeddings).
gpt-4.1-mini generated 264 documents across
44 categories (KYC/onboarding, income and source of funds, tax, investments, pensions, estate
planning, insurance, plus non-advice distractors) and 6 adviser-style queries per document:
1,584 (query, document) pairs. Documents read like the real thing and do not state their
purpose; queries mix document types, the compliance/advice purpose, questions and keywords.MultipleNegativesRankingLoss (in-batch negatives), NO_DUPLICATES batches.Hand-labelled benchmark from nevis-search-api (scripts/benchmark_search.py): 42 documents,
38 labelled queries in three groups, 5 noise queries. "Glossary" queries use KYC terms, "held-out"
queries paraphrase the same concepts in other words, "other" queries cover general finance
concepts. R@5 = share of relevant documents in the top 5.
| model | glossary R@5 / MRR | held-out R@5 / MRR | other R@5 / MRR | F1 at best threshold |
|---|---|---|---|---|
| all-MiniLM-L6-v2 | 0.45 / 0.62 | 0.26 / 0.43 | 0.92 / 0.87 | 0.49 @ 0.35 |
| OpenAI text-embedding-3-large | 0.44 / 0.56 | 0.41 / 0.57 | 0.99 / 1.00 | 0.50 @ 0.32 |
| this model | 0.59 / 0.69 | 0.60 / 0.68 | 0.94 / 0.92 | 0.53 @ 0.24 |
Three training runs with different seeds gave held-out R@5 0.58-0.60, so the gain is stable.
Combined with a small domain glossary for query expansion (as nevis-search-api does), it reaches 0.85 / 1.00 on glossary queries and F1 0.64.
sentence-transformers/all-MiniLM-L6-v2