ibm watson_使用IBM Watson Assistant构建AI私人教练-第1部分

ibm watson

隔离区让您感觉到健身房的情绪低落吗? 通过使用IBM旗舰对话型AI平台创建虚拟锻炼顾问,在家中激发动力。 (Quarantine got you feeling the gym rat blues? Get motivated at home by creating a virtual workout advisor with IBM’s flagship conversational AI platform.)

Staying healthy and fit is a critical habit to build (especially in the midst of a global pandemic). Unfortunately, without the amenities of our everyday fitness routines— lavish community gyms, expert personal trainers, even that one buddy who spends way too much time working out— staying in shape can be a struggle for many.

保持健康和健康是养成的重要习惯(尤其是在全球大流行中)。 不幸的是,没有我们的日常健身routines-奢华的社区体育馆,专家私人教练,的设施,甚至一个哥们谁花太多时间工作OUT-保持体形可能是许多的斗争。

But what if you could have 24/7 access to expert-level, on-demand personal training advice, as quickly and easily as sending a text message? Thanks to increasingly sophisticated conversational AI technologies, it’s now possible to build your very own virtual workout advisor in just minutes (even if you have no clue how to code).

但是,如果您可以像发送文本消息一样快速,轻松地获得专家级按需的个人培训建议的24/7全天候服务,该怎么办? 由于日益复杂的对话式AI技术,现在可以在短短几分钟内构建自己的虚拟锻炼顾问(即使您不知道如何编写代码)。

In this tutorial, we’re going to walk through the process of creating an AI personal trainer using IBM’s Watson Assistant. With a graphical user interface and intuitive mechanisms for mapping dialogue flows, Watson Assistant is one of the most accessible conversational AI platforms on the market, whether you’re a tech-savvy programmer or an ordinary gym-goer.

在本教程中,我们将逐步介绍使用IBM的Watson Assistant创建AI私人教练的过程。 凭借图形用户界面和直观的映射对话流程的机制,无论您是精通技术的程序员还是普通的健身爱好者,Watson Assistant都是市场上最易于访问的对话式AI平台之一。

To ensure our bot only gives its users high-quality exercise tips, we’re going to be leveraging the expertise of my friend Stephon Moise, a Florida-based doctor of physical therapy at the helm of WISE Fitness. Stephon has created a repository of home workout advice that will serve as the basis for our bot’s Q&A dialogue flow.

为了确保我们的机器人仅向用户提供高质量的运动技巧,我们将利用我的朋友Stephon Moise的专业知识,他是佛罗里达州WISE Fitness的物理疗法医生。 Stephon已创建了一个家庭锻炼建议存储库,该存储库将成为我们机器人的Q&A对话流程的基础。

Image for post
YouTube channel. YouTube频道

让培训开始! (Let the training begin!)

1.创建一个IBM Cloud帐户。 (1. Create an IBM Cloud account.)

Watson Assistant is one of the many services available on IBM’s public cloud platform, so the first step in creating our chatbot is to sign up and log in.

Watson Assistant是IBM 公共云平台上可用的众多服务之一,因此创建我们的聊天机器人的第一步是注册并登录。

Image for post

2.签出“资源列表”页面。 (2. Check out the Resource List page.)

This tab will eventually show us the various cloud services we’ve provisioned (including Watson Assistant). Click Create Resource in the upper-right corner.

此标签最终将向我们显示我们已配置的各种云服务(包括Watson Assistant)。 单击右上角的创建资源

Image for post

IBM Cloud boasts 170+ products & services, with dozens of data management, AI, and analytics applications, so be sure to check out everything the platform has to offer.

IBM Cloud 以为 170多种产品和服务,以及数十种数据管理,人工智能和分析应用程序,因此请务必检查平台提供的所有内容。

3.设置Watson Assistant实例。 (3. Provision a Watson Assistant instance.)

Search the IBM Cloud Catalog for Watson Assistant, and create an instance free-of-charge with the Lite plan.

在IBM Cloud Catalog中搜索Watson Assistant,并使用Lite计划免费创建一个实例。

Image for post

4.创建您的第一助手。 (4. Create your first assistant.)

You have the ability to create several assistants within a single instance. After creating your first assistant, provide it with a name and an optional description. Finally, click Create Assistant.

您可以在单个实例中创建多个助手。 创建第一个助手后,请为其提供名称和可选描述。 最后,点击创建助手

Image for post

5.添加对话技能。 (5. Add a Dialog skill.)

Assistants interact with users through a collection of behaviors called Skills. Watson Assistant comes with a library of pre-configured skills for a variety of common enterprise uses cases (customer care, for example). In this tutorial, however, we’ll be creating our own.

助手通过一系列称为“ 技能”的行为与用户互动 Watson Assistant随附了针对各种常见企业用例(例如客户服务)的预配置技能库。 但是,在本教程中,我们将创建自己的教程。

To begin designing our bot’s conversational abilities, click Add dialog skill.

要开始设计我们的漫游器的对话能力,请点击添加对话技能

Image for post

Watson Assistant’s dialog skill is comprised of 3 main components:

Watson Assistant的对话技能包括3个主要组成部分:

#Intents: An intent is a collection of similar statements expressed by users, typically representing a desired goal or function. For a retail bot, for example, a customer might be seeking #product-info.

#Intents: 意图是用户表达的类似语句的集合,通常代表所需的目标或功能。 例如,对于零售机器人,客户可能正在寻找#product-info。

@Entities: An entity represents a more specific piece of information in a user request, providing detail and context to the overarching intent (perhaps a particular @product in the retail bot example).

@ 实体 实体代表用户请求中的一条更具体的信息,为总体意图提供详细信息和上下文(在零售机器人示例中,也许是特定的@product)。

Dialog: The dialog element provides a graphical outline of how intents and entities interact, mapping each combination to a customized, automated response.

对话框: 对话框元素提供了意图和实体如何交互的图形轮廓,将每个组合映射到自定义的自动响应。

6.创建您的第一个Intent。 (6. Create your first Intent.)

Most users will begin interacting with your bot the same way they would interact with a human— by greeting them! Click Create intent and give it the name #Greetings.

大多数用户都会通过与您的机器人互动来开始与您的机器人互动,方法是问候他们! 点击创建意图,并为其命名为#Greetings

Image for post

7.向Watson提供一些问候示例。 (7. Provide Watson some example greetings.)

To help our bot recognize what a typical greeting might look like, we’ll give Watson some examples to train on. Provide at least 5 to 7 variations of common greetings.

为了帮助我们的机器人识别出典型的问候语,我们将为Watson提供一些示例进行培训。 提供至少5到7种常见问候语。

Image for post

After analyzing these examples, our bot will not only be able to recognize those specific phrases as #Greetings — thanks to Watson’s core Natural Language Processing capabilities, it will also be able to more readily identify other variations we haven’t trained on.

在分析了这些示例之后,我们的机器人不仅可以将这些特定的短语识别为#Greetings ,这归功于Watson的核心自然语言处理功能,它还可以更容易地识别出我们尚未接受过培训的其他变体。

8.构造您的第一个对话框节点。 (8. Construct your first Dialog node.)

Now that we’ve created our first Intent, let’s integrate it into our bot’s conversational flow by creating a dialog node. Click Dialog on the menu, then click Add Node. Name the node “Greetings,” and under the subheading “If assistant recognizes,” select your #Greetings Intent.

现在我们已经创建了第一个Intent,让我们通过创建一个对话框节点将其集成到我们的bot对话流中。 单击菜单上的对话框 ,然后单击添加节点 。 将节点命名为“ Greetings”,并在“如果助手识别”子标题下,选择您的#Greetings Intent。

Image for post

Under the “Assistant responds” subheading, script some replies to be triggered whenever your bot detects a greeting. It could seem a little too robotic if your workout assistant responded the same way every time, so give your bot a few different greetings to cycle through!

在“助手响应”子标题下,编写脚本,以在您的漫游器检测到问候语时触发一些响应。 如果您的健身助手每次都以相同的方式响应,这似乎有点太机器人化了,因此请给您的机器人一些不同的问候来循环一下!

9.试用您的机器人。 (9. Try out your bot.)

Your customized dialogue updates in real-time, and we can continuously test out our assistant’s conversational capabilities by clicking the Try it button in the upper-right corner. Open up the chat window and say hello!

您自定义的对话会实时更新,我们可以通过单击右上角的“ 尝试”按钮来不断测试助手的对话能力。 打开聊天窗口,打个招呼!

Image for post

You’ll notice that, below your chat entries, Watson displays the #Greetings classification. If Watson does not recognize your greeting’s Intent, however, the entry will be marked as “Irrelevant.”

您会注意到,在您的聊天条目下方,Watson显示了#Greetings分类。 但是,如果Watson无法识别问候语的Intent 则该条目将标记为“ Irrelevant”。

Luckily, we can train Watson to recognize these unfamiliar greetings right here in the chat window. Try entering a greeting that you did not include in your initial list of examples. If Watson fails to correctly classify it, simply click to open up the classification’s drop-down menu in the chat, and select the #Greetings Intent. Watson will now recognize this phrase in future instances!

幸运的是,我们可以在聊天窗口中训练Watson识别这些陌生的问候。 尝试输入您未包含在示例初始列表中的问候语。 如果Watson无法正确分类,只需单击即可在聊天中打开分类的下拉菜单,然后选择#Greetings Intent。 Watson现在将在将来的实例中识别此短语!

Note that after some changes, Watson will need time to train. Watson is still training if the following purple message appears at the top of the chat window. Once this message disappears, the dialog results will reflect your latest edits.

请注意,进行一些更改后,沃森将需要时间进行培训。 如果以下紫色消息出现在聊天窗口的顶部,Watson仍在培训。 该消息消失后​​,对话框结果将反映您的最新编辑。

Image for post

10.添加一些与锻炼相关的意图。 (10. Add some workout-related Intents.)

Now that we’re familiar with how Intents and Dialog nodes work, let’s teach our assistant about fitness! Navigate back to the Intents window, then click Create intent.

既然我们已经熟悉了Intent和Dialog节点的工作原理,那么让我们来告诉我们的助手适应性! 导航回到“意图”窗口,然后单击“ 创建意图”

Image for post

Choose a common exercise topic that users might want to ask your bot about (for example, “How long should I rest between sets?”). As was the case with our #Greetings Intent, you’ll also need to provide Watson with 3–5 examples of how this type of question might vary. Our example question, with a few variations, might look something like this:

选择一个用户可能想向您的机器人询问的常见练习主题(例如,“我应该在两个组之间休息多长时间?”)。 与我们的# 问候意图一样,您还需要向Watson提供3–5个有关此类问题可能如何变化的示例。 我们的示例问题有一些变化,可能看起来像这样:

How long should I rest between sets?

两次休息之间我应该休息多长时间?

Should I rest before doing another execise?

我应该在再次执行前休息吗?

Rest period?

休息时间?

Do I need to rest between each set?

我需要在每组之间休息吗?

Once you’re finished building out your first Intent, go ahead and add a few more (check out the WISE Fitness FAQ Page for a full list of ideas). The more Intents and topics your Workout Advisor is able to recognize, the more useful it will be for your users!

完成第一个Intent的构建后,继续添加其他一些内容(请查看WISE Fitness常见问题解答页面以获取完整的建议列表)。 Workout Advisor能够识别的意图和主题越多,它将对您的用户越有用!

11.为每个新的Intent创建一个Dialog节点。 (11. Create a Dialog node for each new Intent.)

After you’ve created a collection of new workout-related Intents for your bot to advise users on, return to the Dialog page to integrate them into your conversational flow. Follow the same process from when you creating your Greetings dialog— selecting Add node, identifying the desired Intent, and providing a scripted response.

在为机器人创建了与锻炼相关的新意图的集合以向用户提供建议之后,请返回“对话框”页面以将其集成到您的对话流中。 创建“问候语”对话框时,遵循相同的过程-选择“ 添加”节点 ,标识所需的Intent,并提供脚本化的响应。

Image for post

Feel free to pull answers from the WISE Fitness FAQ, or do a bit of research and customize your own answers. The more details your assistant can provide, the better! As you build out each node, continue to test and experiment with your bot in the Try it window, double-checking to ensure that your Q&A’s are working as expected.

随时从WISE Fitness常见问题解答中获取答案,或者进行一些研究并定制您自己的答案。 您的助手可以提供的详细信息越多,越好! 在构建每个节点时,请继续在“ 尝试”窗口中对您的机器人进行测试和试验,并仔细检查以确保您的问答正常运行。

12.在文件夹中组织新的Intent。 (12. Organize your new Intents in a folder.)

By now, your Exercise Advisor is capable of fielding quite a few questions, but your Dialog map is probably looking pretty crowded. As the number of Intents grows, it can become difficult to visualize how a conversation with your bot might flow. Let’s clean things up a bit!

到目前为止,您的Exercise Advisor可以回答很多问题,但是您的“对话”图可能看起来很拥挤。 随着Intent数量的增加,很难形象化地与机器人进行对话。 让我们整理一下!

Click the Add folder button at the top of the Dialog page.

请点击 对话框页面顶部的添加文件夹按钮。

Image for post

After creating the folder and giving it a name (i.e. “General Workout Questions”), move each of your new exercise-related Dialog nodes by clicking the Actions icon (⋮) and selecting Move. Then, click on your folder and select the To Folder option to place your Dialog node inside.

创建文件夹并为其命名后(即“常规锻炼问题”),通过单击“ 动作”图标(⋮)并选择“ 移动 ”,移动与练习相关的每个新Dialog节点。 然后,单击您的文件夹并选择“ 到文件夹”选项 将您的Dialog节点放置在里面。

Now you can easily reveal/hide this group of Intents by clicking on the folder icon. Much better!

现在,您可以通过单击文件夹图标轻松地显示/隐藏这组Intent。 好多了!

13.创建锻炼建议意图。 (13. Create a workout recommendations Intent.)

So far, we’ve learned how to create basic Q&A dialog flows using some pretty straightforward Intents. But what if our conversation gets a little more complex?

到目前为止,我们已经学习了如何使用一些非常简单的Intent创建基本的Q&A对话框流程。 但是,如果我们的对话变得有点复杂怎么办?

Let’s say our user is looking for some personalized workout recommendations. Inherently, this kind of request can’t be answered with a simple Q&A structure. There’s more context that you need to understand— what kind of equipment do they have available? What muscle group are they targeting? Without getting a little more background, your bot won’t be able to offer a high-quality response.

假设我们的用户正在寻找一些个性化的锻炼建议。 从本质上讲,这种请求不能通过简单的问答结构来回答。 还有更多的背景 您需要了解-他们可以使用哪种设备? 他们针对的是什么肌肉群? 如果没有更多的背景知识,您的漫游器将无法提供高质量的响应。

This is where context variables come in. Watson uses context variables to store this kind of situational input (provided by either the user or an external plugin) in order to create a more specific, customized response.

这是 上下文变量 进入的 地方 。Watson使用上下文变量存储这种情况输入(由用户或外部插件提供),以创建更具体的自定义响应。

Before we create our context variables, however, we’ll need to build out the corresponding Intent and Entities. Begin by creating a “workout recommendations” Intent (i.e. #WorkoutRecs). Follow the same process as before, and include a few variations with alternative phrasings.

但是,在创建上下文变量之前,我们需要构建相应的Intent和Entities。 首先创建“锻炼建议”意图(即#WorkoutRecs )。 遵循与以前相同的过程,并包括一些替代措词形式。

Sample utterances of this Intent might include:

此意图的示例话语可能包括:

Can you recommend some exercises?

你能推荐一些练习吗?

What workouts can I do?

我可以做些什么运动?

Any exercise recommendations for a home workout?

有家庭锻炼的运动建议吗?

I need recommendations for my workouts!

我需要一些锻炼建议!

Image for post

14.为肌肉组创建一个实体。 (14. Create an Entity for muscle groups.)

Next, we’ll add an Entity to help further specify the context of our workout recommendations. In this case, we’ll categorize each exercise by the targeted muscle group. For the sake of simplicity, in this tutorial, we’ll only define 2 broad muscle groups (upper and lower body). Feel free to return to this step later on to create additional muscle groups (and other contextual categories like equipment) to help fine-tune your bot’s recommendation engine.

接下来,我们将添加一个实体以帮助进一步指定我们的锻炼建议的上下文。 在这种情况下,我们将根据目标肌肉群对每种运动进行分类。 为了简单起见,在本教程中,我们将仅定义2个广泛的肌肉组(上半身和下半身)。 稍后请随意返回此步骤,以创建其他肌肉组(以及其他上下文类别,如设备),以帮助微调机器人的推荐引擎。

To begin, click Create entity and provide it with the name @musclegroup.

首先,单击创建实体并为其提供名称@musclegroup

Then, name your first @musclegroup value “upper body.” Under the synonyms field, list a series of muscles that would fall into the upper body category (arms, chest, shoulders, etc.). Also include alternative ways that users might phrase the “upper body” category (upper, torso, top half).

然后,将第一个@musclegroup值命名为“ upper body”。 在同义词字段下,列出一系列属于上身类别的肌肉(手臂,胸部,肩膀等)。 还包括用户可以用语“上半身”类别(上半身,上半身,上半身)的其他方式。

Image for post

Once you’re finished listing possible ways a user might request workout recommendations for the “upper body” category, click Add value. Then, repeat this process for the “lower body” value. Provide both muscle names (quads, glutes, calves) and alternative category names (lower, legs, bottom half).

完成列出可能的方式后,用户可能会要求“上身”类别的锻炼建议,然后点击添加值 。 然后,对“下半身”值重复此过程。 提供肌肉名称(四头肌,臀肌,小腿)和替代类别名称(下腿,腿,下半部分)。

15.添加您的锻炼建议对话框节点。 (15. Add your workout recommendations dialog node.)

Navigate back to the Dialog page and click Add node. Under “If assistant recognizes,” select your #WorkoutRecs Intent.

导航回到“对话框”页面,然后单击“ 添加节点” 。 在“如果助理可以识别”下,选择您的#WorkoutRecs目的。

Because we want to differentiate our recommendations based on the desired muscle group, we’ll need to customize this node a little further. Click Customize in the upper right corner of the node, then turn on the Slots and Multiple conditioned responses options.

因为我们要根据所需的肌肉群来区分建议,所以我们需要进一步自定义此节点。 单击节点右上角的“ 自定义” ,然后打开“ 插槽多个条件响应”选项。

Slots give your bot the ability to collect and store user input. In this case, our slot will store our target muscle group.

插槽 使您的漫游器能够收集和存储用户输入。 在这种情况下,我们的广告位将存储我们的目标肌肉群。

Multiple conditioned responses will allow you to use the input you’ve captured in your slots to offer different responses, depending on the context.

多个条件响应 允许您使用从插槽中捕获的输入来提供不同的响应,具体取决于上下文。

Image for post

16.将用户的肌肉群存储为上下文变量。 (16. Store the user’s muscle group as a context variable.)

Remember context variables? We’re now going to use our slot to capture the user’s muscle group input (in the form of an Entity) and store it in one of these variables. Context variables are denoted with the $ prefix.

还记得上下文变量吗? 现在,我们将使用插槽捕获用户的肌肉组输入(以Entity的形式)并将其存储在这些变量之一中 上下文变量用$前缀表示。

Under the Then check for section, fill out the text fields as follows:

在“ 然后检查”部分下,填写文本字段,如下所示:

Check for: @musclegroup

检查: @musclegroup

Save it as: $musclegroup

另存为: $ musclegroup

If not present, ask: What muscle group would you like to work out?

如果不存在,请询问: 您想锻炼哪个肌肉群?

Image for post

Now, the bot should be able to prompt the user for a target muscle group (if not initially provided), then store this information as a context variable for later use in the conversation.

现在,机器人应该能够提示用户输入目标肌肉群(如果最初没有提供),然后将该信息存储为上下文变量,以供以后在对话中使用。

You can see your context variable in action by clicking the Try it window and chatting with your bot. After requesting a workout recommendation for “arms,” click Manage Context in the upper right corner. Your bot has stored this input as $musclegroup = upper body!

您可以通过单击“ 尝试”窗口并与您的漫游器聊天来查看运行中的上下文变量。 请求“手臂”锻炼建议后,单击右上角的“ 管理上下文 ”。 您的机器人已将此输入存储为$ musclegroup =上身!

Image for post

17.为每个肌肉群提供条件React。 (17. Provide conditioned responses for each muscle group.)

Image for post

It’s finally time to script exercise recommendations! Scroll down to the Assistant Responds section of your node and click Add response to bring the total number of potential responses to 2. Then, fill out each field as follows:

终于可以编写运动建议脚本了! 向下滚动到节点的“ 助理响应”部分,然后单击“ 添加响应”以将潜在响应的总数增加到2。然后,按如下所示填写每个字段:

If assistant recognizes: $musclegroup:(upper body)

如果助理认识到: $肌肉群:(上身)

Respond with: For upper body exercises at home, here are a few options you can try: <br/>- Push-Ups (Chest) <br/>- Dips (Triceps) <br/>- Planks (Shoulders)

响应: 在家里进行上半身锻炼时,您可以尝试以下几种选择:<br/>-俯卧撑(胸部)<br/>-浸入(肱三头肌)<br/>-木板(护肩)

AND

If assistant recognizes: $musclegroup:(lower body)

如果助理意识到: $肌肉群:(下半身)

Respond with: For lower body exercises at home, here are a few options you can try: <br/> - Body Weight Squat (Hamstrings/Quads) <br/> - Lunges (Hamstrings/Quads) <br/> - Toe Raises (Calves)

响应: 对于在家中进行下半身运动,您可以尝试以下几种方法:<br/>-体重深蹲(am绳肌/四肢)<br/>-刺鼻(绳am肌/四肢)<br/>-脚趾抬高(小腿)

The <br/> symbol included in the two examples above is what is known as a “break” element in HTML. This particular element allows you to separate your text into sequential lines. There are many other ways you can format your bot’s responses using HTML tags, for example:

上面两个示例中包含的<br/>符号是HTML中的“ break”元素。 此特定元素使您可以将文本分成连续的行。 您还可以使用其他多种方法来使用HTML标签格式化漫游器的响应,例如:

  • <b>Text Here</b> to make your text bold.

    <b>在此处输入文字</ b>以使文字变为粗体。

  • <i>Text Here</i> to make your text italic.

    <i>在此处输入文字</ i>以使文字变为斜体。

  • <a href=“Link Here”>Text Here</a> to insert a hyperlink.

    <a href=“在这里链接”>“在这里文本” </a>以插入超链接。

Feel free to get creative with the look and feel of your bot’s responses— unique formatting can be a great way of injecting a little more personality into the conversation!

随时根据机器人响应的外观和感觉来发挥创意-独特的格式可以是一种在对话中注入更多个性的好方法!

18.创建一个节点以清除上下文。 (18. Create a node to clear our context.)

While testing your bot, one thing you may notice is that context variables are stored for the entire conversation, by default. This can present some issues. For example, if your user asks for upper body workout recommendations, then follows up to ask about recommendations for a different muscle group, your bot will assume they’re still requesting information from the upper body category.

在测试您的漫游器时,您可能会注意到的一件事是,默认情况下,上下文变量是为整个对话存储的。 这可能会带来一些问题。 例如,如果您的用户要求上身锻炼建议,然后跟进有关其他肌肉群的建议,您的机器人将假定他们仍在请求上身类别的信息。

Bot: Hello. How can I help you?

机器人: 你好。 我怎么帮你?

User: Can you provide me with some workout recommendations?

用户: 您能给我一些锻炼建议吗?

Bot: What muscle group would you like to work out?

Bot: 您想锻炼什么肌肉群?

User: Upper body.

用户: 上身。

Bot: For upper body exercises at home, here are a few options you can try…

Bot: 对于在家进行上半身锻炼,您可以尝试以下几种选择…

User: Any recommended exercises for other muscle groups?

用户: 对其他肌肉群有建议的锻炼方法吗?

Bot: For upper body exercises at home, here are a few options you can try…

Bot: 对于在家进行上半身锻炼,您可以尝试以下几种选择…

What the bot should do is make another request for a target muscle group. Because the “upper body” context variable is still being stored, however, the bot is unable to recognize the new scope of this question.

机器人应该做的是再次请求目标肌肉群。 但是,由于仍在存储“上半身”上下文变量,因此漫游器无法识别该问题的新范围。

To address this concern, we’ll construct a Child node to clear our conversation’s context after exercise recommendations are provided.

为了解决此问题,我们将在提供运动建议后构造一个Child节点,以清除对话的上下文。

Click the Actions icon (⋮) on your “Workout Recommendations” node, then click Add child node. Name this new node “Clear Context.” Under “If assistant recognizes,” select your $musclegroup context variable. Then, click the Actions icon (⋮) next to the “Assistant responds” section, and open up the Context Editor.

点击“锻炼建议”节点上的“ 动作”图标(⋮),然后点击添加子节点 。 将此新节点命名为“ Clear Context”。 在“如果助手识别出”下,选择$ musclegroup上下文变量。 然后,单击“助手响应”部分旁边的“ 动作”图标(⋮),然后打开上下文编辑器

Image for post

After the Context Editor is opened, enter the following values into the fields:

打开上下文编辑器后,在字段中输入以下值:

Variable: musclegroup

变量: 肌肉群

Value: null

值: null

This will clear the $musclegroup variable of any stored values once the node is activated.

一旦激活节点,这将清除$ musclegroup变量的所有存储值。

Finally, under “Assistant responds,” add a friendly follow-up message (“Let me know if you have any other questions!”), inviting the user to make additional queries.

最后,在“助手响应”下,添加友好的后续消息(“让我知道您还有其他问题!”),邀请用户进行其他查询。

19.将“锻炼建议”节点连接到子节点。 (19. Connect our Workout Recommendations node to the child node.)

In order to trigger our “Clear Context” actions, we’ll have to connect it to our “Workout Recommendations” node.

为了触发“清除上下文”操作,我们必须将其连接到“锻炼建议”节点。

Click back over to the “Workout Recommendations” node, and scroll down to the bottom. Underneath the “Then assistant should” section, select Jump to from the dropdown menu. Finally, click the “Clear Context” node, and select Respond.

单击回到“锻炼建议”节点,然后向下滚动到底部。 在“然后助手应该”部分的下面,从下拉菜单中选择跳转到 。 最后,单击“清除上下文”节点,然后选择“ 响应”

Image for post

Your bot’s workout recommendation capabilities should be ready to do some heavy lifting! But one last thing…

您的机器人的锻炼推荐功能应该已经准备好进行一些繁重的工作! 但是最后一件事……

20.自定义机器人的欢迎消息。 (20. Customize your bot’s Welcome message.)

The most important rule in building a chatbot? Make sure people know they’re interacting with one. From the very beginning of the conversation, users should know there’s not a human on the other end of the line. This sets reasonable expectations for what sort of questions your bot can answer, and helps users feel you’re being transparent about your use of an automated system.

建立聊天机器人最重要的规则是? 确保人们知道自己正在与人互动。 从对话的一开始,用户就应该知道线路的另一端没有人。 这为您的机器人可以回答什么样的问题设定了合理的期望,并帮助用户感到您对自动化系统的使用感到透明。

Click the Welcome node to begin editing your intro message. Here’s a sample greeting to get you started:

单击“ 欢迎”节点以开始编辑您的介绍性消息。 这是一个入门的示例问候:

Hi there! My name is Flex. I’m a chatbot, and your very own personal workout assistant! I can help answer basic questions about fitness and provide exercise recommendations. What can I do for you today?

嗨,您好! 我叫 Flex。 我是聊天机器人 您自己的私人健身助手! 我可以帮助回答有关健身的基本问题,并提供锻炼建议。 我今天能为你做什么?

Image for post

准备隆隆声! (Ready to Rumble!)

Congrats— your virtual workout advisor should now be ready for the big leagues! Navigate back to the Assistants page to access your bot’s preview link, and give it a spin. The preview URL is publicly accessible, so be sure to share with your most fitness-savvy friends!

恭喜,您的虚拟健身顾问现在应该已经准备好参加大型联赛! 导航回到“ 助手”页面以访问您的机器人的预览链接,并对其进行旋转。 预览URL可公开访问,因此请务必与最精通健身的朋友分享!

Image for post

多走一英里 (Going the Extra Mile)

We’ve added a lot of cool features today, but don’t stop now! There’s plenty of ways you can continue strengthening your bot’s training capabilities. Now that you’ve got a grip on the basics, here are a few ideas for improvements:

今天,我们添加了许多很酷的功能,但现在就不要停止! 有很多方法可以继续增强机器人的培训能力。 现在您已经掌握了基础知识,这里有一些改进的想法:

  • Add an Intent that allows your bot to give motivational tips, and get users pumped to workout!

    添加一个意图,使您的机器人可以提供激励性的提示,并吸引用户进行锻炼!
  • Create more muscle group Entities and provide your users with more targeted workouts.

    创建更多的肌肉组实体,并为您的用户提供更有针对性的锻炼。
  • Enable your bot to suggest common household objects that can be used for equipment while working out at home.

    使您的机器人能够建议在家锻炼时可用于设备的常见家用物品。
  • Expand the scope of your workout suggestions to include cardio exercises, yoga poses, and more!

    扩大您的锻炼建议范围,包括有氧运动,瑜伽姿势等等!
  • Build out an Intent to help advise users on their nutritional habits, depending on their fitness goals.

    建立一个意图,以根据其健身目标为用户提供营养习惯方面的建议。

Get creative with personalizing your virtual workout advisor, and stay tuned for Part 2 of the tutorial, where we’ll integrate our chatbot with Watson Discovery to extract exercise instructions from the WISE Fitness training manual!

通过个性化您的虚拟锻炼顾问 来发挥 创造力,并继续关注 本教程的 第2部分 ,我们将在其中将聊天机器人与 Watson Discovery 集成在一起, 以从 WISE Fitness 培训手册中 提取锻炼说明

Image for post
WISE Fitness for sharing his fitness insights and expertise. WISE Fitness的 Stephon Moise分享了他的健身见解和专业知识。

Enjoy this tutorial? Learn more about Watson Assistant by checking out our collection of Demos, engaging with us on our developer community, or messaging me directly at parker.merritt@ibm.com.

喜欢本教程吗? 通过查看我们的 演示 集合, 开发人员社区中 与我们 互动或直接通过parker.merritt@ibm.com 与我联系来了解有关Watson Assistant的更多信息

Feel free to connect with me on Twitter and LinkedIn, and be sure to check out other AI-focused articles I’ve written:

请随时在 Twitter LinkedIn 上与我联系 ,并确保查看我撰写的其他有关AI的文章:

翻译自: https://medium.com/ibm-dcpe-group/build-an-ai-personal-trainer-with-ibm-watson-assistant-part-1-5bd42c789ae0

ibm watson

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值