简单的聊天机器人项目

时间:2010-11-09 01:33:23

标签: open-source artificial-intelligence bots google-talk yahoo-messenger

我想要做的是建立一个简单的机器人,它将存储在数据库中的一组信息发送到我的消息聊天窗口[聊天服务是gTalk,Yahoo和其他常用的聊天产品]此外,它应该能够接受很少有预定义的命令并回复它们。

是否有可用的开源代码?

7 个答案:

答案 0 :(得分:5)

查找AIML(人工智能标记语言),它已经存在了很多年,它的定义非常明确,而且对于简单的东西也很灵活。你也可以使用各种递归模板做相当复杂的事情,结果非常不错(就像哑巴机器人一样)。

有一大堆open sdk projects使用这种标记语言,它会将您的输入模式与存储在您必须使用模板配置的xml文件中的给定回复进行匹配。

几年前,我使用AIML在一个使用AIML存储模式的信使机器人(如果你按照上面的链接有很多API)并使用了incesoft msn bot platform。工作得很好。

希望它有所帮助。

答案 1 :(得分:1)

对于那些试图更复杂的东西,你可以看看NLTK自然语言工具包:

http://www.nltk.org/

基于Python并用于教育,但有相当多的文档和至少几本书(一个是开源的)。

答案 2 :(得分:0)

就不同的聊天网络而言,您可能需要查看Pidgin(http://www.pidgin.im/download/source/),这是一个用C& C编写的跨平台GPLed聊天客户端。 GTK +适用于所有主要的聊天网络。

答案 3 :(得分:0)

你可以考虑找一些人工智能资源 聊天机器人有一个非常好的例子 尝试google verbot 它是用.NET库构建的

答案 4 :(得分:0)

我们在python中很容易扩展,它适用于XMPP / gtalk: http://gbin.github.com/err/

为了让您了解最小的hello世界如下:

from errbot.botplugin import BotPlugin
from errbot.jabberbot import botcmd

class HelloWorld(BotPlugin):
    @botcmd
    def hello(self, mess, args):         # the chatbot will then respond to the command !hello
        """ this command says hello """  # this will be the result of !help hello
        return 'Hello World !'           # this will be the answer

答案 5 :(得分:0)

为此,我一直在使用Github的hubot。当被要求讲一个笑话时,我的机器人讲了一个笑话。 (当然我也有一个我可以问我应该做什么的,它会查找我的工作清单。)

GoGoBot> tell a joke about me
GoGoBot> a joke about Shell...  Let me think about it...
GoGoBot>
I heard a funny one the other day:
Chuck Norris doesn't look both ways before he crosses the street...
he just roundhouses any cars that get too close.

僵尸程序在NodeJS上运行。 api采用正则表达式和回调类似

robot.hear /tell a joke/i, (msg) -> msg.send 'I heard a funny joke...'

module.exports = (robot) ->
  robot.hear /tell (?:a|something) (?:joke|funny)(?: about ([a-z.]+))?/i, (msg) ->
    subject = getSubject msg.match[1], msg.message.user.name
    msg.send 'a joke about ' + subject + '...  Let me think about it...' if subject.length
    tellJoke = ->
      getJoke subject, (err, text) ->
        msg.send "Cannot compute.  #{robot.name} is about to die.\r\n#{err}".replace(/e/ig, '3') if err?
        msg.send "I heard a funny one the other day:\r\n#{text}" unless err?
    setTimeout tellJoke, 5000 * Math.random()

这很容易学习,因为我已经熟悉NodeJS和咖啡脚本。我今天在几个小时内写了两个机器人。

答案 6 :(得分:-1)

IMified可能是一种简单的入门方式,它允许您使用服务器端Web开发工具构建IM聊天机器人以接收消息,并通过发出HTTP请求来发送消息或请求状态。

http://www.imified.com/hosting/

  

IMified基于API的解决方案   创建和托管即时消息   应用程序消除了复杂性   并提供了一个简单的解决方案   构建和部署IM应用程序   在多个公共IM网络上使用   一个API。

API文档在这里: http://www.imified.com/developers/api

  

连接到的应用程序   IMified平台是最简单的   形成一个驻留的动态网页   在任何HTTP服务器上并侦听   传入的消息然后输出一个   响应。您指定端点URL   在你的机器人的设置。开发人员可以   也向用户“推送”消息   通过REST请求用户在场   api打电话到IMified的服务器。

相关问题