2017-10-08 34 views
1

我试图让我的机器人根据答案提出问题并回复。这个问题是随机的,以“你好吗?”结尾。在AIML中使用<that>并加* *

<aiml version = "1.0.1" encoding = "UTF-8"> 
    <category> 
     <pattern>HI</pattern> 
     <template> 
      <random> 
       <li>Hi! How are you?</li> 
       <li>Hello there. How are you?</li> 
       <li>Greeings. And how are you?</li> 
      </random> 
     </template> 
    </category> 

    <category> 
     <pattern>GOOD</pattern> 
     <that>* how are you?</that> 
     <template>Happy to hear that.</template> 
    </category> 


    <category> 
     <pattern>*</pattern> 
     <template>Can you rephrase that?</template> 
    </category> 

</aiml> 

如果我回复'好',机器人将不会理解并回复'您能改述吗?'。

+0

你使用这个AIML文件与python代码来传递输入? –

回答

1

尝试从that标记中删除问号。在AIML版本1中,所有模式和'that'标签只能使用星号(*)下划线(_)或大写字母。大写字母更符合实际需求。