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") - Inference
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,6 +31,12 @@ language:
|
|
| 31 |
---
|
| 32 |
|
| 33 |
# NB-SBERT-BASE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
NB-SBERT-BASE is a [SentenceTransformers](https://www.SBERT.net) model trained on a [machine translated version of the MNLI dataset](https://huggingface.co/datasets/NbAiLab/mnli-norwegian), starting from [nb-bert-base](https://huggingface.co/NbAiLab/nb-bert-base).
|
| 35 |
|
| 36 |
The model maps sentences & paragraphs to a 768 dimensional dense vector space. This vector can be used for tasks like clustering and semantic search. Below we give some examples on how to use the model. The easiest way is to simply measure the cosine distance between two sentences. Sentences that are close to each other in meaning, will have a small cosine distance and a similarity close to 1. The model is trained in such a way that similar sentences in different languages should also be close to each other. Ideally, an English-Norwegian sentence pair should have high similarity.
|
|
|
|
| 31 |
---
|
| 32 |
|
| 33 |
# NB-SBERT-BASE
|
| 34 |
+
|
| 35 |
+
> [!IMPORTANT]
|
| 36 |
+
> As of April 13th 2026, there is now a new version of this model, NbAiLab/nb-sbert-v2, with improve performance and context length.
|
| 37 |
+
> - [NbAiLab/nb-sbert-v2-base](https://huggingface.co/NbAiLab/nb-sbert-v2-base)
|
| 38 |
+
> - [NbAiLab/nb-sbert-v2-large](https://huggingface.co/NbAiLab/nb-sbert-v2-large)
|
| 39 |
+
|
| 40 |
NB-SBERT-BASE is a [SentenceTransformers](https://www.SBERT.net) model trained on a [machine translated version of the MNLI dataset](https://huggingface.co/datasets/NbAiLab/mnli-norwegian), starting from [nb-bert-base](https://huggingface.co/NbAiLab/nb-bert-base).
|
| 41 |
|
| 42 |
The model maps sentences & paragraphs to a 768 dimensional dense vector space. This vector can be used for tasks like clustering and semantic search. Below we give some examples on how to use the model. The easiest way is to simply measure the cosine distance between two sentences. Sentences that are close to each other in meaning, will have a small cosine distance and a similarity close to 1. The model is trained in such a way that similar sentences in different languages should also be close to each other. Ideally, an English-Norwegian sentence pair should have high similarity.
|