登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 计算机类 > 软件工程 > 正文

聊天机器人模拟程序的设计与实现毕业论文

 2021-04-21 10:04  

摘 要

随着人工智能日益普及,谷歌,Facebook,微软,亚马逊,苹果等联网公司纷纷推出了自己的智能个人助理和机器人平台。 国内的小米、阿里巴巴等公司也推出了智能音箱、智能客服等产品。 智能人机交互通过拟人互动体验逐渐在智能客服,任务助手,智能家居,智能硬件,交互式聊天等领域发挥重要作用和价值。

聊天机器人涉及到的技术十分广泛,大致可以概括为语音处理,自然语言处理(NLP)以及对话管理(DM)。这些技术中的每一个都是当前AI领域的热门研究课题,各种算法层出不穷。 但是对于评价一款聊天机器人,最核心的还是取决于NLP的技术高度。 目前,开放式聊天机器人技术中使用的大多数技术都采用编码器 - 解码器框架。本文基于seq2seq模型主要实现了一个能够进行单轮问答的聊天机器人,其中涉及的主要工作如下:

(1)对语料库进行中文分词处理。由于中文句子与英语句子不同,中文句子中没有固定的空格分隔符,为了理解它,必须首先进行中文分词。通过分析当前主流的中文分词算法以及中文分词工具,确定了本设计采用jieba中文分词工具,并实现了使用jieba中文分词工具对语料库进行中文分词处理。

(2)词汇转向量。词汇转向量的主要工作实际上就是将中文分词之后的语料库进行切词并统计各个词汇的词频,然后根据词频构建语料库的词典并对每个词编码,最后根据词典中每个词的编码,将语料库的每个语料转化为词编码序列。

(3)基于tensorflow系统实现seq2seq模型。首先通过学习tensorflow提供的方法并基于tensorflow实现seq2seq模型,然后使用序列化之后的语料库作为样本数据对模型进行训练,训练完成的模型可以对输入(问句)进行处理并预测出输出(回答)。

关键字:聊天机器人,自然语言处理,中文分词,tensorflow,seq2seq模型

Abstract

With the increasing popularity of artificial intelligence, Google, Facebook, Microsoft, Amazon, Apple and other networking companies have launched their own smart personal assistant and robot platform. Domestic millet, Alibaba and other companies have also introduced smart speakers, smart customer service and other products. The intelligent human-computer interaction gradually plays an important role and value in the fields of smart customer service, task assistant, smart home, intelligent hardware, interactive chat through anthropomorphic interactive experience.

The technology involved in chat bots is very broad and can be summarized as voice processing, natural language processing (NLP) and dialogue management (DM). Each of these technologies is a hot research topic in the current AI field, and various algorithms emerge one after another. However, the core of the evaluation of a chatbot depends on the technical level of NLP. Currently, most of the techniques used in open chat robot technology use an encoder-decoder framework. Based on the seq2seq model, this article mainly implements a chat robot that can perform a single round of question and answer. The main tasks involved are as follows:

(1) Chinese word segmentation of corpus. Since the Chinese sentence is different from the English sentence, there is no fixed space separator in the Chinese sentence. To understand it, the Chinese word segmentation must be performed first. By analyzing the current mainstream Chinese word segmentation algorithm and the Chinese word segmentation tool, it is determined that the design adopts the Jieba Chinese word segmentation tool, and the use of the jieba Chinese word segmentation tool to process the Chinese word segmentation of the corpus.

(2) vocabulary transfer vector. The main task of the vocabulary transfer vector is actually to cut the word corpora after the Chinese word segmentation and count the word frequency of each vocabulary, then build a corpus dictionary according to word frequency and encode each word, and finally according to the encoding of each word in the dictionary, Each corpus corpora is converted into a word coding sequence.

(3) The seq2seq model is implemented based on the tensorflow system. First, learn the method provided by tensorflow and implement the seq2seq model based on tensorflow, and then use the serialized corpus as the sample data to train the model. The trained model can process the input (question) and predict the output (answer).

Keywords: chatbot, natural language processing, Chinese word segmentation, tensorflow, seq2seq model

目 录

摘要 I

Abstract II

目 录 III

1 绪论 1

1.1背景和研究意义 1

1.2国内外研究现状 1

1.3研究内容 3

1.4本论文的组织结构 4

2 语料库的搜集与预处理 6

2.1 语料库的搜集 6

2.2 中文分词 6

2.2.1 中文分词的技术 6

2.2.2 隐马尔可夫模型(HMM)介绍 6

2.2.3 Viterbi算法 7

2.3 本设计用到的中文分词工具——结巴中文分词 9

2.3.1 jieba中文分词概述 9

2.3.2 jieba中文分词用法 9

2.4 分词实验数据 9

3 词汇转向量 13

3.1 词汇转向量概述 13

3.2 词汇转向量技术实现 13

3.2.1 Token化处理、词编码 13

3.2.2 对话转为向量 14

3.3 对话转向量实验数据 14

4 seq2seq模型 18

4.1 seq2seq模型概述 18

4.2 seq2seq模型核心思想 18

4.3 递归神经网络RNN 19

4.4 解码和编码过程 19

4.5 seq2seq模型实验数据 20

5 聊天机器人的实现 22

5.1 tensorflow接口 22

5.2 构造seq2seq模型 23

5.3 训练seq2seq模型 25

5.4 预测输出 26

6 总结与展望 28

6.1 总结 28

6.2 展望 28

参考文献 31

致谢 33

1 绪论

1.1背景和研究意义

聊天机器人是一种能够与人类进行自然语言模拟对话的程序。通常运行在如PC平台或者移动终端设备平台等软件平台上。

自1995年以来,互联网进入了一个快速增长的轨道,其所包含的信息量已经爆炸性增长。2015年,网页数量超过1万亿,2006年达到2000亿。 传统的谷歌、百度等搜索引擎会根据用户的查询返回一个链接列表,用户逐个的查询链接列表中的文档,为了找到自己期望的信息,这会消耗用户大量的时间和精力。 聊天机器人可以通过分析用户提交的自然语言表达式返回紧凑而准确的答案。并通过与用户进行友好的沟通来进一步了解用户的需求,以获得更准确的答案。 因此,许多大型互联网公司开始尝试使用会话接口来代替传统的UI交互,建立超个性化(hyper-personalized)的用户体验[1][1]

1.2国内外研究现状

1960年前后,外国科学家提出了计算机可以使用自然语言来处理人的问题。1980年左右,自然语言处理领域的问答模型引起了广泛的关注。Turing测试表示,如果计算机能够像人类一样以自然语言进行通信,则可以将其视为人工智能。从那时起,科学家和学者开始探索与语言理解有关的技术,并致力于自然语言问答系统和聊天机器人系统的研究。

在问答系统发展之初,由于计算能力以及知识库有限,因此问答系统初始阶段的实验规模都比较小,这也是问答系统一直被限制在某一特定领域的原因。从1995年开始,虽然信息检索技术以及谷歌百度等搜索引擎公司的商业化运作和计算能力的一直在飞速发展,人们更关注信息检索的发展,然而问答系统的研究并没有得到大的进展。从2005年开始,随着移动互联网的继续发展以及网络知识的快速扩展,移动手机终端可呈现搜索结果的面积受限,同时用户的手机数据流量受限,于是问答系统再次被专家们提出了台面。

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图