Other Applications of Seq2Seq Models: Chatbots

Learn about chatbots as an application of seq2seq models.

One other popular application of sequence-to-sequence models is creating chatbots. A chatbot is a computer program that’s able to have a realistic conversation with a human. Such applications are very useful for companies with a huge customer base. Responding to customers asking basic questions for which answers are obvious accounts for a significant portion of customer support requests. A chatbot can serve customers with basic concerns when it’s able to find an answer. Also, if the chatbot is unable to answer a question, the request gets redirected to a human operator. Chatbots can save a lot of the time that human operators spend answering basic concerns and can let them attend to more difficult tasks.

Training a chatbot

So, how can we use a sequence-to-sequence model to train a chatbot? The answer is quite straightforward because we’ve already learned about the MT model. The only difference would be how the source and target sentence pairs are formed.

In the NMT system, the sentence pairs consist of a source sentence and the corresponding translation in a target language for that sentence. However, in training a chatbot, the data is extracted from the dialogue between two people. The source sentences would be the sentences or phrases uttered by person A, and the target sentences would be the replies to person A made by person B. One dataset that can be used for this purpose consists of movie dialogues between people.

Here are links to several other datasets for training conversational chatbots:

The figure below shows the similarity of a chatbot system to an NMT system. For example, we train a chatbot with a dataset consisting of dialogues between two people. The encoder takes in the sentences or phrases spoken by one person, whereas the decoder is trained to predict the other person’s response. After training in such a way, we can use the chatbot to provide a response to a given question:

Get hands-on with 1400+ tech skills courses.