Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

sentence-transformers
/
stsb-roberta-base-v2

Sentence Similarity
sentence-transformers
PyTorch
google-tensorflow TensorFlow
JAX
ONNX
Safetensors
OpenVINO
Transformers
roberta
feature-extraction
text-embeddings-inference
Model card Files Files and versions
xet
Community
3

Instructions to use sentence-transformers/stsb-roberta-base-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use sentence-transformers/stsb-roberta-base-v2 with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("sentence-transformers/stsb-roberta-base-v2")
    
    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 sentence-transformers/stsb-roberta-base-v2 with Transformers:

    # Load model directly
    from transformers import AutoTokenizer, AutoModel
    
    tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/stsb-roberta-base-v2")
    model = AutoModel.from_pretrained("sentence-transformers/stsb-roberta-base-v2")
  • Inference
  • Notebooks
  • Google Colab
  • Kaggle
stsb-roberta-base-v2
5.35 GB
Ctrl+K
Ctrl+K
  • 5 contributors
History: 22 commits
tomaarsen's picture
tomaarsen HF Staff
Remove deprecated (SEB) evaluation results section
e912d85 verified over 1 year ago
  • 1_Pooling
    Add new SentenceTransformer model. about 5 years ago
  • onnx
    Add exported ONNX model 'model_qint8_avx512_vnni.onnx' over 1 year ago
  • openvino
    Add exported openvino model 'openvino_model_qint8_quantized.xml' over 1 year ago
  • .gitattributes
    1.15 kB
    Adding `safetensors` variant of this model (#2) over 2 years ago
  • README.md
    3.5 kB
    Remove deprecated (SEB) evaluation results section over 1 year ago
  • config.json
    675 Bytes
    Add new SentenceTransformer model. about 5 years ago
  • config_sentence_transformers.json
    122 Bytes
    Add new SentenceTransformer model. about 5 years ago
  • flax_model.msgpack
    499 MB
    xet
    upload flax model about 5 years ago
  • merges.txt
    456 kB
    upload about 5 years ago
  • model.safetensors
    499 MB
    xet
    Adding `safetensors` variant of this model (#2) over 2 years ago
  • modules.json
    229 Bytes
    Add new SentenceTransformer model. about 5 years ago
  • pytorch_model.bin
    499 MB
    xet
    Add new SentenceTransformer model. about 5 years ago
  • sentence_bert_config.json
    52 Bytes
    upload about 5 years ago
  • special_tokens_map.json
    239 Bytes
    upload about 5 years ago
  • tf_model.h5
    499 MB
    xet
    Add TF weights about 4 years ago
  • tokenizer.json
    1.36 MB
    Add new SentenceTransformer model. about 5 years ago
  • tokenizer_config.json
    1.11 kB
    Add new SentenceTransformer model. about 5 years ago
  • vocab.json
    798 kB
    upload about 5 years ago