Sentence Transformers
A Python framework for computing, using and training embedding and reranking models, including sentence embeddings, cross-encoder reranking, sparse embeddings and ColBERT-style multi-vector retrieval, for semantic search and similarity tasks.
Sentence Transformers is a framework for computing embeddings with pretrained Sentence Transformer models, calculating similarity scores with Cross-Encoder reranker models, generating sparse embeddings with Sparse Encoder models, and computing token-level embeddings for ColBERT-style late-interaction retrieval with Multi-Vector Encoder models.
These building blocks support applications such as semantic search, semantic textual similarity and paraphrase mining. More than 15,000 pretrained models are available on Hugging Face, and the framework can also train or fine-tune custom embedding, reranker, sparse encoder or multi-vector encoder models for a specific use case.
It installs from PyPI, requires Python 3.10 or newer, PyTorch 2.2 or newer and Transformers 5.0 or newer, and offers optional extras for image, audio, video, training, ONNX and OpenVINO support.