Get startedGet started for free

Finding fraudsters based on topic

In this exercise you're going to link the results from the topic model back to your original data. You now learned that you want to flag everything related to topic 3. As you will see, this is actually not that straightforward. You'll be given the function get_topic_details() which takes the arguments ldamodel and corpus. It retrieves the details of the topics for each line of text. With that function, you can append the results back to your original data. If you want to learn more detail on how to work with the model results, which is beyond the scope of this course, you're highly encouraged to read this article.

Available for you are the dictionary and corpus, the text data text_clean as well as your model results ldamodel. Also defined is get_topic_details().

This exercise is part of the course

Fraud Detection in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Run get_topic_details function and check the results
print(get_topic_details(____, ____))
Edit and Run Code