Document-term matrix
A document-term matrix is a matrix representing associations or weights between documents and terms, with orientation determined by convention.
Natural Language Processing in Action, Second Edition
A term-document matrix is a matrix whose rows represent terms and whose columns represent documents, with entries describing term-document associations.
- How it is used
- Represents documents numerically for information retrieval, similarity analysis, classification, and topic modeling.
- How deep it goes
- Defines the matrix and inspects its dimensions and modeling limitations, while deferring detailed construction and weighting derivations.
- Examples
- Uses a 5,000-message toxic-comment corpus, a 19,169-dimensional TF–IDF representation, and contrasting phrases with low lexical similarity.
- What you can do after
- Evaluate/understand feature dimensionality, lexical-similarity limits, overfitting risk, and alternative ranking or reduction strategies.
Read how Natural Language Processing in Action, Second Edition explains document-term matrix →
Math and Architectures of Deep Learning
A matrix with documents as rows and terms as columns, storing term-frequency values for retrieval or analysis.
- How it is used
- Supports document retrieval and latent semantic analysis by organizing corpus text for vector and topic-based comparison.
- How deep it goes
- Defines rows, columns, and frequencies, then connects correlations to principal-component topics without detailing matrix computation.
- Examples
- Uses a toy corpus containing violence, gun, America, and roses, including frequency rows d0 through d6.
- What you can do after
- Evaluate document similarity and identify correlated vocabulary topics from term-frequency vectors.
Read how Math and Architectures of Deep Learning explains document-term matrix →
Related concepts
- arraykind of · An array is an indexed, ordered collection of elements arranged in one or more dimensions, with elements accessed by position.
- preprocessingproduced by · Preprocessing is the preparation or transformation of data, content, or other inputs into a form suitable for a subsequent computational operation.
- term frequency-inverse document frequencyproduced by · Term frequency-inverse document frequency is a text-weighting scheme that combines a term’s frequency in a document with its inverse frequency across a document collection.
- bag-of-words modelproduced by · A bag-of-words model represents text using word or token presence, counts, or weights while disregarding their order and syntactic relationships.
- singular value decompositionpart of · Singular value decomposition is a matrix factorization that expresses a matrix as the product of orthogonal or unitary matrices and a diagonal matrix of nonnegative singular values.
- term-topic matrixproduces · A term-topic matrix is a matrix whose entries represent the probabilities or weights of terms under latent topics.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

