Run this model with HF Jobs
Run adambuttrick/funder-set-point-retriever-e5-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/adambuttrick/funder-set-point-retriever-e5-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/adambuttrick/funder-set-point-retriever-e5-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use adambuttrick/funder-set-point-retriever-e5-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use adambuttrick/funder-set-point-retriever-e5-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("adambuttrick/funder-set-point-retriever-e5-base") 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] - Notebooks
- Google Colab
- Kaggle
funder-set-point-retriever-e5-base
This model is the Stage 1 dense retriever for funder-to-ROR set point matching. It maps a serialized funder query and each ROR v2.16 organization card into unit-normalized 768-dimensional vectors so fast dot-product search surfaces candidate ROR records for the Stage 2 set model funder-set-point-set-model-mmbert-base.
What the model does
The retriever encodes a funder query with the "query: " prefix and up to 384 tokens, and encodes each ROR v2.16 card with the "passage: " prefix and up to 128 tokens. Mean pooling and L2 normalization produce cosine-comparable vectors over all 150,849 active and inactive ROR v2.16 records, with 61 conflated Chinese provincial FundRef IDs stripped from the card text.
During inference, the pipeline takes the top 32 dense candidates and merges them with a mode-isolated lexical candidate generator up to a cap of 48 candidates per query.
How to use
With SentenceTransformer
import gzip
import json
from huggingface_hub import hf_hub_download
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("adambuttrick/funder-set-point-retriever-e5-base")
cards_path = hf_hub_download("adambuttrick/funder-set-point-retriever-e5-base", "ror_v2_16/ror_cards.jsonl.gz")
with gzip.open(cards_path, "rt", encoding="utf-8") as f:
cards = [json.loads(line) for line in f if line.strip()]
model.max_seq_length = 128
record_vecs = model.encode(
[row["text"] for row in cards],
prompt_name="passage",
batch_size=256,
convert_to_tensor=True,
normalize_embeddings=True,
)
model.max_seq_length = 384
query = "[TARGET] name: National Natural Science Foundation of China ; award: 62176001 [WORK] cc: CN"
q_vec = model.encode([query], prompt_name="query", convert_to_tensor=True, normalize_embeddings=True)
top = (q_vec @ record_vecs.T).topk(32)
candidates = [(cards[int(i)]["ror_id"], float(s)) for i, s in zip(top.indices[0], top.values[0])]
Direct search with precomputed ROR vectors
ror_v2_16/ror_vectors.pt stores precomputed fp16 vectors for all 150,849 ROR v2.16 records so you only encode incoming queries at runtime.
import torch
from huggingface_hub import hf_hub_download
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("adambuttrick/funder-set-point-retriever-e5-base")
model.max_seq_length = 384
vec_path = hf_hub_download("adambuttrick/funder-set-point-retriever-e5-base", "ror_v2_16/ror_vectors.pt")
payload = torch.load(vec_path, map_location="cpu")
ror_ids = payload["ror_ids"]
record_vecs = payload["vectors"].float()
query = "[TARGET] name: European Research Council ; award: 101001234 [WORK] cc: DE"
q_vec = model.encode([query], prompt_name="query", convert_to_tensor=True, normalize_embeddings=True).cpu().float()
top = (q_vec @ record_vecs.T).topk(32)
candidates = [(ror_ids[int(i)], float(s)) for i, s in zip(top.indices[0], top.values[0])]
Training details
Training uses 325,625 rows blended at 55% weight on Layer-3-cleaned aligned funder assertions and 45% weight on calibrated StartLux-Decision-v1.1-27B-Instant teacher judgments and 113,246 non-Latin funder strings. The extra pool combines 117,490 mined non-Latin retriever rows with 24,945 calibrated StartLux teacher rows. All held-out and 2,886 sealed unseen ROR organizations are excluded from training positives.
| Setting | Value |
|---|---|
| Base model | intfloat/multilingual-e5-base |
| Loss | Multi-positive InfoNCE, temperature 0.02 |
| Batch size | 128 queries |
| Schedule | 3 epochs, 1,800 steps per epoch, 5,400 total steps |
| Max lengths | 384 query tokens, 128 card tokens |
| Seed | 1363 |
Evaluation
Micro link recall in percent from evaluation/stage1_retrieval_eval.json. Dense@32 uses only the retriever; Merged@48 merges Dense@32 with mode-isolated lexical candidates up to 48 candidates per query.
| Split | Queries | Dense@32 | Merged@48 |
|---|---|---|---|
val |
15,798 | 99.59 | 99.83 |
val non-Latin script |
294 | 99.63 | 99.63 |
test |
15,853 | 99.79 | 99.91 |
test non-Latin script |
332 | 98.99 | 99.66 |
unseen_organizations overall |
30,180 | 99.53 | 99.82 |
unseen_organizations 2,886 sealed unseen RORs |
25,528 | 99.59 | 99.85 |
unseen_organizations non-Latin script |
491 | 97.13 | 97.70 |
benchmark_v2_16_aligned unweighted |
3,505 | 99.80 | 100.00 |
benchmark_v2_16_aligned occurrence-weighted |
3,505 | 99.99 | 100.00 |
Files
| Path | Content |
|---|---|
| Model and tokenizer weights | config.json, model.safetensors, retriever_config.json, sentencepiece.bpe.model, tokenizer JSON files |
| SentenceTransformer config | modules.json, 1_Pooling/config.json, config_sentence_transformers.json, sentence_bert_config.json |
ror_v2_16/ror_vectors.pt |
Precomputed fp16 vectors for all 150,849 ROR v2.16 records |
ror_v2_16/ror_cards.jsonl.gz |
Compact ROR v2.16 cards with 61 conflated FundRef IDs stripped |
logs/ |
train_log.txt and train_summary.json |
evaluation/ |
stage1_retrieval_eval.json |
License and credits
Model weights derive from intfloat/multilingual-e5-base under the MIT license. ROR v2.16 metadata is CC0. Teacher judgments come from StartLux-Decision-v1.1-27B-Instant by StartLux Labs.
- Downloads last month
- -
Model tree for adambuttrick/funder-set-point-retriever-e5-base
Base model
intfloat/multilingual-e5-base