Photo by Tim Gouw on Unsplash

Evaluating Microsoft Composer for Bot Framework

An Integrated Development Tool To Build Chatbots & Conversational Experiences

Cobus Greyling

--

Introduction

Most chatbot architectures consist of four pillars, these are typically intents, entities, the dialog flow (State Machine), and scripts.

Traditional Chatbot Architecture

The dialog contains the blocks or states a user navigates between. Each dialog is associated with one or more intents and or entities. Session variables can also be employed the decide on which states or nodes must be visited.

The intents and entities constitute the condition on which that dialog is accessed.

The dialog contains the output to the customer in the form of a script, or a message…or wording if you like.

This is one of the most boring and laborious tasks in crafting a chatbot. It can become complex and changes made in one area can inadvertently impact another area. A lack of consistency can also lead to unplanned user experiences.

Scaling this environment is tricky especially if you want to scale across a large organisation.

Merging Design & Development

The surefire way of developing call-flows is with native code. An Environment like Amazon Lex makes the assumption that business rules and conversation flow will vest within native code.

For many this approach is too abstract and deemed hard to manage.

Example of Digression in a Chatbot

The holy grail is to have a composer or design environment where the call-flow can be designed graphically and simultaneously create executable code.

Or least a design which can be imported into a chatbot framework and executed.

This allows for rapid deployment of chatbot experiences.

General challenges often experienced with this approach include:

  • Complex flows cannot be accommodated practically
  • Massive redundancy
  • Fine programmatic tuning not always possible
  • Digression is Hard to Implement
  • Nested Menus & Conversational Nodes Are Hard to Drop Into
  • Finite Journeys Often Lead to Fallback Proliferation

What Is Bot Framework

The Bot Framework Composer is an open source tool based on the Bot Framework SDK.

Key Aspects Include:

  • A visual editing canvas for conversation flows
  • In context editing for language understanding (NLU)
  • Tools to train, test and manage language understanding (NLU) and QnA components
  • Language generation and templating system
  • A ready-to-use bot runtime executable

Getting Started

Getting started with Composer For Bot Framework…

Head to GitHub and clone or download the project to run in locally. I made use of Visual Studio Code (VSC)to run it.

The build and run composer locally simple execute the following commands. Make use of VSC’s terminal window.

$ cd Composer // switch to Composer folder
$ yarn install // install dependencies
$ yarn build // build extensions and libs
$ yarn startall // start client and server at the same time

Once you have run the last command, you will see the following in your VSC terminal:

Composer Is Running

Once Composer is running you can access it using a browser on port 3000.

Bot Framework Composer UI

To get started a very convenient list of Examples are on the right of the screen.

Build An Echo Chatbot

Creating an Echo Bot

In the example above the echo bot is selected from Examples, loaded and run within the Bot Framework Emulator.

There is a very detailed tutorial to build a weather bot with API integration included.

The composer allows for Natural Language Generation. In essence it is just concatenating the dialog segments presented to the user with dynamic content embedded.

Graphic components can be incorporated for mediums allowing richer user experiences in terms of graphics; like web and app.

Responding With Cards

Adding LUIS

Example project for LUIS are available and excellent tutorials can help you in customizing your project.

The flow you designed can be deployed from bot composer directly into your LUIS account in the cloud.

Some of the functionality included:

Entities, Definition, Machine learned, Prebuilt entity, List entity, Composite entity, Regex entity, Roles, Patterns, Phrase lists features etc.

# BookFlight
- book flight from {city:fromCity} to {city:toCity}
- [can you] get me a flight from {city:fromCity} to {city:toCity}
- get me a flight to {city:toCity}
- I need to fly from {city:fromCity}

$city:Seattle=
- Seattle
- Tacoma
- SeaTac
- SEA

$city:Portland=
- Portland
- PDX

Multiple roles for an entity can be defined, as seen above.

Composer allows you to leverage the power of LUIS, which I found astonishing.

Testing

As stated above, the Bot Framework Emulator allows for seamless transition between the composer and the emulator.

Landing Page: Bot Framework Emulator

The sequence of events required to get your bot out of the door is also defined along a line of activity.

The Emulator can be cloned or Downloaded from GitHub.

It is described as a desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK. You can use the Bot Framework Emulator to test bots running either locally on your machine or connect to bots running remotely through a tunnel.

Positive Elements

  • Graphic Design & Development Presence for Microsoft Bots
  • Seamless Integration with LUIS
  • Leveraging Intents and Entities with Contextual Entities & All Advanced Entity types
  • Seamless Deployment to Azure Resources & Azure Bot Environment
  • Built-In Graphic Elements
  • Seamless Testing in Microsoft Bot Simulator
  • Growth Within the Microsoft Environment
  • Migration Within the Microsoft Environment

Other Considerations

  • Structure Considerations Due To Merging of Dialogs, Triggers, Intents & Entities
  • Framework Maturity Concerns
  • Unknown Scaling Impediments
  • Technical Design Considerations for New Ways of Working

Conclusion

At the very least composer is a good way for an aspiring chatbot developer to get started in an easy way with no cost impediments.

Microsoft has a very powerful NLU API creator in LUIS with the best entity functionality by far; compared to other commercial cloud offerings.

Added to this, is the recently launched Power Virtual Agents. And, add to the mix Bot Framework, the emulator and now composer.

Microsoft has a multi-pronged approached and is addressing various sectors simultaneously with this approach.

--

--

Cobus Greyling
Cobus Greyling

Written by Cobus Greyling

I’m passionate about exploring the intersection of AI & language. www.cobusgreyling.com

No responses yet