Constructing a basic agent

The simplest way to construct an artificial assistant with TensorFlow is to use a sequence-to-sequence (Seq2Seq) model, which we learned in the chapter on RNNs.

While originally developed for neural machine translation, we can adjust this model to act as an intelligent chatbot for our own purposes. We'll create the brain behind our assistant as a Python class called IntelligentAssistant. Then, we'll create the training and chatting functions for our assistant:

  1. First, let's start with our standard imports and initialize our variables. Take special note of the mask variable here; masks are placeholders that allow ...

Get Hands-On Artificial Intelligence for Beginners now with O’Reilly online learning.

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