Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
633 views
in Technique[技术] by (71.8m points)

chatbot - How to use that in AIML

I′m a student from Germany. For my HIWI job at the university I have to program a chatbot in AIML 2.0. This project has already been started by another student and I am now expanding the chatbot. For about a month now, I've been trying to build a continuing conversation around the following question-and-answer scenario. When a user asks the bot "How are you?", the bot responds with "I'm fine. How are you feeling?". with the help of the tag, it now responds to the user's answer. If the user answers with "Fine", then the bot asks if it can help him with the lab. Now the second should actually react. But it does not. I always get the default answer. My question now is: Do I have to work with an index for two consecutive that-tags? Unfortunately I can't find anything about this on the net.

Thank you for your help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is because you are not checking the correct contents of the <that> tag and so the categories are not being activated. Miss out the * wildcard in each of your last 3 categories and it should work. The that tag contains the last sentence the bot said rather than the entire bot output.

An example in English would be:

<category>
    <pattern>HOW ARE YOU</pattern>
    <template>I'm fine. How are you feeling?</template>
</category>

<category>
    <pattern>FINE</pattern>
    <that>HOW ARE YOU FEELING</that>
    <template>Great. Can I help you with the lab?</template>
</category>

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...