Sentence Similarity
sentence-transformers
Safetensors
xlm-roberta
datadreamer
datadreamer-0.46.0
Synthetic
feature-extraction
text-embeddings-inference
Instructions to use fineinstructions/instruction_template_retrieval_embedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use fineinstructions/instruction_template_retrieval_embedding with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("fineinstructions/instruction_template_retrieval_embedding") 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
Update instruction_template_retriever.py
Browse files
instruction_template_retriever.py
CHANGED
|
@@ -270,6 +270,8 @@ class InstructionTemplateRetriever:
|
|
| 270 |
search_k (int): The number of search results to pull when retrieving from FAISS.
|
| 271 |
max_results (int): The max number of results to return.
|
| 272 |
deduplicate (bool): Deduplicate results between coverage sections.
|
|
|
|
|
|
|
| 273 |
"""
|
| 274 |
|
| 275 |
def _reweight(inp, k=None):
|
|
|
|
| 270 |
search_k (int): The number of search results to pull when retrieving from FAISS.
|
| 271 |
max_results (int): The max number of results to return.
|
| 272 |
deduplicate (bool): Deduplicate results between coverage sections.
|
| 273 |
+
reweight (bool): Whether to reweight the results based on a more realistic length distribution.
|
| 274 |
+
reweight_epsilon (float): How tolerant to be when reweighting (larger is more inaccurate results but better reweighting)
|
| 275 |
"""
|
| 276 |
|
| 277 |
def _reweight(inp, k=None):
|