Professional Documents
Culture Documents
Discover QCon Plus by InfoQ: A Virtual Conference for Senior Software Engineers
and Architects (Nov 4-18)
In this article, I’ll first discuss the five levels of AI assistants using a standard
model for conversational AI maturity. Second, I’ll summarize my own recent
experience building a level 3 AI assistant. Finally, I’ll outline various custom tools
I built to continuously iterate upon, improve, and monitor the AI assistant in
production.
The Five
Level-up on theLevels
skills that areof AI most
currently Assistants
in-demand in software. Attend QCon Plus (Nov 4-18).
Most AI assistants today can handle simple questions, and they often reply with
prebuilt responses based on rule-based conversation processing. For instance, if a
user says X, respond with Y; if a user says Z, call a REST API, and so forth.
However, for AI assistants to provide value to business functions like customer
service, supply chain management, and healthcare workflow processes, we need
to move beyond the limitations of rule-based assistants and to a more standard
maturity model for conversational AI. In this article, we’ll talk about how to
model and deploy a contextual assistant and discuss real life examples of
contextual assistants in production.
Level 1
Level 2
At Level 2,on
Level-up the
theassistant can
skills that are answer
currently FAQs
most and engage
in-demand in Attend
in software. simple dialogues.
QCon Plus (Nov The
4-18).
dialogues are pre-built, and the assistant relies heavily on intents, entities, and
rules. In this case, the assistant may answer some FAQs but will get perplexed
should the user engage in interjections or unexpected utterances.
Most assistants today are at level 2; they’re built using rule-based dialogues or
state machines. In this setup, the developer uses a combination of intents, entities
and if/else conditions to build dialogues. Observe the code snippet below. The
assistant has to rely on conditional statements to gather information and respond
to the user.
Observe the resulting conversation below. When the user asks an off-topic
question in the middle of a dialogue, the assistant gets confused and is not able to
respond in a relevant manner. This is because the dialogue is built using if/else
statements and is not able to recognize this new and unexpected conversation
path.
Level-up on the skills that are currently most in-demand in software. Attend QCon Plus (Nov 4-18).
Level 3
Levels 4 & 5
I’ve spent a few years building AI assistants and leading teams that shipped
contextual assistants to production. Building contextual assistants is hard.
Building contextual assistants that actually work, and drive measurable results, is
harder still.
One of the contextual assistants I built last year for an enterprise company was an
employee-facing help desk assistant. The goal was to automate a portion of help
desk tickets in order to reduce costs. An AI assistant that answers questions is
useful; however, AI assistants that perform task execution on behalf of users in
addition to answering questions, and nudging them to make informed decisions,
drive even more value.
The help desk assistant we were building had to answer questions about routine
technical issues, assist with issue resolution, and perform task execution and
follow-ups on behalf of users, none of which reflected predictable conversation
paths. Human language is messy and unpredictable; building state machines, or
rule-based processing, that attempt to script out possible conversation paths can
be incredibly difficult to scale and maintain.
We started to build and iterate upon a level 3 assistant using Rasa, an open-source
platform that provides ML tools to build and deploy contextual assistants.
TheLevel-up
following
on thediagram
skills that is
areacurrently
high-level
most overview
in-demand inof the technology
software. Attend QConstack we 4-18).
Plus (Nov used to
build, model, and deploy the level 3 help desk assistant. Services like Rasa Core,
Rasa NLU, and Rasa Actions were the foundation, or infrastructure layer, for the
help desk assistant. Rasa Core is a machine learning-based dialogue manager,
Rasa NLU is a customizable intent classification and entity extraction service, and
Rasa Actions is an integration point to call external services. We deployed
Duckling, an entity extraction service, and BERT, a language model used here for
named entity recognition, using Azure Kubernetes Service (AKS). Named entity
recognition is the task of extracting named entities from text. Named entities are
things like locations, organizations, or personal names.
It’s important to note that this enterprise company was an Azure customer, and
therefore the architecture was dictated by Azure services. The assistant was
integrated with Azure Active Directory, ServiceNow, and Microsoft Outlook to
authenticate users, create incident tickets, pull user profiles, and perform other
tasks like meeting scheduling.
Rasa’s tracker store that maintains conversation history and the current state of a
user’s conversation was backed by Azure Cosmos database. The assistant was
deployed on Slack and Microsoft Teams via a Chrome extension and other front-
end channels.
Level-up on the skills that are currently most in-demand in software. Attend QCon Plus (Nov 4-18).
The following diagram is a high level representation of the help desk assistant’s
devops process. A command line bootstrapper was custom-created, and used to
initialize and set up the assistant’s code base. Azure DevOps service was used to
version control the assistant’s models and source code. Azure pipeline was used to
build and deploy the assistant to the various Kubernetes environments.
Level-up on the skills that are currently most in-demand in software. Attend QCon Plus (Nov 4-18).
Note that Rasa now ships with an out-of-the-box bootstrapper to initialize and set
up a contextual assistant.
Remember that this company is a Microsoft customer, and Microsoft Teams was
one of the communications software that employees used. When a user would ask
to schedule a meeting with their team, they wanted the assistant to set up a
meeting with a custom team or active directory group they had created; and
when the user would ask to schedule a meeting using teams, they wanted the
assistant to schedule a Microsoft teams meeting.
TheLevel-up
assistant would
on the confuse
skills that the entities
are currently in question
most in-demand -- “team”
in software. Attend and
QCon“teams”
Plus (Nov -- and
4-18).
provide an irrelevant or incorrect response. Both sentences and words may seem
similar but are quite different in the context of this organization. There were
several similar occurrences where the help desk assistant would get confused and
need additional training.
In April 2019, the team integrated the assistant with BERT (Bidirectional Encoder
Representations from Transformers). BERT was seen to achieve state-of-the-art
results on word sense disambiguation and other downstream NLP tasks. This is
due to its ability to pre-train bidirectional, contextual language representations
modeled on a large text corpus. It is therefore better equipped to resolve issues
with entity disambiguation.
However, BERT presented its own challenges in that it was somewhat slow. A
temporary solution was to create a wrapper to the BERT service, and fine-tune the
service to load the model to memory, thereby speeding up the request processing.
Integration with BERT solved some of the issues with entity disambiguation.
We benchmarked these metrics; set weekly, monthly, and quarterly goals; and
tracked the assistant’s progress and made improvements accordingly.
Issues with
Level-up on the skillsMulti-Turn
that are currently mostDialogues
in-demand in software. Attend QCon Plus (Nov 4-18).
Some of the issues with non-linear conversations, where the user introduces a
new topic in the middle of the conversation or modifies a previous statement,
remained. These types of multi-turn conversations are particularly challenging,
and they also happen to be the way that most users actually talk. In an effort to
resolve some of these issues, the team experimented with Rasa’s TED
(Transformer Embedding Dialogue) policy. Using a transformer architecture, the
TED policy can selectively pick which conversation turns to pay attention to, and
which conversation turns to ignore.
Next Steps
We’ve seen
Level-up onathe
shift towards
skills open domain
that are currently systems.
most in-demand That refers
in software. Attend to assistants
QCon Plus (Nov that
4-18).
are, in theory, unencumbered by a particular domain or topic, and are capable of
talking about anything. This makes sense because we have massive amounts of
data, and we have systems that are good at collecting and aggregating data. We
also have the technological capabilities to tell a compelling story with this data,
not merely chase the next benchmark or accuracy score.
While it is true that the field of natural language processing (NLU) has seen many
recent advancements, today’s contextual assistants still have a long way to go
because they don’t truly understand language or its relationship with the world.
Statistical or language mimicry is not the same as language understanding.
All of that is to say that we’re at an exciting time for conversational AI to be the
next computational platform of choice for companies and enterprises to improve
products, offer personalized and curated customer service, and see real results.
Conversational AI hasn’t been solved yet, but what’s promising is the pace of
innovation and the level of discourse in this field.
Discuss