Instructions to use almador2002/tripalchemy-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use almador2002/tripalchemy-embeddings with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("almador2002/tripalchemy-embeddings") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
π§ TripAlchemy Embeddings β MiniLM-L6
The winning embedding model + precomputed vectors for the TripAlchemy recommender
Precomputed 384-dimensional embeddings for all 10,396 TripAlchemy experiences, produced by the model that won a rigorous 3-model comparison β plus the full report so the choice is reproducible.
π The 3-model comparison
Three Hugging Face sentence-embedding models were evaluated with a self-consistency retrieval test: for a stratified sample, a query built only from each experience's category + vibe tags (never its title/description) is embedded, and we measure whether the model ranks the original experience in its own top-5 (Recall@5) and its reciprocal rank (MRR). Final pick = weighted score (50% Recall@5 + 30% MRR + 20% encode-speed).
| model | hf_id | Recall@5 | MRR | encode time | dim |
|---|---|---|---|---|---|
| MiniLM-L6 β | sentence-transformers/all-MiniLM-L6-v2 |
0.0267 | 0.0242 | 34s | 384 |
| BGE-small | BAAI/bge-small-en-v1.5 |
0.05 | 0.0446 | 60s | 384 |
| E5-small | intfloat/e5-small-v2 |
0.06 | 0.0423 | 62s | 384 |
Winner: MiniLM-L6 (sentence-transformers/all-MiniLM-L6-v2). At 10,396 documents the three models' retrieval scores were statistically
close, so the tie-break went to encoding speed β MiniLM-L6 is ~2Γ faster, ideal for a live Space that loads
these vectors at startup.
βΉοΈ The absolute Recall@5 numbers are low by design β the query is intentionally stripped to category + vibe only, so retrieving the one exact experience among 10,396 is hard. The relative ranking is what selects the model; real queryβrelevant retrieval in the app is excellent.
π¦ Files
| file | what it is |
|---|---|
winning_model.npz |
ids + 384-D document vectors for all 10,396 experiences |
comparison_report.json |
full metrics + the query/doc prefixes the app reuses |
embeddings_compare_hf.py |
the comparison code (reproducible) |
π§ How the app uses it
The TripAlchemy Space downloads winning_model.npz at runtime,
loads it into a FAISS IndexFlatIP, and blends embedding similarity with the category sliders:
final_score = Ξ± Β· cosine(query, doc) + (1 β Ξ±) Β· slider_match
π Reproduce
pip install sentence-transformers
python embeddings_compare_hf.py --sample-size 300
Part of TripAlchemy Β· π dataset Β· π live app
Model tree for almador2002/tripalchemy-embeddings
Base model
nreimers/MiniLM-L6-H384-uncased