找回密码
 立即注册→加入我们

QQ登录

只需一步,快速开始

搜索
热搜: 下载 VB C 实现 编写
查看: 4047|回复: 3

训练聊天机器人

[复制链接]

307

主题

228

回帖

7341

积分

用户组: 真·技术宅

UID
2
精华
76
威望
291 点
宅币
5591 个
贡献
253 次
宅之契约
0 份
在线时间
948 小时
注册时间
2014-1-25
发表于 2017-10-7 12:02:48 | 显示全部楼层 |阅读模式

欢迎访问技术宅的结界,请注册或者登录吧。

您需要 登录 才可以下载或查看,没有账号?立即注册→加入我们

×
本帖最后由 元始天尊 于 2017-10-7 21:30 编辑

1. 初始化chatterbot
安装python3.x
git clone https://github.com/gunthercox/ChatterBot.git
cd ChatterBot
python setup.py install

2. 编写我们的机器人

  1. from chatterbot import ChatBot
  2. from chatterbot.trainers import ChatterBotCorpusTrainer

  3. # Create a new instance of a ChatBot
  4. bot = ChatBot(
  5.     "Terminal",
  6.     storage_adapter="chatterbot.storage.SQLStorageAdapter",
  7.     input_adapter="chatterbot.input.TerminalAdapter",
  8.     output_adapter="chatterbot.output.TerminalAdapter",
  9.     logic_adapters = [
  10.         "chatterbot.logic.BestMatch", # 最优逻辑匹配
  11.         "chatterbot.logic.MathematicalEvaluation" # 数学计算
  12.     ]
  13. )
  14. bot.set_trainer(ChatterBotCorpusTrainer)

  15. bot.train("chatterbot.corpus.english") # 训练集成库
  16. bot.train("chatterbot.corpus.chinese")
  17. # bot.train("./data/test.yml")

  18. CONVERSATION_ID = bot.storage.create_conversation()

  19. print("Type something to begin...")

  20. # The following loop will execute each time the user enters input
  21. while True:
  22.     try:
  23.         input_statement = bot.input.process_input_statement()
  24.         statement, response = bot.generate_response(input_statement, CONVERSATION_ID)
  25.         bot.output.process_response(response)
  26.     # Press ctrl-c or ctrl-d on the keyboard to exit
  27.     except (KeyboardInterrupt, EOFError, SystemExit):
  28.         break
复制代码


ai.yml Training: [####################] 100%
botprofile.yml Training: [####################] 100%
computers.yml Training: [####################] 100%
conversations.yml Training: [####################] 100%
drugs.yml Training: [####################] 100%
emotion.yml Training: [####################] 100%
food.yml Training: [####################] 100%
gossip.yml Training: [####################] 100%
greetings.yml Training: [####################] 100%
history.yml Training: [####################] 100%
humor.yml Training: [####################] 100%
literature.yml Training: [####################] 100%
money.yml Training: [####################] 100%
movies.yml Training: [####################] 100%
politics.yml Training: [####################] 100%
psychology.yml Training: [####################] 100%
science.yml Training: [####################] 100%
sports.yml Training: [####################] 100%
trivia.yml Training: [####################] 100%
conversations.yml Training: [####################] 100%
greetings.yml Training: [####################] 100%
trivia.yml Training: [####################] 100%
Type something to begin...

3. 测试
Q:how are you
A:Who? Who is but a form following the function of what
Q:Hi
A:How are you doing?
Q:I'm doing well
A:That is good to hear
Q:What is one plus one
A 1 + 1 ) = 2
Q:嗨
A:你好

深度学习领域令人惊艳的成果:
neural-style:利用卷积神经网络将一幅图像的内容与另一幅图像的风格相结合
https://github.com/jcjohnson/neural-style

Nerual Doodles:把 2 位的 Doodle 转成精良的艺术品
https://github.com/alexjc/neural-doodle

srez:通过深度学习极大提高模糊图片的分辨率
https://github.com/david-gpu/srez

Face2Face:实时捕获面部表情,调换到另外一个人的面部
http://www.graphics.stanford.edu/~niessner/thies2016face.html

open_nsfw:成人图片分类器,雅虎出品
https://github.com/yahoo/open_nsfw

DeepLearningFlappyBird:通过 Deep Q-Network 来玩 Flappy Bird,要是你以前被 Flappy Bird 虐过,可以来试试这个。
https://github.com/yenchenlin/DeepLearningFlappyBird

RoCAlphaGo:根据 DeepMind 公开论文,完成的 AlphaGo 复制品
https://github.com/Rochester-NRT/RocAlphaGo

LipNet:利用深度学习的读唇程序
牛津大学 AI 实验室出品,精确度远超常人。在特定测试中,常人精确率是 52.3%,LipNet 达到了 93.4%。
http://www.oxml.co.uk/publicatio ... lingford_LipNet.pdf

Miles Deep:成人视频分类器,精确度达到 95%,借助深度卷积神经网络,Miles Deep 可以快速针对成人视频每秒画面分类。根据性行为分了 6 个分类,精确度达到 95%。借助这个工具,可以自动编辑视频,删掉所有无性接触的场景。和第 5 个雅虎的成人图片分类器不同的是,Miles Deep 能给区分裸体和各种露骨性行为之间的区别。Miles Deep 作者称,这是目前为止,第一个公共色情图片分类或编辑工具。
https://github.com/ryanjay0/miles-deep

图片说明生成模型:这是 Oriol Vinyals et. al.(2016)的论文“Show and Tell: Lessons learned from the 2015 MSCOCO Image Captioning Challenge”的用TensorFlow实现的 image-to-text 图片说明生成模型。Show and Tell 模型是一个学习如何描述图片的深度神经网络。生成的图片说明是一个完整的句子
GitHub 地址:https://github.com/tensorflow/models/tree/master/im2txt

图片标题生成器:循环神经网络(RNN)可以用于给图像取标题。NeuralTalk2 比原始版本的 NeuralTalk 更快而且性能更好。与原来的 NeuralTalk 相比,NeuralTalk2 的实现是批量的,可以使用 Torch 在 GPU上运行,并且支持 CNN 微调。这些都使得语言模型(~100x)的训练速度大大加快,但由于我们还有一个 VGGNet,因此总体上的提升没有很多。但是这仍然是个好模型,可以在 2~3 天里训练好,而且表现出的性能非常好。Google Brain 2016年9月22日发布了 Vinyals et al.(2015)的图说模型(前文介绍的Show and Tell 模型)。它的核心模型与 NeuralTalk2(一个CNN后面跟着RNN)非常相似,但由于 Google 有更好的CNN,加上一些小技巧和更细致的工程,Google 发布的模型应该比 NeuralTalk2 的效果更好。这个项目里用 Torch 实现的代码将作为教育目的保留。
Github 地址:https://github.com/karpathy/neuraltalk2

灰度图像自动上色:Colornet 是一个给灰度图像自动上色的神经网络
https://github.com/pavelgonchar/colornet

根据图像内容生成一个小故事:Neural-storyteller 是一个能够根据图像内容生成一个小故事的循环神经网络。这个 GitHub 库里包含了使用任意图像生成故事的代码,以及用于训练新模型的说明
GitHub 地址:https://github.com/ryankiros/neural-storyteller

生成爵士音乐:这是一个使用 Keras 和 Theano 生成爵士乐的深度学习项目。作者 Ji-Sung Kim 在参加黑客马拉松(hackathon)的36个小时内建成这个模型,它使用两个深度学习库 Keras 和 Theano 生成爵士音乐。具体来说,它构建两层的 LSTM,从跟定的 MIDI 文件中学习,利用深度学习技术生成音乐
https://github.com/jisungk/deepjazz

2D弹球AI:这个项目包含 DQN 3.0 的源代码,DQN 3.0 是一个基于 Lua 的深度增强学习架构,该架构对再现 DeepMind 2015年的 Nature 论文“Human-level control through deep reinforcement learning”是必要的。为了复制 DeepMind 的实验结果
https://github.com/kuz/DeepMind-Atari-Deep-Q-Learner

创作艺术和谱写曲子:Google Brain团队的一组研究人员发布了一个项目Project Magenta,其主要目标是利用机器学习创作艺术和谱写曲子。Project Magenta使用了 TensorFlow系统。研究人员称,机器生成的音乐已经存在了许多年,但它们在都缺乏长的叙事艺术。Project Magenta就试图将故事作为机器生成音乐的重要部分。Google公布了一个DEMO(MP3)表现Magenta项目的成果。
https%3A//github.com/tensorflow/magenta
https://deepmind.com/blog/wavenet-generative-model-raw-audio/

设计字体:
https://erikbern.com/2016/01/21/ ... ep-neural-networks/

小范围的补全照片:
https://bamos.github.io/2016/08/09/deep-completion/




最新进展deeplearninggallery
回复

使用道具 举报

1

主题

14

回帖

15

积分

用户组: 初·技术宅

UID
2735
精华
0
威望
0 点
宅币
0 个
贡献
0 次
宅之契约
0 份
在线时间
6 小时
注册时间
2017-7-28
发表于 2017-10-8 20:27:33 | 显示全部楼层
好东西,顶顶学习一下.
回复 赞! 靠!

使用道具 举报

1

主题

83

回帖

89

积分

用户组: 小·技术宅

UID
3026
精华
0
威望
1 点
宅币
3 个
贡献
0 次
宅之契约
0 份
在线时间
6 小时
注册时间
2017-10-31
发表于 2017-11-5 18:02:53 | 显示全部楼层
果然厉害。学
回复 赞! 靠!

使用道具 举报

0

主题

9

回帖

31

积分

用户组: 初·技术宅

UID
3245
精华
0
威望
2 点
宅币
18 个
贡献
0 次
宅之契约
0 份
在线时间
0 小时
注册时间
2017-12-24
发表于 2017-12-24 02:49:03 | 显示全部楼层
都是大神啊
回复 赞! 靠!

使用道具 举报

QQ|Archiver|小黑屋|技术宅的结界 ( 滇ICP备16008837号 )|网站地图

GMT+8, 2024-4-24 04:08 , Processed in 0.037522 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表