用于创建自然语言软件代理的xml方言

AgentML的Python项目详细描述


Build StatusCoverage StatusCodacy Badge

简而言之,agentml是一种用于创建自然语言的xml方言 软件代理。这是一个受 AIMLRiveScript

用法

为了提供一个简单的例子来说明它是如何工作的,这里有一个演示aml 允许您向“代理”自我介绍的文件

<agentmlversion="0.2"xmlns=""><!-- Hello! --><trigger><pattern>(hello|hi|hiya|good evening|good morning)</pattern><!-- Do we know this person already? --><condition><ifname="first_name"><responsepriority="2"><limitunit="minutes">3</limit><template><random><item>Hi <varname="first_name"/>!</item><item>Hello, <varname="first_name"/>!</item><item>Hello <varname="first_name"/>.</item><item><starformat="capitalize"/><varname="first_name"/>.</item></random></template></response><!-- We just said hello to them! --><templatepriority="1">Hello yet again, <varname="first_name"/>.</template></if></condition><!-- If not, let's ask them their name! --><response><topic>whats your name</topic><template><random><item>Hi! What is your name?</item><item>Hello! What's your name?</item><item>Hiya! Who are you?</item><item><starformat="capitalize"/>! Who is this?</item></random></template></response></trigger><!-- Response to us asking them their name --><topicname="whats your name"><!-- First name only --><trigger><pattern>[my|the] [name is] (_)</pattern><response><varname="first_name"><starformat="title"/></var><topic/><template>Hello, <starformat="title"/>, it's nice to meet you!</template></response></trigger><!-- First and last name (optional) --><triggerpriority="1"><pattern>[my|the] [name is] (_) (_)</pattern><response><varname="last_name"><starindex="2"format="title"/></var><redirect>my name is <star/></redirect></response></trigger></topic></agentml>

下面是上面的实际标记,

[#] Hello!
Hello! Who is this?

[#] My name is Makoto Fujimoto.
Hello, Makoto, it's nice to meet you!

[#] Hi!
Hello Makoto.

[#] Hello!
Hello yet again, Makoto.

在我们的第一条消息中,我们向软件代理介绍自己。 Agentml发现它还不知道我们是谁并问我们 name,然后保存我们的响应数据以供以后使用。当我们打招呼的时候 再一次,软件代理正常地向我们打招呼。

您还可以看到,如果我们重复我们自己,软件代理 我能意识到我们有点无聊,并向我们打了个招呼 更恼火的语气。这是通过限制响应来实现的,并且 是agentml提供的允许您创建 更深入的互动软件代理和聊天机器人。

由于agentml目前仍然是alpha软件,其功能可能 在任何给定的时间进行更改,都没有使用它的完整文档 可用。但是,您可以查看当前的Working Draft 有关软件的更多技术概述。

许可证

The MIT License (MIT)

Copyright (c) 2015 Makoto Fujimoto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

帮助支持代理商的发展!

如果你想帮助代理商进一步发展,请考虑 保证你对帕特伦的支持!https://www.patreon.com/FujiMakoto

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在jetty请求日志中添加milliscond字段?   java在使用Scanner类从文件读取信息时遇到问题   为什么。类不适用于泛型类型?   SQLite插入上的java空指针异常   java能告诉我们Guava缓存是在禁用统计数据的情况下构建的吗?   java在应用程序中使用常量   java无法使用AutoIT和Selenium Webdriver在所需位置/文件夹保存图像   java如何在jtable中更新jprogress栏   java是比较给定日期和当前日期(在给定时区中没有时间段)的最佳方法   安卓代码中的java错误   java无法访问实体类中的字段   java如何在tomcat中处理三个JDBC连接池?   java无法使用Spring Security保护AngularJS页面   如何在没有TCP/IP协议栈的情况下用Java发送以太帧