Semantic similarity
Semantic similarity is the degree to which two items or representations correspond in meaning, regardless of differences in wording or form.
AI-Powered Search
Semantic textual similarity is the task or measure of determining how closely two text segments correspond in meaning.
- How it is used
- Uses document co-occurrence to discover related terms, expand search queries, rank graph nodes, and generate content-based recommendations.
- How deep it goes
- Explains distributional reasoning, stop-word effects, document-set comparison, scoring, traversal, and query construction without deriving the full equation.
- Examples
- Demonstrates health-term discovery from “advil” and topic-based recommendations from a “star wars” document.
- What you can do after
- Apply it via a knowledge-graph traversal and search API to expand queries and recommend contextually similar documents.
Natural Language Processing in Action, Second Edition
Semantic similarity is the degree to which two language items have similar meanings or contextual associations.
- How it is used
- Supports semantic search and identifies related or redundant passages when wording differs.
- How deep it goes
- Explains embeddings, normalization, cosine matrices, heatmaps, and an approximate redundancy threshold, without detailing transformer internals.
- Examples
- Uses movie-plot retrieval, MiniLM sentence embeddings, pairwise similarity matrices, and a heatmap of manuscript passages.
- What you can do after
- Apply it via sentence-transformers and cosine similarity to retrieve related text or inspect possible redundancy.
Read how Natural Language Processing in Action, Second Edition explains semantic similarity →
Effective Conversational AI
Semantic similarity is the degree of shared meaning between two pieces of text, typically estimated from their representations.
- How it is used
- Finds relevant document passages for chatbot questions by comparing meaning rather than exact words.
- How deep it goes
- Explains vector-space matching and runtime retrieval, but does not specify a similarity formula or threshold.
- Examples
- Uses indexed document chunks and user questions, then compares generated answers with expected responses.
- What you can do after
- Evaluate response relevance by scoring semantic similarity and informativeness, comparing generated and expected answers, and reviewing precision, recall, and F1.
Read how Effective Conversational AI explains semantic similarity →
Math and Architectures of Deep Learning
Similarity of meaning between terms or documents, as opposed to exact string overlap.
- How it is used
- Measures document relatedness through shared topics when explicit term overlap misses meaningful connections.
- How deep it goes
- Explains semantic similarity through topics, subspaces, variance, and principal components.
- Examples
- Uses documents d5 and d6, the terms gun and violence, and a toy document-vector dataset.
- What you can do after
- Evaluate document relatedness through topic-based representations rather than relying only on explicit word overlap.
Read how Math and Architectures of Deep Learning explains semantic similarity →
Building Reliable AI Systems
A measure of how closely the meanings of two pieces of content correspond.
- How it is used
- Uses similarity to retrieve relevant passages and compare generated claims with grounding data.
- How deep it goes
- Explains spatial proximity and threshold filtering, but gives no similarity formula or scoring implementation.
- Examples
- Uses clustered policy documents, an international-roaming FAQ query, and claim comparisons against knowledge-base data.
- What you can do after
- Evaluate retrieved passages for relevance and compare generated claims with grounding data.
Read how Building Reliable AI Systems explains semantic similarity →
Related concepts
- BERTScoremeasured by · BERTScore is an automatic text-generation evaluation metric that compares candidate and reference texts using contextual representations of their tokens.
- similarity searchused by · Similarity search is a retrieval technique that finds or ranks items by comparing their representations with a query according to a similarity or distance measure.
- embeddingmeasures · A numerical vector representation of an item or input that encodes features or relationships useful for computational tasks.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




