从 Watson Dialog 文档中,它指示了用于连接 NLC 的配置设置。但是如果没有运行的示例应用程序,很难理解它是如何工作的。大多数可以谷歌搜索的示例都没有此类设置。我试图找到一些示例,这些示例使用“分类器”设置和“意图:{xxxxxx}”设置等中的指示设置。每个文档。如果有人能在这方面提供帮助,那就太好了,非常感谢。
问问题
210 次
1 回答
0
这是一个使用演示 NLC 训练数据的示例。将该文本保存到 CSV 文件中。
创建您的 NLC 服务。服务的名称无关紧要。
创建后,单击“Access Beta Toolkit”。您将需要再次登录,并允许工具包访问 NLC 服务。
单击“上传训练数据”按钮。选择您之前保存的 CSV 文件。如果它有效,您将看到您的意图 + 问题。如果失败,最常见的问题是没有给它一个 csv 文件扩展名。
单击“创建分类器”。名字并不重要。
单击训练数据/分类器以查看它是否已完成编译。可能需要一些时间才能完成。
一旦分类器完成编译,它应该会显示分类器 id值。例子:
3d84bfx43-nlc-10356
将下面的文本复制到 XML 文件。您在哪里看到 CLASSIFIER_ID_GOES_HERE 更改为您的分类器 ID。
<?xml version="1.0" encoding="UTF-8"?> <dialog xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <flow> <folder label="Main"> <output> <prompt selectionType="RANDOM"> <item>Enter your weather related question.</item> </prompt> <getUserInput> <search ref="folder_200143"/> <default> <output> <prompt selectionType="RANDOM"> <item>I couldn't determine what you are asking about.</item> </prompt> </output> </default> </getUserInput> </output> </folder> <folder label="Library"> <folder label="NLC Intents" id="folder_200143"> <input isAutoLearnCandidate="false" isRelatedNodeCandidate="true"> <grammar> <item>conditions</item> </grammar> <output> <prompt selectionType="RANDOM"> <item>I believe you are asking about conditions. </item> </prompt> </output> </input> <input> <grammar> <item>temperature</item> </grammar> <output> <prompt selectionType="RANDOM"> <item>I believe you are asking about temperture. </item> </prompt> </output> </input> </folder> </folder> <folder label="Global"/> <folder label="Concepts"/> </flow> <constants> <var_folder name="Home"/> </constants> <variables> <var_folder name="Home"> <var name="CLASSIFIER_CLASS_0" type="TEXT" description="auto-created"/> <var name="CLASSIFIER_CONF_0" type="TEXT" description="auto-created"/> <var name="CLASSIFIER_CLASS_1" type="TEXT" description="auto-created"/> <var name="CLASSIFIER_CONF_1" type="TEXT" description="auto-created"/> </var_folder> </variables> <settings> <setting name="AUTOLEARN" type="USER">false</setting> <setting name="LANGUAGE" type="USER">en-US</setting> <setting name="RESPONSETIME" type="USER">-2</setting> <setting name="MAXAUTOLEARNITEMS" type="USER">4</setting> <setting name="NUMAUTOSETRELATED" type="USER">0</setting> <setting name="TIMEZONEID" type="USER">Australia/Sydney</setting> <setting name="AUTOSETRELATEDNODEID" type="USER">0</setting> <setting name="INPUTMASKTYPE" type="USER">0</setting> <setting name="CONCEPTMATCHING" type="USER">0</setting> <setting name="DNR_NODE_ID">-15</setting> <setting name="MULTISENT">0</setting> <setting name="USE_CONCEPTS">3</setting> <setting name="ENTITIES_SCOPE">3</setting> <setting name="USER_LOGGING">2</setting> <setting name="USE_TRANSLATIONS">3</setting> <setting name="USE_STOP_WORDS">3</setting> <setting name="USE_SPELLING_CORRECTIONS">3</setting> <setting name="USE_AUTOMATIC_STOPWORDS_DETECTION">0</setting> <setting name="PLATFORM_VERSION">10.1</setting> <setting name="UI_COLOUR"></setting> <setting name="PARENT_ACCOUNT"></setting> <setting name="AL_NONE_LABEL">None of the above</setting> <setting name="CLS_SEARCH_MODE">0</setting> <setting name="CLS_MODEL">0</setting> <setting name="CLS_ENDPOINT"></setting> <setting name="CLS_USERNAME"></setting> <setting name="CLS_PASSWORD"></setting> <setting name="CLS_MODELNAME">CLASSIFIER_ID_GOES_HERE</setting> <setting name="CLS_ADVANCED_SETTINGS">false</setting> <setting name="CLS_MAXNBEST">3</setting> <setting name="CLS_USE_OFFTOPIC">false</setting> <setting name="DEFAULT_DNR_RETURN_POINT_CANDIDATE">-1</setting> </settings> <specialSettings> <specialSetting label="DNR Join Statement"> <variations/> </specialSetting> <specialSetting label="AutoLearn Statement"> <variations/> </specialSetting> </specialSettings> </dialog>
将该文件上传到您的对话服务并进行测试。
于 2016-07-06T07:40:51.413 回答