Technical Articles
IBM Watson Assistant Chatbot for UI5 Application : Step-by-step guide
IBM Watson Assistant is an AI-powered virtual agent that provides customers with fast, consistent and accurate answers across any messaging platform, application, device or channel. Using artificial intelligence and natural language processing, Watson Assistant learns from customer conversations, improving its ability to resolve issues the first time .
Image Source :IBM
I am using IBM Cloud account which is offering many services , The account is free and provides access to everything you need to develop, track, plan, and deploy apps .
You can create one from here :https://cloud.ibm.com/login
This blog will introduce you to addIBM Watson Assistant chatbotfor yourSAP UI5Application where this app will look like a basic home page .
这篇文章的第一部分将创建chatbot service that will interact with the user with basic Inquiries and the second part will be creating our UI5 application .
1: Create the Assistant service
Login to the IBM Cloud. On the dashboard, click buttonCreate Resource, Click on Services from the left bar ( There is a lot of services that everyone has it’s own functionality ) , ChooseAI / Machine Learningand ClickWatson Assistant. We will use the Lite free plan.
Scroll to changeClick onCreate
In this simple scenario we won’t dig into all the service details ,We will just make the bot responds to user with his Company HR & IT contact details .We will start by creating bot skills ( bot training phase ) .
2: Create a Dialog Skill
Adialog skillis a container for the artifacts that define the flow of a conversation that your assistant can have with your customers where Actions skill ( Compose step-by-step flows for any range of simple or complex conversations ) is still in its beta versions .
ClickAdd an actions or dialog skill .
Choose it’s Name , language and type we stated then ClickCreate Skill.
3: Create Intent & Dialogs
The Intents page is where you start to train your assistant. You can add training data that was built by IBM to your skill. Prebuilt intents are available from the content catalog, But in this tutorial we will create our own intents.
ClickCreate Intent
Now we will Enter Intent Name that match user question , In this step We will addUser examplesreferring to HR contact details like the following .
Repeat the same steps for IT contact details intent like the following .
A dialog defines the flow of your conversation in the form of a logic tree. It matches intents (what users say) to responses (what your virtual assistant says back). Each node of the tree has a condition that triggers it, based on user input.
From the Skills menu, chooseDialogand ClickAdd nodeto state the intents we created before responses .
Repeat the same steps for IT contact details dialog .
We can test it to see the results by clickingTry it:
Enter “HR” in the chat & See the results .
4:Integrating web chat
On the left bar , Click onAssistantsand chooseWatson Assistantthat we created before then Scroll and In the right ClickIntegrate web chat.
Choose
After it’s created , You can customize it’s style from Style tab .
Now ClickEmbedand copy the following script that we will use later in our app .
5: Create SAPUI5 App
I am using in this blogSAP Web IDE however it’s recommended to useSAP Business Application Studio.
Create New SAPUI5 Application
After the project is created . Navigate toProject name > webapp > index.html我们复制和粘贴脚本在最后step to look like the following :
Homepage
controllerName = " HomepageHomepage.control < mvc:视图ler.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m" xmlns:layout="sap.ui.layout" xmlns:microchart="sap.suite.ui.microchart">
We can run the application , It will look like the following where chatbot is displayed at the bottom & The tiles we created at the top :
We can test the widget across the app by typing “I need to contact HR” & “IT” and let’s see the result .
Conclusion:
By leveraging machine learning and NLP, AI-powered chatbots can understand the intent behind your user’s requests and respond to their questions in a natural, human way.
In this blog , I introduced you to use one of this chatbots in a user friendly app . By creating a simple UI5 homepage that contains Watson Assistant widget with it’s basic functionally that can be used for SAP Fiori app where the user asks for department contact number and the bot answers it.The widget has a lot more of features that can be used .
You can find more about this widget :here
Feel free to leave your feedback on this post or any questions you may have .
Excellent esmat very informative
Great job Esmat (Y) (Y)
Good IdeaEssmat