AI engineering glossary · NLP embeddings

What is DTM (document-term matrix)?

Document-term matrix (also called Term-document matrix, DTM): A table with one row per document and one column per term, whose cells hold counts or weights such as tf-idf. It turns a text collection into a numeric matrix that most standard machine-learning algorithms can use, though it is mostly zeros.

Level: beginnerTopic: NLP embeddings

Document-term matrix: an example

With 10,000 reviews and 5,000 terms, the matrix has 10,000 rows and 5,000 columns; each review fills only a few dozen cells.

Related terms

More NLP embeddings terms

Where you learn it

Document-term matrix is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.