🎵 Do you want to build a Chatbot? 🎵
Tags: ai, chatbots, azure, chatgpt
Published: 2022-12-30 20:57:04

---
title: 🎵 Do you want to build a Chatbot? 🎵
published: true
description: Chatbots have come a long way since ELIZA. Let's see how modern chatbots stack up compared to transformers and ChatGPT - and where they will go from here.
tags: AI, chatbots, Azure, ChatGPT
canonical_url: https://accessibleai.dev/post/do_you_want_to_build_a_chatbot/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mobxhjhi1qevv7vytuy.png
---
_Cover image created by [Matt Eland](https://MattEland.dev) using MidJourney_

This article is part of [Festive Tech Calendar 2022](https://festivetechcalendar.com/) and was originally intended to be a high-level overview of the conversational AI capabilities in Azure. However, in late November of 2022 ChatGPT released and completely changed our expectations of conversational AI.

Instead, we'll keep the festive theme and look at chatbots through 3 lenses:

- **The ghost of chatbots past** - the history of conversational AI from ELIZA to ChatGPT
- **The ghost of chatbots present** - what we can currently do with conversational AI on the Azure Platform
- **The ghost of chatbots future** - where I think conversational AI needs to go in the future

By the time we're done, you should have a basic understanding of where we are on conversational AI at the moment and where I think we need to head as an industry.

## The Ghost of Chatbots Past

As a child of the 80's, I've had the privilege to play with many different conversational AI systems as I grew up. Each one of these added something new to what we thought was possible, so we'll speak briefly on each one.

### ELIZA

While the original [ELIZA program](https://en.wikipedia.org/wiki/ELIZA) was created in the 1950's, I still remember playing with a version of it as a kid.

ELIZA was an attempt to simulate intelligence from a computer using a clever trick: since understanding the user was hard, the chatbot could be more convincing if it pretended to be a therapist and responded to anything the user said with a question about that statement.

![An interaction with Eliza](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eeqa80bvkstfami11cl5.png)

It was an interesting trick and it got people talking, but after a few interactions it was clear that ELIZA was just a clever way of parsing sentences and responding to them.

Still, I think ELIZA was a significant factor in society dreaming of later advances in conversational AI.

There are a number of online versions of ELIZA if you're interested in [seeing what it was like to chat with Eliza](http://psych.fullerton.edu/mbirnbaum/psych101/Eliza.htm).

### Personal Assistants

A decade ago the world changed when personal assistants like Siri, Alexa, Cortana, and Google Assistant hit the market.

These services lived in consumer devices such as your cell phone, affordable Echo Dot devices, or even the Windows taskbar. This made conversational AI widely available to the general public for the first time.

Additionally, these offerings improved what was possible with conversational AI in a few key ways:

- These systems could understand the user's spoken words as text
- These systems could synthesize speech from their own text output and reply aloud
- These systems could more intelligently map what the user was saying to things the device knew how to accomplish

These factors combined to make conversational AI much more accessible to the average person with access to a cell phone or computer. Additionally, the capabilities of these systems were able to grow significantly over time by looking at common things users asked the systems to do that the systems could not do yet. Additionally, many of these systems offered APIs that let developers integrate their own offerings into the conversational AI platform.

At a high level, these systems worked in the following way:

1. The user says something to the device, typically starting with a _wake word_ like "Alexa" or "Hey Google"
2. The device uses speech recognition to translate those words to a string of text called the user's _utterance_
3. The string of text is then sent to an API that tries to map it to a supported _intent_ that the system provides
4. Once an intent is identified, any relevant entities are extracted, such as specific places times the user might have mentioned
5. The intent receives the relevant entities and generates a text reply
6. That text reply is then converted to speech using some form of speech synthesis
7. The user hears the spoken reply

![How Chatbots Work](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjknhp7z5e65yzc0yl43.png)

If you're interested, I go into this process in significantly more depth in my [How Chatbots Work](https://accessibleai.dev/post/how-chatbots-work/) article from earlier this year.

These conversational AI assistants continue to be relevant and already provide value, however they are [not necessarily driving revenue](https://arstechnica.com/gadgets/2022/11/amazon-alexa-is-a-colossal-failure-on-pace-to-lose-10-billion-this-year/) the way their organizations may have hoped and they are consistently the focus of concern, mostly related to the [always-on microphones](https://www.makeuseof.com/tag/alexa-amazon-echo-privacy-risk/) that some use as they wait for their wake words.

Additionally, these systems have some technical difficulties in a few key areas:

- It is hard to remember context from request to request and support longer conversations
- Dealing with nuance or tone in messages is harder for these systems
- Complex multi-part messages are difficult for these systems

Keep these limitations in mind because these things are things that ChatGPT is actually good at as we'll discuss later on.

### Web Help Agents

Seeing the success of conversational AI on consumer devices, a growing number of organizations have sought to integrate chat into their applications.

This is typically done for a number of different reasons:

- Helping users find what they're looking for
- Reducing the impact on support by trying to resolve issues for users before support is involved
- Reducing the number of employees needed in the support department
- Increasing sales leads
- Attempting to look "modern"

The net result of this is that the majority of Software as a Service (SaaS) organizations now have some form of chatbot on their website that pesters you to interact with it:

![A Web Chatbot on Udacity's site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y9uaxwjs3bcidrgecrv.png)

This technology has also made it into the voice support channels with automated AI systems triaging incoming calls.

Frankly, these systems can be more annoying than anything else when done purely to cut costs. This in turn leaves the consumer world feeling like its falling deeper into a dystopian AI hellscape as half-baked AI implementations act as gatekeepers to real help and support.

Incidentally, the phrase "dystopian AI hellscape" is not one I thought I'd write when I set out to create this piece, but here we are.

### ChatGPT

[ChatGPT](https://chat.openai.com) was made publicly available in late November of 2022 and it changed what we thought was possible for conversational AI systems.

ChatGPT uses _transformers_ trained on large bodies of text. These transformers are a newer innovation in AI within the last 5 years of writing and essentially enable a greater degree of context-awareness for where text is in sentences and paragraphs when training these models. This in turn allows the models to be effective when trained on larger bodies of text.

As a result, transformer-based systems can generate convincing text, code, and even images from a textual prompt. Not only that, but they can take in more contextual and nuanced queues in a larger conversation, respond to multi-part requests, and follow-on queries effectively.

In short, transformers make ChatGPT really good at something that traditional conversational AI was really bad at: generating dynamic replies that reflect the user's full question, tone, and the context of the conversation.

However, ChatGPT has some severe limitations:

- It is difficult to determine why ChatGPT responds the way it does or what specific sources it is using to reply to a question
- ChatGPT will confidently make mistakes, generate broken code, and other flaws without any awareness of its shortcomings
- ChatGPT does not integrate with external APIs or company-provided data sources

I expand upon many of these flaws (and others) in my longer article on [What ChatGPT means for new devs](https://newdevsguide.com/2022/12/19/what-does-chatgpt-mean-for-new-software-developers/).

Still, even with these severe limitations, the sudden popularity of ChatGPT and its success at generating compelling responses has changed the public expectations of conversational AI. This is now the bar that our systems must meet or exceed in the future.

## The Ghost of Chatbots Present

Having covered the history of chatbots and how ChatGPT absolutely changes the expectations we have for chatbots going forward, let's take a moment and explore the technologies _currently_ available on Azure for chatbot development.

So lets talk a bit more about what our _current_ systems can do. While they are not as effective at generating dynamic content through the magic of transformers, our current systems are doing better at understanding the user's intent.

### Conversational Language Understanding

[Conversational Language Understanding (CLU)](https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/conversational-language-understanding/overview) is the successor to Azure's Language Understanding (LUIS) service.

CLU is a pay-per-usage mechanism that can map a user's utterance to a supported intent.

With CLU you provide a number of supported utterances to the system for each intent and then CLU effectively acts as a _classification_ machine learning model that classifies new utterances to any intent that the system supports (including a "None" intent for statements that could not be mapped to a supported command).

CLU also supports pattern matching for extracting out entities from utterances. These entities are typically people, places, dates / times, or topics of interest.

For example, let's look at a sample utterance:

> I would like to make a reservation for 7 PM at your downtown location

This utterance would likely map to a `Make Reservation` intent, but that intent would want to know a few pieces of information the user already provided in their message.

We can map a few things the user said into entities for this intent:

- **7 PM** would be the date and time that we'd like the reservation (since no date was specified, today would be implied)
- **downtown location** would be a location entity that your app might support

If you register some utterances as having entities associated with them, these entities are automatically identified via CLU and passed on to your code that later responds to that intent.

![Conversational Language Understanding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4532kkygdiorepbv3972.png)

This allows the code you write to prompt for entities that were not provided (e.g. "What time is this reservation for?") or respond intelligently to the ones that are present.

CLU, and systems like it, do have a few weaknesses, however:

- You need to have a decent number of utterances already available for the intents you want to add
- Like any multi-class classification model, if you have a large imbalance in the number of utterances per intent, your app might not be as effective identifying intents with few utterances
- Sometimes users might say complex things that might be appropriate to map to multiple intents
- Your application may falsely map an utterance to an intent it doesn't belong to. I recently interacted with a system where I was requesting an E-Mail address to contact someone and the system proceeded to start a request to change my E-Mail address!
- At a pay-per-usage model, I find myself less willing to write unit tests around code that integrates with services like CLU

_Note: If cost is a factor, it is possible to emulate some of CLU's capabilities by writing your own multi-class classification model. Take a look at my article on [using ML.NET 2.0 to perform text classification](https://accessibleai.dev/post/ml_net_2_0_text_classification/) for some ideas there._

### Azure Cognitive Services

[Azure Cognitive Services](https://azure.microsoft.com/en-us/products/cognitive-services/) provide a few interesting AI as a service offerings beyond CLU & LUIS that can be helpful for conversational AI:

- **Speech to Text** allows AI systems to translate spoken words to raw text in a variety of languages.
- **Text to Speech** allows AI systems to speak to you in a human-like voice using neural voices in a variety of languages and dialects.
- **Language detection** allows AI systems to recognize what language is being used
- **Sentiment Analysis** allows AI systems to determine if the words someone is using are likely conveying a positive, negative, or neutral sentiment
- **Entity recognition** allows AI systems to extract named locations, people, things, and events from text
- **Key Phrase Extraction** allows AI systems to summarize long text (like this article) into a set of key phrases

See [my articles and videos on Azure Cognitive Services](https://accessibleai.dev/post/cognitiveservices/) for more on what we can do with Azure Cognitive Services, but these APIs allow us to integrate AI capabilities into our applications with minimal effort.

### Azure Cognitive Search

[Azure Cognitive Search](https://azure.microsoft.com/en-us/products/search/) may seem out of place in an article on conversational AI, but I do believe that chatbots are really often a form of conversational search. You're interacting with a virtual agent looking for some piece of information or looking to accomplish some task.

Search can help with that. If a bot encounters something it is not programmed for, a possible solution would be to search a series of documents or other sources of information you've registered with Azure Cognitive Search and see what responses you get.

That way your bot can say "I'm not able to handle that request, but I found a few resources that may meet your needs" and list the top few results of an internal search.

Azure Cognitive Search is more than just search in that it can extract meaning from PDFs, images, and other encoded forms of data. This allows it to transform the documents it searches to make them more relevant and searchable.

### Azure Bot Services

[Azure Bot Services](https://azure.microsoft.com/en-us/products/bot-services/) are a way of integrating your chatbot into Microsoft's multi-channel bot interaction ecosystem. This allows your chatbot to connect to various _channels_ including **text**, **voice**, **Slack**, **Teams**, **web user interfaces**, and **Amazon Alexa skills**. 

![Bot Channels](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8ioa1lvzi44p2ri2jpi.png)

An Azure Bot Service is not an application in of itself, but a registration that allows a bot at an endpoint you configure to communicate via any of these channels it desires.

Typically if you are developing a bot using Azure Bot Service you will use either Microsoft Bot Framework or Bot Framework Composer. The resulting bot will then be deployed as an App Service that your Azure Bot Service will integrate with by pointing it at a specific endpoint.

![Azure Bot Service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h05zss5ua6k58wmjs2jx.png)

### Microsoft Bot Framework

[Microsoft Bot Framework](https://dev.botframework.com/) is a SDK for integrating with Azure Bot Service.

Bot Framework lets you write what is effectively an Web API application to take in requests and generate responses to the user however you'd like.

Typically Bot Framework applications will take advantage of Conversational Language Understanding, Azure Cognitive Search, external APIs, and your organization's code and data sources.

These applications can be involved to set up and configure, which is why I have a specific article just for [setting up a Bot Framework app in C#](https://accessibleai.dev/post/create_and_deploy_bot/). However, this complexity gives you a lot of power and control in responding to requests.

While contextual information is available using Microsoft Bot Framework, any carry over of context from message to message must be coded in by the developer.

### Bot Framework Composer

Most of the time organizations want to offer a chatbot and have someone other than a developer control how it reacts to statements.

Microsoft understands the complexity involved in creating chatbots and so gives us the [Bot Framework Composer](https://learn.microsoft.com/en-us/composer/introduction) to help simplify this process.

![Bot Framework Composer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frme5fqy1w302hviu4dn.png)

Bot Framework Composer is a graphical user interface to create and test chatbots using flowcharts with different series of nodes per intent that your application supports.

Bot Framework Composer bots are compatible with Azure Bot Service and can be deployed to Azure the same way a Bot Framework bot can.

Unfortunately, my experience with Bot Framework Composer has been largely negative with it not supporting the types of things I need it to (often requiring custom code) and I've had a large number of errors attempting to provision or even deploy applications. Support was largely unhelpful with these issues as well, informing me in August that there were open issues for the things I've reported and then declining to assist further when checking in with me in early December.

As a result, I view Bot Framework Composer as a promising sign of whats to come and maybe not what is truly enterprise-ready at the moment.

### Question Answering

Because writing chatbots can be difficult, Microsoft provides the [Question Answering service](https://azure.microsoft.com/en-us/products/cognitive-services/question-answering/). Question Answering is a successor to the old QnA Maker service much like CLU now replaces LUIS.

Question Answering allows you to provide knowledge base or frequently asked question documents to Azure that are then indexed via Azure Cognitive Search that can be responded to via conversational workflows using CLU.

Once you have a knowledge base you're satisfied with, Question Answering then lets you deploy your trained bot to Azure Bot Service for users to interact with it.

This makes Question Answering a great way of getting started with a conversational AI system, but one that isn't going to be able to respond to anything dynamic or integrate external data sources.

### Bot Framework Emulator

One of the really interesting things about chatbots on Azure is the [Bot Framework Emulator](https://github.com/microsoft/BotFramework-Emulator) tool that lets you test a chatbot locally and get detailed information about the request the bot received and the response the bot generated.

![Bot Framework Emulator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47rcvkhfielry4mz9axj.png)

This tool is invaluable for testing and debugging your applications and I strongly recommend it.

## The Ghost of Chatbots Future: Where Conversational AI is Heading

So we've now seen a history of conversational AI systems and a rich set of current offerings. Let's talk about where I believe all of this is heading.

First, ChatGPT changes everything. Bots that were unaware of conversational context or unable to handle nuanced messages from users are now suddenly a lot less acceptable to the general user now that they've seen what transformer-based systems like ChatGPT can do.

However, these transformer-based systems are not trained on your organization's data, may be trained on data you don't want to include responses from (including potentially competitor's materials or copyrighted materials, despite claims to the contrary), and may completely misunderstand your users true needs.

Current language understanding systems work well, are controllable, and map user inputs to things the bot can understand and accomplish, but may miss nuance from users and struggle with the larger context of a conversation.

I believe that these systems should eventually merge. I believe that traditional conversational AI systems can potentially take advantage of transformers to generate rich responses to user messages.

I believe that transformer-based models will eventually gain the ability to cite the sources used in generating their end results. I also believe we will innovate new ways of controlling and constraining these systems to produce responses more in line with organizational needs and goals.

OpenAI, the organization responsible for ChatGPT, DALL-E and other models, is already [integrating into Azure via the OpenAI service](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service/). I believe it is only a matter of time before OpenAI starts merging more and more into the rest of Azure Cognitive Services and specifically conversational language understanding.

## Closing Thoughts

So this is the shape of what was, what is, and what I hope is soon to come.

Keep in mind that transformers are only 5 years old whereas image classification, the core innovation that powers self-driving cars, is 25 years old. While conversational AI has been around since ELIZA and the 1950s, it truly feels like we're back on the frontier where innovations may come suddenly and iterate rapidly.

Our old way of doing things via utterances to intents and back to the same piece of text for every intent is no longer cutting edge and users will notice. However, the intent mapping approach is not dead, but rather has some opportunities to integrate with the exciting and powerful transformer-based way of doing things.

I'm personally very excited to see where things will go and still plan on developing some traditional conversational AI applications in the new year. I hope you'll join me.