Sentence Similarity
sentence-transformers
Safetensors
semantic-search
vector-database
chromadb
embeddings
reranking
two-stage-retrieval
information-retrieval
nlp
rag
bge-base
cross-encoder
python
fastapi
streamlit
docker
food-science
flavor-pairing
culinary-ai
recipe-recommendation
cooking
taste-chemistry
Instructions to use Srihari2020/FlavorVector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Srihari2020/FlavorVector with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("Srihari2020/FlavorVector") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
FlavorVector
FlavorVector is a standalone, local-first semantic cooking substitution, flavor-pairing, and pantry flavor-bridge engine grounded in food-science chemistry and volatile aroma compounds. This repository includes the complete codebase, Streamlit UI, FastAPI service, pre-indexed ChromaDB database, and bundled transformer weights for offline execution.
Repository Contents
models/bi_encoder/β BundledBAAI/bge-base-en-v1.5dense retrieval model (~438 MB).models/cross_encoder/β Bundledcross-encoder/ms-marco-MiniLM-L-6-v2reranker (~91 MB).chroma_db/β Pre-built persistent vector store (143 vectors acrossflavor_substitutionsandflavor_pairings).flavor_atlas.jsonβ Exported structured food-science substitution rules and ingredient compound profiles.app/β Core retrieval engine (engine.py), live web synthesis (live_fetcher.py), ratio scaler (balancer.py), and FastAPI endpoints (main.py).streamlit_app.pyβ Interactive Streamlit dashboard with 10-taste Plotly radar charts.scripts/&tests/β Atlas builders, 25-case benchmark runner, PNG chart generator, andpytestsuite.
Evaluation Benchmarks
Benchmarked across 25 culinary edge cases on NVIDIA GeForce RTX 5060 Laptop GPU:
| Category | Metric | Stage 1 (bge-base-en-v1.5) |
Two-Stage (+ Cross-Encoder) |
|---|---|---|---|
| Accuracy | Hit Rate@1 | 100.0% | 100.0% |
| Accuracy | Hit Rate@3 | 100.0% | 100.0% |
| Ranking Quality | Mean Reciprocal Rank (MRR) | 100.0% | 100.0% |
| Ranking Quality | NDCG@3 | 100.0% | 100.0% |
| Latency | Substitutions (p50 / p95) | 6.67 ms | 28.95 ms / 30.81 ms |
| Latency | Flavor Pairing (p50 / p95) | β | 36.38 ms / 41.52 ms |
| Latency | Pantry Flavor Bridge (p50 / p95) | β | 60.04 ms / 62.85 ms |
| Throughput | Sustained QPS | β | 35.1 QPS (/substitute) Β· 26.6 QPS (/pair) |
Standalone Usage
import sys
from huggingface_hub import snapshot_download
# Downloads the full repo (bundled bi-encoder, cross-encoder, chroma_db, and app)
local_dir = snapshot_download(repo_id="Srihari2020/FlavorVector", repo_type="model")
sys.path.insert(0, local_dir)
from app.engine import FlavorEngine
engine = FlavorEngine()
subs, _ = engine.search_substitutes(
query="what can replace buttermilk and give the same tanginess in pancakes?",
top_k=3,
)
for hit in subs:
print(f"#{hit['rank']} ({hit['relevance_score']*100:.1f}%): {hit['substitute']}")
Model tree for Srihari2020/FlavorVector
Base model
BAAI/bge-base-en-v1.5
