【问题标题】:How to handle multiple questions within one utterance?如何在一个话语中处理多个问题?
【发布时间】:2019-12-18 09:58:41
【问题描述】:

示例:

User: How old are you and where do you live ?
Alice: I'm 7 months old. I live on earth.

我的尝试:

<category>
    <pattern>WHERE DO YOU LIVE</pattern>
    <template>I live on earth.</template>
</category>

<category>
    <pattern>HOW OLD ARE YOU</pattern>
    <template>I'm 7 months old.</template>
</category>

上面的AIML代码只有我分开问这两个问题才能回复。

【问题讨论】:

    标签: chat chatbot aiml pandorabots


    【解决方案1】:

    通过挖掘AIML syntax,我终于找到了带有&lt;srai&gt;标签的解决方案:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE inline_dtd[
    <!ENTITY nbsp "&#160;">
    ]>
    <aiml version="2.0">
        <category>
            <pattern>WHERE DO YOU LIVE</pattern>
            <template>I live on earth.</template>
        </category>
    
        <category>
            <pattern>HOW OLD ARE YOU</pattern>
            <template>I'm 7 months old.</template>
        </category>
    
        <category>
            <pattern>HOW OLD ARE YOU AND WHERE DO YOU LIVE</pattern>
            <template>
                <srai>HOW OLD ARE YOU</srai>
                &nbsp;
                <srai>WHERE DO YOU LIVE</srai>
            </template>
        </category>
    </aiml>
    

    【讨论】:

      【解决方案2】:

      您也可以使用通配符来改善这一点。现在我们可以回答诸如“你好吗?伦敦在哪里”之类的问题

      <category>
          <pattern>HOW _ AND WHERE *</pattern>
          <template>
              <srai>HOW <star/></srai>
              <srai>WHERE <star index="2"/></srai>
          </template>
      </category>
      

      【讨论】:

        猜你喜欢
        • 2015-05-26
        • 1970-01-01
        • 2015-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-21
        • 1970-01-01
        相关资源
        最近更新 更多