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:
# pip install -U transformers accelerate # 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
Download sentence_bert_config.json from NbAiLab/nb-sbert-base: direct link, hf CLI and curl.
- Browser
- Download file 52 Bytes
-
https://huggingface.co/NbAiLab/nb-sbert-base/resolve/main/sentence_bert_config.json
- Command line
-
hf download hf://NbAiLab/nb-sbert-base/sentence_bert_config.json
-
curl -L -o sentence_bert_config.json https://huggingface.co/NbAiLab/nb-sbert-base/resolve/main/sentence_bert_config.json
52 Bytes
| { | |
| "max_seq_length": 75, | |
| "do_lower_case": false | |
| } |