Stella Platform Documentation

Stella Platform Documentation

  • Docs
  • Procedures
  • Reference
  • FAQ
  • Bot API
  • API
  • Languages iconEnglish
    • 中文

›FAQ Chatbot Setup

Basic Facebook Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes
  • 2.1: Production Channel
  • 3.1: Draft a Post
  • 3.2: Create Public/Private Reply

Basic Web Chat Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes

Basic WhatsApp Chatbot Setup

  • Overview
  • 1.1: WABA Subscription
  • 1.2: Connect WABA
  • 2.1: Create New Tree
  • 2.2: Build the First Node
  • 2.3: Create a Global Node
  • 2.4: Build Child Nodes
  • 2.5: Connect to Datasource
  • 3.1: Create Priority Group

Advanced Chatbot Application

  • Overview
  • Apply Datasource to Chatbot
  • Apply Payload Value to Chatbot
  • Apply API to Chatbot
  • Apply Custom Locale to Chatbot
  • Apply Opt-in Flow to Chatbot
  • Apply Agenda to Chatbot
  • Apply Stella API to Chatbot

Stella Partner Portal Setup

  • Overview
  • 1.1: Partner Portal Setup
  • 1.2: New Customer Onboarding
  • 1.3: WABA Setup

Template Tree

  • Overview
  • Create Template Tree
  • Manage Proxy Tree

Chatbot Testing & Deployment

  • Overview
  • Stage One - Tree Building
  • Stage Two - Testing Stage
  • Stage Three - Production Deployment

Slack Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Live Chat Assignment
  • 2.1: Set Up Pick Ticket Status
  • 2.2: Create Done Command
  • 2.3: Create Transfer Command
  • 2.4: Create Archive Function
  • 2.5: Create Member Tagging/Remarks Command
  • 3.1: Automatic End Live Chat Function

Zendesk Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Assignment
  • 2.1: Create Done Command

FAQ Chatbot Setup

  • Overview
  • 1.1: Exact Keyword Match
  • 2.1: Exact Keyword Match & Diversion
  • 3.1: Keyword Groups Match & Diversion
  • 4.1: Redirect to Existing Chatbot Tree
  • 4.2: Data Analytics for FAQ Chatbot
  • 4.3: NLP for FAQ Chatbot
  • 5.1: Filtering Questions for FAQ Chatbot

NLP Chatbot Setup

  • Overview
  • 1.1: Apply NLP to your Chatbot
  • 2.1: Set Up an NLP Fallback Tree
  • 3.1: NLP Fallback to Other Languages

Connect Shopify Store to Stella

  • Overview
  • 1.1: Integrate Stella to Shopify
  • 2.1: Apply Facebook SDK to Shopify
  • 2.2: Setup Facebook Messenger Chatbot for Shopify
  • 2.3: Setup WhatsApp Chatbot for Shopify
  • 2.4: WhatsApp Customer Care Notification for Shopify

Exact Keyword Match

What is your Result?

  1. When user types the question (e.g. How much time do you need to build a WhatsApp chatbot?), the FAQ module will scan the entire data source to see if there is an exact match in the keyword group(s).
Example of FAQ Chatbot Data source
  1. Once matched with an FAQ entry, the chatbot will display the answer of the corresponding entry. (In this case, a text response.)
Example of FAQ Chatbot

FAQ Data Source Format

Example of FAQ Chatbot Data source

The basic data source format should in be .CSV file format and includes the following items:

ItemsDescription
Language"Language" refers to the language of this FAQ entry
Category 1-3The categories refer to the option displayed on the Category 1-3 filtering question.
Category 1-3 PriorityCategoy Priority refers to the positional priority (Lower the value, higher the position) of the option displayed on the Category 1-3 filtering question
Question ID“Question ID” is a unique identifier for each entry.
Question“Question” is for your own reference at this stage. It is a standard sample question you expect the users to ask. For instance, “What is the price for Product A?”

However, if you categorize your FAQs and display them in the form of a list (on Stella Web Chat only), a set of filtering questions (WhatsApp) or in a carousel (Facebook), then the “Question” you have set will be displayed to allow the users to choose from.
Analytics CategoryAnalytics Category refers to the unique analytics label for each FAQ entry.
Analytics IDAnalytics ID refers to the analytics category for each FAQ entry.
Keyword GroupThe keyword groups consist of keywords to be searched/matched with user input. You can input multiple variations/synonyms of the keyword. For instance, if you expect users to ask about your product’s pricing, putting “pricing”, “price” or “cost” into the data source will make sense. The format will be [“pricing”,”price”,”cost”]. The words between quotation marks share an “OR” relationship.

You may also set multiple keywords per entry. The relationship between different keyword groups is “AND”. This means that the user's input must match all keyword groups of an entry in order for the chatbot to reply with the corresponding answer. With more keyword groups per entry, you provide more context to the system. (However, this also means that this entry is harder to trigger.)

For example, if the user is asking about "What is the price for Product A?", you may set up keyword group 1 as [“Product A”] & keyword group 2 as [“price”]. You may do the same for Product B, Product C…Product N. Then, each chatbot answer will be replying to a specific product.
Intent"Intent" refers to the trained intent of an NLP engine on Google Dialogflow or Microsoft LUIS
Type“Type” is the type of message responses of your answer. For this standard procedure, the type: "Text", "Image", "Video", "GIF", "File", "Audio" & "Redirect" are supported. Please make sure you have the correct type.
Text“Text” is the chatbot textual answer of the FAQ entry.
URL“URL” refers to the multimedia link for the “Image”, “Video”, “GIF”, “File” & “Audio”.
Preview"Preview" refers to the link preview on WhatsApp text response. Set "TRUE" to display the preview.
Caption"Caption" refers to the caption text of a WhatsApp image. Please make sure "URL" is filled with an image link before inputting the caption.
treeID"treeID" refers to the tree that Stella should redirect user to. Please make sure "*Redirect" is chosen for message type.
compositeID"compositeID" refers to the compositeID of the tree node that Stella should redirect user to. You may locate this information in here of a tree node. Please make sure "*Redirect" is chosen for message type.

You may download the sample FAQ data source in .CSV here.


Getting Hands-on

Sample Tree Structure

Tree Structure of FAQ Chatbot with Exact Keyword Match

Create a New Data Source

  1. Head to “Data Source” and select “+ New Data Source”.
Add a New Data Source
  1. Name your new Data Source.
Name the New Data Source
  1. Import your .CSV file by choosing the file, toggle on “Replace” & “Parse JSON”
Import the Data Source File
Toggle to "Append" if you want to add additional entries only; toggle to "replace" if you want to replace the whole data source.
  1. Copy the “Data Source ID” and save it for latter use in “collectionName” in the code later.
Save Data Source ID

Create a Tree Node for FAQ Module

  1. Head to a tree and create a tree node for the FAQ module.

  2. Create a pre-action (this is for handling the exact keyword matching logic) in this tree node with the following code (Remember to apply the Data Source ID to collectionName in the code):

return new Promise((resolve, reject) => {
 console.log("in Save FAQ temp ans")
 let text = this.messageEvent.data.text
 text = text.replace(/\r\n|\r|\n/g, "")
 text = text.replace(/(\/|\.|\*|\?|\+)/g, "")

 function genKeywordsRegex(keywords, text) {
   // return "/(" + keywords.join("|") + ")/i.test('" + text + "')"
   let regex = new RegExp("(" + keywords.join("|") + ")", "i")
   return regex.test(text)
 }

 this.fetchDataFromDataSource({ channel: this.channel, collectionName: "enter the Data Source ID here", filter: {} }).then((result) => {
   console.log("length", result.length);
   const ans = result.filter((doc) => {
     if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length") && this.lodash.isArray(doc["Keyword Group 2"]) && this.lodash.get(doc, "Keyword Group 2.length") && this.lodash.isArray(doc["Keyword Group 3"]) && this.lodash.get(doc, "Keyword Group 3.length") ) {
       const regex1 = genKeywordsRegex(doc["Keyword Group 1"], text)
       const regex2 = genKeywordsRegex(doc["Keyword Group 2"], text)
       const regex3 = genKeywordsRegex(doc["Keyword Group 3"], text)
       // return eval(`(function() { return ${regex1} && ${regex2} })`)()
       console.log("current doc (3 keyword group)", doc["Question ID"])
       return regex1 && regex2 && regex3
     } else if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length") && this.lodash.isArray(doc["Keyword Group 2"]) && this.lodash.get(doc, "Keyword Group 2.length")) {
       const regex1 = genKeywordsRegex(doc["Keyword Group 1"], text)
       const regex2 = genKeywordsRegex(doc["Keyword Group 2"], text)
       // return eval(`(function() { return ${regex1} && ${regex2} })`)()
       console.log("current doc (2 keyword group)", doc["Question ID"])
       return regex1 && regex2
     } else if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length")) {
       const regex1 = genKeywordsRegex(doc["Keyword Group 1"], text)
       // return eval(`(function() { return ${regex1} })`)()
       console.log("current doc (1 keyword group)", doc["Question ID"])
       return regex1
     } else {
       return false
     }
   })
   console.log("ans", ans)
   this.lodash.set(this.member, "botMeta.tempData.faqAns", [])
   this.lodash.set(this.member, "botMeta.tempData.faqAns", ans)
   // this.member.botMeta.tempData.faqAns = ans
   resolve({ member: this.member })
 })
})

  1. Create a transformed response in “Advanced” in this tree node for displaying the chatbot answer based on the matched entry with the following code:
 return new Promise((resolve, reject) => {
 console.log("in FAQ Keyword")
 let ans = this.member.botMeta.tempData.faqAns || []
 console.log("ans", ans)
 if (ans.length >= 1) {
   let response = {}
   switch (ans[0].Type) {
     case "Text":
       response.type = "TEXT"
       response.text = ans[0].Text
       if (ans[0].Preview === true || ans[0].Preview === "TRUE") {
         response.preview_url = true
       }
       break
     case "Image":
     case "Image_Text":
       response.type = "IMAGE"
       response.url = ans[0].URL
       response.text = ans[0].Caption
       break
     case "Video":
     case "GIF":
     case "File":
       response.type = "FILE"
       response.url = ans[0].URL
       response.text = ans[0].Caption
       response.filename = ans[0]["File Name"]
       break
     case "Audio":
       response.type = "AUDIO"
       response.url = ans[0].URL
       break
     default:
       response = null
       break;
   }
   resolve(response)
 } else {
   resolve({
       type: "TEXT",
       text: "Sorry, we don't have the answer for you at the moment. You  may try to ask us in another way or reach our support team at hello@sanuker.com."
     })
 }

}

)

Create a Global Node for FAQ Module

  1. Create a global node for triggering the FAQ module in the same tree.

  2. Create a trigger in the global node with a pre-defined trigger as “Any Text”.

Create "Any Text" Trigger
  1. Toggle on redirect to the FAQ tree node you created and save this global node.
Redirect to FAQ Tree Node
  1. Check and see if you can produce the expected outcome.
← Overview2.1: Exact Keyword Match & Diversion →
  • What is your Result?
  • FAQ Data Source Format
  • Getting Hands-on
    • Sample Tree Structure
    • Create a New Data Source
    • Create a Tree Node for FAQ Module
    • Create a Global Node for FAQ Module
Stella Platform Documentation
Docs
Get StartedBest PracticesAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2021 Sanuker Inc. Limited