--- license: apache-2.0 library_name: sentence-transformers pipeline_tag: sentence-similarity tags: - sentence-transformers - feature-extraction - fitness - retrieval base_model: BAAI/bge-small-en-v1.5 --- # CoachTwin Embedder The sentence embedding model powering workout retrieval in the [CoachTwin](https://huggingface.co/spaces/OrDora/coachtwin) app. It is `BAAI/bge-small-en-v1.5`, chosen by evaluating three encoders on the [CoachTwin Workouts](https://huggingface.co/datasets/OrDora/coachtwin-workouts) dataset (10,393 workouts). ## Why this model Leave-one-out retrieval. *Strict* relevance requires a match on both `goal` and `body_focus`; *loose* requires `body_focus`. | model | params | dim | strict P@3 | loose P@3 | MRR@10 | corpus encode | |---|---|---|---|---|---|---| | **bge-small-en-v1.5** | 33M | 384 | 0.6687 | 0.8273 | 0.8020 | 10.4s | | all-mpnet-base-v2 | 110M | 768 | 0.5047 | 0.7453 | 0.6866 | 31.2s | | all-MiniLM-L6-v2 | 22M | 384 | 0.4733 | 0.6667 | 0.6686 | 7.0s | Random-retrieval baseline: strict P@3 **0.0220**, loose 0.1200, MRR@10 0.0685. A precision number without its baseline is not interpretable. **Selected: `BAAI/bge-small-en-v1.5`** - strict P@3 0.669, about **30x random**. The middle row is the interesting one: `all-mpnet-base-v2` is 3.3x the parameters, 3x slower, and *scores worse*. The bigger encoder is not the better one here. ## Usage from sentence_transformers import SentenceTransformer model = SentenceTransformer("OrDora/coachtwin-embedder") emb = model.encode([text], normalize_embeddings=True) Documents and queries use different templates, both recorded in `embedding_info.json`. This is a BGE model, so queries - not documents - take the prefix `Represent this sentence for searching relevant passages: ` (`needs_query_prefix: true`). ## Serialization note Saved in the **sentence-transformers 3.x** module format. A repo saved by 5.x fails on 3.x with `No module named 'sentence_transformers.base'`, and a client with a try/except fallback then silently swaps in a different encoder - no error, wrong neighbours, because several candidates share 384 dimensions. ## Limitations Base checkpoint, **not fine-tuned**. Evaluated only on synthetic English workout descriptions. Not fitness or medical advice.