| With the rapid development of computer science and technology,big data technology and data quality continue to improve,artificial intelligence technology is becoming more and more mature.Deep learning is widely used in natural language processing,Chinese word segmentation technology,word vector technology and other fields.At the same time,a large number of intelligent speakers and online customer service enter people’s lives.Chat robot is more and more popular,it also has the big development in future.At the present,this seq2 seq model method is the most common be used deep learning method to build chat robots.However,if the traditional seq2 seq model is directly used to build chat robots,there will always be many problems.Such as unable to carry out multiple rounds of dialogue,often produce meaningless "security reply" problems.Aiming at the problems of traditional seq2 seq model,this paper proposes a new model to solve the common problems of chat robot conversation,which is a new chat robot conversation model based on the combination of attention mechanism,bi-directional long-term and short-term memory network(Bi LSTM),traditional seq2 seq model and beam search algorithm.The generative dialogue model can chat with users in daily life,while the retrieval model can retrieve the user’s message and reply accurately with the sentence with the best similarity.The specific research work is as follows.Firstly,the related technologies of Chinese automatic word segmentation,part of speech tagging and word vector are studied.A simple text method is very difficult to show those similar words,which is easy to form ambiguity.When dealing with a large number of data,the vector dimension is too large.Through automatic word segmentation,the error caused by ambiguity of words can be eliminated to the greatest extent.The language model is used to transform the text information into word vector,so that the word vector contains semantic information.Then,we analyze the problem that the traditional seq2 seq model loses part of its semantics when dealing with long sequence problems,and propose a method that combines attention mechanism with bidirectional long-term and short-term memory network model.The traditional method is using the fix length vector to finish decode and encode.Combined with the attention mechanism,by retaining the intermediate output results of the input sequence of the encoder,the training model is used to selectively learn these inputs,and output sequences are associated with this input sequences when this model outputs,so as solving this problem on losing information on the long text.In the end,it combines beamsearch algorithm to reduce meaningless "safe reply" and make reply more effective and diverse.At the same time,comparing Bi LSTM with LSTM,it is found that Bi LSTM can better predict bidirectional semantics and solve thess problems on losing parts of the information.LSTM can’t encode information from back to front.At the same time,based on the generative reply model,combined with a retrieval reply model,the retrieval reply model is more accurate for university related information reply.The chat robot can simultaneously take into account the functions of daily chat and information acquisition in specific fields.Finally,a chat robot running on We Chat official account was implemented.Connecting the model mentioned in this paper to the wechat public account platform can make the user easy to operate and conform to the usual use habits.We Chat’s official account can only be used for chat and robot related information acquisition and daily chatting. |