为聊天机器人创建AIML以提问

3
我正在为Program-O聊天机器人创建AIML文件,但遇到了问题。

我想做的是按顺序一个接一个地问问题。此外,问题应该以随机顺序出现。这是对学生进行满意度评估测试,我正在尝试使用聊天机器人代替传统方法进行开发。

这是我考虑中的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?

“is not working well” 是什么意思?你的问题具体是什么? - Hokascha
2个回答

2

使用下划线通配符。在AIML中,有两种通配符——*和_。下划线通配符的优先级高于星号。


现在,在aiml ver=2.0中,有额外的通配符来帮助解决这个问题。其中之一是^。也许对于将来遇到这个问题的任何人都值得一试。 - Marlon van der Linde

-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中显示这些token,它是txt_gbox,但在while循环程序停止...

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接