Emotion recognition method and device based on user session analysis

文档序号:830126 发布日期:2021-03-30 浏览:5次 中文

阅读说明:本技术 一种基于用户会话分析的情绪识别方法和装置 (Emotion recognition method and device based on user session analysis ) 是由 杨菁 张全 盛妍 田诺 刘鲲鹏 马宏杰 宫立华 张明杰 朱龙珠 徐青 金鹏 赵 于 2020-12-14 设计创作,主要内容包括:本发明公开了一种基于用户会话分析的情绪识别方法和装置,属于情绪识别技术领域。本发明提出了一种基于用户会话分析的情绪识别方法,该方法创造性的通过对用户反馈的历史记录进行整理和分词处理,对用户的反馈内容进行剖析,同时还设计有用户情绪识别模型,可以用于对用户的反馈记录的进行识别和分析,辅助客服判断用户的情绪,进而有助于客服对用户做出合适的反馈,能够提供更好的客服服务,同时还提出了与一种基于用户会话分析的情绪识别方法相匹配的一种基于用户会话分析的情绪识别装置,有效解决了在线客服的用户情绪识别问题,及时掌控用户情绪,辅助在线人工客服或者是人工智能客服更好的为用户服务。(The invention discloses an emotion recognition method and device based on user session analysis, and belongs to the technical field of emotion recognition. The invention provides an emotion recognition method based on user session analysis, which creatively analyzes the feedback content of a user by arranging and segmenting the historical records fed back by the user, is also provided with a user emotion recognition model which can be used for recognizing and analyzing the feedback records of the user to assist a customer service in judging the emotion of the user, further is beneficial to the customer service to make proper feedback to the user, can provide better customer service, and simultaneously provides an emotion recognition device based on user session analysis matched with the emotion recognition method based on user session analysis.)

1. A emotion recognition method based on user session analysis is characterized by comprising the following steps:

s1, acquiring text records of online questions and answers in real time in the process of the user and manual online customer service or artificial intelligent customer service conversation;

s2, performing word segmentation on the text records of the online question and answer, and setting stop words by using a Jieba word segmentation tool;

s3, labeling the emotion of the user, and constructing a target variable, wherein the negative emotion is 1, and the others are 0;

s4, processing the target variable to construct a target variable structure of the recheck deep learning LSTM algorithm;

s5, constructing a word index, setting the maximum MAX _ NB _ WORDS, and constructing the word index by using the Tokenizer of Keras;

s6, after the word index is constructed, converting the user session into a word vector matrix;

s7, expanding the word vector matrix of the user session into a uniform length to make the word vector matrix conform to the standard format of input data of deep learning LSTM;

s8, dividing the text records subjected to word segmentation processing in the S2 into a patrol inspection set test set;

s9, carrying out user emotion recognition model training by using an LSTM algorithm, and recognizing the emotion of the user;

and S10, the user emotion recognition model feeds back the user emotion recognition result to the online customer service or the intelligent customer service, and emotion recognition work based on user session analysis is completed.

2. The emotion recognition method based on user session analysis of claim 1, wherein: the training of the user emotion recognition model mentioned in S9 specifically includes:

a1, training an Embedding layer, setting parameters of the Embedding layer, and outputting samples, sequence _ length and Embedding _ dimension three-dimensional floating point tensors;

a2, three-layer LSTM layer training;

a3, Dense layer training.

3. An emotion recognition apparatus based on user session analysis, characterized in that: the system comprises a user group (1), a customer service team (2) and an emotion recognition model (3), wherein the user group (1), the customer service team (2) and the emotion recognition model (3) are all connected to a computer processing device (4); a user session text acquisition module (5) is arranged between the user group (1) and the computer processing equipment (4), and a user feedback module (11) is arranged between the computer processing equipment (4) and the customer service team (2); a conversation text word segmentation module (6) is arranged between the computer processing equipment (4) and the emotion recognition model (3), a user emotion recognition model calling module (7) is arranged between the emotion recognition model (3) and the computer processing equipment (4), and a user emotion feedback module (8) is arranged between the computer processing equipment (4) and the customer service team (2); a customer service feedback editing module (9) is arranged between the customer service team (2) and the computer processing equipment (4), and a customer service feedback module (10) is arranged between the computer processing equipment (4) and the user group (1).

4. An emotion recognition apparatus based on user session analysis according to claim 3, wherein:

the user session text acquisition module (5) is used for acquiring a user session text;

the conversation text word segmentation module (6) is used for segmenting the conversation text of the customer service and the user;

the user emotion recognition model calling module (7) is used for calling the user emotion recognition model (3) to recognize the emotion of the user;

the user emotion feedback module (8) is used for feeding back the emotion recognition result of the user emotion recognition model (3) to the online customer service or the intelligent customer service;

the customer service feedback editing module (9) is used for editing a proper utterance to reply to the user according to the emotion recognition result of the user;

and the customer service feedback module (10) is used for feeding back the reply words of the customer service to the user group.

Technical Field

The invention relates to the technical field of emotion recognition, in particular to an emotion recognition method and device based on user session analysis.

Background

Along with the rapid development of artificial intelligence and the breakthrough of technologies such as machine learning, natural language processing and the like, more and more commercial and service websites open intelligent question-answering robots and provide real-time, automatic and convenient online question-answering services for users; emotion recognition is used as a basis of human-computer interaction, and enables a machine to understand the perceptual thinking of a human, and becomes a key factor of human-computer interaction.

An online customer service, also called as an online foreground, is a page communication technology which takes a website as a medium and provides instant communication for internet visitors and employees in the website; the online customer service is the basis of online service, in the process of the online service, emotion recognition of a user is added, emotion and emotion of the user are comprehensively considered, online service can be better provided for the user, and in order to achieve the purpose, an emotion recognition method and device based on user session analysis are provided.

Disclosure of Invention

The invention aims to solve the problem of user emotion recognition of online customer service, timely master the emotion of a user, assist online artificial customer service or artificial intelligence customer service to better serve the user, and provide an emotion recognition method and device based on user session analysis.

In order to achieve the purpose, the invention adopts the following technical scheme:

a emotion recognition method based on user session analysis comprises the following steps:

s1, acquiring text records of online questions and answers in real time in the process of the user and manual online customer service or artificial intelligent customer service conversation;

s2, performing word segmentation on the text records of the online question and answer, and setting stop words by using a Jieba word segmentation tool;

s3, labeling the emotion of the user, and constructing a target variable, wherein the negative emotion is 1, and the others are 0;

s4, processing the target variable to construct a target variable structure of the recheck deep learning LSTM algorithm;

s5, constructing a word index, setting the maximum MAX _ NB _ WORDS, and constructing the word index by using the Tokenizer of Keras;

s6, after the word index is constructed, converting the user session into a word vector matrix;

s7, expanding the word vector matrix of the user session into a uniform length to make the word vector matrix conform to the standard format of input data of deep learning LSTM;

s8, dividing the text records subjected to word segmentation processing in the S2 into a patrol inspection set test set;

s9, carrying out user emotion recognition model training by using an LSTM algorithm, and recognizing the emotion of the user;

and S10, the user emotion recognition model feeds back the user emotion recognition result to the online customer service or the intelligent customer service, and emotion recognition work based on user session analysis is completed.

Preferably, the training of the user emotion recognition model mentioned in S9 specifically includes:

a1, training an Embedding layer, setting parameters of the Embedding layer, and outputting samples, sequence _ length and Embedding _ dimension three-dimensional floating point tensors;

a2, three-layer LSTM layer training;

a3, Dense layer training.

An emotion recognition device based on user session analysis comprises a user group, a customer service team and an emotion recognition model, wherein the user group, the customer service team and the emotion recognition model are all connected to computer processing equipment; a user session text acquisition module is arranged between the user group and the computer processing equipment, and a user feedback module is arranged between the computer processing equipment and the customer service team; a conversation text word segmentation module is arranged between the computer processing equipment and the emotion recognition model, a user emotion recognition model calling module is arranged between the emotion recognition model and the computer processing equipment, and a user emotion feedback module is arranged between the computer processing equipment and the customer service team; and a customer service feedback editing module is arranged between the customer service team and the computer processing equipment, and a customer service feedback module is arranged between the computer processing equipment and the user group.

Preferably, the user session text acquisition module is configured to acquire a user session text;

the conversation text word segmentation module is used for segmenting the conversation text of the customer service and the user;

the user emotion recognition model calling module is used for calling the user emotion recognition model to recognize the emotion of the user;

the user emotion feedback module is used for feeding back the emotion recognition result of the user emotion recognition model to the online customer service or the intelligent customer service;

the customer service feedback editing module is used for editing a proper utterance to reply to the user according to the emotion recognition result of the user;

and the customer service feedback module is used for feeding back the reply words of the customer service to the user group.

Compared with the prior art, the invention provides the emotion recognition method and device based on the user session analysis, and the method and device have the following beneficial effects:

(1) the invention provides an emotion recognition method based on user session analysis, which creatively analyzes the feedback content of a user by sorting and word segmentation processing on historical records fed back by the user, and is also provided with a user emotion recognition model which can be used for recognizing and analyzing the feedback records of the user, assisting a customer service in judging the emotion of the user, further helping the customer service to make proper feedback to the user and providing better customer service.

(2) The invention also provides an emotion recognition device based on user session analysis, which is matched with an emotion recognition method based on user session analysis, when in use, the computer processing equipment acquires feedback information of a user group through a user session text acquisition module, on one hand, the computer processing equipment directly transmits the feedback information of the user group to a customer service team through a user feedback module, on the other hand, the computer processing equipment transmits the feedback information to an emotion recognition model through a session text word segmentation module, the computer processing equipment calls the emotion recognition model through a user emotion recognition model calling module to recognize emotion of the user group, then the computer processing equipment feeds back the recognition result to an online customer service or an intelligent customer service through the user emotion feedback module, the customer service team makes appropriate answer and feedback to the emotion result of the user according to the direct customer service feedback information and the emotion recognition model, the system can assist manual online customer service or online intelligent customer service to provide customer service better.

(3) The invention relates to prediction of user feedback emotion, in particular to the prediction of the user feedback emotion, which takes a user feedback conversation as an input variable and can assist manual online customer service or online intelligent customer service to better provide customer service.

Drawings

FIG. 1 is a schematic flow chart of a method for emotion recognition based on user session analysis according to the present invention;

fig. 2 is a schematic structural diagram of an emotion recognition apparatus based on user session analysis according to the present invention;

FIG. 3 is an overall schematic diagram of emotion recognition model training of the emotion recognition method based on user session analysis according to the present invention.

Description of the figure numbers:

1. a user group; 2. a customer service team; 3. a mood recognition model; 4. a computer processing device; 5. a user session text acquisition module; 6. a conversation text word segmentation module; 7. a user emotion recognition model calling module; 8. a user emotion feedback module; 9. a customer service feedback editing module; 10. a customer service feedback module; 11. and a user feedback module.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.

In the description of the present invention, it is to be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, are merely for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention.

Example 1:

referring to fig. 1, a emotion recognition method based on user session analysis includes the following steps:

s1, acquiring text records of online questions and answers in real time in the process of the user and manual online customer service or artificial intelligent customer service conversation;

s2, performing word segmentation on the text records of the online question and answer, and setting stop words by using a Jieba word segmentation tool;

s3, labeling the emotion of the user, and constructing a target variable, wherein the negative emotion is 1, and the others are 0;

s4, processing the target variable to construct a target variable structure of the recheck deep learning LSTM algorithm;

s5, constructing a word index, setting the maximum MAX _ NB _ WORDS, and constructing the word index by using the Tokenizer of Keras;

s6, after the word index is constructed, converting the user session into a word vector matrix;

s7, expanding the word vector matrix of the user session into a uniform length to make the word vector matrix conform to the standard format of input data of deep learning LSTM;

s8, dividing the text records subjected to word segmentation processing in the S2 into a patrol inspection set test set;

s9, carrying out user emotion recognition model training by using an LSTM algorithm, and recognizing the emotion of the user;

and S10, the user emotion recognition model feeds back the user emotion recognition result to the online customer service or the intelligent customer service, and emotion recognition work based on user session analysis is completed.

The training of the user emotion recognition model mentioned in S9 specifically includes:

a1, training an Embedding layer, setting parameters of the Embedding layer, and outputting samples, sequence _ length and Embedding _ dimension three-dimensional floating point tensors;

a2, three-layer LSTM layer training;

a3, Dense layer training.

The invention provides an emotion recognition method based on user session analysis, which creatively analyzes the feedback content of a user by sorting and word segmentation processing on historical records fed back by the user, and is also provided with a user emotion recognition model which can be used for recognizing and analyzing the feedback records of the user, assisting a customer service in judging the emotion of the user, further helping the customer service to make proper feedback to the user and providing better customer service.

Example 2:

referring to fig. 2, the embodiment 1 is different from the above embodiments;

an emotion recognition device based on user session analysis comprises a user group 1, a customer service team 2 and an emotion recognition model 3, wherein the user group 1, the customer service team 2 and the emotion recognition model 3 are all connected to a computer processing device 4; a user session text acquisition module 5 is arranged between the user group 1 and the computer processing equipment 4, and a user feedback module 11 is arranged between the computer processing equipment 4 and the customer service team 2; a conversation text word segmentation module 6 is arranged between the computer processing equipment 4 and the emotion recognition model 3, a user emotion recognition model calling module 7 is arranged between the emotion recognition model 3 and the computer processing equipment 4, and a user emotion feedback module 8 is arranged between the computer processing equipment 4 and the customer service team 2; a customer service feedback editing module 9 is arranged between the customer service team 2 and the computer processing equipment 4, and a customer service feedback module 10 is arranged between the computer processing equipment 4 and the user group 1.

A user session text acquisition module 5, configured to acquire a user session text;

the conversation text word segmentation module 6 is used for segmenting the conversation text of the customer service and the user;

the user emotion recognition model calling module 7 is used for calling the user emotion recognition model 3 to recognize the emotion of the user;

the user emotion feedback module 8 is used for feeding back the emotion recognition result of the user emotion recognition model 3 to the online customer service or the intelligent customer service;

the customer service feedback editing module 9 is used for editing proper words to reply to the user according to the emotion recognition result of the user;

and the customer service feedback module 10 is used for feeding back the reply words of the customer service to the user group.

The invention also provides an emotion recognition device based on user session analysis, which is matched with an emotion recognition method based on user session analysis, when in use, the computer processing equipment 4 acquires feedback information of the user group 1 through the user session text acquisition module 5, the computer processing equipment 4 directly transmits the feedback information of the user group 1 to the customer service team 2 through the user feedback module 11 on one hand, and transmits the feedback information to the emotion recognition model 3 through the session text participle module 6 on the other hand, the computer processing equipment 4 calls the emotion recognition model 3 to recognize the emotion of the user group 1 through the user emotion recognition model calling module 7, and then the computer processing equipment 4 feeds back the recognition result to the online customer service or the intelligent customer service through the user emotion feedback module 8, and the customer service team 2 makes proper answer and feedback to the emotion result of the user according to the direct customer service feedback information and the emotion recognition model 3 The system can assist manual online customer service or online intelligent customer service to provide customer service better.

Example 3:

referring to fig. 3, the basic difference between the embodiments 1 and 2 is that:

the method also comprises the following specific identification methods:

(1) data preparation

Sorting the online feedback history records of the user, carrying out emotion marking, marking the negative emotion as 1 and marking the non-negative emotion as 0, carrying out word segmentation on the feedback of the user, and using the ending word segmentation to work, wherein the following specific examples are as follows:

1 → some functions of the new version update can not be found with poor experience

1 → this question I has fed back five days without receiving a reply

0 → resource map is good to use efficiently

(2) LSTM model

1) Target variable processing

Processing label into matrix type using python

array([[0.,1.],

[0.,1.],

[0.,1.],

...,

[1.,0.],

[1.,0.],

[1.,0.]])

2) User feedback processing

2.1) constructing word indexes

{...

987 of the 'achievement',

988 of 'main',

989 as if it were,

990 of the shape of the Chinese character 'hui',

991 of the ' look's ' looks,

992 is used as a basic material of the Chinese patent specification,

993 of the depth' is provided,

994 of the Chinese characters 'thought',

‘love’:995,

996 of the age of the people's brave,

997 of the people's parents' can be found,

998 of the 'space',

the rate of the slow speed of the device is 999,

a Gou die of 1000,

...}

2.2)

representing user feedback as a word vector matrix, expanded to uniform length

array([[0,0,0,...,3138,83,3139],

[0,0,0,...,561,1111,178],

[0,0,0,...,73,5,198],

...,

[0,0,0,...,1106,9,5705],

[0,0,0,...,307,6,1561],

[0,0,0,...,428,621,3854]])

(3) Model parameters

1)LSTM

2) Model effects

test loss 0.4771944817477238

accuracy 0.9609460946273441。

The invention relates to prediction of user feedback emotion, in particular to the prediction of the user feedback emotion, which takes a user feedback conversation as an input variable and can assist manual online customer service or online intelligent customer service to better provide customer service.

The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be able to cover the technical scope of the present invention and the equivalent alternatives or modifications according to the technical solution and the inventive concept of the present invention within the technical scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:政策文本关联性分析方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!