arrow_back

Building a Smart Reply model using Agent Assist Console

登录 加入
访问 700 多个实验和课程

Building a Smart Reply model using Agent Assist Console

实验 1 小时 30 分钟 universal_currency_alt 5 个积分 show_chart 入门级
info 此实验可能会提供 AI 工具来支持您学习。
访问 700 多个实验和课程

SCBL092

Agent Assist uses machine learning technology to provide suggestions to your human agents when they are in a conversation with a customer. Suggestions are based on your own uploaded data and therefore can be tailored to your specific business needs. Agent Assist also has multiple features that you can use to provide different types of suggestions and fine tune the suggested content that is provided to your agents. For example, you can configure suggestions using the Smart Reply feature. Each time an end-user asks a question, Agent Assist can provide suggested responses to the human agent.

This lab is a step-by-step approach to upload your data, train a model, and test your Smart Reply results during design-time using the Agent Assist console.

What you will learn

You will learn :

  • How to create a conversation dataset using public transcript data.
  • How to train a Smart Reply model using conversation datasets.
  • How to create a conversation profile.
  • How to test Smart Reply results using the Agent Assist simulator.

Reference Architecture

High Level Architecture

The following diagram shows a high-level architecture of customer onboarding process for agent assist.

Step 1: Prepare data

At this stage, you'll collect recent, relevant and high quality chat conservations (including speaker role and timestamp) which are stored in Google Cloud storage.

Step 2: Setup Dataset

A conversation dataset contains conversation transcript data, and is used to train a Smart Reply model. Smart Reply uses the conversation transcripts to recommend text responses to human agents conversing with an end-user.

Step 3: Train Model

At this stage, a Smart Reply model is being trained for the defined conversation dataset.

a8a2ed7422103a80.png

Step 4: Configuration

A conversation profile configures a set of parameters that control the suggestions made to an agent. These parameters control the suggestions that appear at runtime. Each profile can be configured either for a Conversational Agents or for a human agent for a conversation. If a human agent is in the conversation, you can also configure which category of suggestions are surfaced (for example, FAQ documents or Article Suggestions). You must create a conversation profile in order to create a conversation with an end-user.

Step 5: Integration

At this stage, the integration with client environments is being performed. Both chat integration and Phone integration (gRPC and Telephony) are possible.

Step 6: Feedback Loop

Feedback Loop (FBL) is a process that enables you to understand conversational traffic patterns through flows and pages that helps to quickly identify issues, such as pages with high escalations, no-match events or webhook errors. This step is critical to improve bot's performance.

Prerequisites and Cloud Environment Setup

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.

This Qwiklabs hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.

What you need

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
  • Time to complete the lab.

Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.

Note: If you are using a Pixelbook, open an Incognito window to run this lab.

Activate Cloud Shell

Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.

In the Cloud Console, in the top right toolbar, click the Activate Cloud Shell button.

Cloud Shell icon

Click Continue.

cloudshell_continue.png

It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. For example:

Cloud Shell Terminal

gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.

You can list the active account name with this command:

gcloud auth list

(Output)

Credentialed accounts: - <myaccount>@<mydomain>.com (active)

(Example output)

Credentialed accounts: - google1623327_student@qwiklabs.net

You can list the project ID with this command:

gcloud config list project

(Output)

[core] project = <project_ID>

(Example output)

[core] project = qwiklabs-gcp-44776a13dea667a6

Task 1. Enable APIs

  1. Open Cloud Shell and run the following commands to enable the Dialogflow, Cloud Storage and Data Labeling APIs
gcloud services enable dialogflow.googleapis.com gcloud services enable storage.googleapis.com gcloud services enable datalabeling.googleapis.com

You should see a success message similar to the following.

Operation "operations/acf.p2-433111697035-74541b6c-efc3-4c78-9141-3ac1368621e4" finished successfully.

Task 2. Creating a conversation dataset

In this step, you will create a conversation dataset which will be used for model training. A conversation dataset contains conversation transcript data, and is used to train either a Smart Reply or Summarization custom model. Smart Reply uses the conversation transcripts to recommend text responses to human agents conversing with an end-user.

You will be using a public dataset which is derived from an external source and is stored in a Google Cloud Storage bucket. The data contains task-oriented dialogues touching six domains: "Booking", "Restaurant", "Hotel", "Attraction", "Taxi", and "Train".

  1. Run the following command in Cloud Shell to see the publicly available transcript: (You can see few files for understanding the transcript)
gsutil ls gs://smart_messaging_integration_test_data | sed '1,5!d'

You should see the following output.

gs://smart_messaging_integration_test_data/test_MUL0001_3b6620b2134c902c.json gs://smart_messaging_integration_test_data/test_MUL0001_3b6620b2134c93f2.json gs://smart_messaging_integration_test_data/test_MUL0001_3b6620b2134c9a0f.json gs://smart_messaging_integration_test_data/test_MUL0002_588f4cd535cfb350.json gs://smart_messaging_integration_test_data/test_MUL0002_588f4cd535cfb3fa.json
  1. Go to the Agent Assist Console and select the project.

  2. Click Datasets in the left side panel of the Agent Assist console.

  3. Click + Create button. You should the screen shown below.

  4. Enter all required details:

    • Name: smart-reply-dataset
    • Description: Dataset for training a Smart Reply model
    • Language: Select Language for your dataset [By default - English (United States)]
    • Conversation data: gs://smart_messaging_integration_test_data/*.json
  5. Click Create.

d274583ac30fc4d4.png

After clicking the Create button, the dataset creation will begin. You can monitor the progess by clicking the Status option:

ec1b9999daa3a873.png

Once the conversation dataset is created, you'll see the following screen. Note that it will take 10-15 minutes for the dataset to be created.

3237d2dfe9b8baf9.png

Now, you have successfully created the dataset having 37,314 conversations.

Task 3. Training a Smart Reply Model

In this step, you train a smart reply model for the purpose of deploying it using the Agent Assist Console.

  1. If you are not still in the Agent Assist Console, return to the Agent Assist Console and select the project.

  2. Click Smart reply on the left side of the panel.

  3. Click Create a custom model button.

ff1178cf843fa501.png
  1. Enter smart-reply-model-demo for Display name and then click the Start button.
1b8d01ef08cbc2cf.png
  1. Select the radio button I have an existing Conversation Dataset I would like to use and then select the smart-reply-dataset conversation dataset you created previously. Click Next
ab7624c23b9eafb3.png
  1. Click Begin training as shown in the screenshot below.
9be204a9165f594c.png Model training will start and it can take anywhere between 8-24 hours to complete the training. The following steps are here to describe complete the model deployment process. You will not be able to perform these steps within the lab envrionment due to the training time for the Smart Reply model. a8fd574ccc8a964c.png

Once the model has completed training, click the Deploy Model button to proceed to the next step.

9e402ee7ea40fa88.png

After model deployement, you should evaluate model performance. You can verify accuracy, completeness, compliance, and grammar and spelling. If you are satisfied with the evaluation results, click Next.

Otherwise, return to the data upload process to fix your training data and train a new model.

6fac512f6e09fd4c.png

You also need verify the allowlist for the smart reply model. Click Review allowlist.

The allowlist is a list of potential suggestions that can be surfaced to agents during a conversation. The allowlist contains all possible suggestions generated using the selected conversation dataset.

cbcbe142989e6610.png

To make messages easier to manage, Agent Assist automatically groups messages with similar meaning. You can see a message's similar messages by clicking on the Show (X) similar messages link to the right of the message.

5e026b43391e0965.png

Click on any message and you'll see similar messages as shown below.

2eff614b922bd1d7.png

You can also edit the displayed messages by clicking on the message as shown below.

2aacf50f40f1d8e9.png

After careful observation and as per your business need, you can move the messages to either MOVE TO ALLOWED or MOVE TO BLOCKED

Note: Only allowed messages will be suggested during runtime chat and hence, Allowed messages should have sufficient entries to suggest.

3b6f945567a61ca5.png

Now, once you are done, click on the 3 dots icon on the right side of screen and select + Create profile button.

2f49296455a1983b.png

In this step, you'll create a conversation profile.

A conversation profile configures a set of parameters that control the suggestions made to an agent. These parameters control the suggestions that appear at runtime.

Enter the required information as shown in the below screenshot.

  • Display Name: Any name (for example, conversation-profile-demo)
  • Suggestion type: Tick the Smart reply option
  • Confidence threshold and Max suggestion: Keep by default for now.

(Later, you've to play with these parameters for achieving better results)

78f0fda97ea7f7b9.png

Now, finally go and select this conversation profile in the step 6 config.

Navigate to the Conversation Profile button on the left side of the screen. You'll see Integration ID that would get generated for the same shown in the screenshot below.

3e3c230743299b00.png

Finally, navigate to the Models button to view the trained smart reply model.

2d21fde3f2fab280.png

Congratulations! You have successfully created a Smart reply model.

Conclusion

Congratulations! You have successfully loaded a conversation dataset, and started training a model for Smart Reply using the Agent Assist console.

Further Documentation

Agent Assist Basics

https://cloud.google.com/agent-assist/docs/basics

Train a Smart Reply model & manage allowlists

https://cloud.google.com/agent-assist/docs/model-training

Conversational Agent Basics

https://cloud.google.com/dialogflow/cx/docs/basics

Best practices: Knowledge documents

https://cloud.google.com/agent-assist/docs/knowledge-documents

Agent Assist pricing

https://cloud.google.com/agent-assist/pricing

End your lab

When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2023 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

准备工作

  1. 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
  2. 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
  3. 在屏幕左上角,点击开始实验即可开始

使用无痕浏览模式

  1. 复制系统为实验提供的用户名密码
  2. 在无痕浏览模式下,点击打开控制台

登录控制台

  1. 使用您的实验凭证登录。使用其他凭证可能会导致错误或产生费用。
  2. 接受条款,并跳过恢复资源页面
  3. 除非您已完成此实验或想要重新开始,否则请勿点击结束实验,因为点击后系统会清除您的工作并移除该项目

此内容目前不可用

一旦可用,我们会通过电子邮件告知您

太好了!

一旦可用,我们会通过电子邮件告知您

一次一个实验

确认结束所有现有实验并开始此实验

使用无痕浏览模式运行实验

请使用无痕模式或无痕式浏览器窗口运行此实验。这可以避免您的个人账号与学生账号之间发生冲突,这种冲突可能导致您的个人账号产生额外费用。