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

Keyword Groups Match & Diversion

What is your Result?

  1. When user types the question (i.e. Do you support WhatsApp Chatbot Solution?), the FAQ module will scan the entire data source to see which entry has the highest number of keyword group(s) that matched with the input (score).
Data Source Example of FAQ Chatbot with Keyword Groups Match & Diversion
  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 with Keyword Groups Match & Diversion 1
  1. If there are multiple entries with the same score, the chatbot will display all matched questions (diversion).
Example of FAQ Chatbot with Keyword Groups Match & Diversion 2

FAQ Data Source Format

Please refer to level one procedure for the the FAQ Data Source Format. To allow more variations, you may just add additional columns for extra keyword groups on the data source.

Getting Hands-on

Sample Tree Structure

Tree Structure of FAQ Chatbot with Keyword Groups Match & Diversion

Edit the Tree Node for FAQ Module

  1. Before proceeding, you should have completed the level two FAQ Chatbot with Exact Keyword Match and Diversion. You may edit the level two tree directly or duplicate a new tree.

  2. Edit the existing pre-action (this is for handling the keyword groups matching logic) in the FAQ Module tree node with the following code (Remember to apply the Data Source ID to collectionName in the code):

return new Promise(async (resolve, reject) => {
let text = this.messageEvent.data.text
text = text.replace(/\/n/g, "")
// text = text.replace(/(\/|\.|\*|\?|\+)/g, "")

let result = await this.fetchDataFromDataSource({
  channel: this.channel,
  collectionName: "enter the Data Source ID here",
  filter: {}
})

let maxScore = 0
result = result.map((doc) => {
  try {
  let score = 0
  if (this.lodash.isArray(doc["Keyword Group 1"]) && this.lodash.get(doc, "Keyword Group 1.length")) {
    let keywords = doc["Keyword Group 1"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (this.lodash.isArray(doc["Keyword Group 2"]) && this.lodash.get(doc, "Keyword Group 2.length")) {
    let keywords = doc["Keyword Group 2"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (this.lodash.isArray(doc["Keyword Group 3"]) && this.lodash.get(doc, "Keyword Group 3.length")) {
    let keywords = doc["Keyword Group 3"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (this.lodash.isArray(doc["Keyword Group 4"]) && this.lodash.get(doc, "Keyword Group 4.length")) {
    let keywords = doc["Keyword Group 4"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (this.lodash.isArray(doc["Keyword Group 5"]) && this.lodash.get(doc, "Keyword Group 5.length")) {
    let keywords = doc["Keyword Group 5"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (this.lodash.isArray(doc["Keyword Group 6"]) && this.lodash.get(doc, "Keyword Group 6.length")) {
    let keywords = doc["Keyword Group 6"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (this.lodash.isArray(doc["Keyword Group 7"]) && this.lodash.get(doc, "Keyword Group 7.length")) {
    let keywords = doc["Keyword Group 7"]
    keywords = keywords.map((str) => {
      str = str.replace("+", "\\+")
      str = str.replace("$", "\\$")
      str = str.replace(".", "\\.")
      str = str.replace("!", "\\!")
      return str
    })
    let reg = new RegExp(keywords.join("|"), "i")
    if (reg.test(text)) {
      score++
    }
  }
  if (score > maxScore) {
    maxScore = score
  }
  doc.score = score
  } catch (error) {
    
  console.log("doc", doc)
  console.log("error", error)
  }
  return doc
})
console.log("maxScore", maxScore)
let ans = result.filter((doc) => {
  return doc.score === maxScore && doc.score > 0
})
  ans = ans.slice(0, 10)
console.log("ans", ans)

this.member.botMeta.tempData.faqAns = ans

resolve({
  member: this.member,
})
})
  1. Check and see if you can produce the expected outcome.
← 2.1: Exact Keyword Match & Diversion4.1: Redirect to Existing Chatbot Tree →
  • What is your Result?
  • FAQ Data Source Format
  • Getting Hands-on
    • Sample Tree Structure
    • Edit the Tree Node for FAQ Module
Stella Platform Documentation
Docs
Get StartedBest PracticesAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2021 Sanuker Inc. Limited