https://github.com/chivandikwa/AIMLBot (csharp)

https://github.com/gunthercox/ChatterBot (python)

http://hci.stanford.edu/~winograd/shrdlu/

http://familyshow.codeplex.com/

https://github.com/Microsoft/CNTK/wiki/Setup-CNTK-on-your-machine

https://developer.syn.co.in/tutorial/siml/siml-aiml.html

只需改两个地方(当然,中文词库要自已处理):

1.Settings.xml :

//Settings.xml :
<item name="stripperregex" value="[^\u4e00-\u9fa5|a-zA-Z0-9]"/>

 2.Bot.cs

this.GlobalSettings.addSetting("stripperregex", "[^\u4e00-\u9fa5|a-zA-Z0-9]"); //设置正则表达式

  

加上语音:

using System;
using System.Collections.Generic;
using System.Text;
using AIMLbot;
using System.IO;
using System.Speech.Synthesis; namespace ConsoleBot
{
class Program
{ /// <summary>
/// 涂聚文
/// Geovin Du
/// </summary>
public class CharRoBot
{ const string UserId = "consoleUser";
private Bot AimlBot;
private User myUser;
/// <summary>
///
/// </summary>
public CharRoBot()
{ //------I added this code just coz I love that Light Green Geeky Looking Console ;-)------
//Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.Green;
//---------------------------------------------------------------------------------------- AimlBot = new Bot();
myUser = new User(UserId, AimlBot);
Console.Title = "CharRoBot v1.0 - By Geovin Du (www.dusystem.com)";
Initialize();
} // Loads all the AIML files in the \AIML folder
public void Initialize()
{
string settingsPath = Path.Combine(Environment.CurrentDirectory, Path.Combine("config", "Settings.xml"));
AimlBot.loadSettings(settingsPath);
AimlBot.isAcceptingUserInput = false;
AimlBot.loadAIMLFromFiles();
AimlBot.isAcceptingUserInput = true;
} // Given an input string, finds a response using AIMLbot lib
public String getOutput(String input)
{
Request r = new Request(input, myUser, AimlBot);
Result res = AimlBot.Chat(r);
return (res.Output);
}
} static CharRoBot bot;
/// <summary>
///
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{ //1.第一种
//string settingsPath = Path.Combine(Environment.CurrentDirectory, Path.Combine("config", "Settings.xml"));
//Bot myBot = new Bot();
//myBot.loadSettings(settingsPath);
//User myUser = new User("consoleUser", myBot);
//myBot.isAcceptingUserInput = false;
//myBot.loadAIMLFromFiles();
//myBot.isAcceptingUserInput = true;
//while (true)
//{
// Console.Write("You: ");
// string input = Console.ReadLine();
// if (input.ToLower() == "quit")
// {
// break;
// }
// else
// {
// Request r = new Request(input, myUser, myBot);
// Result res = myBot.Chat(r);
// Console.WriteLine("Bot: " + res.Output);
// //Make the bot Speak
// SpeechSynthesizer synthesizer = new SpeechSynthesizer();
// synthesizer.Volume = 100; // 0...100
// synthesizer.Rate = -2; // -10...10
// var output = res.Output;
// // Synchronous
// synthesizer.Speak(output);
// }
//} //2.第二种
string input = "start";
while (input != "exit")
{ bot = new CharRoBot();
Console.Write("You: ");
input = Console.ReadLine();
var output = bot.getOutput(input); //Console.WriteLine(input);
Console.WriteLine("Bot: " + output); //Make the bot Speak
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
synthesizer.Volume = 100; // 0...100
synthesizer.Rate = -2; // -10...10 // Synchronous
synthesizer.Speak(output); // Asynchronous
// synthesizer.SpeakAsync(output); } }
}
}

  

AIMLBot (中文自动回复)文本自动回复机器人的更多相关文章

  1. 微信的自动回复&接入聊天机器人

    今天偶尔发现了一个有趣的python库--itchat,可以实现微信的自动回复.防撤回,结合图灵机器人还能实现聊天机器人的作用 简单介绍一下配置与工具 win7旗舰版  pycharm  python ...

  2. PHP微信关注自动回复文本消息。

    服务器配置URL默认接受 $_GET["echostr"] 配置成功. public function GetShow(){ $token = $this->token; / ...

  3. 利用人工智能(Magpie开源库)给一段中文的文本内容进行分类打标签

    当下人工智能是真心的火热呀,各种原来传统的业务也都在尝试用人工智能技术来处理,以此来节省人工成本,提高生产效率.既然有这么火的利器,那么我们就先来简单认识下什么是人工智能吧,人工智能是指利用语音识别. ...

  4. [dx11]利用SpriteFont绘制中文--本地化文本

    1.下载DirectX11 Tool Kit SDK,解压后编译,生成DirectXTK.lib库文件和MakeSpriteFont应用工具; 2.在Dx11环境基础上,用生成的库文件搭建XTK环境; ...

  5. Python itchat模块的使用,利用图灵机器人进行微信消息自动回复

    一.下载安装itchat模块 二.小实验:获取微信好友头像信息 这需要用itchat模块中的一个方法 itchat.get_friends()#获取微信所有微信好友信息 现在我们导入itchat,打印 ...

  6. 【chrome插件】web版微信接入图灵机器人API实现自动回复

    小贱鸡自动回复API已经不可以用了,现在改良接入图灵机器人API 360chrome浏览器团队翻译了部分谷歌插件开发文档 地址:http://open.chrome.360.cn/extension_ ...

  7. 自动回复消息-微信公众平台开发4(asp.net)

    接着上一节的processRequest 处理函数,代码如下: /// <summary>    /// 处理微信发来的请求     /// </summary>    /// ...

  8. 微信公众号自动回复 node

    纯属分享记录: app.js var bodyParser = require('body-parser'); require('body-parser-xml')(bodyParser); var ...

  9. Python文本处理——中文标点符号处理

    中文文本中可能出现的标点符号来源比较复杂,通过匹配等手段对他们处理的时候需要格外小心,防止遗漏.以下为在下处理中文标点的时候采用的两种方法,如有更好的工具,请推荐补充. 中文标点集合 比较常见标点有这 ...

随机推荐

  1. 在.NET Core中三种实现“可插拔”AOP编程方式(附源码)

    一看标题肯定会联想到使用动态编织的方式实现AOP编程,不过这不是作者本文讨论的重点. 本文讨论另外三种在netcore中可实现的方式,Filter(过滤器,严格意义上它算是AOP方式),Dynamic ...

  2. 【手记】解决VS发布asp.net项目报错“该项目中不存在目标GatherAllFilesToPublish”及后续问题

    办法在最后. 用VS2017打开一个以前用VS2010写的asp.net项目后,设置好发布选项(发布到文件夹),发布的时候报错如图: 搜索一番,找到的办法是: 在项目文件(xxx.csproj)中,在 ...

  3. Delphi - TDateTimePicker使用注意问题

    TDateTimePicker使用时候,如果想获取到修改后的值,必须注Kind和time属性必须对应! 1,时间设置: treatmentTime1DTPicker.Kind := dtkTime; ...

  4. apache环境之困扰,Rewrite导致无法加载多个不同的.html文件

    又是一个项目,为访问多个纯静态html页面h5游戏页,能够做一些简单分享和跳转即可.原本是一个简单得不能的项目,但是却多生了事端. 我按照apache的惯例,将文件上传到服务器的DocumentRoo ...

  5. Swift 里的指针

     基础知识 指针的内存状态 typed? initiated? ❌ ❌ ✅ ❌ ✅ ✅ 之前分配的内存可能被释放,使得指针指向了未被分配的内存. 有两种方式可以使得指针指向的内存处于Uninitia ...

  6. ubuntu16.04 编译出错:fatal error: SDL/SDL.h: No such file or directory

    在ubuntu 16.04编译神经网络代码时候,遇到了这样一种错误? fatal error: SDL/SDL.h: No such file or directory 原因是SDL库没有安装,根据你 ...

  7. Hexo的next主题安装

    通过Git+Hexo搭建的个人博客地址:https://liangh.top/ 1.使用git克隆最新版本 2.先在themes目录创建一个next文件夹,然后在hexo站点目录下右键打开Git Ba ...

  8. Redis主从和集群

    主从概念 一个master可以拥有多个slave,一个slave又可以拥有多个slave.如此下去,形成了强大的多级服务器集群架构. master用写数据,经统计:网站的读写比率是10:1 通过主从分 ...

  9. Spark SQL读取hive数据时报找不到mysql驱动

    Exception: Caused by: org.datanucleus.exceptions.NucleusException: Attempt to invoke the "BoneC ...

  10. Android并发编程 多线程与锁

    该文章是一个系列文章,是本人在Android开发的漫漫长途上的一点感想和记录,如果能给各位看官带来一丝启发或者帮助,那真是极好的. 前言 前一篇Android并发编程开篇呢,主要是简单介绍一下线程以及 ...