Skip to content

UNIT is Baidu's NLP offering. It is specifically used for Simplified Chinese. This documentation focuses on how to integrate DialogFlow with Stackchat. To best understand how to use UNIT itself, visit the Help Center.

Integration Scope

UNIT has many features, but Stackchat's integration with UNIT takes advantage of the following features only:
- intent detection
- entity extraction
- sentiment analysis

UNIT Setup

In order to connect UNIT to Stackchat, you will first need to create a UNIT account and then a new UNIT skill.

Create your UNIT account, navigate to 我的技能 (My Skills) in the top navigation and click 新建技能 (New Skills) to create your first skill.

UNIT Create Skill

*The UNIT skill creation interface.*

This will create a modal, and you will want to select the first option, 对话技能 (Dialogue Skills).

UNIT Create Skill Modal

*The UNIT skill creation interface.*

Give your skill a name that matches your Stackchat bot's name for ease of understanding. You can also add an optional description. Finally click 创建技能 (Create Skills).

UNIT Create Skill Modal Part Two

*The UNIT skill creation interface.*

Once your bot has been created, you can connect your Dialogflow agent to Stackchat using your API Key, Secret Key and Skill ID.

To create the Secret Key and API Key, you will need to add an application in your Baidu Cloud Console. You will only need to create one application regardless of how many UNIT skills you create.

UNIT Create App Part One

*The Baidu Cloud console application creation interface.*

Click 创建应用 (Create an App). Now give your app a name, select its purpose (工具应用, Tool Application, is a good choice for a Stackchat bot), and list of Baidu services to use (UNIT is automatically selected, and you will not need others).

UNIT Create App Part Two

*1. Name 2. Purpose 3. Baidu Services.*

Fill in a description of your use for the app you are creating, and click 立即创建 (Create Now).

UNIT Create App Part Three

*The UNIT skill creation interface.*

You can now return to the app list and copy and paste your API and Secret Keys.

UNIT API and Secret Keys

*Do not share your API and Secret Keys with people outside your organization.*

To find the Skill ID, simply open the skill you created earlier. The Skill ID will be under the name of the skill at the upper left.

UNIT Skill ID

*Each UNIT Skill has this unique identifier.*

Stackchat Setup

Select the bot you wish to add the Cloud Configuration to and select Integrations. Click Add Integration at the upper right and select UNIT from the modal.

Cloud Config Modal

*This modal shows all available Integrations.*

In the dialogue on the right, enter a name for your UNIT configuration, copy and paste the API and Secret Keys from Baidu Cloud Console, and enter your Skill ID from your UNIT Skills page and click Add Integration.

Dialogflow Configuration Modal

*Make sure all keys and IDs are exact matches.*

Your bot is now linked to a UNIT NLP Skill. These steps will need to be repeated for each UNIT skill you wish to use in your bots.

You can now add UNIT intents & entities to your bot.

Sentiment Analysis in UNIT

If you're using our Adobe Analytics Cloud Configuration, you may wish to use sentiment analysis in UNIT so that you can report on your audience's sentiment.

Sentiment analysis allows Natural Language Processing to attempt to determine the user's attitude during interaction with your chatbot, and it is automatically enabled in UNIT. Sentiment analysis data will be able to flow into Adobe Analytics and will appear in your Adobe Analytics Report Suite as Prop 11 (Sentiment Score), Prop 12 (Sentiment Magnitude), and Prop 24 (Sentiment Score Range).