SAP Conversational AI is powerful platform to build chatbots. You can chat with your bot to query the weather, enjoy a joke, and even more, create a sales order. Here I’d like to share with you how to build a sales bot (for creating sales orders) using the community edition of SAP Conversational AI.  In this blog series, I’ll show you how to build a chatbot from scratch and how to let the bot call API to create a sales order (with 1 item).

As the first one in a blog series, this blog post will focus on bot training. In this blog post, you’ll learn how bots understand human inputs and how to train your bots.

Note:

SAP Conversational AI is available in community and enterprise editions. You can directly access the community edition at https://cai.tools.sap/ and test almost all features. To access the enterprise edition, you need to subscribe to SAP Conversational AI using your BTP account (See Subscribe to SAP Conversational AI). Here are the differences between these two editions:

(Screenshot from Introduction | SAP Help Portal)

Now let’s get started.

Step 1: Create a new bot

1. Open https://cai.tools.sap/ and log in.

2. Click “New Bot”. Perform basic settings for the bot. The following table lists an example.

What do you want your chatbot to do? Perform Actions
Select predefined skills for your bot Don’t choose
Create your bot Your bot name: Sales Order Helper
Data Policy Type of data: Non-personal

Store conversation data: Store

Bot visibility Private

3. Choose “Create”. The following page is displayed.

(Some parts of the screenshot are blurred for protecting user information)

Step 2: Create intents and add expressions

Before building any business logic, we need to make the bot “understand” user input. For example, when I enter “I want to create sales order for customer 10100001”, the bot should know a sales order is expected to be created for a customer whose id is “10100001”. To achieve that, we need to create an intent and add expressions for the intent. By learning a variety of expressions, the bot is potentially equipped to perceive the intent.

1. On the “Train” tab, choose “New Intent” and enter an intent name. For example, it can be named as “create-sales-orders”.

2. Next, add expressions for this intent and label entities in each expression.

In the following screenshot, the expression “I want to create sales order for customer 10100001, 5 PC of product TG11, sales area 1010/10/00” is added. When you expand the expression, some words have been automatically extracted as entities and labelled. For example, “5” has been detected as an entity and labeled as “Number” by default.

Also, you can create custom entities (by highlighting words or phrases) and label them as needed. For example, for business processing purposes, you can highlight “TG11” and label it as “Product”, and label “10100001” as “Soldto-Party” in a similar way.

After labeling, the expression will be like:

You are ready to go on once you have one expression for an intent. But for better performance, you can add more expressions. The richer expressions you have, the more precisely your bot can understand user input.

Step 3: Train the bot

Whenever you modify the expressions in an intent, the training status changes from green to yellow.

Click “Train” to let the bot learn from the newest expression dataset.

Step 4: Test bot processing of expressions

Okay, now the bot is ready to automatically extract the entities from user input. Is there a way to test it? The answer is of course yes. The SAP Conversational AI platform provides a convenient way to test the expressions.

Choose the “Expression Analysis” side menu (or press Shift+Alt+E).

After entering an expression, you can see extracted entities and values below.

You can also talk with your bot after opening the “Chat Preview” side menu.

Enter a sentence to test the bot directly. For now, the bot has no business logic for user input, so it will react with a fallback response, which is “I trigger the fallback skill because I don’t understand or I don’t know what I’m supposed to do…”. But you can click the yellow information button to open the JSON view of the bot.

The JSON view shows the entities that have been extracted, and we will use these entities in next blog post to build the business logic.

Okay that’s all for the part 1 of our blog series. In this blog post, we learned how to let the bot get the entities from the user input and how to test the bot. Hope you enjoy it.

In the next blog post, I’ll show you how to build business logic based on the extracted entities. If you have any questions or ideas, please feel free to comment under this blog post. And also please feel free to follow this blog post or my profile to receive new article notification. See you soon 🙂

Series Navigation

Part 1: Train (Current article)

Part 2: Build

Part 3: Connect to Webpage

Related Information

SAP Conversational AI

Create Your Chatbot – SAP Help Portal

SAP API Business Hub – Sales Order (A2X)

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x