• Syn Bot /OSCOVA 快速回复(11)


    Quick Replies

    快速回复,简单说就是小语料知识库。

    具体说有两种,一种是直接文本

    class SmallTalkDialog : Dialog
    {
        public SmallTalkDialog()
        {
            QuickReplies.Add("How are you?","I am going great.");
            QuickReplies.Add("Hi there!", "Well, hello there!");
            //More quick replies...
        }
    }

    另一种,带参回复

    QuickReplies.Add("I like @sys.music.genre", (context, result) =>
    {
        var genre = result.Entities.OfType(Sys.MusicGenre);
        result.SendResponse($"I like {genre} music as well.");
    });

    SIML格式

    <Siml>
      <Dialog Name="SmallTalkDialog" IntentAlias="SmallTalk.Greetings">
        <Intent>
          <Expression>How are you?</Expression>
          <Response>I am doing great!</Response>
        </Intent>
        <Intent>
          <Expression>Hi there</Expression>
          <Response>Well, hello there!</Response>
        </Intent>
      </Dialog>
    </Siml>

    在该例子中,IntentAlias在Dialog上定义了一个通用的名称,因此,在上面的示例代码中,如果任何意图匹配,则对应的响应由名称SmallTalk.Greeting的意图生成。
     
  • 相关阅读:
    坚决不再犯的脑残错误
    2018.8.21提高A&省选组模拟考试
    2018.10.9模拟考试
    fread()快读
    2018.10.6模拟考试
    2018.10.4模拟考试
    2018.8.20提高AB组模拟考试
    2018.8.21提高AB组模拟考试
    2018.8.19提高B组模拟考试
    2018.8.18提高B组模拟试题
  • 原文地址:https://www.cnblogs.com/mrtiny/p/9082620.html
Copyright © 2020-2023  润新知