Coding Challenge: Plot Topic Distribution

Create a Latent Dirichlet Allocation model and plot a topic distribution.

Problem statement

In this challenge, we’ll plot topic_distribution on the Kiva dataset. First of all, we need to load the dataset to a variable named data. Second, we load the first 2000 dataset instances to the data variable. Third, we have to initialize the PyCaret NLP environment based on the aforementioned dataset, and set the target variable as en.

Furthermore, the initialized environment will be assigned to a variable named nlp_setup. After that, we need to create a Latent Dirichlet Allocation model and assign it to a variable named lda_model. Finally, we need to plot topic_distribution.

Expected output

We should get an output plot as shown below:

Get hands-on with 1400+ tech skills courses.