你知道机器人的自由,也提供免费的托管 问题跟踪 用于自己的网站或移动应用程序?
FAQ : How to use pattern or wildcard responses

RE: How to use pattern or wildcard responses

通过 admin 发布 Nov 23 2016, 9:25

The issue you where browsing your bot's "conversations" logs and click on the button to "correct" the bot's response. This enters a new response to the "question" that the bot was asked. In this case the "question" is "hockey", so you are entering a "response" to "hockey".

Your issue is you are trying to enter a "question and response", just enter the "response".
i.e. "I love hockey, it is the best sport."

To create a new question and response click on the "Add New Response" link, or the green + when browsing "new responses". Then paste the pattern into the question field, and the response into the response field.

Please review this how 2 on how to on how to train your bot,

https://www.botlibre.com/forum-post?id=483549

The sample code from the forum post you mentioned was for a "response list" file, that you could import. It was an example of a question and response, not an example of a response.

In general you do not need to use patterns, as just entering "hockey" would match the question "hockey" and other similar questions. You could also add "hockey" as a keyword to the response to match any question with "hockey" in it (that did not have a closer match).

Note that the Pattern("* hockey *") will not match "hockey" as * requires a word, i.e. it would match "do you like hockey eh?".

To match anything with "hockey" as a pattern use Pattern("^ hockey ^"), ^ matches any words or empty space. The pattern rules are from the AIML standard.

I changed your bot's response to use Pattern("^ hockey ^"), and it is now responding to "hockey".


Id: 14732434
发布: Nov 23 2016, 9:25
更新: Nov 23 2016, 9:29
答复: 0
的风景: 3758, 今天: 1, 周: 1, 一个月: 6
2 1 4.0/5