代码之家  ›  专栏  ›  技术社区  ›  tm1701

AIML-context-为什么context在所有情况下都没有最高优先级?

  •  1
  • tm1701  · 技术社区  · 7 年前

    使用AIML上下文时(通过<(即>)有些谈话我无法解释。 我原以为一个(那个)环境比其他任何东西都优先。

    下面我首先展示脚本。然后我展示了一些对话。我在回答后面用“/”号标出了不可预料的部分。

    剧本:

    <category><pattern>STEP 1</pattern>
      <template>Step 2</template>
    </category>
    <category><pattern>YES</pattern><that>STEP 2</that>
      <template>step 3</template>
    </category>
    <category><pattern>NO</pattern><that>STEP 2</that>
      <template>step 3</template>
    </category>
    <category><pattern>*</pattern><that>STEP 2</that>
      <template>step 3</template>
    </category>
    <category><pattern>*</pattern><that>STEP 3</that>
      <template>Step 4! and you typed '<star/>'</template>
    </category>
    

    Human : step 1
    Robot : Step 2
    Human : yes
    Robot : step 3
    Human : yes
    Robot : Step 4! and you typed 'yes'
    Human : step 1
    Robot : Step 2
    Human : no
    Robot : step 3
    Human : no
    Robot : So. // ? I expected here step 4
    Human : step 1
    Robot : Step 2
    Human : any
    Robot : any is a name. // ? I expected here step 3
    

    你能解释一下这两种意想不到的谈话流程吗?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Ubercoder    7 年前

    这个 <that> 元素优先于其他模式 . 我不知道您使用的是aimlv1还是v2,但大体上讲有3个级别的模式

    1. 最重要级别=包括下划线通配符(\的模式)
    2. 中层=没有任何通配符的原子模式
    3. 最低级别=包含星号通配符(*)的模式

    您的意外响应是因为有一个优先级更高的ALICE响应。例如,当机器人回答“第三步”而人类回答“不”时,你想要 <pattern>*</pattern><that>STEP 3</that> <pattern>NO</pattern> <pattern>STEP _</pattern> )ALICE的回答将对你的3级分类生效 <图案>*</图案>&书信电报;这>步骤3</这> . 找到ALICE类别最快的方法就是问“否”,然后看看机器人会回答什么。你也可以搜索爱丽丝文件,但这将是非常耗时的。

    [注]

    推荐文章