How it works...

In this recipe, we created an RNN-to-category model to predict whether SMS text is spam or ham. We achieved about 86% accuracy on the test set. The following are accuracy and loss plots on both the test and training sets:

Figure 3: The accuracy (left) and loss (right) of the training and test sets

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.