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
Update README.md
Browse files
README.md
CHANGED
|
@@ -59,10 +59,11 @@ kw_model.extract_keywords(doc, stop_words=None)
|
|
| 59 |
The [keyBERT Homepage](https://github.com/MaartenGr/KeyBERT) gives several other examples on how this can be used. For instance how it can be combined with stop words, how longer phrases can be extracted and how it directly can output the highlighted text.
|
| 60 |
|
| 61 |
## Keyword Extraction
|
| 62 |
-
https://github.com/MaartenGr/BERTopic
|
|
|
|
| 63 |
|
| 64 |
## Similarity Search
|
| 65 |
-
[Javier]
|
| 66 |
|
| 67 |
|
| 68 |
## Embeddings and Sentence Similarity (Sentence-Transformers)
|
|
@@ -145,8 +146,7 @@ print(scipy_cosine_scores)
|
|
| 145 |
# Evaluation and Parameters
|
| 146 |
|
| 147 |
## Evaluaton
|
| 148 |
-
|
| 149 |
-
|
| 150 |
|
| 151 |
## Training
|
| 152 |
The model was trained with the parameters:
|
|
|
|
| 59 |
The [keyBERT Homepage](https://github.com/MaartenGr/KeyBERT) gives several other examples on how this can be used. For instance how it can be combined with stop words, how longer phrases can be extracted and how it directly can output the highlighted text.
|
| 60 |
|
| 61 |
## Keyword Extraction
|
| 62 |
+
[ToDo - Per Egil - https://github.com/MaartenGr/BERTopic]
|
| 63 |
+
|
| 64 |
|
| 65 |
## Similarity Search
|
| 66 |
+
[TODO - Javier]
|
| 67 |
|
| 68 |
|
| 69 |
## Embeddings and Sentence Similarity (Sentence-Transformers)
|
|
|
|
| 146 |
# Evaluation and Parameters
|
| 147 |
|
| 148 |
## Evaluaton
|
| 149 |
+
[Insert some numbers here, Rolv-Arild?]
|
|
|
|
| 150 |
|
| 151 |
## Training
|
| 152 |
The model was trained with the parameters:
|