Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Paul_P
Product and Topic Expert
Product and Topic Expert
In this guide, I will walk you through how you can build an FAQ (Frequently Asked Questions) chatbot using the SAP Conversational AI platform.

What you will need:  

  • A CSV file in UTF 8 format with your question and answer pairs  

  • An account on SAP Conversational AI!  


What you will get:  

  • bot that routes a user question to an answer from your FAQ document  

  • A skill for small talk (hello, thank you and goodbye)  

  • A skill for customer satisfaction that allows you the ability to help a user find information when they indicate an answer is not helpful

  • Pure happiness (probably)  


In case you want to understand why it would be a good idea to build a FAQ chatbot, I have created a few use cases that this bot would be great for your life/business/website. If you are ready to start building your chatbot, you can skip ahead to Step 1: Upload your Content. 

Use Cases:  


1. The “offline support bot” 
If you have live support on your website during specific business hours and want to provide coverage 24/7, then you can setup a bot to take over when a human agent isn’t available.  

2. The “I have a really large knowledge base bot”
If you have a large amount of questions and answersthen you can setup an internal tool to help your team find answers faster. This would be great for a team that has accumulated information in a knowledge base for RFPs or needs new policy around compliance. 

3. The “I am tired of answering the same question over and over and over again bot” 
If you have a support team that is tired of answering the same question, then you can setup a bot that can field the frequently asked questions. This will allow your team to focus on more value-add tasks and your customers to get their questions answered faster.  

Now that we have gone over some use cases for a frequently asked questions chatbot, we can get started with building the chatbot!  

Step 1: Upload your content   


Start by uploading your content. Guess what? You just created a FAQ chatbot! This is because SAP Conversational AI’s FAQ algorithm is configured to work out-of-the-box provided your CSV file is well formatted. *High fives all around! *  

There are some best practices to ensure a great FAQ chatbot launch. For example, you can adjust your bot responses (see “Step 2: Adjust your Skills” for more information on customizing your bot responses). You can also format your content to optimize it for the chatting medium.  

Before you update your skills, it would be good to:

a) Successfully upload your content
b) Optimize your content for a chatbot  

a) Successfully upload your content


Make sure your content is stored as a csv in UTF8 formatYour document can have semicolons, commas, or tabs as delimiters. There may be a case where you want to upload a document with multiple questions routing to one answer. This is an example of how your content would look if you are adding alternative questions using Excel.  































Question   Answer 
What do you think of my first question?    I think this first question is absolutely wonderful. 
How much do you love this alternative phrasing of the first question?    
Isn’t the first question the most fantastic?    
How much do you hate this second question?    I think the second question is gross.  
Isn’t the second question just the worst?    
Wow, did you ever dislike something more than this second question?    

Once you have finished creating your content and feel ready to export your file, you can select “save as” and save it as “CSV UTF-8” file format.  


To download a sample file you can select the template on our documentation found here.

b) Optimize your content for a chatbot


Depending on where the source of your question and answer pairs are coming from, you may want to adjust the content to make sure it is optimized for a chatbot. Something that looks nice on a webpage may feel very different when it is presented in a chatbot. Here are some tips to make sure your bot is looking good.

Limit your answers to 640 characters


If you are creating a chatbot it is recommended that you limit the text field to under 640 characters. If you have additional text, it becomes hard for the user to read the content in a chatbot window. Some channels may even cutoff the character at that point.

Consider Routing to an External Website


If you can’t break up your answer, consider creating a shorter version of your answer and then link it to either a website or an external documentation source where a chatbot user can click to get more information. The platform supports markdown syntax so you can link it to a website in your answer!

EXAMPLE
Question: What is SAP Conversational AI?
Answer: SAP Conversational AI is the best chatbot building platform in the whole world.
To build your own chatbot, follow this link [here] > https://cai.tools.sap/

Make your Questions Actual Questions


The system was designed to map questions to other questions thus we would recommend your questions be actual questions or sentences rather than key words.

EXAMPLE
 BAD
Question: SAP Conversational AI
Answer: SAP Conversational AI is the best chatbot building platform in the whole world.

 GOOD
Question: What is SAP Conversational AI?
Answer: SAP Conversational AI is the best chatbot building platform in the whole world.

Design your Content to Rephrase the Question


When displaying your content to your end user you have the option to show just the answer, the question and the answer, or just the question. If you choose to show the answer alone it will be important to rephrase the question, so you maintain the context even if the question isn’t there.

EXAMPLE
 BAD
Question: Can I fly first class?
Answer: Yes.

 GOOD
Question: Can I fly first class?
Answer: Yes, you can fly first class.

Once you have you content uploaded to the platform and feel like it is in a good state for the chatbot medium, then you can move to step 2, which is to configure your skills by customize the text and bot responses.

Step 2: Adjust your Skills  


We have pre-set your skills in your FAQ bot so that after you upload your document your chatbot is ready to respond. We also wanted to give you the flexibility to go through and adjust your skills so that your bot behavior fits your use case.

In this section, I will share with you some ideas for what you can do in each of your skills. As a reminder here are the four skills that come with your bot: the FAQ, Customer Satisfaction Prompt, Customer Satisfaction Reply, and Small Talk skill.

FAQ Skill


Your FAQ has been created to have three ranges: the “I know the answer” range, the “I am not sure I know the answer” range and the “fallback” range. I will break down each of the ranges for you and share some customizations you can do in each area.

The “I know the answer” Range


Chatbot’s Confidence Range: 90%-100%

When a user question gets sent to your chatbot, the platform generates a ranking score that does an analysis of the user question and its similarity to questions in the document. When the question is found to have 90%-100% similarity to a question in your document the default behavior is to show the top matched question in bold and the answer to the top matched question below. It will also redirect the skill to the “customer-satisfaction-prompt” skill which will ask the user if the information displayed answered their question.


Additional Configuration Options

  • Make the top range stricter and just show the top matched answer without the question

  • Show more than one answer to a user question


The “I am not sure I know the answer” range


Chatbot’s Confidence Range: 5%-90%

When the question is found to have 5%-90% similarity to a question in your document the default behavior is to show a quick reply message that displays the top three matched questions. When your end-user selects for which question they want to see the answer the bot will postback the value of the question and the “I know the message” range will be triggered.


Additional Configuration Options

  • Change the text from “Did you mean to ask?” to something else

  • Show more or less than the top three matched questions (You can show up to the top 10 matched questions and answers)


The “fallback” range


Chatbot’s Confidence Range: 0%-5%

When the question is found to have 0%-5% similarity to a question in your document the default behavior is to send a message telling the user that the bot was not able to find the information they were looking for in the document.


Additional Configuration Options

  • You can customize the message at the bottom

  • You can provide actionable items for the user to select – link to documentation, information and a person they can send an email to who can answer the question

  • You can do something similar to the middle range make this message show up to the top 10 questions


Adding Additional Ranges


You are not limited to three ranges that we provide for you. You can add in as many ranges as you like by selecting “Add New Message Group” and adding in the conditions you want that will trigger your additional range.

Make sure that when you add an additional range, you include the “equals to” condition.Customer-Satisfaction-Prompt


This is where you can control the message that is sent to your user when the high confidence range is triggered. By default, it is set to “Did this answer your question?” With “Yes” and “No” as quick replies to the question.

You can change the sentence however you would like. We would not recommend changing the postback value of this skill as if you do the response will not work with our pre-trained classifier. If you don’t want the customer satisfaction skill to be active, you can deactivate it in the “Build” tab. Make sure you deactivate both the customer satisfaction prompt and the customer satisfaction reply.



Customer-Satisfaction-Reply


This is the core of your two customer satisfaction skills. In this skill, you can control what you send to a user when they say a certain answer was not helpful.

For example, if a user says “no” an answer was not helpful you can guide them to a place where they can take an action to get further information by sending an email, viewing full documentation, or speaking to a live agent.

  • If a user selects “no” an answer was not helpful you can:

    • Link to full documentation

    • Email address for an admin

    • Suggested questions the bot can answer





  • If a user selects “yes” an answer was helpful you can:

    • Suggest a follow up question they can ask




Small Talk


We pre-trained the bot so that you don’t have to do any training to setup small talk on your bot. All you need to do is decide how you want your bot to respond when hello, thank you or goodbye is detected.

Hello
Expectation management is key with a FAQ bot. It is important to be clear and helpful when a user first interacts with a bot so that they know what value they can expect to receive from the interaction. We would recommend an introduction message that tells the user what type of questions the bot can answer and how best to use the bot.

Thank you
Even chatbots could use good manners. Feel free to customize whatever you would like for this message.

Goodbye
When a user is saying goodbye to a bot it can be a great opportunity to send a closing message or link to a survey.

Remember these are all suggestions, you know your use case best and it will ultimately be up to you to design a conversation flow that suites yours and your customers’ needs!

Step 3: Deploy, monitor, and improve your FAQ chatbot  


In this section, we will walk through how you can go about selecting a channel to deploy your bot and how you can monitor and improve your bot with the questions that your chatbot users ask.

Connecting your chatbot


Always remember when you are building your bot that context plays a big role in your chatbots success. This means that selecting a channel is super important! For example, a policy related chatbot can do really well when it is deployed on a site where someone is booking travel and may have questions about that specific process. Think about how you can provide information WHEN a user will want that information.

When you feel that your bot is ready you can begin the deployment process! Go to the “Connect” tab, choose the messaging platform you prefer and follow the step-by-step instructions. You won’t have anything else to do other than the initial configuration to deploy your bot to a new channel.

As mentioned in the configuring your message section, depending on the channel you deploy your bot to the messages may look different and may have different cutoff points. Be sure to review the channel limitations and test your bot before you make your bot live on the channel.

Assigning user questions to answers


Once you start getting some real user questions, you can begin using the assign feature as part of the log feed in the “Monitor” tab to improve the rankings of your questions.

In real life, we can ask a single question in several ways. By strategically assigning real user questions contained in your log feed to an answer in your document you are helping your chatbot comprehend the variety of ways a user can ask the same question.

We would recommend assigning a user question as a sample user question for two reasons:

  1. You would like the answer to move to a higher confidence range
    For example, a user questions receives a score of 40% (medium range) and you want that question to fall into the high range.



  1. You want to change the routing of the user question from what it is now to something else.
    For example, a user question gets routed to answer A but you want the routing to go to answer B.



Ensure that you are only assigning unique sample user questions. If two answers are associated with similar or overlapping sample user questions, your bot won’t know which content is the best reply for which question.

Discover new content to add to your knowledge base


You can use the filters on the log feed to simulate existing ranges you have setup in your FAQ skill or to try new ranges to see how the user questions get classified and identify questions that don’t yet exist in your document.

You can add your questions by going to your document and adding a new question and answer pair.

Closing


I hope that this blog post provided some clarity on how you can get your FAQ bot out into the world and the best practices for making sure it provides value to the people that use it.

For additional resources, please check the links below:

  • Ask your questions by joining our community on SAP Answers or by using the comment section below

  • Read our documentation for more help topics

  • Watch our video about the FAQ chatbot

  • Check out our API reference

  • Got feedback? Use the comment section below to tell us more!


 
5 Comments