liveBook · Manning

Sentence-BERT

As explained in Build an Advanced RAG Application (From Scratch)

SBERT is a BERT-based sentence-embedding model optimized to represent semantic relationships and similarity between sentences.

Sentence-BERT (SBERT) is a BERT-based encoder model designed to represent entire sentences for semantic textual similarity. It processes sentences independently and compares their resulting embeddings with cosine similarity. section 2.3.1

BERT supplies bidirectional contextual representations through masked language modeling. SBERT extends this encoder foundation with siamese and triplet network architectures that emphasize useful sentence embeddings rather than only word-level context. section 2.3.1 section 2.3.1

Sentence similarity

Given two sentences, encode each independently with SBERT, then compare the resulting vectors using cosine similarity to estimate their semantic relationship.

How Build an Advanced RAG Application (From Scratch) covers it

How deep it goes
Explains independent encoding, cosine comparison, and siamese or triplet training, but does not detail implementation code.
Examples
Uses paired sentence inputs, independent embeddings, and cosine similarity as the central comparison workflow.
What it assumes
Assumes familiarity with BERT and encoder models while grounding SBERT in bidirectional context and masked language modeling.
What you can do after
Evaluate semantic relationships between sentences using independently generated embeddings and cosine similarity.
How it connects
Connects BERT, encoder models, contextual embeddings, masked language modeling, cosine similarity, and semantic textual similarity.

Also explained in

Compare how 3 books explain Sentence-BERT →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build an Advanced RAG Application (From Scratch). The section links point to the parts of the book it draws on.