STAT 4051 Fall 2026: Advance Topic Models in Machine Learning
Overview
Kazeem Adepoju introduces unsupervised topic modeling for text, using anonymous course comments to show how recurring themes such as teaching, assessment, and technology can be discovered without labels. He demonstrates text preprocessing, a 5-document by 10-word document-term matrix with 16 retained tokens, TF-IDF weighting and cosine similarity, then outlines Latent Semantic Analysis (LSA) through truncated singular value decomposition (SVD).
Key takeaways
- Topic modeling is an unsupervised learning task: it infers themes from word patterns in documents without pre-existing topic labels.
- The five-comment example becomes a 5-by-10 document-term matrix containing 16 retained tokens after preprocessing.
- Preprocessing choices affect meaning as well as dimensionality: common stop words can be removed, but “not” must remain in comments such as “canvas not good.”
- TF-IDF reduces the influence of terms that appear across many documents by weighting within-document frequency against inverse document frequency, log(N/DF).
- Cosine similarity compares document directions in feature space; zero represents orthogonality, while one represents identical direction.
- LSA uses truncated SVD to retain the strongest K dimensions of the TF-IDF matrix and represent documents and words in a lower-dimensional latent space.
Chapters
- Topic modeling finds hidden themes in collections of comments or documents when topic labels are unavailable.
- Text must first be converted into numerical features before statistical machine learning algorithms can use it.
- The planned methods include TF-IDF, Latent Semantic Analysis (LSA), singular value decomposition (SVD), and nonnegative matrix factorization.
- A university may receive thousands of anonymous course comments, too many for staff to review individually.
- Recurring word patterns can reveal themes such as teaching quality, exam assessment, and technology problems.
- The same approach applies to scientific abstracts, news articles, patient feedback, and customer reviews as an NLP task.
- A corpus is the collection of documents; the worked example uses five student comments as five documents.
- Preprocessing normalizes comments and removes uninformative repetition before constructing a vocabulary and numerical matrix.
- A document can also be a research abstract, newspaper article, email, or customer review.
- Case normalization maps variants such as capitalized and lowercase forms of “professor” to one token.
- Stop-word filtering removes common terms such as “the” and “a” to reduce vocabulary dimensionality and emphasize informative words.
- Negation must be preserved: removing “not” from “canvas not good” reverses the comment’s meaning.
- Stemming groups related forms such as “explain,” “explains,” and “explaining” to reduce duplicate features.
- Lemmatization maps words to dictionary forms, such as converting “studying” to “study.”
- The goal is to avoid treating closely related forms such as “exam” and “exams” as separate vocabulary dimensions.
- The processed five-comment example has 10 distinct vocabulary terms, so its vocabulary size is V = 10.
- The document-term matrix places documents in rows and vocabulary terms in columns, with each cell recording a term count.
- The example contains 16 retained tokens in total; a zero marks a word absent from a document.
- Row totals describe the number of retained words in each document, while column totals give corpus-wide term counts.
- Raw frequency alone can overemphasize common words, so TF-IDF combines within-document term frequency with inverse document frequency.
- The inverse document frequency uses log(N/DF), where N is the number of documents and DF counts documents containing the term; the example weights “exam” using its occurrence in two of four documents.
- Cosine similarity compares document feature vectors using their dot product divided by their vector lengths.
- A cosine value of 0.8 indicates substantial directional similarity, while 1 indicates identical direction.
- A cosine of 0 indicates orthogonal vectors, meaning the documents share no aligned features in the representation.
- The model assumes each document mixes latent topics, each topic corresponds to a collection of words, and word order is ignored.
- The analyst chooses the number of topics ahead of time, similar to choosing K in K-means clustering.
- LSA decomposes the TF-IDF matrix Y into document patterns, word patterns, and singular values that indicate dimension strength.
- Keeping the top K dimensions gives a lower-rank reconstruction; the method aims to minimize the difference from the original matrix.
- Kazeem Adepoju says he will record and share the remaining topic-model material rather than hold another regular lecture.
- Groups 1 through 5 are scheduled to present the following week on Zoom.
- Attendance is compulsory for every student, including students whose groups are not presenting, and participants must join with cameras on.
Transcript excerpt
0:00 class. Of course, today we're starting the last topic in the semester. I will call uh text data and topic uh moodly. So, um I think I try to uh update the material that I uploaded um initially. So, um I've updated that. So um you can take a look at what we have at the moment. So like I said um we today's topic focus on text data and the topic modeling. Okay. So um you actually going to see how we apply statistical machine learning algorithm uh to figure
0:51 out um the topic. You know, you could have a collection of document, collection of comments and um we do not have uh the time to go around every comment and um we want to identify uh uh topic you know using the combination of words. Okay, we want to identify what the topic is going to be. So uh this is going to look like an unsupervised learning problem where we do not have label. The label is a topic but the topic is not available. So we want to use the model to be able to um uncover the hidden topic. Okay. So um that's the introduction.
1:46 So like I said um that is introduction. So in the objective what we're going to do is because we actually um we're going to have a series of uh comments [snorts] or you know documents um that actually u they are in form of textual they have textual information and we want to use statist statistical machine learning model or to learn topics and to be able to do that we need to force or you know have this converted to data the numerical form so I'm going to
2:37 walk you through how we convert structural text into document
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Prof Kazeem Adepoju.