Hierarchical Topic Model for Airbnb Reviews

Amy @GrabNGoInfo
14 min readNov 4, 2022

Extracting topics and sub-topics hierarchical structure in Airbnb reviews using the Python package BERTopic

Hierarchical Topic Model for Airbnb Reviews Extracting topics and sub-topics hierarchical structure in Airbnb reviews using the Python package BERTopic
Photo by Taylor Heery on Unsplash

Hierarchical topic models are the models that utilize the semantic hierarchy to identify topics and sub-topics for a collection of text. In this tutorial, we will use Airbnb review data to illustrate the following:

  • How to use a transformer-based deep learning model to build a hierarchical topic model in Python?
  • How to process the data to remove the noise in the topics?
  • How to extract the topics and sub-topics from the model outputs?
  • How to make predictions for a new document?

The Python package used for the hierarchical model in this tutorial is BERTopic. For more details about using this package, please check out my previous tutorials Topic Modeling with Deep Learning Using Python BERTopic and Hyperparameter Tuning for BERTopic Model in Python.

Resources for this post:

  • Video tutorial for this post on YouTube
  • Click here for the Colab notebook.
  • More video tutorials on NLP
  • More blog posts on NLP

Let’s get started!

Step 1: Install And Import Python…

--

--