Text Retrieval
Transformers
Safetensors
sentence-transformers
English
kpr-bert
feature-extraction
custom_code
Instructions to use knowledgeable-ai/kpr-retromae with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use knowledgeable-ai/kpr-retromae with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("knowledgeable-ai/kpr-retromae", trust_remote_code=True, dtype="auto") - sentence-transformers
How to use knowledgeable-ai/kpr-retromae with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("knowledgeable-ai/kpr-retromae", trust_remote_code=True) 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
Add new SentenceTransformer model
Browse files- README.md +4 -4
- config_sentence_transformers.json +1 -1
README.md
CHANGED
|
@@ -19,7 +19,7 @@ This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps
|
|
| 19 |
<!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
|
| 20 |
- **Maximum Sequence Length:** 512 tokens
|
| 21 |
- **Output Dimensionality:** 768 dimensions
|
| 22 |
-
- **Similarity Function:**
|
| 23 |
<!-- - **Training Dataset:** Unknown -->
|
| 24 |
<!-- - **Language:** Unknown -->
|
| 25 |
<!-- - **License:** Unknown -->
|
|
@@ -68,9 +68,9 @@ print(embeddings.shape)
|
|
| 68 |
# Get the similarity scores for the embeddings
|
| 69 |
similarities = model.similarity(embeddings, embeddings)
|
| 70 |
print(similarities)
|
| 71 |
-
# tensor([[
|
| 72 |
-
# [
|
| 73 |
-
# [
|
| 74 |
```
|
| 75 |
|
| 76 |
<!--
|
|
|
|
| 19 |
<!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
|
| 20 |
- **Maximum Sequence Length:** 512 tokens
|
| 21 |
- **Output Dimensionality:** 768 dimensions
|
| 22 |
+
- **Similarity Function:** Dot Product
|
| 23 |
<!-- - **Training Dataset:** Unknown -->
|
| 24 |
<!-- - **Language:** Unknown -->
|
| 25 |
<!-- - **License:** Unknown -->
|
|
|
|
| 68 |
# Get the similarity scores for the embeddings
|
| 69 |
similarities = model.similarity(embeddings, embeddings)
|
| 70 |
print(similarities)
|
| 71 |
+
# tensor([[746.8777, 706.3154, 683.6250],
|
| 72 |
+
# [706.3154, 747.0701, 683.0114],
|
| 73 |
+
# [683.6249, 683.0115, 746.7446]])
|
| 74 |
```
|
| 75 |
|
| 76 |
<!--
|
config_sentence_transformers.json
CHANGED
|
@@ -10,5 +10,5 @@
|
|
| 10 |
"document": ""
|
| 11 |
},
|
| 12 |
"default_prompt_name": null,
|
| 13 |
-
"similarity_fn_name": "
|
| 14 |
}
|
|
|
|
| 10 |
"document": ""
|
| 11 |
},
|
| 12 |
"default_prompt_name": null,
|
| 13 |
+
"similarity_fn_name": "dot"
|
| 14 |
}
|