【问题标题】:My set tag for aiml does not work我为目标设置的标签不起作用
【发布时间】:2017-08-09 23:37:59
【问题描述】:

我正在尝试在我的目标文件中使用 set 标签,但似乎没有任何效果。它永远不会匹配。

color.aiml 文件

     <?xml version="1.0" encoding="UTF-8"?>
      <aiml version="2.0">
         <category>
           <pattern>IS <set>colors</set> A COLOR</pattern>
           <template>Yes, <star /> is a color.</template>
         </category>

         <category>
           <pattern>IS * A COLOR</pattern>
           <template>No, <star /> is not a color.</template>
         </category>
      </aiml>

colors.set 文件

[["red"],["orange"],["yellow"],["green"],["blue"],["indigo"]]

结果:

Human: Is green a color?
Bot: No, green is not a color.

预期结果:

Human: Is green a color?
Bot: Yes, green is a color.

谁能帮我解决这个问题?

【问题讨论】:

  • 如果你有兴趣,我可以帮助你用 AIML + Python 做同样的事情

标签: tags set aiml


【解决方案1】:

我尝试了以下更改的相同示例

在“sets文件夹下添加了“colors.txt文件,其值类似于

红色

绿色

蓝色

绿色

【讨论】:

    【解决方案2】:

    您的 AIML 代码和设置均正确。我在 Pandorabots 上测试过,效果很好。这似乎是您使用的任何解释器的问题,或者,您可能有一个类别在您的 AIML 的其他部分中覆盖了这个类别。

    【讨论】:

      猜你喜欢
      • 2016-06-21
      • 1970-01-01
      • 2016-12-14
      • 1970-01-01
      • 1970-01-01
      • 2021-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多