如何启用 Watson 对话服务以使用您自己的数据库来满足用户的请求

How to enable Watson conversation service to use your own database for serving user's request

我想构建一个智能搜索代理,它将使用 Watson 对话来处理请求并给出响应,但会使用我自己的数据库,比如 SQL 服务器来搜索所需的输出。

简而言之,我不想手动编写意图和对话或从 csv 文件导入,而是想在 .net 中编写我的获胜代码,以便所有请求和响应都受我自己存储在我的数据中的数据的影响数据库。我只打算使用沃森的处理和解释能力。但必须对我的数据进行处理。

例如,如果用户搜索单词 say "Dog",Watson 会话服务必须在我的数据库中搜索并根据搜索结果为用户提供相关答案。

看看solution architecture in the Watson Conversation documentation. Your database would be one of the depicted backend systems. Your application would be, as you mentioned, written in .NET and would use WCS to process the user input. It would return a response with all the associated metadata. Instead of having complete answers configured in a dialog, you would use something I have described as "replaced markers" in my collection of examples。这些标记是对您的应用程序要执行哪个数据库查询或执行哪个操作的提示。

请注意,WCS 需要一些意图和实体才能处理。如果您只想依赖检测到的意图和实体,则可以使用一个或两个通用对话节点。作为另一种技术,您可以使用数据库中的数据来生成意图和实体作为初始设置。在我的 "Mutating EgoBot" 中,我使用 Watson Conversation API 即时添加意图和实体。

我相信你应该使用标准技巧: 而不是在你的diaglog的节点中定义resposnses,在输出对象上定义一个action节点并让您的应用程序负责提供响应(参见 https://console.bluemix.net/docs/services/conversation/develop-app.html#building-a-client-application