Instructions to use EdwardHuy/persona-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use EdwardHuy/persona-embeddings with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("EdwardHuy/persona-embeddings") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Fishstick
Belgian Persona Embeddings (Dutch and English)
Embedding models for finding people from short descriptions, in Dutch and English. Each is Qwen/Qwen3-Embedding-0.6B fine-tuned with LoRA on synthetic "Iemand die…" / "Someone who…" queries written for the NVIDIA Nemotron-Personas-Belgium personas. The LoRA adapters are merged into the weights, so each folder is a regular Sentence Transformers model.
The two languages were trained and evaluated separately, each only on its own language's queries and profiles, and are stored in their own folder:
| Folder | Language | Training run | Objective | q2d MRR@10 | q2q MRR@10 |
|---|---|---|---|---|---|
nl/ |
Dutch | qwen-lora-mixed-nl-seed42 |
query-to-query plus query-to-profile contrastive loss | 0.811 | 0.031 |
en/ |
English | qwen-lora-mixed-en-seed42 |
query-to-query plus query-to-profile contrastive loss | 0.858 | 0.052 |
Made for the Advanced Natural Language Processing project by Ward Huybrechts and Raphael Hermans.
- Base model: Qwen/Qwen3-Embedding-0.6B (1024 dimensions, last-token pooling, L2-normalized)
- Training data: EdwardHuy/persona-queries
- Languages: use
nl/for Dutch anden/for English. Neither was trained or evaluated on the other language.
Usage
pip install -U sentence-transformers
from huggingface_hub import snapshot_download
from sentence_transformers import SentenceTransformer
language = "nl" # or "en"
path = snapshot_download("EdwardHuy/persona-embeddings", allow_patterns=[f"{language}/*"])
model = SentenceTransformer(f"{path}/{language}")
queries = ["Iemand die geniet van melancholieke romans en solitaire wandelingen in de polders."]
profiles = [
"Een gepensioneerde juriste uit Boom die graag leest en lange wandelingen maakt.",
"Een jonge verpleger uit Gent die in het weekend voetbalt met vrienden.",
]
# Query -> full profile: use the "query" prompt for queries, nothing for profiles.
query_embeddings = model.encode(queries, prompt_name="query")
profile_embeddings = model.encode(profiles)
print(model.similarity(query_embeddings, profile_embeddings))
# Query -> other short descriptions of the same person: same prompt on both sides.
a = model.encode(queries, prompt_name="same_person")
b = model.encode(["Iemand die rechten heeft gestudeerd en momenteel niet actief is op de arbeidsmarkt."], prompt_name="same_person")
print(model.similarity(a, b))
snapshot_download with allow_patterns fetches only the chosen language's folder.
The two prompts are the instructions used during training and evaluation, and are the same for both languages:
| Prompt name | Used for | Text prepended to the input |
|---|---|---|
query |
queries searching full profiles | Instruct: Given a short description of a person, retrieve the full profile of that person\nQuery: |
same_person |
both sides of query-to-query search | Instruct: Given a short description of a person's interests, work or background, retrieve other descriptions of the same person\nQuery: |
Profiles (documents) get no prompt. Profiles up to 2304 tokens were
used in evaluation, which is also the models' max_seq_length.
Without Sentence Transformers
import torch
import torch.nn.functional as F
from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("EdwardHuy/persona-embeddings", subfolder=language, padding_side="left")
model = AutoModel.from_pretrained("EdwardHuy/persona-embeddings", subfolder=language, dtype=torch.bfloat16).eval()
instruction = "Given a short description of a person, retrieve the full profile of that person"
texts = [f"Instruct: {instruction}\nQuery:{q}" for q in queries] + profiles
batch = tokenizer(texts, padding=True, truncation=True, max_length=2304, return_tensors="pt")
with torch.inference_mode():
hidden = model(**batch).last_hidden_state
embeddings = F.normalize(hidden[:, -1].float(), dim=-1) # left padding: last position = last token
Tokenizer note
During training the inputs ended in <|endoftext|><|im_end|>: the Qwen3-Embedding
tokenizer appends <|endoftext|> itself, and the training code appended the
<|im_end|> end-of-sequence token after it. The embedding is the hidden state of
that final token. The tokenizers in this repository append both tokens, so the
usage above reproduces the training setup. If you combine these weights with the
original Qwen3-Embedding tokenizer instead, the embeddings will not match.
Training
- Data: each person has three short queries and a full persona profile, per
language. Persons are split by a hash of their UUID, and the split is the same for
Dutch and English, so no person or translation of a person crosses splits. The
split is computed by
src/embeddings.py:split_assignmentin the project repository; the published dataset contains all splits. - Objective: The sum of two InfoNCE losses. (1) Symmetric query-to-query: the positive for a query is another query of the same person. (2) Query-to-profile: the positive is the person's full profile, and the other persons' profiles in the batch are negatives. Profiles are encoded with gradient caching so a full batch fits in 10 GB.
- Batches: distinct persons only, so every in-batch negative is a different person. Each person contributes the same number of pairs per epoch.
- Model selection: validation MRR@10 after every epoch (mean of query-to-query and query-to-profile MRR@10).
Dutch (nl/) |
English (en/) |
|
|---|---|---|
| Training run | qwen-lora-mixed-nl-seed42 |
qwen-lora-mixed-en-seed42 |
| Train / validation / test persons | 2,788 / 180 / 366 | 2,776 / 188 / 370 |
| Queries per person | 3 | 3 |
| Epochs (best epoch) | 1 (1) | 1 (1) |
| Persons per batch | 128 | 128 |
| LoRA rank / alpha / dropout | 16 / 32 / 0.0 | 16 / 32 / 0.0 |
| Learning rate | 0.0001 | 0.0001 |
| Temperature | 0.05 | 0.05 |
| Max query / profile length (tokens) | 128 / 2304 | 128 / 2304 |
| Seed | 42 | 42 |
| Training time | about 111 minutes | about 64 minutes |
Both runs used LoRA on the q, k, v, o, gate, up and down projections, a linear learning-rate schedule with 10% warmup, AdamW with weight decay 0.01, a bf16 frozen base with fp32 LoRA weights, and one NVIDIA RTX 3080 (10 GB).
Evaluation
Held-out test persons, each language evaluated on its own queries and profiles. Each test query is used once:
- q2d: the query searches all test profiles; only its own person's profile is relevant.
- q2q: the query searches all other test queries; the person's other two queries are relevant.
Brackets are 95% person-level bootstrap intervals from a single run.
| Language | Model | q2d MRR@10 | q2d Acc@1 | q2d Recall@10 | q2q MRR@10 | q2q Acc@1 | q2q Recall@10 |
|---|---|---|---|---|---|---|---|
| Dutch | e5-nl | 0.128 [0.110, 0.146] | 0.069 [0.053, 0.087] | 0.283 [0.253, 0.313] | 0.006 [0.003, 0.009] | 0.001 [0.000, 0.003] | 0.015 [0.009, 0.020] |
| Dutch | qwen-base | 0.135 [0.116, 0.153] | 0.077 [0.059, 0.095] | 0.288 [0.258, 0.320] | 0.007 [0.004, 0.011] | 0.003 [0.000, 0.006] | 0.012 [0.007, 0.018] |
| Dutch | this model (nl/) |
0.811 [0.793, 0.830] | 0.741 [0.717, 0.766] | 0.943 [0.929, 0.955] | 0.031 [0.021, 0.042] | 0.013 [0.005, 0.022] | 0.052 [0.041, 0.065] |
| English | e5-nl | 0.125 [0.108, 0.143] | 0.068 [0.053, 0.084] | 0.272 [0.244, 0.302] | 0.012 [0.006, 0.019] | 0.005 [0.001, 0.011] | 0.016 [0.010, 0.023] |
| English | qwen-base | 0.232 [0.210, 0.254] | 0.165 [0.142, 0.187] | 0.419 [0.390, 0.450] | 0.011 [0.006, 0.017] | 0.004 [0.000, 0.008] | 0.018 [0.012, 0.025] |
| English | this model (en/) |
0.858 [0.841, 0.876] | 0.799 [0.774, 0.825] | 0.966 [0.955, 0.976] | 0.052 [0.039, 0.067] | 0.023 [0.013, 0.034] | 0.078 [0.064, 0.095] |
e5-nl is clips/e5-large-trm-nl and
qwen-base is the unmodified base model, both evaluated with the same code and data.
Read these numbers with care:
- The test pools are small (a few hundred profiles), so the task is easier than searching a large collection.
- The test persons were carved out of the generated training queries by hash, not taken from the project's separate validation/test manifest.
- A person's three queries are written from different profile fields, which limits how similar they can be. This caps the q2q scores.
- The queries are synthetic and have not been fully reviewed by humans. Other persons that also fit a query are counted as wrong.
- Dutch and English scores come from separate models and separately generated queries. They are not a controlled comparison between the languages.
Intended use and limitations
Intended for research on persona retrieval and as a starting point for retrieving Belgian persona profiles from short Dutch or English descriptions. It is not meant for searching or profiling real people.
- All training data is synthetic. The personas may carry stereotypes or internal inconsistencies, and the generated queries can inherit them or add their own errors.
- The models were only trained on "Iemand die…" / "Someone who…" descriptions and Nemotron-style profiles. Behaviour on other query styles, other domains or mixed languages was not measured.
- Fine-tuning on this narrow task may reduce quality on general retrieval tasks compared with the base model. This was not measured.
License and attribution
Our fine-tuning changes and this model card are released under
CC BY 4.0, the same license as the
training data. The weights are a modified version of
Qwen/Qwen3-Embedding-0.6B, which is
licensed under the Apache License 2.0; the parts that come from the base model stay
under Apache 2.0, and a copy of that license is included as LICENSE-APACHE-2.0.
The training data is derived from
NVIDIA Nemotron-Personas-Belgium
(CC BY 4.0); keep NVIDIA's and Qwen's attribution when you redistribute this model.
@misc{belgian_persona_embeddings,
title = {Belgian Persona Embeddings},
author = {Huybrechts, Ward and Hermans, Raphael},
year = {2026},
url = {https://huggingface.co/EdwardHuy/persona-embeddings}
}