liveBook · Manning

Topic

As explained in Natural Language Processing in Action, Second Edition

A topic is a latent semantic theme represented as a dimension in a reduced space of language data.

A topic is a latent semantic theme represented as a dimension in a compact vector space. Topic modeling replaces thousands of orthogonal word dimensions with fewer dimensions whose aligned words are semantically related. section 4.1.2

Topic vectors make document meaning easier to inspect and compare:

  • Represent each document with a document-topic vector showing how strongly every topic is expressed. section 4.4.1
  • Inspect topic-term weights to identify which words contribute most strongly to each topic. section 4.4.1
  • Compare, add, or subtract topic vectors for tasks such as similar-document retrieval and semantic search. section 4.1.2

Reducing comments to topic dimensions

TruncatedSVD can reduce a TF–IDF matrix from 9,232 dimensions to 16 topic dimensions. Inspecting words such as “pathetic,” “stupid,” “idiot,” and “hate” reveals which dimensions are associated with toxic comments. section 4.4.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Defines topics, document-topic matrices, and term weights, then demonstrates TruncatedSVD and compares topic counts without deriving decomposition mathematics fully.
Examples
Uses toxic-comment vectors, topic-term tables, weighted toxic words, and 16- or 32-dimensional topic representations.
What it assumes
Assumes familiarity with word-count representations and TF-IDF while defining reduced semantic spaces and topic vectors incrementally.
What you can do after
Apply it via TruncatedSVD or LDiA to create document-topic vectors and inspect their terms for semantic or classification tasks.
How it connects
Connects topic modeling with TF-IDF, bag-of-words, LSA, TruncatedSVD, LDiA, semantic search, and linear classification.

Also explained in

Compare how 2 books explain topic →

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.