我正在为Program-O聊天机器人创建AIML文件并遇到问题。
我想要做的是顺序问问题。而且,问题应该是随机的。这是对学生的满意度评估测试,我正在尝试使用chatbot而不是传统方法进行开发。
这是我想到的AIML格式。
sample.aiml
<category>
<pattern>HELLO<bot/></pattern>
<template>
<random>
<li><warm/>Hello there. Do you want to talk about your campus life?</li>
<li><happy/>Hi. Do you want to talk about your campus life?</li>
<li><happy/>Goodday. Do you want to talk about your campus life?</li>
</random>
</template>
</category>
<category>
<pattern>*</pattern>
<that>HELLO THERE. DO YOU WANT TO TALK ABOUT CAMPUS LIFE</that>
<template>
<random>
<li>How were the classes?</li>
<li>Does the teacher give a clear answer?</li>
<li>Was the teacher come on time?</li>
</random>
</template>
</category>
<category>
<pattern>*</pattern>
<that>HOW WERE THE CLASSES</that>
<template>
<random>
<li>Does the teacher give the full and clear explanation?</li>
<li>What about the material used in the classes?</li>
<li>What do you think about the courses content?</li>
</random>
</template>
</category>
问题是*(星号)通配符与该谓词不兼容。 有没有其他方法来构建符合我要求的AIML?
答案 0 :(得分:2)
使用下划线通配符。在AIML中,有两个通配符 - *和_。下划线通配符的优先级高于星号。
答案 1 :(得分:-1)
string text = System.IO.File.ReadAllText(txt_filename.Text.ToString()).ToString();
int length = (Int32)text.Length;
txt_gbox.Text = length.ToString();
LexicalAnalysis analyzer = new LexicalAnalysis();
while (text !=)
{
text = text.Trim(' ', '\t');
string token = analyzer.GetNextLexicalAtom(ref text);
txt_gbox.Text = token;
}
我想在richtextbox中显示这些令牌,这是txt_gbox但是在while循环程序停止....