Sentence Similarity
sentence-transformers
Safetensors
Transformers
xlm-roberta
feature-extraction
text-embeddings-inference
Instructions to use bachngo/sentence with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use bachngo/sentence with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("bachngo/sentence") 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 bachngo/sentence with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("bachngo/sentence") model = AutoModel.from_pretrained("bachngo/sentence") - Notebooks
- Google Colab
- Kaggle
| { | |
| "added_tokens_decoder": { | |
| "0": { | |
| "content": "<s>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "1": { | |
| "content": "<pad>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "2": { | |
| "content": "</s>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "3": { | |
| "content": "<unk>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "250001": { | |
| "content": "<mask>", | |
| "lstrip": true, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| } | |
| }, | |
| "bos_token": "<s>", | |
| "clean_up_tokenization_spaces": true, | |
| "cls_token": "<s>", | |
| "eos_token": "</s>", | |
| "mask_token": "<mask>", | |
| "max_length": 128, | |
| "model_max_length": 512, | |
| "pad_to_multiple_of": null, | |
| "pad_token": "<pad>", | |
| "pad_token_type_id": 0, | |
| "padding_side": "right", | |
| "sep_token": "</s>", | |
| "stride": 0, | |
| "tokenizer_class": "XLMRobertaTokenizer", | |
| "truncation_side": "right", | |
| "truncation_strategy": "longest_first", | |
| "unk_token": "<unk>" | |
| } | |