【问题标题】:creating AIML for chatbot to ask questions为聊天机器人创建 AIML 以提问
【发布时间】:2012-12-31 12:02:49
【问题描述】:

我正在为 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?

【问题讨论】:

  • 什么是“工作不正常”?你到底有什么问题?

标签: artificial-intelligence chatbot aiml


【解决方案1】:

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

【讨论】:

  • 现在,在 aiml ver=2.0 中有额外的通配符可以帮助解决这个问题。其中之一是^。也许值得将来遇到这个问题的人检查一下。
【解决方案2】:
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;
        }

我想在 txt_gbox 的 Richtextbox 中显示这些标记,但在 while loop programe stop....

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-12
    • 2017-03-05
    • 1970-01-01
    • 1970-01-01
    • 2014-01-29
    • 2017-10-12
    • 1970-01-01
    相关资源
    最近更新 更多