十分钟,教你创建自己的聊天机器人

这几天在网络上闲逛发现一个帮助你创建聊天机器人(Chat Robot)的网站。尝试了一下,很有意思呀!

关于人工智能(AI Artificial Intelligence)是我一直感兴趣的领域,但一直未能分出时间系统学习。目前为止,知道的最深入的也只是基于贝叶斯统计算法的专家系统。至于机器学习,还有神经网络哥一点都不懂哈!希望以后能有时间学习并应用。

言归正传。我发现的这个帮助你快速创建在线聊天机器人的网站是 http://www.pandorabots.com  。你在这个网站注册以后就只需要几步就可以创建一个WEB页面上的聊天机器人了。这个网站的机器人技术是基于AIML语言的。前几天写过一篇关于AIML的博文,可以参考下。前期工作来自于自由软件设区 www.alicebot.org。Pandorabots网站上的About介绍里说该网站还在继续语音识别,TTS(语音合成)等方面的研究,不过据我观赛。已经好久都没有更新了喔。

STEP ONE:在pandorabots的首页,找到Sign-up for an Account,按ctrl+F 搜索一下 Sign,就能马上定位到了。点击这个链接就可以注册一个账号了。

STEP TWO:和大多数注册过程一样,填上一些最基本的信息就注册成功。记得勾选上 By checking this box and clicking on the button labeled “Submit Account Request” you are agreeing to the Term Service 复选框。点击 SUBMIT ACCOUT REQUEST.

STEP THREE:接着网站提示: There are no Pandorabots defined yet. You must first create a new  chat robot。点击 create 单词上的链接。

STEP FOUR:  接着是聊天机器人最基本的设定。

Name:      // 这里填上你要创建的机器人的名字。

– automatically discover spaces between words (suggested for Japanese)   // 建议勾选上,因为中文和日文都没有用空格分词。

Startup AIML – Please select the AIML set you wish to include:     // 让你选择你创建的机器人的知识库。不要选最后一个就好!因为最后一个是没有任何知识库~你需要从头开始创建。但如果你喜欢从头开始。那就选最后一个吧。

– Standard AIML – Sept 2001
– Dr Wallace's A.L.I.C.E – March 2002
– Annotated A.L.I.C.E. AIML – September 2003
– Christian Drossmann's standalone German AIML – January 2002
– Sandro Pons' Italian AIML set – April 2001

– No initial content, the pandorabot starts with no knowledge.

点击下面的 Create Chat Robot 按钮,完成创建。

STEP FIVE: 于是你看到了一个界面,上面有各种按钮。你可以一个一个试试看看有什么功能。最重要的就是选 TRAIN 菜单项,你就可以开始训练你的机器人了。在 HUMAN ASK 栏里填上人类要说的话,然后在 SAY INSTEAD前面的框框里填上聊天机器人要回答的话,于是一条规则就创建好了。当然一般情况下会提示匹配到了某条规则,机器人会如何回答,你可以看到当前机器人会如何回答。可以支持中文喔。比如我要教机器人回答“你是学生吗”?

Human: 你是学生吗
Matched:
*   (category defined in star.aiml )
zzz: A deeper algorithm is needed to respond to that correctly. 

zzz是我刚创建的机器人的名字,上面提示当前聊天机器人不知道如何回答。因为基本上没有人用中文教过他。其它他已经对英文回答得相当好了。

那么,我可以教他回答: 我是。 再选择 SAY INSTEAD。

STEP FIVE: 下面我们可以验证下。

在菜单项里找到你的机器人的名字那个菜单项,右上方有个小星号。打开新页面后选择下面的 PUBLISH。然后会有一个链接给你,你点击这个链接。就可以和你的机器人聊天啦。看看我的:

Human: Because you are so stupid                    // 我说因为你好笨呀

zzz: Interesting explanation. Wrong. I am smart.          // 它说:你的解释真有意思,但是错了,我很聪明呢

Human: Are you a robot                                   // 问它你是机器人吗
zzz: How did you know I am a machine?    // 它回答: 你怎么知道我是机器。

Human: what's your name                           // 对英文回答得很好
zzz: My name is zzz.

Human: 你叫什么名字                                        # 不识别其它中文
zzz: I will mention that to my botmaster, . 

Human: 你是学生吗                                           # 这是刚才教他的。
zzz: 我是,我在中山大学读书。

 

是不是很有趣呢? 还可以教他广东话喔。

本博原创,转载请注明出处 http://ykyi.net/2012/06/%E5%8D%81%E5%88%86%E9%92%9F%EF%BC%8C%E6%95%99%E4%BD%A0%E5%88%9B%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E8%81%8A%E5%A4%A9%E6%9C%BA%E5%99%A8%E4%BA%BA/ 谢谢喔

一篇广外女生的外贸论文的中译英.节选.

应一位广外女生的要求,帮她翻译了部分她的论文。好累好累~诸多术语不熟悉~

 

进口配额制(Import Quotas)又称进口限额制。它是直接限制进口的一种重要措施。进口配额制是指一国政府在一定时期内(如一季度、半年或一年内),对某些商品的进口数量或金额规定一个数额加以直接的限制,在规定时限内,配额以内的货物可以进口,超过配额则不准进口,或者征收较高的关税、附加税或罚款后才能进口。
进口配额,又称进口限额。它是发达国家实行进口数量限制的重要手段之一。主要有两大类:(1)绝对配额。
(2)关税配额。 
5.The definition of the import quotas.
Import Quotas, namely Import Limits, which is one of the most important measures to limit import. Import quotas is defined as the direct limitation impossed on some certain
import commodity on import quantity or sum in some periods(e.g. one quarter, one half-year or a whole year). In the limitation period, merchats in limitation range is granted to be imported, otherwise, will be refused or much higher tariffs will be impossed.
There are two kinds of Import Quotas.
1) Absolte Quotas.
2) Tariff Quotas.
 
1. 在进口配额制下管理好使用好配额,扩大出口,增加外汇
在配额制下,进口国对某些商品直接限定数量或金额,在限定范围内,货物才许可进口。因此,对出口国来说,配额用完了就不能扩大出口。即使有的国家允许超配额商品进口,而进口国则要征收高额 关税或罚款,但这种关税非同一般关税,有时甚至高达百分之几百,罚款数额也很大。所以,实际上这种高额关税或罚款起到了禁止进口的作用。
这些配额都是通过谈判达成的双边协定,那么如何在配额制下管理好使用好我国的配额,扩大出口,增加外汇? 
1. Manage the quotas well and make good use of it to expand export and raise foreign-currency(foreign reserves?) under the import quotas system.
Due to the fact that under the import quotas system, importing nations set a ceiling limit of the quantity and sum of the import commodity and import commodity gained the access permission only when the quota limit has not been used out. As for the exporting nations, it is not possible to expand export when no quotas is available. Even though in some nations, excess import happens only on the basis that the importing nation imposes higher tariffs, usually go up to several hundred percent, or levies heavy fines which is also very huge. Actually, it serves as a ban on imports.
 
1.在品种和单价方面做到对我有利,以达到扩大出口,多收外汇的目的。对配额品种首先要选择售价高的高挡商品出口。当然这要求考虑到客户的需要和国内生产的可能,但总体来说,以出口高附加值
商品为主,同时,对于资源原料型和畅销品可适当增加价格出口。
The varieties and unit price should be in our favor in order to expand the export and raise the foreign reserve. High price and high class commodities should be given high priority. The customer demands and the production capacity are surely to take into consideration. Generally speaking, high value added products should take main account of the export, resource-based goods, raw materials, and best-selling goods can be slightly exported more on the meanwhilek.
 
2要努力扩大配额地区的非配额品种出口。如欧盟对纺织品“篮子品种”敏感性较差,尽管协定中规定了我出口比例,但欧盟对它控制较松。这类品种我国约占二、三万吨,过去几年我国往往出口很少,数没有做足,今后应积极扩大出口“篮子品种”。但这类品种成交和出运要保持均衡,避免过分集中,而引起共同体注意和交涉。 
Best effort should be make to expand export of the commodities that are not be limited by import quotas. As a example, though export quotas on "Bastket Species" are specified in trade agreement, the EU is less sensitive to it and the leash has been loosed. This kind of product accout for two or three tons in our country, which has been export a small amout in the past years and it has not been exported enough. We should expand "basket species" export positively. However, balance must be control well to prevent being intensivly centralized which will result in the EU's attention and negotiation.
 
3.要加强对客户的管理。配额品种一般是供不应求的商品,对进口商来说,利润是有保障的。因此,我们可以通过发放出口许可证,签发产地证和装船证书加以控制。
Customer management should be strengthed. In most cases, commodities suffering from quotas are in short supply. As for the importers, profits is well guaranted. So, we could control through taking measures such as releasing export licence, signing certificate of origin and shipment.
 
4.为了履行对外缔结的协定义务,管理好配额品种的出口,各业务部门必须要有一个精确的统计资料。业务部门按时上报的配额使用情况,数字一定要正确。业务部门内部也要加强统计和联系,保证成 交出运数不超过配额数。
4. In order to fullfill well the trade agreement and manage well the quota commodities, every operating deparment must have prcise statistical materials. Opeating department has to report the quota usuage condition in time and the figure accuracy is a must. As inside the operating department, statistics and communications should be enforced to assure the quotas will not be accessed.
 
copyright ykyi.net
 

怎么编译,构建,安装,使用WinKVM

 

WinKVM : Windows kernel-based Virtual Machine

 

WinKVM Windows下台下基于内核的虚拟机(Linux的KVM的windows移植)

 

怎么编译,构建WinKVM

 

这篇方章会告诉你如何编译WinKVM.

你必须先准备好三件东西。

1. 去到http://www.cygwin.com/ 下载安装Cygwin。注意安装时选好gcc-3.x rsync, zlib和awk.

2. 建议用Visual Studio 2008专业版,你也可以使用Visual Studio Express版。

3. Windows DDK, 本文使用The Microsoft® Windows Server™ 2003 Service Pack 1 (SP1) DDK。

必须先下载并安装好这三大件!呃,当然!WinKVM的代码必须下载好了。https://github.com/ddk50/winkvm/

 

在动手编译之前,先设置好好编译环境。添加环境变量BASEDIR2K3,指向你的DDK安装的目录。Visual Studio使用这个环境变量构建驱动程序WinKVM

好吧,动手干活吧!WinKVM的构建过程有一点麻烦。

三样东西必须分开构建。

STEP ONE:

先构建 kvmctldll: cd到vcproj/user/kvmctldll目录,双击kvmctldll.vcproj打开工程,点击build。结束后到vcproj/bin目录下查看有没有kvmctldll.dll文件。如果有,那恭喜你,第一步成功了。

STEP TWO:

使用Cygwin环境编译KVM的原生版本。

cd kvm/kernel  ## 转到kvm/kernel目录。

make           ## 如果你得到:unrecognized emulation mode:elf_i386。不要慌张,这不是一个错误。

make cpobjs   

STEP THREE: 

打开到vcproj/kernel/winkvm.vcproj,编译构建WinKVM驱动。

到vcproj/bin目录下查看有没有成功。如果有生成winkvmstab.sys,则成功了。

STEP FOUR:

最后,要在cygwin环境下构建QEMU。如下:

cd kvm/winkvm-qemu

./configure –prefix=path/to/installation –enable-kvm –target-list=i386-softmmu –disable-kqemu

make

make install

 

 

怎么使用WinKVM

 

必须先申明,在安装好WinKVM以后,你的操作系统可能很不稳定喔!因为WinKVM还只是一个alpha版本。

另外!一定不能在多处理器的系统上运行~如果你的机器是多处理器或者多内核的,必须在启动阶段启用单内核模式。见本文最后怎么进入单内核模式。

先到http://github.com/ddk50/winkvm/downloads下载WinKVM的编译好的二进制驱动并方便方装的相当文件。

然后, 执行下载好的 DIP_gui.exe,这个程序会帮助你安装好WinKVM。点击“…”按钮,再选中winkvmstab.sys驱动文件,最后点击“Install”就开始安装了。安装过程可能会花费一点时间。如果你要卸载驱动的话,同样点击'…'按钮后,再选'Uninstall'。

最后一步,双击"WinKVM.bat"批处理文件执行WinKVM。

 

 

有童鞋问,哥的cpu是多核啊,怎么设置从单核模式启动啊????

 

那本座就告诉你怎么转换到单核模式(single-core mode)启动windows。

1. 按win+r, 输入cmd回车。 (即启动windows的控制台,你可以用其它方式打开windows的控制台)

2. cd c:\

3. attrib -h -r -s boot.ini (这样才能看到c驱动器下的boot.ini文件)

4. 用资源管理器转到c盘根目录,随便用什么文本编辑器参照下面一行编辑boot.ini文件。

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional (onecpumode)" /noexecute=optin /fastdetect /onecpu

5. attrib +h +r +s boot.ini (如果你不怕麻烦再把boot.ini默认的系统属性,隐藏属性,只读属性再加回去吧!)

重启机器,可以进入单核模式啦(single-core mode)!

copyright ykyi.net