Sentence Similarity
sentence-transformers
Safetensors
bert
embeddings
retrieval
rag
text-embeddings-inference
Instructions to use Sushmitha2003/minilm-fastapi-docs-retrieval with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Sushmitha2003/minilm-fastapi-docs-retrieval with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Sushmitha2003/minilm-fastapi-docs-retrieval") 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
minilm-fastapi-docs-retrieval
sentence-transformers/all-MiniLM-L6-v2 fine-tuned for question-to-passage retrieval over FastAPI documentation.
It maps text to 384-dimensional vectors and was built for the RAG pipeline in
multimodal-rag-copilot.
Training
- Data: 743 (question, passage) pairs. Passages are chunks of the FastAPI tutorial documentation (MIT licensed). The questions were generated by an LLM (Gemini) from each passage.
- Method:
MultipleNegativesRankingLoss(other passages in a batch act as negatives), 3 epochs, batch size 32, learning rate 2e-5, trained withsentence-transformerson PyTorch. - Split: documents were split by file into train and held-out sets, so the held-out documents were never seen in training.
Evaluation
Held-out documents: 256 synthetic queries searched over 64 passages.
| Model | Recall@1 | Recall@3 | Recall@5 | MRR@10 |
|---|---|---|---|---|
| sentence-transformers/all-MiniLM-L6-v2 (base) | 0.566 | 0.789 | 0.863 | 0.695 |
| This model | 0.730 | 0.906 | 0.965 | 0.831 |
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Sushmitha2003/minilm-fastapi-docs-retrieval")
embeddings = model.encode(["How do I add a prefix to a router in FastAPI?"], normalize_embeddings=True)
Limitations
- Tuned for one domain (FastAPI documentation); gains are not expected to transfer to other domains.
- Evaluated on LLM-generated queries from the same documentation, not on real user queries.
- Small evaluation pool and a single training run, so no confidence intervals.
- Downloads last month
- 19
Model tree for Sushmitha2003/minilm-fastapi-docs-retrieval
Base model
nreimers/MiniLM-L6-H384-uncased Quantized
sentence-transformers/all-MiniLM-L6-v2