Training NTM in SageMaker

In this section, we will train NTM on Enron emails to produce topics. These emails were exchanged between Enron, an American energy company that ceased its operations in 2007 due to financial losses, and other parties that did business with the company.

The dataset contains 39,861 emails and 28,101 unique words. We will work with a subset of these emails – 3,986 emails and 17,524 unique words. Additionally, we will create a text file, vocab.txt, so that the NTM model can report the word distribution of a topic. 

Before we get started, make sure that both docword.enron.txt.gz and vocab.enron.txt have been uploaded to a folder called data on the local SageMaker compute instance. Follow these steps:

  1. Create a bag-of-words ...

Get Hands-On Artificial Intelligence on Amazon Web Services now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.