Sentence Similarity
sentence-transformers
Safetensors
Transformers
bert
feature-extraction
text-embeddings-inference
Instructions to use basic-go/math-ru-sbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use basic-go/math-ru-sbert with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("basic-go/math-ru-sbert") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use basic-go/math-ru-sbert with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("basic-go/math-ru-sbert") model = AutoModel.from_pretrained("basic-go/math-ru-sbert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download special_tokens_map.json from basic-go/math-ru-sbert: direct link, hf CLI and curl.
- Browser
- Download file 695 Bytes
-
https://huggingface.co/basic-go/math-ru-sbert/resolve/main/special_tokens_map.json
- Command line
-
hf download hf://basic-go/math-ru-sbert/special_tokens_map.json
-
curl -L -o special_tokens_map.json https://huggingface.co/basic-go/math-ru-sbert/resolve/main/special_tokens_map.json
695 Bytes
| { | |
| "cls_token": { | |
| "content": "[CLS]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "mask_token": { | |
| "content": "[MASK]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "pad_token": { | |
| "content": "[PAD]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "sep_token": { | |
| "content": "[SEP]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "unk_token": { | |
| "content": "[UNK]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| } | |
| } | |