Qwen3-Embedding-0.6B — Swiss company purpose → German business categories (housing-cooperative fix)
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 a fixed set of German category descriptions by cosine similarity.
The only difference from the original model is a correction to the training data for housing cooperatives (Wohnbaugenossenschaften, coopératives d'habitation). The original model sent most of them to a spiritual/esoteric category; this one ranks them as real estate. Overall quality is unchanged.
What changed and why
An error analysis of the original model found that housing cooperatives were usually classified as Esoterik & Spirituelles instead of Immobilien & Wohnungen. The cause was in the training labels: 32 housing-cooperative purposes carried the esoteric label, outnumbering the correctly labeled cooperatives the model saw. Their typical wording ("in gemeinsamer Selbsthilfe", "gemeinnützig") was learned as a sign of that category.
For this model:
- 24 cooperatives relabeled from the esoteric category (and one job-placement label) to real estate. These were purposes that clearly describe providing housing. Nine borderline cases, such as co-working, elderly care and artists' cooperatives, were left as they were.
- 24 additional correctly labeled housing cooperatives added to training. They came from purposes the original run had skipped because of the per-category sampling cap.
- Everything else is identical to the original run: data, sampling seed, hyperparameters, hard-negative mining.
Results
Comparison with the original model. 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-back housing cooperatives | 24 | 0.167 | 0.625 | 0.958 | 1.000 |
| Held-out eval, all | 3,000 | 0.662 | 0.665 | 0.867 | 0.866 |
| Held-out eval, German | 2,256 | 0.642 | 0.646 | 0.857 | 0.856 |
| Held-out eval, French | 555 | 0.733 | 0.728 | 0.904 | 0.904 |
| Held-out eval, Italian | 189 | 0.688 | 0.704 | 0.878 | 0.868 |
| Purposes neither run trained on | 55,015 | 0.607 | 0.601 | 0.861 | 0.862 |
- Housing cooperatives. On 24 cooperatives that were in neither run's training data, correct top-1 predictions went from 4 to 15. Cooperatives sent to the esoteric category dropped from 19 to 7, and the correct category is now always in the top 3.
- Everything else is within half a point of the original on the large test sets. The Italian set differs by 1.6 points, but it has only 189 purposes. Differences this small can come from the changed data order alone.
Full held-out metrics (3,000 purposes, 100 categories):
| Metric | Base model | Original fine-tune | This model |
|---|---|---|---|
| Accuracy@1 | 0.389 | 0.663 | 0.664 |
| Accuracy@3 | 0.598 | 0.867 | 0.865 |
| Accuracy@5 | 0.673 | 0.913 | 0.913 |
| NDCG@10 | 0.573 | 0.818 | 0.816 |
Usage
Identical to the original model: purposes are encoded with the query prompt, and category descriptions without one.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("andyP/qwen3-embedding-0.6b-german-categories-coopfix")
# Category descriptions in the training format (illustrative; the training taxonomy is not distributed)
categories = {
"Immobilien & Wohnungen": "Immobilien & Wohnungen. Unternehmen für Vermittlung, Vermietung und Verwaltung von Wohnliegenschaften. Beispiele: Liegenschaftsverwaltung, Vermietung, Immobilienbewertung",
"Treuhand & Buchhaltung": "Treuhand & Buchhaltung. Unternehmen für Buchführung, Steuerberatung und Lohnadministration. Beispiele: Jahresabschluss, Steuererklärung, Lohnbuchhaltung",
}
purposes = ["Die Genossenschaft bezweckt, in gemeinsamer Selbsthilfe ihren Mitgliedern preisgünstigen Wohnraum zu verschaffen."]
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:
Category texts follow the pattern <Name>. <One-sentence description> Beispiele: <example>, <example>, .... See the original model card for details on the category format, the training method and score thresholds.
Training
Same setup as the original model:
- Loss: MultipleNegativesRankingLoss with in-batch negatives plus one mined hard negative per pair (margin-filtered).
- Schedule: batch 32, learning rate 2e-5 with a cosine schedule, one epoch (1,980 steps).
- Inputs: max length 384 tokens, fp32, on Apple Silicon.
There are 63,340 training triplets, including the 48 cooperative rows described above.
Evaluation trace on the 3,000 held-out purposes:
| Step | Acc@1 | Acc@3 | Acc@5 | NDCG@10 |
|---|---|---|---|---|
| 0 (base) | 0.389 | 0.598 | 0.673 | 0.573 |
| 500 | 0.582 | 0.814 | 0.883 | 0.764 |
| 1000 | 0.645 | 0.858 | 0.903 | 0.804 |
| 1500 | 0.657 | 0.862 | 0.912 | 0.813 |
| 1980 | 0.664 | 0.865 | 0.913 | 0.816 |
This run trailed the original by about 5 points at step 500 but matched it by the end. Mid-training comparisons between runs whose data order differs are noisy; compare finished runs.
Limitations
- Cooperative fix is partial. 7 of the 24 test cooperatives still go to the esoteric category, and other cooperatives in the training data may still carry wrong labels.
- Small test set. The cooperative result rests on 24 purposes. The direction is clear, but the exact size of the gain is uncertain.
- Limitations of the original model also apply. It is tuned to one style of German category description, labels are mostly single-category, and it covers only Swiss register purpose language.