Sentence Similarity
sentence-transformers
PyTorch
Safetensors
Transformers
Norwegian
bert
feature-extraction
text-embeddings-inference
Instructions to use NbAiLab/nb-sbert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NbAiLab/nb-sbert-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("NbAiLab/nb-sbert-base") sentences = [ "This is a Norwegian boy", "Dette er en norsk gutt", "This is an English boy", "This is a dog" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use NbAiLab/nb-sbert-base with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("NbAiLab/nb-sbert-base") model = AutoModel.from_pretrained("NbAiLab/nb-sbert-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Commit ·
f419068
1
Parent(s): 6326958
Update README.md
Browse files
README.md
CHANGED
|
@@ -145,8 +145,14 @@ print(scipy_cosine_scores)
|
|
| 145 |
|
| 146 |
# Evaluation and Parameters
|
| 147 |
|
| 148 |
-
##
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
## Training
|
| 152 |
The model was trained with the parameters:
|
|
|
|
| 145 |
|
| 146 |
# Evaluation and Parameters
|
| 147 |
|
| 148 |
+
## Evaluation
|
| 149 |
+
Evaluation results on the sts-test dataset:
|
| 150 |
+
| | Pearson | Spearman |
|
| 151 |
+
|------------------------|------------|------------|
|
| 152 |
+
| Cosine Similarity | **0.8275** | **0.8245** |
|
| 153 |
+
| Manhattan Distance | 0.8193 | 0.8182 |
|
| 154 |
+
| Euclidean Distance | 0.8190 | 0.8180 |
|
| 155 |
+
| Dot Product Similarity | 0.8039 | 0.7951 |
|
| 156 |
|
| 157 |
## Training
|
| 158 |
The model was trained with the parameters:
|