Qwen3-Embedding-0.6B — Swiss company purpose → German business categories (long descriptions)
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.
Results
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 |
- Head start that doesn't last. Before fine-tuning, long descriptions work better than short ones (top-1 0.462 vs 0.389). After fine-tuning, the short-text model ends 1.7 points ahead. Most of each long description in our data is shared template text, which makes categories harder to tell apart once the model learns from labels.
- Real estate is a bright spot. Long descriptions handle real-estate purposes better, including housing cooperatives, which the original model mostly misclassified.
- Cost. Training took about 60% longer (5 h vs 3 h 07 m on Apple Silicon), and every category embedding is computed from 384 tokens instead of about 130.
Usage
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.
Training
Same setup as the original model:
- Loss: MultipleNegativesRankingLoss with in-batch negatives plus one mined hard negative per pair. The hard negatives were mined with long descriptions.
- Schedule: batch 32, learning rate 2e-5 with a cosine schedule.
- Inputs: max length 384 tokens for both purposes and descriptions, fp32, on Apple Silicon.
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 |
Limitations
- Lower overall accuracy than the short-text original, by about 1.7 points top-1 on held-out data and 2.7 points on a larger never-trained set.
- Tied to a description style. The model learned one specific style of long German category description, and prose in a very different style will score lower.
- Limitations of the original model also apply. Labels are mostly single-category, so top-1 accuracy understates quality; it is trained only on Swiss register purpose language; and generic purposes carry little signal.