liveBook · Manning

Topic modeling

As explained in Starting Data Analytics with Generative AI and Python

Topic modeling is a statistical or machine-learning technique that discovers recurring abstract topics in a collection of documents.

Topic modeling discovers recurring themes across a collection of documents. Unlike summarization, it represents each document as a mixture of topics, with each topic expressed as a probability distribution over words. section 6.3.4 section 6.3.5

A practical workflow uses topic modeling to investigate customer concerns:

  • Select the relevant documents, such as reviews with scores of 1 or 2. section 6.3.5
  • Inspect the most common topics, then use generative AI to translate and interpret difficult-to-read output. section 6.3.5

Negative customer reviews

Running the workflow on Portuguese reviews produces topics associated with purchases, received products, delivery, deadlines, missing items, and products not yet received. These topics summarize the collection's main concerns, but they do not summarize each review individually.

Treat the output as analytical clues rather than ready-made prose: topic labels may be unfriendly, and interpretation improves when the input's negative context is stated explicitly. section 6.3.5

How Starting Data Analytics with Generative AI and Python covers it

How deep it goes
Explains document-topic mixtures and word distributions, then demonstrates preprocessing, filtering, output interpretation, and translation.
Examples
Uses Portuguese negative customer reviews, five extracted topics, English translations, and interpretations about delivery, products, purchases, and missing items.
What it assumes
Assumes a document collection in a pandas dataframe and basic text-processing needs, while demonstrating the preprocessing steps required for analysis.
What you can do after
Apply it via Python, pandas, NLTK, and generative AI to extract and interpret recurring concerns in filtered review collections.
How it connects
Connects topic modeling with text summarization, generative AI, text preprocessing, tokenization, stopword removal, and stemming.

Also explained in

Compare how 2 books explain topic modeling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Starting Data Analytics with Generative AI and Python. The section links point to the parts of the book it draws on.