A variant of andyP/qwen3-embedding-0.6b-german-categories, fine-tuned from Qwen/Qwen3-Embedding-0.6B. It maps the statutory purpose ("Zweck" / "but" / "scopo") of a Swiss company to the business categories it belongs to, by ranking German category descriptions by cosine similarity.
The only difference from the original model is the category text it was trained to match. The original uses a short text: name, one-sentence description and ten examples, about 130 tokens. This model uses the category name plus a long, multi-paragraph description of about 1,000 tokens, of which the first 384 tokens are used.
Which one to use: the original model scores higher overall. Use this one if your category definitions are long prose descriptions rather than short example lists.
Comparison with the original model. Each model is evaluated with the category text it was trained on, and both were trained for one full epoch with identical settings.
| Test set | Purposes | Original acc@1 | This model acc@1 | Original acc@3 | This model acc@3 |
|---|---|---|---|---|---|
| Held-out eval, all | 3,000 | 0.662 | 0.646 | 0.867 | 0.861 |
| Held-out eval, German | 2,256 | 0.642 | 0.628 | 0.857 | 0.854 |
| Held-out eval, French | 555 | 0.733 | 0.708 | 0.904 | 0.892 |
| Held-out eval, Italian | 189 | 0.688 | 0.677 | 0.878 | 0.857 |
| Purposes neither run trained on | 55,015 | 0.607 | 0.580 | 0.861 | 0.849 |
| Housing cooperatives (held back) | 24 | 0.167 | 0.583 | 0.958 | 1.000 |
Full held-out metrics (3,000 purposes, 100 categories):
| Metric | Base model, long text | Base model, short text | Original fine-tune | This model |
|---|---|---|---|---|
| Accuracy@1 | 0.462 | 0.389 | 0.663 | 0.646 |
| Accuracy@3 | 0.677 | 0.598 | 0.867 | 0.860 |
| Accuracy@5 | 0.750 | 0.673 | 0.913 | 0.911 |
| NDCG@10 | 0.644 | 0.573 | 0.818 | 0.807 |
Purposes are encoded with the query prompt; category texts are encoded without a prompt, as <Name>. <long description>.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("andyP/qwen3-embedding-0.6b-german-categories-longdesc")
model.max_seq_length = 384 # as in training; longer descriptions are cut here
# Illustrative long description; the training taxonomy is not distributed.
categories = {
"Treuhand & Buchhaltung": (
"Treuhand & Buchhaltung. Die Kategorie erfasst Unternehmen, deren Schwerpunkt in Buchführung, "
"Steuerberatung und Lohnadministration liegt. Typische Tätigkeiten sind die Führung von Finanzbuchhaltungen, "
"die Erstellung von Jahresabschlüssen und Steuererklärungen sowie die Lohnbuchhaltung für KMU. "
"Zum erweiterten Leistungsspektrum zählen Firmengründungen, Revisionen und Nachfolgeberatung. "
),
}
purposes = ["Die Gesellschaft bezweckt die Führung von Buchhaltungen und die Erbringung von Treuhanddienstleistungen."]
q = model.encode(purposes, prompt_name="query", normalize_embeddings=True)
d = model.encode(list(categories.values()), normalize_embeddings=True)
print(model.similarity(q, d))
The query prompt is stored in the model config; written out, it is:
Instruct: Given the statutory purpose of a Swiss company, retrieve the business categories it belongs to
Query:
Description style used in training. Each description opens by defining the category, then lists typical activities and an extended range of services, followed by general guidance on classification. Only the first 384 tokens are used, so put the category-specific activities early.
Same setup as the original model:
There are 63,312 training triplets. Early stopping was enabled, ending the run after two evaluations without improvement. It never triggered: the model improved until step 1500 and held steady to the end of the epoch.
Evaluation trace on the 3,000 held-out purposes:
| Step | Acc@1 | Acc@3 | Acc@5 | NDCG@10 |
|---|---|---|---|---|
| 0 (base) | 0.462 | 0.677 | 0.750 | 0.644 |
| 500 | 0.589 | 0.811 | 0.871 | 0.762 |
| 1000 | 0.634 | 0.850 | 0.903 | 0.797 |
| 1500 | 0.646 | 0.860 | 0.911 | 0.807 |
| 1979 | 0.646 | 0.860 | 0.911 | 0.807 |
Qwen/Qwen3-Embedding-0.6B