Sentence Similarity
sentence-transformers
Safetensors
Azerbaijani
bert
feature-extraction
retrieval
azerbaijani
embedding
Eval Results (legacy)
text-embeddings-inference
Instructions to use LocalDoc/LocRet-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use LocalDoc/LocRet-small with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("LocalDoc/LocRet-small") 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -62,20 +62,20 @@ from sentence_transformers import SentenceTransformer
|
|
| 62 |
|
| 63 |
model = SentenceTransformer("LocalDoc/LocRet-small")
|
| 64 |
|
| 65 |
-
queries = ["
|
| 66 |
passages = [
|
| 67 |
-
"
|
| 68 |
-
"
|
| 69 |
]
|
| 70 |
|
| 71 |
-
query_embeddings = model.
|
| 72 |
-
passage_embeddings = model.
|
| 73 |
|
| 74 |
similarities = model.similarity(query_embeddings, passage_embeddings)
|
| 75 |
print(similarities)
|
| 76 |
```
|
|
|
|
| 77 |
|
| 78 |
-
> **Important:** Always use `"query: "` prefix for queries and `"passage: "` prefix for documents.
|
| 79 |
|
| 80 |
## Training
|
| 81 |
|
|
|
|
| 62 |
|
| 63 |
model = SentenceTransformer("LocalDoc/LocRet-small")
|
| 64 |
|
| 65 |
+
queries = ["Azərbaycanın paytaxtı hansı şəhərdir?"]
|
| 66 |
passages = [
|
| 67 |
+
"Bakı Azərbaycan Respublikasının paytaxtı və ən böyük şəhəridir.",
|
| 68 |
+
"Gəncə Azərbaycanın ikinci böyük şəhəridir.",
|
| 69 |
]
|
| 70 |
|
| 71 |
+
query_embeddings = model.encode_query(queries)
|
| 72 |
+
passage_embeddings = model.encode_document(passages)
|
| 73 |
|
| 74 |
similarities = model.similarity(query_embeddings, passage_embeddings)
|
| 75 |
print(similarities)
|
| 76 |
```
|
| 77 |
+
Prefixes `"query: "` and `"passage: "` are applied automatically via encode_query and encode_document. If using model.encode directly, the `"passage: "` prefix is added by default.
|
| 78 |
|
|
|
|
| 79 |
|
| 80 |
## Training
|
| 81 |
|