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. 【UWP】使用 Rx 改善 AutoSuggestBox

    在 UWP 中,有一个控件叫 AutoSuggestBox,它的主要成分是一个 TextBox 和 ComboBox.使用它,我们可以做一些根据用户输入来显示相关建议输入的功能,例如百度首页搜索框那种 ...

  2. CPP全面总结(涵盖C++11标准)

    OOP之类和对象 1. this指针的引入 每个成员函数都有一个额外的隐含的形参,这个参数就是this指针,它指向调用对象的地址.默认情况下,this的类型是指向类类型非常量版本的常量指针.可以表示成 ...

  3. 不修改模板的前提下修改VisualState中的某些值

    原文链接:不修改模板的前提下修改VisualState中的某些值 - 超威蓝火 UWP里有一件非常令人不爽的事,大部分控件只提供了Normal状态下的Background,Foreground,Bor ...

  4. sql-向已有数据的表添加约束

    语法: alter table 表名 with nocheck add constraint 约束名 约束类型 具体的约束说明 对表中现有的数据不做检查, 只对添加约束后再录入的数据进行检查. 例子: ...

  5. cad2008 参照面板 在位编辑后无法使用

    有时候在位编辑之后,保存在位编辑了,可是参照面板无法动了,这个时候只要保存一下,然后ctrl+z,就可以解决了..蛮神奇的,我还没想到如何用代码去搞定它..

  6. 深圳scala-meetup-20180902(2)- Future vs Task and ReaderMonad依赖注入

    在对上一次3月份的scala-meetup里我曾分享了关于Future在函数组合中的问题及如何用Monix.Task来替代.具体分析可以查阅这篇博文.在上篇示范里我们使用了Future来实现某种non ...

  7. Android Studio向项目中导入jar包的方法

    第一步: 切换到"Project"视图,找到app --> libs目录 第二步: 将需要导入的jar包粘贴到libs目录中,此时还不能看到jar包中的内容 第三步: 右键点 ...

  8. Android基础-系统架构分析,环境搭建,下载Android Studio,AndroidDevTools,Git使用教程,Github入门,界面设计介绍

    系统架构分析 Android体系结构 安卓结构有四大层,五个部分,Android分四层为: 应用层(Applications),应用框架层(Application Framework),系统运行层(L ...

  9. 本地调用QQ只需要一句代码

    如下图:点击在线客服以后,弹出QQ登录框 经测试,如果已经登录QQ,可能会提示版本不支持该功能,让你升级,但并不一定就是说你QQ版本需要更新,只是因为你QQ已经登录 有的浏览器可能因为出于安全考虑,会 ...

  10. JS应用实例3:定时弹出广告

    在观看视频时候总会发现有广告弹出 这里就做一个类似这样的定时弹出广告的实例: 前面的JS代码和HTML写在同一个文件,实际开发中总是分开来写 用的时候引入即可 HTML代码: <!DOCTYPE ...