Open-Domain Chatbot Implementation: Retrieval and Generative Approaches
This article explains the implementation of open-domain chatbots for customer service, comparing retrieval‑based and generative seq2seq approaches, describing hybrid methods that first attempt constrained retrieval before falling back to generation, and discusses training data, keyword extraction, and performance observations.
Artificial intelligence applied to customer service can greatly reduce labor costs by providing continuous, 24‑hour support, even during peak holiday periods. In the service domain, three main types of bots are identified: task‑bots, FAQ‑bots, and open‑domain chat‑bots.
FAQ‑bots handle common post‑sale inquiries by encoding both user questions and a standard FAQ database into semantic vectors using end‑to‑end deep learning, then returning the most similar answer based on vector similarity.
Task‑bots operate in pre‑sale scenarios such as flight or hotel booking. They rely on natural language understanding (NLU) for intent detection, dialog state tracking (DST) for multi‑turn interactions, and must manage context switches (e.g., from flight queries to train queries) by maintaining clear slot‑inheritance strategies.
Open‑domain chat‑bots first detect that the user is engaging in casual conversation, then generate replies. They should recognize user emotions (e.g., anger), filter sensitive words, and answer open‑domain knowledge questions such as “Where will the next Olympics be held?”.
The retrieval‑based method searches a massive chat corpus for the most similar question and returns the corresponding answer, using rich matching features as input to a ranking model, exemplified by Huawei Noah’s Lab.
The generative method is built on seq2seq models: an encoder transforms the input question into a semantic vector, and a decoder generates the answer. Attention mechanisms improve diversity, and several extensions exist, such as TA‑seq2seq (topic‑guided generation) and DVS2S (dynamic vocabulary to reduce training time).
Each approach has trade‑offs: retrieval is simple and yields fluent, diverse replies but depends heavily on the dataset and lacks context awareness; generation offers end‑to‑end learning and contextual awareness but can produce repetitive or nonsensical answers.
The article proposes a hybrid strategy: first perform constrained retrieval using dependency‑parsing‑derived keywords as matching features; if no result is found, fall back to the generative model.
Keyword extraction focuses on sentence‑level relational components, e.g., extracting “google” from “Google announced its return to the Chinese market” or “nothing” from “Why do I still have nothing?”.
Training data consists of over 750,000 short QA pairs scraped from micro‑blogs, cleaned and filtered. A single‑layer LSTM seq2seq model without attention was trained for about fifty epochs. When sufficiently trained, the model produces intelligent, fluent answers; insufficient training leads to generic replies like “haha”. Improvements can be achieved by adopting the aforementioned advanced seq2seq variants.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.