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 README.md
Browse files
README.md
CHANGED
|
@@ -103,6 +103,22 @@ print(json.dumps(retriever.search(document=EXAMPLE_DOC), indent=4))
|
|
| 103 |
|
| 104 |
# Instruction Templates for Chunk 4/4 of the Document:
|
| 105 |
# - "how did <fi>a group of people</fi> <fi>perform a common practice or activity</fi>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
```
|
| 107 |
|
| 108 |
---
|
|
|
|
| 103 |
|
| 104 |
# Instruction Templates for Chunk 4/4 of the Document:
|
| 105 |
# - "how did <fi>a group of people</fi> <fi>perform a common practice or activity</fi>"
|
| 106 |
+
|
| 107 |
+
# ******************************************************
|
| 108 |
+
# Increasing diversity:
|
| 109 |
+
# -----------------------
|
| 110 |
+
# You can increase diversity using the reweight parameter
|
| 111 |
+
# to increase diversity in instruction length like so:
|
| 112 |
+
# `print(json.dumps(retriever.search(document=EXAMPLE_DOC, reweight=True), indent=4))`
|
| 113 |
+
# ******************************************************
|
| 114 |
+
|
| 115 |
+
# ******************************************************
|
| 116 |
+
# Documentation:
|
| 117 |
+
# -----------------------
|
| 118 |
+
# You can read the full documentation of the `InstructionTemplateRetriever.search` method:
|
| 119 |
+
# by opening/reading the instruction_template_retriever.py file here:
|
| 120 |
+
# https://huggingface.co/fineinstructions/instruction_template_retrieval_embedding/tree/main
|
| 121 |
+
# ******************************************************
|
| 122 |
```
|
| 123 |
|
| 124 |
---
|