liveBook · Manning

Term-topic matrix

As explained in Natural Language Processing in Action, Second Edition

A term-topic matrix is a matrix whose entries represent the probabilities or weights of terms under latent topics.

A term-topic matrix stores the probabilities or weights that indicate how appropriate each vocabulary term is for each latent topic. It lets a topic-mixture model choose words when generating a bag-of-words document. section 4.5.1

In the LDiA process, a document first receives a length and a topic mixture; the matrix then supplies word probabilities for those topics. LDiA estimates the matrix from a collection of documents. section 4.5.1

From corpus to word choices

Imagine a bot discussing several topics. It samples topics for a document, then repeatedly looks up suitable vocabulary terms in the term-topic matrix until reaching the chosen document length. The matrix is computed from tokenized and vectorized documents. section 4.5.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains the matrix’s generative role and corpus estimation, but does not detail the estimation algorithm.
Examples
Uses an imaginary bag-of-words-generating bot and a corpus of tokenized, vectorized documents.
What it assumes
Assumes familiarity with bag-of-words, vocabularies, tokenization, vectorization, and basic Poisson and Dirichlet distributions.
What you can do after
Build it from scratch by computing the matrix and related distribution parameters from a document corpus.
How it connects
Connects term-topic matrices with LDiA, bag-of-words, latent topics, vocabulary, Poisson distributions, and Dirichlet distributions.

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.