| Artificial intelligence is the research and development of theories and technologies for simulating and extending human intelligence.As one of the hot spots in the field of artificial intelligence and computer science,chatbot dialogue systems have attracted widespread attention.At present,common chatbots are mainly used in scenarios such as intelligent question and answer,entertainment chat,personal assistant and online customer service,and the application scenarios are very common.The Seq2seq model is a deep learning model,which is mainly used for chatbots to generate dialogues or open-domain dialogue systems such as multi-label text classification.However,this type of chatbot lacks functions such as sentiment analysis and psychological counseling.Therefore,in view of the traditional Seq2 seq Chinese chatbot,this paper proposes a psychological counseling chatbot based on the Seq2 seq model,which provides users with psychological counseling services.It can conduct conversations anytime and anywhere to provide support for psychological growth and has a bright future.The main research work is as follows:This paper mainly uses Python’s Jieba word segmentation technology for text preprocessing,selects the open source psychological counseling question and answer corpus efaqa-corpus-zh as the model training data,and uses the Word2 vec function in the natural language processing tool Gensim module to implement word vectorization.Aiming at the widespread problem of gradient vanishing in traditional recurrent neural network,this paper takes the traditional recurrent neural network improved to grow short-term memory network as the main neural unit.For problems such as invalid responses in the traditional Seq2 seq model question answering,this paper uses the Encoder-Decoder framework and combines the attention mechanism at the decoder output to improve the decoding accuracy.In order to avoid invalid responses to the sentences with the highest probability in the output candidate set during decoding,the Beam Search algorithm is added to the decoder network.Based on the improved Seq2 seq model,this paper uses the Tensor Flow2.0 framework combined with the Keras function to establish a question-and-answer model and a depression index model.After the model is trained,the dialogue and depression index vectors can be obtained.Finally,the depression index is detected through the conversation content to realize the prediction function.Combined with feasibility analysis and overall demand analysis,the main functional modules of the system are designed in detail.By analyzing the experimental results of the traditional Seq2 seq model and the question-and-answer model constructed in this paper,it can be seen that the question and answer of the psychological counseling chatbot proposed in this paper is more suitable for daily conversations,which verifies The validity of the psychological counseling chatbot model proposed in this paper.At the end of the experiment,the Get interface test and the Post interface test were carried out respectively through the interface test tool Postman,and the interface connectivity was verified by the test,which further proved the effectiveness of the system. |