HubCloneHubClone
Tasks

Sentence Similarity

Sentence similarity scores how close two pieces of text are in meaning.

Inputs

Input

A dog runs on the beach.

Sentence Similarity Model

Output

Output
  • A puppy plays by the sea.0.82
  • The stock market fell.0.04

About Sentence Similarity

Sentence similarity scores how close two pieces of text are in meaning. Browse sentence similarity models on HubClone to compare checkpoints, or open a Space to try one in the browser.

Use Cases

Duplicate detection

Spot questions that were already asked.

Recommendation

Suggest articles similar to the one being read.

Inference

The Transformers pipeline API runs sentence similarity models in a few lines. Replace <model-id> with any model listed on this page.

from transformers import pipeline

pipe = pipeline("sentence-similarity", model="<model-id>")
pipe("A dog runs on the beach.")

Useful Resources

Want to dig deeper into the topic? Great! Here is a hand-picked list of resources we found helpful.

Documentation

  • Sentence Similarity task guide
  • Pipelines reference

Notebooks

  • Fine-tuning a sentence similarity model