Instructions to use armkh/wanderlens-embed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use armkh/wanderlens-embed with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("armkh/wanderlens-embed") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
wanderlens-embed
BAAI/bge-small-en-v1.5 fine-tuned to match how travelers describe a trip ("somewhere quiet by a lake with good hiking") to the Wikivoyage passages that fit it. It powers the search in Wanderlens. 33M parameters, 384-dim normalized embeddings.
Use
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("armkh/wanderlens-embed")
query = model.encode("Represent this sentence for searching relevant passages: old town with canals to wander along")
passages = model.encode(["Gouda โ See\nThe old centre is ringed by canals..."])
print(model.similarity(query, passages))
As with the base model, queries take the instruction prefix and passages are embedded as they are. In Wanderlens a passage is the place and section name, a newline, then the guide text.
ONNX
onnx/ holds an ONNX export with int8 weights (model.onnx, tokenizer.json, and encoder.json with the query
prefix and dimension) that runs on CPU with onnxruntime alone; the Wanderlens API uses it so the server needs no
torch. The graph already includes the CLS pooling and normalization, so its output is the final embedding.
baseline-onnx/ is the same export of the unchanged base model, which the site shows next to this one.
Training
- Data: 28,401 triplets from armkh/wanderlens: a synthetic traveler query, the guide passage it was written from, and a hard negative, a passage from another destination that the base model ranked close to the query but clearly below the positive.
- Queries: written by
gpt-5.4-nanoin three styles per destination: a specific detail, a short casual query about the feel of a place, and two or three wishes combined. - Splits: by destination. 9,473 train, 500 dev, 1,000 test; test places never appear in training.
- Loss:
CachedMultipleNegativesRankingLoss, batch 128, learning rate 2e-5, 1 epoch (222 steps). - Checkpoint: the one with the best dev MRR@10, scored every 50 steps.
- Hardware: 44 minutes on an Apple Silicon Mac (MPS).
Evaluation
2,997 held-out synthetic queries for the 1,000 test destinations, searched against all 138,753 chunks. A hit is the query's own destination appearing in the top k places.
| Base bge-small | wanderlens-embed | |
|---|---|---|
| Recall@1 | 6.9% | 34.7% |
| Recall@5 | 15.7% | 51.6% |
| Recall@10 | 20.6% | 58.7% |
| MRR@20 | 0.111 | 0.423 |
By query style, recall@1 rises from 11.5% to 34.8% for specific queries, 1.2% to 17.9% for casual ones and 7.9% to 51.5% for combined wishes. The int8 ONNX export scores within 0.3 points of these (recall@1 34.5%).
On 32 hand-written queries, scored by whether a result's guide actually mentions what was asked, precision@5 moves from 0.59 to 0.63, which is within noise at that size. The synthetic test comes from the same generator as the training queries, so it measures the gain on that style of query; the hand-written set is the check on real phrasing.
Limitations
- Trained and tested on English Wikivoyage text and on queries written by one language model.
- Tuned for matching trip descriptions to destination guides; general-purpose retrieval may be worse than the base.
- Inherits the base model's 512-token limit.
Licence
MIT, like the base model. The training data is derived from Wikivoyage and licensed CC BY-SA 4.0; see armkh/wanderlens.
- Downloads last month
- -
Model tree for armkh/wanderlens-embed
Base model
BAAI/bge-small-en-v1.5