Update README.md
Browse files
README.md
CHANGED
|
@@ -75,7 +75,6 @@ model-index:
|
|
| 75 |
# bge-large-en-v1.5
|
| 76 |
|
| 77 |
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) on the [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
| 78 |
-
|
| 79 |
## Model Details
|
| 80 |
|
| 81 |
### Model Description
|
|
@@ -120,7 +119,8 @@ Then you can load this model and run inference.
|
|
| 120 |
from sentence_transformers import SentenceTransformer
|
| 121 |
|
| 122 |
# Download from the 🤗 Hub
|
| 123 |
-
|
|
|
|
| 124 |
# Run inference
|
| 125 |
sentences = [
|
| 126 |
'Young boy kicks a soccer ball towards the goal as the crowd watches.',
|
|
@@ -129,7 +129,7 @@ sentences = [
|
|
| 129 |
]
|
| 130 |
embeddings = model.encode(sentences)
|
| 131 |
print(embeddings.shape)
|
| 132 |
-
# [3,
|
| 133 |
|
| 134 |
# Get the similarity scores for the embeddings
|
| 135 |
similarities = model.similarity(embeddings, embeddings)
|
|
|
|
| 75 |
# bge-large-en-v1.5
|
| 76 |
|
| 77 |
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) on the [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
|
|
|
| 78 |
## Model Details
|
| 79 |
|
| 80 |
### Model Description
|
|
|
|
| 119 |
from sentence_transformers import SentenceTransformer
|
| 120 |
|
| 121 |
# Download from the 🤗 Hub
|
| 122 |
+
matryoshka_dims = [768,512,256,128,64] # for truncateing the dimensions
|
| 123 |
+
model = SentenceTransformer("DannyAI/embedding_fine_tuning_adaptive_layer_matryoshka2dloss_bge_large_en_v1.5", truncate_dim=matryoshka_dims[0])
|
| 124 |
# Run inference
|
| 125 |
sentences = [
|
| 126 |
'Young boy kicks a soccer ball towards the goal as the crowd watches.',
|
|
|
|
| 129 |
]
|
| 130 |
embeddings = model.encode(sentences)
|
| 131 |
print(embeddings.shape)
|
| 132 |
+
# [3, 768]
|
| 133 |
|
| 134 |
# Get the similarity scores for the embeddings
|
| 135 |
similarities = model.similarity(embeddings, embeddings)
|