如何让 <topic> 标签在 AIML 中处理这个问题?

How do I get the <topic> tag to work with this question in 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>

去掉句号。 标签中不应使用标点符号。您不需要为此使用主题。

<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>