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

jamescalam
/
bert-stsb-cross-encoder

Sentence Similarity
sentence-transformers
PyTorch
Transformers
bert
text-classification
cross-encoder
text-embeddings-inference
Model card Files Files and versions
xet
Community
2

Instructions to use jamescalam/bert-stsb-cross-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use jamescalam/bert-stsb-cross-encoder with sentence-transformers:

    from sentence_transformers import CrossEncoder
    
    model = CrossEncoder("jamescalam/bert-stsb-cross-encoder")
    
    query = "Which planet is known as the Red Planet?"
    passages = [
    	"Venus is often called Earth's twin because of its similar size and proximity.",
    	"Mars, known for its reddish appearance, is often referred to as the Red Planet.",
    	"Jupiter, the largest planet in our solar system, has a prominent red spot.",
    	"Saturn, famous for its rings, is sometimes mistaken for the Red Planet."
    ]
    
    scores = model.predict([(query, passage) for passage in passages])
    print(scores)
  • Transformers

    How to use jamescalam/bert-stsb-cross-encoder with Transformers:

    # Load model directly
    from transformers import AutoTokenizer, AutoModelForSequenceClassification
    
    tokenizer = AutoTokenizer.from_pretrained("jamescalam/bert-stsb-cross-encoder")
    model = AutoModelForSequenceClassification.from_pretrained("jamescalam/bert-stsb-cross-encoder")
  • Notebooks
  • Google Colab
  • Kaggle
bert-stsb-cross-encoder
877 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 5 commits
SFconvertbot's picture
SFconvertbot
Adding `safetensors` variant of this model
f81eb8c verified over 1 year ago
  • .gitattributes
    1.23 kB
    Adding `safetensors` variant of this model over 1 year ago
  • README.md
    446 Bytes
    Update README.md over 4 years ago
  • config.json
    756 Bytes
    added model files for STSb cross encoder demo over 4 years ago
  • model.safetensors
    438 MB
    xet
    Adding `safetensors` variant of this model over 1 year ago
  • pytorch_model.bin

    Detected Pickle imports (4)

    • "collections.OrderedDict",
    • "torch._utils._rebuild_tensor_v2",
    • "torch.FloatStorage",
    • "torch.LongStorage"

    What is a pickle import?

    438 MB
    xet
    added model files for STSb cross encoder demo over 4 years ago
  • special_tokens_map.json
    112 Bytes
    added model files for STSb cross encoder demo over 4 years ago
  • tokenizer.json
    466 kB
    added model files for STSb cross encoder demo over 4 years ago
  • tokenizer_config.json
    321 Bytes
    added model files for STSb cross encoder demo over 4 years ago
  • vocab.txt
    232 kB
    added model files for STSb cross encoder demo over 4 years ago