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 →
Also covered in
Related concepts
- preprocessingproduced by · Preprocessing is the preparation or transformation of data or other inputs into a form suitable for subsequent processing, analysis, or execution.
- arraykind of · An array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
- term frequency-inverse document frequencyproduced by · Term frequency-inverse document frequency (TF-IDF) 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 occurrences, 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 using orthogonal or unitary matrices and a diagonal matrix of nonnegative singular values.
Questions about document-term matrix
What is document-term matrix?
A document-term matrix is a matrix representing associations or weights between documents and terms, with orientation determined by convention.
Which Manning books explain document-term matrix?
Natural Language Processing in Action, Second Edition and Math and Architectures of Deep Learning.
What is the difference between document-term matrix and document-topic matrix?
A document-term matrix is a matrix representing associations or weights between documents and terms, with orientation determined by convention. A document-topic matrix is a matrix whose rows represent documents and whose columns represent topic expression weights.
What is document-term matrix a kind of?
Document-term matrix is a kind of array. An array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
What is document-term matrix part of?
Document-term matrix is part of singular value decomposition. Singular value decomposition is a matrix factorization that expresses a matrix using orthogonal or unitary matrices and a diagonal matrix of nonnegative singular values.
What is document-term matrix also called?
Document-term matrix is also called term-document matrix.
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.

