Cloud Configuration

Stackchat Cloud Configurations provide connections to critical third-party services for Natural Language Processing (NLP) and analytics. Stackchat supports three Natural Language Processing (NLP) providers, Dialogflow (dialogflow.com), LUIS (luis.ai) and Baidu Unit (ai.baidu.com/unit) and one analytics provider, Adobe Analytics.

NLP

NLP providers are an integral part of your chatbot experience, as they extract intents and entities from user utterances.

Intent : What the user wants to do. E.g., the user wants to know when an event happens.

Entity : A term or object that explains the context of the intent. E.g. if the user wants to know when the 2020 Australian Open is, the “2020 Australian Open” is the event entity.

With any of our three NLP provider, you will need to create a system of intents and entities that supports your Stackchat bot model by creating intents that feed your Flows and entities that fill your Custom Slots.

Each Stackchat bot will have one NLP agent connected to it. It is hypothetically possible to use one NLP agent for multiple Stackchat bots, but it is inadvisable unless the bots are very close in functionality, as increased complexity within a single agent will create more difficult workflows especially among larger teams.

Dialogflow

Dialogflow is Google’s NLP offering. It supports a wide variety of European and Asian languages. Full documentation is available at:

Dialogflow Documentation

In order to connect Dialogflow to Stackchat, you will first need to create a Dialogflow account and an NLP Agent.

Create your Dialogflow account with a new or pre-existing Google account and click the arrow under the Dialogflow logo to create your first agent.

Dialogflow Create Agent

Give your agent a name that matches your Stackchat bot’s name for ease of understanding. Once your bot has been created, you can connect your Dialogflow agent to Stackchat using a Google Cloud Key ID that is unique to your NLP model.

To find it, go to bot settings and click next to where it says “Service Account”.

Dialogflow Service Account

Then follow these instructions from Dialogflow to start your service account, stopping after step 11.

Dialogflow Authentication Setup

For integrating your Dialogflow model into Stackchat, you will need a Key ID associated with the Dialogflow “App Engine default service account.”

Make sure you are on the bot you want, and click service accounts. Locate the App Engine default service account and click the three dots icon under actions. Select Create Key and then choose JSON format.

You should now download the JSON.

Open the JSON file in a text editor and copy its entire contents to your clipboard and head to Stackchat.

Cloud Config Modal

Then enter the name you wish to have the Cloud Configuration to have and paste your Client Access Token and click Add.

IMG enter service account Key ID

Now you can link your bot to your new cloud configuration. These steps will need to be repeated for each Dialogflow agent you wish to use in your bots.

LUIS

Coming soon!

Baidu Unit

Coming soon!

Linking Cloud Configurations

  1. Through the Cloud Configuration page.

Click the desired Cloud Configuration and then click Link to Bot at the lower left.

Link to Bot

Select which bot you want to link from the dropdown.

Select a Bot

Select whether you want this to be a preview or production configuration.

Select Configuration

Your bot is now linked to your NLP agent!

  1. From a specific bot’s page.

Go to Integrations in your bot’s sidebar and click Add Cloud Configuration

Add Cloud Integration

Click on your desired NLP provider.. You will then see the list of Cloud Configurations you have installed. Select the appropriate one from the list and click Sync.

Select from List and Sync

The Cloud Configuration will now appear in your list.

Agent Successfully Linked

Linking Intents and Linking Entities to Slots

Once you have linked your Cloud Configuration to your bot, you are ready to connect NLP entities and Stackchat Custom Slots.

Every entity you are pulling from NLP should have a corresponding Custom Slot.

Tip: Give your slots the same name as entities in the NLP model. This helps prevent confusion.

Every Custom Slot , however, does not require a linked entity, as your bot may ask questions outside of the NLP provider by directly asking.

To setup the linkage:

Go to Bot Builder and click the context menu. Select Configure AI.

Configure AI Button

You will now want to take a look at your NLP agent to find the intent you want. In this Dialogflow Agent, I want the intent venues.arts_entertainment.search.

Dialogflow Intent Copy

This intent must match exactly, so copy it from your NLP agent.

Now go back to Stackchat and open the Configure AI dialogue. Click Add Intent and paste that into the Intent field in Stackchat.

Dialogflow Intent Paste

You’re now ready to link entities to Slots.

Click the + button and a new line will appear.

Add Entity

Take a look at your intent in your NLP agent. In Dialogflow, scroll down to Action and Parameters. Find the entity you want to map. In this case, I want to use the location entity. Take the entry from the VALUE column that begins with a $.

Dialogflow Entity Name

Paste that value without the $ into the Add Entity field and click the checkmark. You can then click Select Slot and find your matching Slot in the dropdown.

Select Slot

You now have one entity linked to a Slot! Continue to connect all entities you created in your NLP agent for this intent to Slots. If you have an entity in your NLP agent that isn’t connected to a Slot, Stackchat will not do anything with it.

Analytics

To best understand how users are interacting with your bots, you can connect them to your existing analytics suite. Currently, Stackchat supports integration with Adobe Analytics.

Analytics Data

Out of the box, Stackchat collects all key interactions with your users, and, if you have a special need for something not captured by our standard analytics, you can add it through an Action Sequence within your bot.

Each bot interaction registers like a hit to a web page and covers the following items:

Every interaction includes key identification information:

Our Analytics covers these interactions with these additional values passed along:

  1. User Message: Triggers on an incoming message from a user.
  2. Message Type: text, postback or Cloud Function postback

  3. Flow Started: Triggers on a user entering a flow.

  4. Flow Name
  5. Flow Element Name

  6. Message Thread Started: Triggers on entering a message thread.

  7. Flow Name
  8. Flow Element Name

  9. Message Sent: Triggers when the bot sends a message to the user and identifies its type.

  10. Flow Name
  11. Flow Element Name
  12. Message Type: Image, Text, Carousel, List, Quick Navigation

  13. User Input Group Started: Triggers when the user enters a User Input Group.

  14. Flow Name
  15. Flow Element Name
  16. User Input Group ID: A unique identifier for the User Input Group

  17. User Input Group Ended: Triggers when the user completes a User Input Group.

  18. Flow Name
  19. Flow Element Name
  20. User Input Group ID

  21. User Input Group Restarted: Triggers when the user changes data in the group upon refusing confirmation.

  22. Flow Name
  23. Flow Element Name
  24. User Input Group ID
  25. Name of Slot Changed

  26. User Input Group Input Validation Failed: Triggers when the user enters data into the group that cannot be validated.

  27. Flow Name
  28. Flow Element Name
  29. User Input Group ID
  30. Name of Slot for which Validation Failed

  31. Branch Encountered: Triggers when the user enters a conditional branch and returns the true or false result of the branch.

  32. Flow Name
  33. Flow Element Name
  34. Branch conditional expression
  35. Branch Options
  36. Branch Selected

  37. Cloud Function Start: Triggers when a user enters a Cloud Function.

  38. Flow Name
  39. Flow Element Name

  40. Cloud Function End: Triggers when a Cloud Function completes.

  41. Flow Name
  42. Flow Element Name
  43. End Reason: Success, Timeout, or Error
  44. Error Message (if ended in error)

  45. NLP Driven Navigation: Triggers when NLP causes a user to navigate to a flow.

  46. NLP Recognizer: Dialogflow, LUIS or Baidu UNIT
  47. Confidence Score
  48. Destination Flow Name
  49. Destination Flow Element Name

  50. NLP Entity Resolution: Triggers when the NLP attempts to recognize entities within an intent.

  51. Flow Name
  52. Flow Element Name
  53. Resolved Slots Name(s)
  54. Unresolved Slots Name(s)

  55. Sentiment Resolved: Triggers when the NLP returns a sentiment score.

  56. Sentiment Score
  57. Sentiment Magnitude

  58. Action Sequence Started: Triggers when a user enters an Action Sequence.

  59. Flow Name
  60. Flow Element Name
  61. Action Sequence Name (same as Flow Element Name)
  62. Clear Slot: Clear Slot Name & Slots Cleared are returned
  63. Set Slot: Set Slot Name & Slots Set are returned
  64. Analytics Event Name

Adobe Analytics

In order to achieve integration with Adobe Analytics, we have documentation to aid your organization’s analytics specialist in getting Stackchat data into your existing Adobe Analytics implementation.

Only one Adobe Analytics configuration is necessary across all your bots (although more may be desirable), as they can be filtered by Bot ID. So you can simply choose that configuration on your bots’ pages under Integrations.

Click the Add Integration button at the upper right of the Integrations page and select Adobe Analytics:

Link Analytics to Bot in Integrations 1

Select the Adobe Analytics button in the popup and then choose your desired Adobe Analytics Cloud Configuration (most users will have just one) and then choose the report suite you want.

Link Analytics to Bot in Integrations 2

The linkage can also be done from the Cloud Configurations page. Find your Adobe Analytics configuration and click Link to Bot at the bottom left in the sidebar.

Link Analytics to Bot in Cloud Configs 1

On the popup, select your desired bot from the list and choose the report suite.

Link Analytics to Bot in Cloud Configs 2