CN113761146A - Method and device for recognizing emotional fluctuation of customer - Google Patents
Method and device for recognizing emotional fluctuation of customer Download PDFInfo
- Publication number
- CN113761146A CN113761146A CN202110010501.8A CN202110010501A CN113761146A CN 113761146 A CN113761146 A CN 113761146A CN 202110010501 A CN202110010501 A CN 202110010501A CN 113761146 A CN113761146 A CN 113761146A
- Authority
- CN
- China
- Prior art keywords
- emotion
- sentence
- input
- customer
- statement
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 230000002996 emotional effect Effects 0.000 title claims abstract description 50
- 230000008451 emotion Effects 0.000 claims abstract description 310
- 230000008859 change Effects 0.000 claims abstract description 51
- 238000012549 training Methods 0.000 claims abstract description 41
- 206010027951 Mood swings Diseases 0.000 claims abstract description 25
- 238000009825 accumulation Methods 0.000 claims abstract description 15
- 239000013598 vector Substances 0.000 claims description 66
- 230000001186 cumulative effect Effects 0.000 claims description 17
- 230000008569 process Effects 0.000 claims description 13
- 238000000605 extraction Methods 0.000 claims description 11
- 238000011156 evaluation Methods 0.000 claims description 4
- 230000000694 effects Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 13
- 238000004590 computer program Methods 0.000 description 11
- 230000015654 memory Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000008901 benefit Effects 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- 208000019901 Anxiety disease Diseases 0.000 description 2
- 230000036506 anxiety Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000001747 exhibiting effect Effects 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000036651 mood Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 239000000758 substrate Substances 0.000 description 2
- 206010021703 Indifference Diseases 0.000 description 1
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/01—Customer relationship services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0631—Item recommendations
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Business, Economics & Management (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Biophysics (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Economics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present disclosure provides a method and apparatus for identifying a mood swing of a customer. The method comprises the following steps: acquiring an ith statement input by a first customer in the conversation; and acquiring an accumulated emotion value corresponding to the ith sentence, wherein the accumulated emotion value is the accumulation of the emotion change value corresponding to each sentence in one sentence input by the customer in the conversation and all previous sentences. The emotion change value is used for measuring the emotion fluctuation degree of a customer when inputting a sentence; and evaluating an emotional state of the first customer when the ith sentence is input based on the accumulated sentiment value corresponding to the ith sentence. The disclosure also provides a training method and a device of the emotion fluctuation time sequence model, wherein the emotion fluctuation time sequence model is used for predicting the emotional state of a customer. The present disclosure also provides an electronic device, and a computer-readable storage medium.
Description
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for recognizing emotional fluctuation of a customer, a method and an apparatus for training an emotional fluctuation timing model, an electronic device, and a computer-readable storage medium.
Background
With the explosion of the internet, the online customer service system has become an important component of the website. The customer consults with the customer service system to know various information. The service attitude and efficiency of customer service are improved, and the consultation conversion rate of customers is improved. If the customer service grasps the emotion fluctuation of the customer and performs customized service in the consultation process of the customer, the service quality can be effectively improved. If the customer presents angry emotion, the customer service should give priority to appeasing, and then the customer presents happy emotion, and the customer service can properly recommend the commodity.
In the prior art, short text recognition in the technical field of natural speech processing (NLP) can be applied to the field of online customer service. For example, the positive and negative emotions expressed by each short text can be recognized through training and recognition of the short text, and the recognized emotion information is provided to the customer service.
In the course of implementing the disclosed concept, the inventors found that there are at least the following problems in the prior art: the short text is recognized, only the emotion expressed by the sentence when the customer inputs each sentence can be presented, but fluctuation and change of the emotion of the customer in the whole conversation cannot be evaluated.
Disclosure of Invention
In view of the above, the embodiments of the present disclosure provide a method and an apparatus for identifying a fluctuation in a customer's emotion that can evaluate fluctuations and changes in the customer's emotion during a conversation. In addition, the embodiment of the disclosure also provides a training method and a training device of the emotion fluctuation time sequence model for predicting the emotional state of the customer in the conversation process, an electronic device and a computer readable storage medium.
A first aspect of embodiments of the present disclosure provides a method of identifying a mood swing in a customer. The method comprises the following steps: acquiring an ith statement input by a first customer in the conversation, wherein i is an integer greater than or equal to 1; acquiring an accumulated sentiment value corresponding to the ith sentence, wherein when i is 1, the accumulated sentiment value corresponding to the ith sentence is an emotion change value corresponding to a first sentence input by the first customer; when i is larger than 1, the accumulated emotion value corresponding to the ith sentence is the accumulation of the emotion change value corresponding to each sentence in the ith sentence and all sentences before the ith sentence, and the emotion change value is used for measuring the emotion fluctuation degree of the first customer when inputting one sentence; and evaluating an emotional state of the first customer when the ith sentence is input based on the accumulated sentiment value corresponding to the ith sentence.
According to an embodiment of the present disclosure, the method further comprises: obtaining M sentences input by the first customer and closest to the current moment to obtain a first input sentence sequence, wherein M is an integer greater than 1; extracting a feature vector corresponding to each statement in the first input statement sequence to obtain a first feature vector sequence corresponding to the first input statement sequence; the feature vector corresponding to each statement in the first input statement sequence comprises the accumulated sentiment value corresponding to the statement; and predicting the accumulated emotion value corresponding to the sentence which is input next by the first customer by using an emotion fluctuation time sequence model based on the first feature vector sequence so as to evaluate the next emotional state of the first customer.
According to an embodiment of the present disclosure, the obtaining of the accumulated emotion value corresponding to the ith sentence includes: outputting N emotion probabilities corresponding to the ith sentence by using a short text emotion model; the N emotion probabilities are probabilities that the emotion expressed by any statement belongs to N emotion categories respectively; the short text emotion model is used for classifying emotions expressed by any statement in the N emotion categories, wherein N is an integer greater than or equal to 2; acquiring the accumulated sentiment value corresponding to the i-1 st statement input by the first customer in the conversation; when i is equal to 1, setting the accumulated emotion value corresponding to the (i-1) th statement as a first initial value; and obtaining the accumulated emotion value corresponding to the ith sentence based on the accumulated emotion value corresponding to the (i-1) th sentence and the N emotional probabilities corresponding to the ith sentence.
According to an embodiment of the present disclosure, the method further comprises: setting the accumulated emotion value corresponding to the ith sentence to be equal to the accumulated emotion value corresponding to the (i-1) th sentence, and accumulating the emotion change value corresponding to the ith sentence; the emotion change value corresponding to any statement is weighted sum of the N emotion probabilities corresponding to the statement; the positive and negative effects of the emotion type corresponding to the emotion probability on the propulsion session are determined, and the absolute value of the weight of each emotion probability is determined according to the influence degree of the emotion type corresponding to the emotion probability on the propulsion session.
According to the embodiment of the disclosure, the emotion fluctuation time sequence model is obtained by training through the following operations: acquiring at least one second conversation sample, wherein the number of sentences input by a second customer in each second conversation sample is more than M; extracting at least one second input sentence sequence consisting of M sentences continuously input by the second customer from the second conversation sample; extracting a feature vector corresponding to each statement in the second input statement sequence to obtain a second feature vector sequence corresponding to the second input statement sequence, wherein the second feature vector sequence is used as input sample data of the emotion fluctuation time sequence model; marking the accumulated sentiment value corresponding to the sentence input by the second customer after the second input sentence sequence in the second conversation sample to obtain output sample data of the sentiment fluctuation time sequence model; and training the emotion fluctuation time sequence model by using the input sample data and the output sample data.
According to the embodiment of the disclosure, the feature vector corresponding to any sentence further includes the N emotion probabilities corresponding to the sentence.
According to an embodiment of the present disclosure, the method further comprises: acquiring the accumulated emotion value corresponding to each sentence input by the first customer in the conversation, and arranging the accumulated emotion values according to the sequence of the sentences input by the first customer to obtain an emotion value sequence; obtaining a current emotion fluctuation sequence curve of the first customer in the current session based on the emotion value sequence; and displaying the mood swing sequence curve.
In a second aspect of the embodiments of the present disclosure, a method for training an emotion fluctuation time sequence model is provided, where the emotion fluctuation time sequence model is used to predict an emotional state of a customer in a conversation process. The training method comprises the following steps: obtaining at least one second conversation sample, wherein the number of sentences input by a second customer in each second conversation sample is greater than M, and M is an integer greater than 1; extracting at least one second input sentence sequence consisting of M sentences continuously input by the second customer from the second conversation sample; extracting a feature vector corresponding to each sentence in the second input sentence sequence to obtain a second feature vector sequence corresponding to the second input sentence sequence, wherein the second feature vector sequence is used as input sample data of the emotion fluctuation time sequence model; the feature vector corresponding to any statement comprises an accumulated sentiment value corresponding to the statement; the accumulated emotion value corresponding to any statement is the accumulation of emotion change values corresponding to each statement in the statement input by the customer and all previous statements in the conversation, and is used for evaluating the emotional state of the customer when the statement is input; the emotion change value is used for measuring the emotion fluctuation degree of a customer when inputting a sentence; acquiring the accumulated emotion value corresponding to the sentence input by the second customer after the second input sentence sequence in the second conversation sample to obtain output sample data of the emotion fluctuation time sequence model; and training the emotion fluctuation time sequence model by using the input sample data and the output sample data.
According to an embodiment of the present disclosure, the extracting a feature vector corresponding to each sentence in the second input sentence sequence further includes: acquiring the accumulated sentiment value corresponding to each statement, including: for the r sentence in the second input sentence sequence, outputting N emotion probabilities corresponding to the r sentence by using a short text emotion model; the N emotion probabilities are probabilities that the emotion expressed by any statement belongs to N emotion categories respectively; the short text emotion model is used for classifying emotions expressed by any statement in the N emotion categories, wherein N is an integer greater than or equal to 2; acquiring the accumulated sentiment value corresponding to the (r-1) th sentence in the second input sentence sequence, wherein the accumulated sentiment value corresponding to the (r-1) th sentence is set as a second initial value when r is 1; and obtaining the accumulated emotion value corresponding to the r-1 th sentence based on the accumulated emotion value corresponding to the r-1 th sentence and the N emotion probabilities corresponding to the r-1 th sentence. Wherein r is an integer of 1 or more.
According to the embodiment of the disclosure, the feature vector corresponding to any sentence further includes the N emotion probabilities corresponding to the sentence.
In a third aspect of the disclosed embodiments, an apparatus for identifying mood swings of a customer is provided. The device comprises a first acquisition module, a second acquisition module and an evaluation module. The first obtaining module is used for obtaining an ith statement input by the first customer in the conversation, wherein i is an integer greater than or equal to 1. The second obtaining module is configured to obtain an accumulated sentiment value corresponding to the ith sentence, where when i is equal to 1, the accumulated sentiment value corresponding to the ith sentence is an emotion change value corresponding to a first sentence input by the first customer; and when i is larger than 1, the accumulated emotion value corresponding to the ith sentence is the accumulation of the emotion change value corresponding to each sentence in the ith sentence and all sentences before the ith sentence, and the emotion change value is used for measuring the emotion fluctuation degree of the first customer when inputting one sentence. The evaluation module is used for evaluating the emotional state of the first customer when the ith statement is input based on the accumulated emotional value corresponding to the ith statement.
According to an embodiment of the present disclosure, the apparatus further comprises an extraction module and a prediction module. The first obtaining module is further configured to obtain M sentences input by the first customer that are closest to the current time to obtain a first input sentence sequence, where M is an integer greater than 1. The extraction module is used for extracting a feature vector corresponding to each statement in the first input statement sequence to obtain a first feature vector sequence corresponding to the first input statement sequence; the feature vector corresponding to any statement comprises an accumulated sentiment value corresponding to the statement. And the prediction module is used for predicting an accumulated emotion value corresponding to a statement to be input next by the first customer by using an emotion fluctuation time sequence model based on the first feature vector sequence so as to evaluate the next emotional state of the first customer.
According to the embodiment of the disclosure, the device further comprises a fluctuation curve obtaining module and a display module. The second obtaining module is further configured to obtain an accumulated sentiment value corresponding to each sentence input by the first customer in the session up to the present time, and arrange the cumulative sentiment values according to the sequence of the sentences input by the first customer to obtain a sentiment value sequence. And the fluctuation curve obtaining module is used for obtaining a current emotion fluctuation sequence curve of the first customer in the current session based on the emotion value sequence. And the display module is used for displaying the emotion fluctuation sequence curve.
In a fourth aspect of the embodiments of the present disclosure, a training apparatus for an emotion fluctuation time sequence model is provided. The emotion fluctuation time sequence model is used for predicting the emotional state of the customer in the conversation process. The training device comprises a third acquisition module, a first extraction module, a second extraction module, a fourth acquisition module and a training module. The third obtaining module is used for obtaining at least one second conversation sample, wherein the number of the sentences input by the second customer in each second conversation sample is more than M. The first extraction module is used for extracting at least one group of second input sentence sequence consisting of M sentences continuously input by the second customer from the second conversation sample. The second extraction module is used for extracting a feature vector corresponding to each statement in the second input statement sequence to obtain a second feature vector sequence corresponding to the second input statement sequence, wherein the second feature vector sequence is used as input sample data of the emotion fluctuation time sequence model; the feature vector corresponding to any statement comprises an accumulated sentiment value corresponding to the statement; the accumulated emotion value corresponding to any statement is the accumulation of emotion change values corresponding to each statement in the statement input by the customer and all previous statements in the conversation, and is used for evaluating the emotional state of the customer when the statement is input; the emotion change value is used for measuring the emotion fluctuation degree of the customer when inputting a sentence. The fourth obtaining module is configured to obtain the accumulated sentiment value corresponding to the sentence, which is input by the second customer after the second input sentence sequence, in the second conversation sample, and obtain output sample data of the sentiment fluctuation time sequence model. And the training module is used for training the emotion fluctuation time sequence model by utilizing the input sample data and the output sample data.
In a fifth aspect of the disclosed embodiments, an electronic device is provided. The electronic device includes one or more processors, and a storage. The storage device is used to store one or more programs. Wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of the first or second aspect as described above.
A sixth aspect of embodiments of the present disclosure provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the method of the first or second aspect.
A seventh aspect of embodiments of the present disclosure provides a computer program comprising computer executable instructions for implementing a method as described in the first or second aspect above when executed.
One or more of the above-described embodiments may provide the following advantages or benefits: the accumulated sentiment value corresponding to each sentence is to accumulate the sentiment change value corresponding to the sentence and each sentence before the sentence, which is input by the customer in the process of a conversation, so that the accumulated sentiment value corresponding to each sentence can be used for evaluating the sentiment change condition of the customer from the beginning of the conversation to the current sentiment change condition.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario of the method and apparatus for identifying customer emotional fluctuation according to an embodiment of the present disclosure;
FIG. 2 schematically shows a flow diagram of a method of identifying a customer's mood swings according to an embodiment of the present disclosure;
fig. 3 schematically shows a flowchart for acquiring an accumulated sentiment value corresponding to a sentence in a method for identifying a fluctuation in a customer's emotion according to an embodiment of the present disclosure;
FIG. 4 schematically shows a flow chart of a method of identifying a customer's mood swings in accordance with another embodiment of the present disclosure;
FIG. 5 schematically shows a diagram of a mood wave sequence curve according to an embodiment of the present disclosure;
FIG. 6 schematically shows a flow chart of a method of identifying a customer's mood swings according to yet another embodiment of the present disclosure;
FIG. 7 schematically shows a flow chart of a method for training an emotion fluctuation timing model according to an embodiment of the present disclosure;
FIG. 8 schematically shows a block diagram of an apparatus for identifying customer mood swings in accordance with an embodiment of the present disclosure;
FIG. 9 schematically illustrates a block diagram of a training apparatus for a perceptual fluctuation timing model in accordance with an embodiment of the present disclosure; and
FIG. 10 schematically illustrates a block diagram of a computer system suitable for implementing methods according to various embodiments of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides a method and a device for identifying emotion fluctuation of a customer. The method comprises the following steps: acquiring an ith statement input by a first customer in the conversation, wherein i is an integer greater than or equal to 1; acquiring an accumulated sentiment value corresponding to the ith sentence, wherein the accumulated sentiment value is the accumulation of a sentence input by a customer in a conversation and an emotion change value corresponding to each sentence in all previous sentences; and evaluating an emotional state of the first customer when the ith sentence is input based on the accumulated sentiment value corresponding to the ith sentence.
According to some embodiments of the present disclosure, short text emotion models may be utilized to obtain emotion change values corresponding to each sentence. For example, the short text emotion model may be used to output the probability that the emotion expressed by each sentence input by the customer can be classified into each of N emotion categories, so that N emotion probabilities may be obtained, and then the emotion change value corresponding to each sentence may be measured by weighting the N emotion probabilities. In this way, the accumulated emotion value corresponding to the i-th sentence is an accumulation of emotion change values corresponding to each of the i sentences input by the first customer. Therefore, the emotion change condition of the first customer can be evaluated according to the accumulated emotion value corresponding to the ith sentence.
Fig. 1 schematically illustrates an application scenario 100 of a method and apparatus for identifying customer emotional fluctuations in accordance with an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, an application scenario 100 according to this embodiment may include a terminal device 101, networks 102 and 104, a server 103, and a customer service terminal 105. Network 102 is configured to provide a communication link between terminal device 101 and server 103, and network 104 is configured to provide a communication link between client terminal 105 and server 103. Networks 102 and 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. Networks 102 and 104 may be the same network, different networks, or partially overlapping networks, and this disclosure is not limited thereto.
A customer may use terminal device 101 to interact with server 103 via network 102 to obtain customer service. The customer service personnel may use the service terminal 105 to interact with the server 103 via the network 104 to provide service to the customer.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of a method of identifying a customer's mood swings according to an embodiment of the present disclosure.
As shown in fig. 2, the method may include operations S210 to S230.
In operation S210, an ith sentence input by the first customer in the current session is acquired, where i is an integer greater than or equal to 1. In one embodiment, the ith sentence may be a sentence currently input by the first customer, so that the disclosed embodiments may identify the current mood swing of the first customer. In another embodiment, the ith sentence may be any one of the sentences input by the first customer in the session, for example, one or more sentences are extracted for emotional state recognition one by one for the necessity of data analysis or background statistical processing.
In operation S220, an accumulated sentiment value corresponding to the ith sentence is acquired. When i is 1, the cumulative emotion value corresponding to the ith sentence is an emotion change value corresponding to a first sentence input by the first customer; and when i is larger than 1, the accumulated emotion value corresponding to the ith sentence is the accumulation of the emotion change value corresponding to each sentence in the ith sentence and all sentences before the ith sentence, and the emotion change value is used for measuring the emotion fluctuation degree of the first customer when inputting one sentence.
In operation S230, an emotional state of the first customer at the time of inputting the ith sentence is evaluated based on the accumulated emotional value corresponding to the ith sentence.
According to the embodiment of the disclosure, the accumulated sentiment value corresponding to each sentence is obtained by accumulating the emotion change value corresponding to the sentence and each sentence before the sentence, which is input by the customer during a conversation, so that the accumulated sentiment value corresponding to each sentence can be used for evaluating the emotion change condition of the customer from the beginning of the conversation to the current emotion change condition.
Fig. 3 schematically shows a flowchart in which operation S220 acquires an accumulated emotion value corresponding to a sentence in a method of recognizing a fluctuation in customer' S emotion according to an embodiment of the present disclosure.
As shown in fig. 3, acquiring the accumulated emotion value corresponding to the ith sentence in operation S220 may include operations S301 to S303 according to an embodiment of the present disclosure.
In operation S301, outputting N emotion probabilities corresponding to the ith sentence using the short text emotion model; the N emotion probabilities are probabilities that the emotion expressed by any statement belongs to N emotion categories respectively; the short text emotion model is used for classifying the emotion expressed by any sentence in the N emotion categories, wherein N is an integer greater than or equal to 2. The emotion fluctuation degree of the customer when inputting a sentence can be obtained through the summarization of the N emotion probabilities.
In one embodiment, the emotions may be classified into 5 emotion categories (N ═ 5) as shown in table 1 below.
In one embodiment, the short text emotion model can be trained and constructed by using an LSTM neural network model. Specifically, in the training and construction process, a large number of sentences input by the customer in the history conversation in the online customer service system may be obtained first to form a history conversation corpus, and the history conversation corpus is cleaned, such as removing emoticons, pure numbers or characters, short or long texts, and the like. And then, manually labeling the historical conversation corpus, for example, according to the emotion classification table in table 1, the emotion classification of each conversation statement in the historical conversation corpus is shown. Then, the word2vec algorithm can be adopted to convert the Chinese short text in the historical conversation corpus into word vectors. Then, the word vector of a short text is used as the input of the LSTM neural network model, and the probability values corresponding to the five categories to which the short text belongs are output.
Table 1:
in operation S302, an accumulated sentiment value corresponding to the i-1 st sentence input by the first customer in the current session is acquired. Wherein when i is 1, the cumulative emotion value corresponding to the i-1 th sentence may be set to a first initial value (e.g., 0).
In operation S303, a cumulative emotion value corresponding to the ith sentence is obtained based on the cumulative emotion value corresponding to the (i-1) th sentence and the N emotional probabilities corresponding to the ith sentence.
In one embodiment, a one-way conversation in an online customer service system is composed of several short texts and is accumulated gradually over time and the number of sentences input by customers. In order to evaluate the emotional fluctuation of the customer in the conversation process, each statement of the customer can be predicted by using a short text emotion model, and N emotional probabilities are obtained. And then weighting the N emotion probabilities corresponding to each sentence to obtain the emotion change value corresponding to each sentence. And then accumulating the sentences input by the customer at the current time point and the emotion change values corresponding to all previous sentences at the current conversation time point to obtain the accumulated emotion values of the sentences input by the customer at the current time point.
Specifically, in the calculation, a calculation model of the cumulative emotion value may be set in advance. In one embodiment, the cumulative sentiment value corresponding to a sentence is equal to the sentiment change value corresponding to the sentence on the basis of the cumulative sentiment value corresponding to the sentence before the sentence. And for the first statement, setting the accumulated emotion value corresponding to the previous statement of the statement as a first initial value. And, the emotion change value is a weighted sum of N emotion probabilities corresponding to one sentence. The positive and negative effects of the emotion type corresponding to the emotion probability on the propulsion session are determined, and the absolute value of the weight of each emotion probability is determined according to the influence degree of the emotion type corresponding to the emotion probability on the propulsion session.
For example, the short text emotion model is used to predict and output five emotion probability values corresponding to each sentence input by the first customer in the current session. Assume that the cumulative sentiment value corresponding to the first customer when no statements are input at the beginning of the session is a first initial value, e.g. P0When the value is 0, for the ith sentence in the conversation, the cumulative emotion value P corresponding to the ith sentence is calculated according to the following formula (1)i:
Pi=Pi-1+Pother*otherratio+Phappy*happyratio-Panxiety*anxietyratio-Panger*angerratio-Plost*lost_ratio (1)
Wherein, Pother、Phappy、Panxiety、PangerAnd PlostThe short text emotion model is used for predicting the probability (namely 5 emotion probabilities) of each of 5 emotion categories input in the table 1 in the ith sentence input by the first customer in the current conversation; otherratio、happyratio、anxietyratio、angerratioAnd lost _ ratio is eachThe weight of the category weighted in mood swings. In equation (1), considering happiness and indifference as belonging to positive emotions, the weighting values should be added up, while anxiety, anger and disappointment all belong to negative interests, and the weighting values are subtracted up.
And (3) traversing all the sentences input by the first customer in the conversation to obtain the emotion accumulated values corresponding to all the sentences through the formula (1).
In one embodiment, the absolute value of the weight of each emotion probability is determined according to the degree of influence of the emotion type corresponding to each emotion probability on the propulsion session. E.g. otherratio=0.1,happyratio=1,anxietyratio=0.5,angerratio1, and lostratio=0.5。
Fig. 4 schematically shows a flow chart of a method of identifying a customer's mood swings according to another embodiment of the present disclosure.
As shown in fig. 4, the method for identifying the emotional fluctuation of the customer according to the embodiment of the present disclosure may further include operations S410 to S430.
In operation S410, the accumulated sentiment values corresponding to each sentence input by the current first customer in the session are obtained and arranged according to the sequence of the sentences input by the first customer, so as to obtain a sentiment value sequence.
In operation S420, based on the emotion value sequence, an emotion fluctuation sequence curve of the first customer as far as the current emotion in the session is obtained.
In operation S430, a mood swing sequence curve is presented.
Fig. 5 schematically shows a schematic diagram of a mood swing sequence curve according to an embodiment of the present disclosure.
In conjunction with fig. 4 and 5, a mood swing curve may be plotted based on the sequence of mood values. Each emotion accumulated value is plotted as a scatter, and all scatter are connected and smoothed, so that an emotion fluctuation sequence curve can be generated, as shown in fig. 5. The mood swing sequence curve can be displayed in the display interface of the customer service terminal 105 to prompt the mood swing condition of the customer during the conversation process of the customer service personnel.
Fig. 6 schematically shows a flow chart of a method of identifying a customer's mood swings according to yet another embodiment of the present disclosure.
As shown in fig. 6, the method for identifying the emotional fluctuation of the customer according to the embodiment of the present disclosure may further include operations S610 to S630.
In operation S610, M sentences input by the first customer and closest to the current time are obtained, and a first input sentence sequence is obtained, where M is an integer greater than 1.
In operation S620, extracting a feature vector corresponding to each sentence in the first input sentence sequence to obtain a first feature vector sequence corresponding to the first input sentence sequence; the feature vector corresponding to one statement comprises an accumulated sentiment value corresponding to the statement.
In another embodiment, the feature vector corresponding to each sentence extracted in operation S620 may further include N emotion probabilities corresponding to the sentence.
In operation S630, an accumulated emotion value corresponding to a sentence that the first customer will input next is predicted using the emotion fluctuation time series model based on the first feature vector sequence to evaluate a next emotional state of the first customer.
For example, the first sequence of feature vectors constitutes input data for the emotion fluctuation timing model. According to an embodiment of the present disclosure, for example, the ith sentence is a current input sentence of the first customer, and the first feature vector sequence may be exemplified by the following formula (2):
wherein each parameter has the same meaning as in formula (1).
Then, the input data shown in equation (2) is input to the emotion fluctuation time sequence model, and the accumulated emotion value P of the next sentence (i.e., the (i + 1) th sentence) of the first customer is output from the emotion fluctuation time sequence modeli+1。
Embodiments of the present disclosure may predict the next mood swings of the first customer from the M sentences most recently entered by the first customer. Specifically, the accumulated emotion value of the sentence to be input next by the first customer can be predicted based on the feature vectors corresponding to the M sentences continuously input by the first customer in the current session, so as to achieve the purpose of predicting the emotion trend of the first customer in advance. The emotion fluctuation timing model can be implemented by, for example, an LSTM neural network.
According to one embodiment of the present disclosure, predicting future mood swings is referred to as point-by-point prediction. For example, in the emotion fluctuation sequence graph shown in fig. 5, the emotion fluctuation time sequence model is used to predict the accumulated emotion value corresponding to a single point, the position is drawn in the graph, then the sliding window is moved, and the accumulated emotion value of the next point is predicted by using the sequence data composed of the feature vectors corresponding to M points. And on the basis of a time sequence model of emotion fluctuation, constructing input characteristics of an emotion fluctuation time sequence model according to 10 sentences before conversation, outputting an accumulated emotion value of the 11 th sentence, simultaneously predicting the accumulated emotion corresponding to the 12 th sentence by using the accumulated emotion values corresponding to the 2 nd to 11 th sentences, and analogizing in turn, so that a complete emotion fluctuation curve can be drawn, and the emotion tendency of the historical customer and the future customer in the whole conversation can be obtained.
FIG. 7 schematically shows a flowchart of a method for training an emotion fluctuation timing model according to an embodiment of the present disclosure.
As shown in FIG. 7, the method for training the emotion fluctuation time sequence model may include operations S710 to S750. The emotion fluctuation time sequence model is used for predicting the emotional state of a customer in the conversation process.
In operation S710, at least one second conversation sample is obtained, where the number of sentences input by the second customer in each second conversation sample is greater than M, where M is an integer greater than 1.
At least one second input sentence sequence consisting of M sentences consecutively input by the second customer is extracted from the second conversation sample in operation S720.
In operation S730, a feature vector corresponding to each sentence in the second input sentence sequence is extracted, so as to obtain a second feature vector sequence corresponding to the second input sentence sequence. And taking the second characteristic vector sequence as input sample data of the emotion fluctuation time sequence model. The feature vector corresponding to any statement comprises an accumulated emotion value corresponding to the statement; the accumulated sentiment value corresponding to any sentence is the accumulation of the emotion change value corresponding to each sentence in the sentence and all sentences before the sentence input by the customer in the conversation, and is used for evaluating the emotional state of the customer when the sentence is input.
In one embodiment, extracting the feature vector corresponding to each sentence in the second sequence of input sentences includes obtaining an accumulated sentiment value corresponding to each sentence. In particular, the cumulative sentiment value corresponding to a sentence can be obtained by means of a short text emotion model in a similar way to that described with reference to fig. 3.
For example, for the r-th sentence in the second input sentence sequence (where r is an integer equal to or greater than 1), first, N emotion probabilities corresponding to the r-th sentence are output using the short text emotion model. Wherein, the N emotion probabilities are the probabilities that the emotion expressed by one sentence is classified into N emotion categories; the short text emotion model is a model for classifying emotions expressed by one sentence in N emotion categories, wherein N is an integer greater than or equal to 2.
Then, the cumulative sentiment value corresponding to the (r-1) th sentence in the second input sentence sequence is acquired. Wherein the cumulative emotion value corresponding to the (r-1) th sentence is set to a second initial value when r is 1. The second initial value may be zero or any value, or may be an accumulated sentiment value corresponding to the input sentence (if any) of the second customer before the second input sentence sequence. Because the emotion fluctuation time sequence model essentially predicts the emotion fluctuation sequence changing along with time, the change or relative significance of the emotion accumulated value is more valuable, and the absolute value has little influence on measuring the emotion fluctuation size. Moreover, in an actual customer service system, each customer must be in an emotional state at the beginning of the communication with the customer service, which cannot be known in advance. Therefore, the fluctuation trend of the emotion fluctuation sequence predicted by the emotion fluctuation time sequence model is not greatly influenced by the size of the second initial value.
And finally, obtaining the accumulated emotion value corresponding to the r-1 th sentence based on the accumulated emotion value corresponding to the r-1 th sentence and the N emotion probabilities corresponding to the r-1 th sentence.
In one embodiment, the feature vector corresponding to each sentence includes not only the cumulative sentiment value corresponding to each sentence, but also N sentiment probabilities corresponding to each sentence.
In operation S740, obtaining an accumulated sentiment value corresponding to a sentence, which is input by the second customer after the second input sentence sequence, in the second conversation sample, to obtain output sample data of the sentiment fluctuation time sequence model; and
in operation S750, an emotion fluctuation time sequence model is trained using input sample data and output sample data.
In one embodiment, M-10, input sample data may be obtained based on any consecutive 10 input samples by one customer in one session. For example, the training features may be constructed with the arbitrary consecutive 10 sentences as 1 sample. And extracting features of each statement to obtain a feature vector corresponding to the statement. In one embodiment, the feature vector mentioned in this statement may include the following 6 parameters: (1) the accumulated sentiment value corresponding to the sentence; (2) a probability value that the customer's emotion belongs to the category of "anxiety/anxiousness" when the customer inputs the sentence; (3) a probability value that the emotion of the customer belongs to the category of "happy/excited" when the customer inputs the sentence; (4) a probability value of a customer's emotion belonging to the "anger/anger" category when the customer enters the statement; (5) a probability value that the customer's emotion belongs to the category of "disappointment/disappointment" when the customer inputs the sentence; (6) probability value that the customer's emotion belongs to the "flat" category when the customer enters the sentence. The parameters (2) to (6) can be obtained by prediction through a short text emotion model. Thus, a 10, 6 two-dimensional matrix can be constructed for each sample. If S samples are collected, the input sample data can form a three-dimensional matrix of [ S, 10, 6 ].
Fig. 8 schematically shows a block diagram of an apparatus 800 for identifying a customer's mood swings according to an embodiment of the present disclosure.
As shown in fig. 8, the apparatus 800 for identifying a mood swing of a customer may include a first obtaining module 810, a second obtaining module 820, and an evaluating module 830. The apparatus 800 may be used to implement the method of identifying a mood swing in a customer described with reference to fig. 2-6.
The first obtaining module 810 is configured to obtain an ith statement input by the first customer in the current session, where i is an integer greater than or equal to 1.
The second obtaining module 820 is configured to obtain an accumulated sentiment value corresponding to the ith sentence, where when i is equal to 1, the accumulated sentiment value corresponding to the ith sentence is an emotion change value corresponding to a first sentence input by the first customer; and when i is larger than 1, the accumulated emotion value corresponding to the ith sentence is the accumulation of the emotion change value corresponding to each sentence in the ith sentence and all sentences before the ith sentence, and the emotion change value is used for measuring the emotion fluctuation degree of the first customer when inputting one sentence.
The evaluation module 830 is configured to evaluate an emotional state of the first customer when the ith sentence is input based on the accumulated sentiment value corresponding to the ith sentence.
According to an embodiment of the present disclosure, the apparatus 800 further comprises an extraction module and a prediction module.
The first obtaining module 810 is further configured to obtain M sentences input by the first customer that are closest to the current time, to obtain a first input sentence sequence, where M is an integer greater than 1. The extraction module is used for extracting the feature vector corresponding to each statement in the first input statement sequence to obtain a first feature vector sequence corresponding to the first input statement sequence. The feature vector corresponding to any statement comprises an accumulated sentiment value corresponding to the statement. And the prediction module is used for predicting an accumulated emotion value corresponding to a statement to be input next by the first customer by using an emotion fluctuation time sequence model based on the first feature vector sequence so as to evaluate the next emotional state of the first customer. .
According to an embodiment of the present disclosure, the apparatus 800 further comprises a fluctuation curve obtaining module and a display module.
The second obtaining module 820 is further configured to obtain an accumulated sentiment value corresponding to each sentence input by the current first customer in the session, and arrange the cumulative sentiment values according to the sequence of the sentences input by the first customer to obtain a sentiment value sequence. The fluctuation curve obtaining module is used for obtaining a current emotion fluctuation sequence curve of the first customer in the conversation based on the emotion value sequence. And the display module is used for displaying the emotion fluctuation sequence curve.
FIG. 9 schematically shows a block diagram of a training apparatus 900 for a fluctuation-aware timing model according to an embodiment of the present disclosure.
As shown in FIG. 9, the apparatus 900 for training the emotion fluctuation time sequence model may include a third obtaining module 910, a first extracting module 920, a second extracting module 930, a fourth obtaining module 940, and a training module 950. The emotion fluctuation time sequence model is used for predicting the emotional state of a customer in the conversation process. The training apparatus 900 may be used to implement the training method described with reference to fig. 7.
The third obtaining module 910 is configured to obtain at least one second session sample, where the number of sentences input by the second customer in each second session sample is greater than M.
The first extraction module 920 is used to extract at least one second input sentence sequence composed of M sentences continuously input by the second customer from the second conversation sample.
The second extracting module 930 is configured to extract a feature vector corresponding to each sentence in the second input sentence sequence, to obtain a second feature vector sequence corresponding to the second input sentence sequence, where the feature vector includes an accumulated sentiment value, and the accumulated sentiment value is an accumulation of the emotion change value corresponding to each sentence in the sentence and all sentences before the sentence, which are input by one customer in the conversation.
The fourth obtaining module 940 is configured to obtain the accumulated sentiment value corresponding to the sentence, which is input by the second customer after the second input sentence sequence, in the second conversation sample, to obtain output sample data of the sentiment fluctuation time sequence model.
The training module 950 is configured to train the emotion fluctuation time sequence model by using the input sample data and the output sample data.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the first obtaining module 810, the second obtaining module 820, the evaluating module 830, the third obtaining module 910, the first extracting module 920, the second extracting module 930, the fourth obtaining module 940, the training module 950, the extracting module, the predicting module, the fluctuation curve obtaining module, and the exhibiting module may be combined to be implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first obtaining module 810, the second obtaining module 820, the evaluating module 830, the third obtaining module 910, the first extracting module 920, the second extracting module 930, the fourth obtaining module 940, the training module 950, the extracting module, the predicting module, the fluctuation curve obtaining module, and the exhibiting module may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware such as any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the first obtaining module 810, the second obtaining module 820, the evaluating module 830, the third obtaining module 910, the first extracting module 920, the second extracting module 930, the fourth obtaining module 940, the training module 950, the extracting module, the predicting module, the fluctuation curve obtaining module, and the presenting module may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
FIG. 10 schematically illustrates a block diagram of a computer system 1000 suitable for implementing methods according to various embodiments of the present disclosure. The computer system 1000 shown in fig. 10 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in fig. 10, a computer system 1000 according to an embodiment of the present disclosure includes a processor 1001 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. Processor 1001 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the present disclosure.
In the RAM 1003, various programs and data necessary for the operation of the computer system 1000 are stored. The processor 1001, ROM 1002, and RAM 1003 are connected to each other by a bus 1004. The processor 1001 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 1002 and/or the RAM 1003. Note that the program may also be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in one or more memories.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the removable medium 1011. The computer program performs the above-described functions defined in the system of the embodiment of the present disclosure when executed by the processor 1001. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 1002 and/or the RAM 1003 described above and/or one or more memories other than the ROM 1002 and the RAM 1003.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.
Claims (14)
1. A method of identifying mood swings of a customer, comprising:
acquiring an ith statement input by a first customer in the conversation, wherein i is an integer greater than or equal to 1;
acquiring an accumulated sentiment value corresponding to the ith sentence, wherein when i is 1, the accumulated sentiment value corresponding to the ith sentence is an emotion change value corresponding to a first sentence input by the first customer; when i is larger than 1, the accumulated emotion value corresponding to the ith sentence is the accumulation of the emotion change value corresponding to each sentence in the ith sentence and all sentences before the ith sentence, and the emotion change value is used for measuring the emotion fluctuation degree of the first customer when inputting one sentence; and
evaluating an emotional state of the first customer at the time of inputting the ith sentence based on the accumulated sentiment value corresponding to the ith sentence.
2. The method of claim 1, wherein the method further comprises:
obtaining M sentences input by the first customer and closest to the current moment to obtain a first input sentence sequence, wherein M is an integer greater than 1;
extracting a feature vector corresponding to each statement in the first input statement sequence to obtain a first feature vector sequence corresponding to the first input statement sequence; the feature vector corresponding to each statement in the first input statement sequence comprises the accumulated sentiment value corresponding to the statement; and
and predicting the accumulated emotion value corresponding to the sentence which is input next by the first customer by using an emotion fluctuation time sequence model based on the first feature vector sequence so as to evaluate the next emotional state of the first customer.
3. The method of claim 2, wherein said obtaining a cumulative sentiment value corresponding to the ith statement comprises:
outputting N emotion probabilities corresponding to the ith sentence by using a short text emotion model; the N emotion probabilities are probabilities that the emotion expressed by any statement belongs to N emotion categories respectively; the short text emotion model is used for classifying emotions expressed by any statement in the N emotion categories, wherein N is an integer greater than or equal to 2; wherein, the emotion change value corresponding to any sentence is equal to the weighted summation of the N emotion probabilities corresponding to the sentence;
acquiring the accumulated sentiment value corresponding to the i-1 st statement input by the first customer in the conversation; wherein when i is equal to 1, the cumulative sentiment value corresponding to the i-1 th sentence is set to a first initial value; and
and obtaining the accumulated emotion value corresponding to the ith sentence based on the accumulated emotion value corresponding to the (i-1) th sentence and the N emotional probabilities corresponding to the ith sentence.
4. The method of claim 3, wherein the method further comprises:
setting the accumulated emotion value corresponding to the ith sentence to be equal to the accumulated emotion value corresponding to the (i-1) th sentence, and accumulating the emotion change value corresponding to the ith sentence;
the positive and negative of the weight of each emotion probability in the N emotion probabilities are determined according to the positive and negative effects of the emotion type corresponding to the emotion probability on the propulsion session, and the absolute value of the weight of each emotion probability is determined according to the influence degree of the emotion type corresponding to the emotion probability on the propulsion session.
5. The method of claim 3, wherein the emotion fluctuation timing model is trained by:
acquiring at least one second conversation sample, wherein the number of sentences input by a second customer in each second conversation sample is more than M;
extracting at least one second input sentence sequence consisting of M sentences continuously input by the second customer from the second conversation sample;
extracting a feature vector corresponding to each statement in the second input statement sequence to obtain a second feature vector sequence corresponding to the second input statement sequence, wherein the second feature vector sequence is used as input sample data of the emotion fluctuation time sequence model;
marking the accumulated sentiment value corresponding to the sentence input by the second customer after the second input sentence sequence in the second conversation sample to obtain output sample data of the sentiment fluctuation time sequence model; and
and training the emotion fluctuation time sequence model by using the input sample data and the output sample data.
6. The method of claim 3 or 5, wherein the feature vector for any one sentence further comprises the N emotion probabilities for that sentence.
7. The method of claim 1, further comprising:
acquiring the accumulated emotion value corresponding to each sentence input by the first customer in the conversation, and arranging the accumulated emotion values according to the sequence of the sentences input by the first customer to obtain an emotion value sequence;
obtaining a current emotion fluctuation sequence curve of the first customer in the current session based on the emotion value sequence; and
and displaying the emotional fluctuation sequence curve.
8. A training method of an emotion fluctuation time sequence model, wherein the emotion fluctuation time sequence model is used for predicting the emotional state of a customer in a conversation process, and the training method comprises the following steps:
obtaining at least one second conversation sample, wherein the number of sentences input by a second customer in each second conversation sample is greater than M, and M is an integer greater than 1;
extracting at least one second input sentence sequence consisting of M sentences continuously input by the second customer from the second conversation sample;
extracting a feature vector corresponding to each sentence in the second input sentence sequence to obtain a second feature vector sequence corresponding to the second input sentence sequence, wherein the second feature vector sequence is used as input sample data of the emotion fluctuation time sequence model; the feature vector corresponding to any statement comprises an accumulated sentiment value corresponding to the statement; the accumulated emotion value corresponding to any statement is the accumulation of emotion change values corresponding to each statement in the statement input by the customer and all previous statements in the conversation, and is used for evaluating the emotional state of the customer when the statement is input; the emotion change value is used for measuring the emotion fluctuation degree of a customer when inputting a sentence;
acquiring the accumulated emotion value corresponding to the sentence input by the second customer after the second input sentence sequence in the second conversation sample to obtain output sample data of the emotion fluctuation time sequence model; and
and training the emotion fluctuation time sequence model by using the input sample data and the output sample data.
9. The training method of claim 8, wherein said extracting a feature vector corresponding to each sentence in the second sequence of input sentences further comprises:
acquiring the accumulated sentiment value corresponding to each statement, wherein the accumulated sentiment value comprises an r statement in the second input statement sequence, and r is an integer greater than or equal to 1:
outputting N emotion probabilities corresponding to the r statement by using a short text emotion model; the N emotion probabilities are probabilities that the emotion expressed by any statement belongs to N emotion categories respectively; the short text emotion model is used for classifying emotions expressed by any statement in the N emotion categories, wherein N is an integer greater than or equal to 2;
acquiring the accumulated sentiment value corresponding to the (r-1) th sentence in the second input sentence sequence, wherein the accumulated sentiment value corresponding to the (r-1) th sentence is set as a second initial value when r is 1; and
and obtaining the accumulated emotion value corresponding to the r-1 th sentence based on the accumulated emotion value corresponding to the r-1 th sentence and the N emotional probabilities corresponding to the r-1 th sentence.
10. The training method of claim 9, wherein the feature vector corresponding to any one sentence further comprises the N emotion probabilities corresponding to that sentence.
11. An apparatus for identifying mood swings of a customer, comprising:
the first obtaining module is used for obtaining an ith statement input by a first customer in the conversation, wherein i is an integer greater than or equal to 1;
a second obtaining module, configured to obtain an accumulated sentiment value corresponding to the ith sentence, where when i is equal to 1, the accumulated sentiment value corresponding to the ith sentence is an emotion change value corresponding to a first sentence input by the first customer; when i is larger than 1, the accumulated emotion value corresponding to the ith sentence is the accumulation of the emotion change value corresponding to each sentence in the ith sentence and all sentences before the ith sentence, and the emotion change value is used for measuring the emotion fluctuation degree of the first customer when inputting one sentence; and
and the evaluation module is used for evaluating the emotional state of the first customer when the ith statement is input based on the accumulated emotional value corresponding to the ith statement.
12. An apparatus for training a fluctuation timing model of emotion, the fluctuation timing model of emotion being used for predicting an emotional state of a customer during a conversation, wherein the apparatus comprises:
the third acquisition module is used for acquiring at least one second conversation sample, wherein the number of sentences input by a second customer in each second conversation sample is more than M;
a first extraction module, configured to extract at least one second input sentence sequence composed of M sentences continuously input by the second customer from the second conversation sample;
a second extraction module, configured to extract a feature vector corresponding to each sentence in the second input sentence sequence to obtain a second feature vector sequence corresponding to the second input sentence sequence, where the second feature vector sequence is used as input sample data of the emotion fluctuation time sequence model; the feature vector corresponding to any statement comprises an accumulated sentiment value corresponding to the statement; the accumulated emotion value corresponding to any statement is the accumulation of emotion change values corresponding to each statement in the statement input by the customer and all previous statements in the conversation, and is used for evaluating the emotional state of the customer when the statement is input; the emotion change value is used for measuring the emotion fluctuation degree of a customer when inputting a sentence;
a fourth obtaining module, configured to obtain the accumulated sentiment value corresponding to a sentence, which is input by the second customer after the second input sentence sequence, in the second session sample, to obtain output sample data of the sentiment fluctuation time sequence model; and
and the training module is used for training the emotion fluctuation time sequence model by utilizing the input sample data and the output sample data.
13. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform:
the method according to any one of claims 1 to 7; or
The training method according to any one of claims 8 to 10.
14. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement:
the method according to any one of claims 1 to 7; or
The training method according to any one of claims 8 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110010501.8A CN113761146A (en) | 2021-01-05 | 2021-01-05 | Method and device for recognizing emotional fluctuation of customer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110010501.8A CN113761146A (en) | 2021-01-05 | 2021-01-05 | Method and device for recognizing emotional fluctuation of customer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113761146A true CN113761146A (en) | 2021-12-07 |
Family
ID=78786272
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110010501.8A Pending CN113761146A (en) | 2021-01-05 | 2021-01-05 | Method and device for recognizing emotional fluctuation of customer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113761146A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114863636A (en) * | 2022-03-25 | 2022-08-05 | 吉林云帆智能工程有限公司 | Emotion recognition algorithm for rail vehicle driver |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1637740A (en) * | 2003-11-20 | 2005-07-13 | 阿鲁策株式会社 | Conversation control apparatus, and conversation control method |
CN104636425A (en) * | 2014-12-18 | 2015-05-20 | 北京理工大学 | Method for predicting and visualizing emotion cognitive ability of network individual or group |
CN108920510A (en) * | 2018-05-30 | 2018-11-30 | 出门问问信息科技有限公司 | Automatic chatting method, device and electronic equipment |
CN109903851A (en) * | 2019-01-24 | 2019-06-18 | 暨南大学 | A kind of automatic Observation technology of the psychological abnormality variation based on social networks |
CN110096631A (en) * | 2019-03-19 | 2019-08-06 | 北京师范大学 | A kind of stock market's mood report-generating method of the text analyzing of posting based on stock forum |
CN110334182A (en) * | 2019-06-24 | 2019-10-15 | 中国南方电网有限责任公司 | Online service method with speech emotion recognition |
CN111739559A (en) * | 2020-05-07 | 2020-10-02 | 北京捷通华声科技股份有限公司 | Speech early warning method, device, equipment and storage medium |
-
2021
- 2021-01-05 CN CN202110010501.8A patent/CN113761146A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1637740A (en) * | 2003-11-20 | 2005-07-13 | 阿鲁策株式会社 | Conversation control apparatus, and conversation control method |
CN104636425A (en) * | 2014-12-18 | 2015-05-20 | 北京理工大学 | Method for predicting and visualizing emotion cognitive ability of network individual or group |
CN108920510A (en) * | 2018-05-30 | 2018-11-30 | 出门问问信息科技有限公司 | Automatic chatting method, device and electronic equipment |
CN109903851A (en) * | 2019-01-24 | 2019-06-18 | 暨南大学 | A kind of automatic Observation technology of the psychological abnormality variation based on social networks |
CN110096631A (en) * | 2019-03-19 | 2019-08-06 | 北京师范大学 | A kind of stock market's mood report-generating method of the text analyzing of posting based on stock forum |
CN110334182A (en) * | 2019-06-24 | 2019-10-15 | 中国南方电网有限责任公司 | Online service method with speech emotion recognition |
CN111739559A (en) * | 2020-05-07 | 2020-10-02 | 北京捷通华声科技股份有限公司 | Speech early warning method, device, equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114863636A (en) * | 2022-03-25 | 2022-08-05 | 吉林云帆智能工程有限公司 | Emotion recognition algorithm for rail vehicle driver |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109859772B (en) | Emotion recognition method, emotion recognition device and computer-readable storage medium | |
US11403680B2 (en) | Method, apparatus for evaluating review, device and storage medium | |
CN110032630B (en) | Dialectical recommendation device and method and model training device | |
CN112801219B (en) | Multi-mode emotion classification method, device and equipment | |
CN109598387A (en) | Forecasting of Stock Prices method and system based on two-way cross-module state attention network model | |
CN113553412B (en) | Question-answering processing method, question-answering processing device, electronic equipment and storage medium | |
CN114416943B (en) | Training method and device for dialogue model, electronic equipment and storage medium | |
US20230205994A1 (en) | Performing machine learning tasks using instruction-tuned neural networks | |
CN109582788A (en) | Comment spam training, recognition methods, device, equipment and readable storage medium storing program for executing | |
CN112926308B (en) | Method, device, equipment, storage medium and program product for matching text | |
US20230290126A1 (en) | Method for training roi detection model, method for detecting roi, device, and medium | |
CN110826327A (en) | Emotion analysis method and device, computer readable medium and electronic equipment | |
CN113312907B (en) | Remote supervision relation extraction method and device based on hybrid neural network | |
CN113392920B (en) | Method, apparatus, device, medium, and program product for generating cheating prediction model | |
CN113761146A (en) | Method and device for recognizing emotional fluctuation of customer | |
US20230063686A1 (en) | Fine-grained stochastic neural architecture search | |
CN115066690A (en) | Search normalization-activation layer architecture | |
CN117290596A (en) | Recommendation label generation method, device, equipment and medium for multi-mode data model | |
WO2023158881A1 (en) | Computationally efficient distillation using generative neural networks | |
US20220335274A1 (en) | Multi-stage computationally efficient neural network inference | |
CN109144284B (en) | Information display method and device | |
CN114048929A (en) | Stock price data prediction method and device | |
CN114240250A (en) | Intelligent management method and system for vocational evaluation | |
CN115017321A (en) | Knowledge point prediction method and device, storage medium and computer equipment | |
Agarwal et al. | Sentiment Analysis Dashboard for Socia Media comments using BERT |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |