MENU

Fun & Interesting

How to Perform Supervised Topic Modelling (Supervised Latent Dirichlet Allocation, sLDA) in R

Melissa Van Bussel (ggnot2) 4,430 lượt xem 2 years ago
Video Not Working? Fix It Now

In this video, we learn about supervised topic modelling (supervised Latent Dirichlet Allocation, often abbreviated to sLDA). We first begin with an overview of what topic modelling (LDA) is, and then learn how supervised topic modelling (sLDA) differs. We then walk through an example of performing sLDA in R using the lda package, with two approaches:

1) predicting a continuous response variable using *only* text and
2) predicting a continuous response variable using text *and* other explanatory variables.

This video is part 2 of a 2-part video collaboration with fellow YouTuber @SamerHijjazi, who also creates R programming tutorials! You can check out Samer’s channel (and subscribe to him!) here: https://www.youtube.com/c/SamerHijjazi

The dataset used in this video was generated by Samer, who web scraped the “Rate My Professors” website. You can see how this dataset was scraped by watching Samer’s tutorial (part 1 of the 2-part video series) here: https://youtu.be/mWUOdV2nMOk

This video is partially based on section 7.5 of the book “Text Mining for Social and Behavioral Research Using R”, available online for free here: https://books.psychstat.org/textmining/topic-models.html#supervised-topic-modeling

All of the code from this tutorial (and from all my YouTube videos!) is available on my GitHub. You can find the code for this video here: https://github.com/melissavanbussel/YouTube-Tutorials/tree/main/supervised_topic_modelling

0:00 - What is supervised topic modelling?
3:32 - Preparing the data
18:18 - Fitting the sLDA model
28:08 - Adding an explanatory variable to the model
34:40 - Performing prediction on unseen data

Want to connect?

Twitter: https://twitter.com/melvanbussel
LinkedIn: https://www.linkedin.com/in/melissavanbussel/
Website: https://www.melissavanbussel.com/
GitHub: https://github.com/melissavanbussel

*Please note: it’s helpful for me if you send me a message on LinkedIn when you add me letting me know you’re adding me because of YouTube, so that I can keep track of how I know each person in my network😊

Comment