如何获得<topic>标记以在AIML中解决此问题?

时间:2019-11-30 21:00:57

标签: xml artificial-intelligence aiml

对于一个项目,我问了相同的问题,但由于上下文而要求不同的答案。以下代码无法正常工作,我在理解原因时遇到了问题。我认为这是指我的另一个问题,因为它具有相同的模式,但是我认为标记将首先查看下面的两个模式。

<category>
    <pattern>WHAT IS *</pattern>
    <template>
        <think>
            <set name = "topic">
                state<star />
            </set>
        </think>
        <condition name = "topic" value = "beauty">A subjective judgment evoked by an emotional response</condition>
        <condition name = "topic" value = "Bristol">Bristol is a city.</condition>
        <condition name = "topic" value = "London">London is a city.</condition>
        <condition name = "topic" value = "UWE">I do not have an answer for that</condition>
    </template>
</category>
<topic name = "state">
    <category>
        <pattern># WHERE IS IT #</pattern>
        <that>Bristol is a city.</that>
        <template>In the South-West of England</template>
    </category>
    <category>
        <pattern># WHERE IS IT #</pattern>
        <that>London is a city.</that>
        <template>Somewhere east of Bristol</template>
    </category>
</topic>

1 个答案:

答案 0 :(得分:0)

删除句号。 标记中不应使用标点符号。您无需为此使用主题。

<that>Bristol is a city</that>

您实际上可以在不使用如下主题标签的情况下更轻松地完成此操作:

<category>
    <pattern>WHAT IS *</pattern>
    <template>
        <think><set name="it"><star/></set></think>
        <condition name="it">
            <li value="beauty">A subjective judgment evoked by an emotional response.</li>
            <li value="Bristol">Bristol is a city.</li>
            <li value="London">London is a city.</li>
            <li value="UWE">I do not have an answer for that</li>
            <li>I have no idea.</li>
        </condition>
    </template>
</category>

<category>
    <pattern># WHERE IS IT #</pattern>
    <template>
        <condition name="it">
            <li value="beauty">In someone attractive.</li>
            <li value="Bristol">In the South-West of England.</li>
            <li value="London">Somewhere east of Bristol.</li>
            <li value="UWE">I do not have an answer for that</li>
            <li>Where is what?</li>
        </condition>
    </template>
</category>