liveBook · Manning

Sparse lexical expansion

As explained in AI-Powered Search

Sparse lexical expansion is query expansion that adds weighted lexical terms represented as features in sparse vectors.

Sparse lexical expansion improves search by adding related, weighted terms to a query’s sparse vector of lexical features. A semantic knowledge graph can generate these terms without additional dataset fine-tuning, allowing documents with similar wording to match. section 5.4.5

A practical expansion pipeline:

  • Start with a query term and traverse a semantic knowledge graph to find related nodes and their relatedness scores. section 5.4.5
  • Convert relatedness scores into boosted lexical terms, preserving a stronger weight for the original query. section 5.4.5
  • Choose whether expansion broadens recall, increases precision, preserves recall, or only improves ranking through query boosts and minimum-match settings. section 5.4.5

Expanding “vibranium”

A graph traversal returns wakandan, adamantium, wakanda, alloy, and other related terms. The expanded query boosts vibranium to 5 and assigns lower weights such as wakandan^0.8197 and adamantium^0.80724. section 5.4.5

Listing 5.5 Discovering context for the unknown term “vibranium”
stackexchange_skg = get_skg(engine.get_collection("stackexchange"))

query = "vibranium"
nodes_to_traverse = [{"field": "body", "values": [query]},
                     {"field": "body", "min_occurrences": 2, "limit": 8}]

traversal = stackexchange_skg.traverse(*nodes_to_traverse)

print_graph(traversal, query)

Shows the Python-style traversal that discovers contextual terms for an initially obscure query node. section 5.4.5

How AI-Powered Search covers it

How deep it goes
Explains graph traversal, weighted query construction, and matching strategies, while deferring SPLADE implementation details.
Examples
Uses Advil synonyms and a vibranium traversal producing weighted terms such as wakandan, adamantium, and wakanda.
What it assumes
Assumes query and ranking basics, while teaching graph traversal, relatedness weights, and minimum-match configuration.
What you can do after
Apply it via semantic knowledge-graph traversal and weighted search requests to broaden or rerank lexical retrieval.
How it connects
Connects query expansion with semantic knowledge graphs, sparse vectors, SPLADE, recall, precision, and ranking.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.