liveBook · Manning

Information retrieval

As explained in Natural Language Processing in Action, Second Edition

Full-text search retrieves documents by searching their complete textual contents rather than only structured fields.

Information retrieval finds documents by searching their textual contents, especially keywords, instead of relying only on structured fields. It provides a practical way to locate reliable human-authored information for search tools and language-model applications. section 10.3 section 10.3.1

The central data structure is an inverted index. A forward index lists the words in each document; inversion produces a word-to-document lookup, much like a textbook index. Searching for cat can then jump directly to matching documents rather than scanning every document. section 10.3.1

A useful retrieval pipeline combines complementary methods:

  • Use TF-IDF vectors for fast lexical matching across documents. section 10.3
  • Use character-based trigram indexing to improve matching for variations such as cat and cats, and for typos or misspellings. section 10.3.1 section 3.9
  • Combine text search with semantic search and an LLM when a question-answering system needs both speed and semantic recall. section 10.3

Finding cat and cats

A word-only index may fail when a query contains cat but a document contains cats. Character trigrams extend the matching surface so related spellings, and potentially misspellings, can be retrieved without reading every document sequentially. section 10.3.1 section 3.9

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains forward and inverted indexes, lookup scaling, TF-IDF, trigrams, and integration with semantic search, while deferring full implementation details.
Examples
Uses textbook indexes, cat-versus-cats matching, typo-tolerant trigrams, and large-corpus search as concrete examples.
What it assumes
Assumes familiarity with TF-IDF vectors and vectorizers while explaining indexing through an everyday textbook analogy.
What you can do after
Build a retrieval component with TF-IDF vectors, inverted indexing, character trigrams, and semantic-search or LLM integration.
How it connects
Connects inverted indexing, TF-IDF, semantic search, embeddings, large language models, and question answering.

Also explained in

Compare how 11 books explain information retrieval →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.