Conversational emotion topic recognition method, device, equipment and medium
By using a pre-set emotion theme lexicon on the terminal device to identify and assign emotion theme words, the problem of low efficiency in manually identifying customer emotion themes by business personnel is solved, and the accurate identification and intensity of emotion themes are realized, thus improving the identification efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEBANK (CHINA)
- Filing Date
- 2023-01-10
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, business personnel rely on human experience to identify customer emotional themes, which is inefficient, cannot accurately judge the intensity of emotions, and is costly.
By receiving dialogue information through terminal devices, identifying emotional theme words in the text content using a pre-set emotional theme word library and assigning weights, the score of the emotional theme is calculated, reducing manual operation and improving recognition efficiency.
It has improved the accuracy of machine recognition of emotional keywords in dialogue information, reflecting the intensity of customer emotions and improving the recognition efficiency and accuracy of business personnel.
Smart Images

Figure CN115936016B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and more particularly to a method, apparatus, device, and medium for identifying emotion topics based on dialogue. Background Technology
[0002] In today's financial industry, differentiated service has become a development trend for customer service center optimization. The core of differentiated service is understanding the user's true needs, and the customer's immediate feedback on the service best reflects the effectiveness of differentiated service; customer emotions are the most direct manifestation of this immediate feedback.
[0003] Currently, for sales personnel to identify customer emotions from conversations, they mainly rely on their own experience. They construct keywords for pre-defined emotional themes (such as excitement, dissatisfaction, etc.) and then judge whether the corresponding emotional theme is contained in the entire text of the conversation based on whether the keywords are matched. In this way, identifying customer emotional themes requires a lot of experience and manual operation from sales personnel, which is costly and cannot guarantee that the corresponding emotional theme will be found. At the same time, simply outputting whether the corresponding emotional theme is contained cannot reflect the intensity of the customer's emotions on that emotional theme.
[0004] In summary, current business personnel are inefficient at identifying customer emotional themes. Summary of the Invention
[0005] The main objective of this invention is to provide a dialogue-based emotion theme recognition method, apparatus, device, and medium, which aims to improve the efficiency of business personnel in recognizing customer emotion themes.
[0006] To achieve the above objectives, the present invention provides a dialogue-based emotion topic recognition method, applied to editing software, wherein the dialogue-based emotion topic recognition method includes:
[0007] Receive dialogue information and extract the text content from the dialogue information;
[0008] Based on a pre-defined emotion topic lexicon, the emotion topic words in the text content are identified and their weights are obtained.
[0009] The score of the emotional topic represented by the emotional topic is calculated based on the weight of the emotional topic.
[0010] Optionally, after the step of receiving dialogue information and extracting text content from the dialogue information, the method further includes:
[0011] Based on a pre-defined emotional topic lexicon, emotional topic terms are mined from the text content and weights are assigned to the newly mined emotional topic terms.
[0012] Add the new, weighted emotion themes to the emotion theme library;
[0013] The step of identifying emotion-related keywords in the text content and obtaining the weights of the emotion-related keywords based on a preset emotion-related keyword database includes:
[0014] Based on the historical and new emotional thesaurus stored in the emotional thesaurus, emotional thesaurus words in the text content are identified and their weights are obtained.
[0015] Optionally, the emotion topic lexicon stores multiple preset emotion topics and multiple seed words corresponding to each emotion topic; the step of mining emotion topic words from the text content based on the preset emotion topic lexicon and assigning weights to the newly mined emotion topic words includes:
[0016] Based on a pre-defined emotional theme lexicon, word vectors are trained on the text content to mine new emotional theme words similar to the seed words;
[0017] Assign weights to the new emotional themes.
[0018] Optionally, the step of mining emotional keywords from the text content based on a preset emotional keyword database and assigning weights to the newly mined emotional keywords further includes:
[0019] Distinguish the roles and conversation times associated with the text content;
[0020] Based on a pre-set emotional theme lexicon, emotional theme words are mined for the text content of different characters according to the dialogue time, and the newly mined emotional theme words are assigned weights.
[0021] Optionally, the emotion topic lexicon stores multiple preset emotion topics; the step of mining emotion topic terms based on the preset emotion topic lexicon and according to the dialogue time for different characters' respective text content includes:
[0022] Based on a pre-defined emotional theme lexicon, an iterative algorithm is used to obtain the target text content of different characters for the same emotional theme one by one.
[0023] The frequent itemset algorithm is used to find frequent patterns in the target text content;
[0024] The frequent patterns are calculated using word frequency-inverse document frequency to obtain multiple emotional topic words for the same emotional topic for different roles.
[0025] Optionally, the step of assigning weights to the newly discovered sentiment keywords includes:
[0026] Obtain the number of times N, the newly discovered emotional keywords, appear in the text content;
[0027] The number of times, S, the new emotional topic term matches the emotional topic represented by the new emotional topic term;
[0028] The new emotional themes are weighted as S / N.
[0029] Optionally, after the step of receiving dialogue information and extracting text content from the dialogue information, the method further includes:
[0030] Add the emotion-related terms stored in the preset emotion-related terminology library to the preset word segmentation terminology library;
[0031] The text content is segmented based on the aforementioned word segmentation dictionary to obtain a word sequence of the text content;
[0032] Based on a pre-defined emotional topic lexicon, emotional topic words in the word sequence are identified and their weights are obtained.
[0033] The score of the emotional topic represented by the emotional topic is calculated based on the weight of the emotional topic.
[0034] Furthermore, to achieve the above objectives, the present invention also provides a dialogue-based emotion topic recognition device, the dialogue-based emotion topic recognition device comprising:
[0035] The receiving module is used to receive dialogue information and extract the text content from the dialogue information;
[0036] The recognition module is used to identify emotional theme words in the text content and obtain the weight of the emotional theme words based on a preset emotional theme word library;
[0037] The calculation module is used to calculate the score of the emotional topic represented by the emotional topic word based on the weight of the emotional topic word.
[0038] In addition, to achieve the above objectives, the present invention also provides a terminal device, the terminal device comprising: a memory, a processor, and a dialogue-based emotion topic recognition program stored in the memory and executable on the processor, wherein the dialogue-based emotion topic recognition program, when executed by the processor, implements the steps of the dialogue-based emotion topic recognition method as described above.
[0039] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a dialogue-based emotion topic recognition program, which, when executed by a processor, implements the steps of the dialogue-based emotion topic recognition method as described above.
[0040] This invention proposes a dialogue-based emotion topic recognition method, apparatus, terminal device, and computer-readable storage medium. The dialogue-based emotion topic recognition method includes: receiving dialogue information and extracting text content from the dialogue information; identifying emotion topic words in the text content based on a preset emotion topic word library and obtaining the weights of the emotion topic words; and calculating the score of the emotion topic represented by the emotion topic words according to the weights of the emotion topic words.
[0041] Compared to traditional dialogue-based emotion topic recognition methods, this invention first receives dialogue information between business personnel and customers through a terminal device and extracts the text content from the dialogue information; then, based on a preset emotion topic lexicon, the terminal device identifies multiple emotion topic words in the text content and obtains the weight of each emotion topic word; finally, the terminal device calculates the score of the emotion topic represented by each emotion topic word based on the obtained weights of each emotion topic word.
[0042] Thus, this invention enables machine recognition of emotion theme words that represent emotional themes in dialogue information, obtaining the weight score of at least one emotion theme contained in the dialogue, reducing manual operation, improving the accuracy of identifying customer emotion themes, and reflecting the intensity of customer emotions on that emotion theme, thereby improving the efficiency of business personnel in identifying customer emotion themes. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the device structure of the terminal device hardware operating environment involved in the embodiments of the present invention;
[0044] Figure 2 This is a flowchart illustrating the first embodiment of the dialogue-based emotion topic recognition method of the present invention.
[0045] Figure 3 This is a schematic diagram illustrating pattern mining in an embodiment of the dialogue-based emotion topic recognition method of the present invention;
[0046] Figure 4 This is a schematic diagram illustrating topic recognition in an embodiment of the dialogue-based emotion topic recognition method of the present invention;
[0047] Figure 5 This is a schematic diagram of the functional modules of an embodiment of the dialogue-based emotion topic recognition device of the present invention.
[0048] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0049] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0051] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0052] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0053] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0054] This invention provides a terminal device.
[0055] like Figure 1 As shown, Figure 1 This is a schematic diagram of the hardware operating environment of the terminal device involved in the embodiments of the present invention.
[0056] like Figure 1As shown, in the hardware operating environment of the terminal device, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or stable non-volatile memory, such as a disk storage device. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0057] Those skilled in the art will understand that Figure 1 The terminal device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0058] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a dialogue-based emotion topic recognition program.
[0059] exist Figure 1 In the device shown, network interface 1004 is mainly used to connect to the backend server and communicate data with it; user interface 1003 is mainly used to connect to the client (user end) and communicate data with it; while processor 1001 can be used to call the dialogue-based emotion topic recognition program stored in memory 1005 and perform the following operations:
[0060] Receive dialogue information and extract the text content from the dialogue information;
[0061] Based on a pre-defined emotion topic lexicon, the emotion topic words in the text content are identified and their weights are obtained.
[0062] The score of the emotional topic represented by the emotional topic is calculated based on the weight of the emotional topic.
[0063] Optionally, the processor 1001 can also be used to invoke a dialogue-based emotion topic recognition program stored in the memory 1005, and after performing the steps of receiving dialogue information and extracting text content from the dialogue information, further perform the following operations:
[0064] Based on a pre-defined emotional topic lexicon, emotional topic terms are mined from the text content and weights are assigned to the newly mined emotional topic terms.
[0065] Add the new, weighted emotion themes to the emotion theme library;
[0066] The processor 1001 can also be used to invoke a dialogue-based emotion topic recognition program stored in the memory 1005 and perform the following operations:
[0067] Based on the historical and new emotional thesaurus stored in the emotional thesaurus, emotional thesaurus words in the text content are identified and their weights are obtained.
[0068] Optionally, the emotion topic lexicon stores multiple preset emotion topics and multiple seed words corresponding to each emotion topic; the processor 1001 can also be used to call the dialogue-based emotion topic recognition program stored in the memory 1005 and perform the following operations:
[0069] Based on a pre-defined emotional theme lexicon, word vectors are trained on the text content to mine new emotional theme words similar to the seed words;
[0070] Assign weights to the new emotional themes.
[0071] Optionally, the processor 1001 can also be used to invoke a dialogue-based emotion topic recognition program stored in the memory 1005 and perform the following operations:
[0072] Distinguish the roles and conversation times associated with the text content;
[0073] Based on a pre-set emotional theme lexicon, emotional theme words are mined for the text content of different characters according to the dialogue time, and the newly mined emotional theme words are assigned weights.
[0074] Optionally, the processor 1001 can also be used to invoke a dialogue-based emotion topic recognition program stored in the memory 1005 and perform the following operations:
[0075] Based on a pre-defined emotional theme lexicon, an iterative algorithm is used to obtain the target text content of different characters for the same emotional theme one by one.
[0076] The frequent itemset algorithm is used to find frequent patterns in the target text content;
[0077] The frequent patterns are calculated using word frequency-inverse document frequency to obtain multiple emotional topic words for the same emotional topic for different roles.
[0078] Optionally, the processor 1001 can also be used to invoke a dialogue-based emotion topic recognition program stored in the memory 1005 and perform the following operations:
[0079] Obtain the number of times N, the newly discovered emotional keywords, appear in the text content;
[0080] The number of times, S, the new emotional topic term matches the emotional topic represented by the new emotional topic term;
[0081] The new emotional themes are weighted as S / N.
[0082] Optionally, the processor 1001 can also be used to invoke a dialogue-based emotion topic recognition program stored in the memory 1005, and after performing the steps of receiving dialogue information and extracting text content from the dialogue information, further perform the following operations:
[0083] Add the emotion-related terms stored in the preset emotion-related terminology library to the preset word segmentation terminology library;
[0084] The text content is segmented based on the aforementioned word segmentation dictionary to obtain a word sequence of the text content;
[0085] Based on a pre-defined emotional topic lexicon, emotional topic words in the word sequence are identified and their weights are obtained.
[0086] The score of the emotional topic represented by the emotional topic is calculated based on the weight of the emotional topic.
[0087] Based on the above hardware structure, the overall concept of various embodiments of the dialogue-based emotion topic recognition method of the present invention is proposed.
[0088] In this embodiment of the invention, differentiated service has become a development trend for customer service optimization in the current financial industry. The core of differentiated service is understanding the user's true needs, and the customer's immediate feedback on the service best reflects the effectiveness of differentiated service; customer emotions are the most direct manifestation of this immediate feedback.
[0089] Currently, for sales personnel to identify customer emotions from conversations, they mainly rely on their own experience. They construct keywords for pre-defined emotional themes (such as excitement, dissatisfaction, etc.) and then judge whether the corresponding emotional theme is contained in the entire text of the conversation based on whether the keywords are matched. In this way, identifying customer emotional themes requires a lot of experience and manual operation from sales personnel, which is costly and cannot guarantee that the corresponding emotional theme will be found. At the same time, simply outputting whether the corresponding emotional theme is contained cannot reflect the intensity of the customer's emotions on that emotional theme.
[0090] In summary, current business personnel are inefficient at identifying customer emotional themes.
[0091] To address the aforementioned problems, this invention proposes a dialogue-based emotion topic recognition method. The method includes: receiving dialogue information and extracting text content from the dialogue information; identifying emotion topic words in the text content based on a preset emotion topic lexicon and obtaining the weights of the emotion topic words; and calculating a score for the emotion topic represented by the emotion topic words based on their weights.
[0092] Compared to traditional dialogue-based emotion topic recognition methods, this invention first receives dialogue information between business personnel and customers through a terminal device and extracts the text content from the dialogue information; then, based on a preset emotion topic lexicon, the terminal device identifies multiple emotion topic words in the text content and obtains the weight of each emotion topic word; finally, the terminal device calculates the score of the emotion topic represented by each emotion topic word based on the obtained weights of each emotion topic word.
[0093] Thus, this invention enables machine recognition of emotion theme words that represent emotional themes in dialogue information, obtaining the weight score of at least one emotion theme contained in the dialogue, reducing manual operation, improving the accuracy of identifying customer emotion themes, and reflecting the intensity of customer emotions on that emotion theme, thereby improving the efficiency of business personnel in identifying customer emotion themes.
[0094] Based on the overall concept of the dialogue-based emotion topic recognition method of the present invention described above, various embodiments of the dialogue-based emotion topic recognition method of the present invention are proposed.
[0095] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the dialogue-based emotion topic recognition method of the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0096] In this embodiment, for ease of understanding and explanation, the terminal device is used as the direct execution subject to illustrate the dialogue-based emotion topic recognition method of the present invention.
[0097] like Figure 2 As shown, in this embodiment, the dialogue-based emotion topic recognition method of the present invention may include:
[0098] Step S10: Receive dialogue information and extract the text content from the dialogue information;
[0099] In this embodiment, when the terminal device receives dialogue information between a customer, two customer roles, or any number of customer roles, it extracts the text content from the received dialogue information.
[0100] It should be noted that in this embodiment, the terminal device can start receiving dialogue information when it receives an emotion topic recognition instruction, or it can be set to periodically export dialogue information from the system in real time. The dialogue information received by the terminal device can be understood as multiple data items arranged in chronological order, including dialogue roles, dialogue time, and text content. The text content can be the expressed text in the text dialogue information, the expressed content in the voice or telephone conversion dialogue information converted into text, etc.
[0101] Step S20: Based on a preset emotion topic lexicon, identify emotion topic words in the text content and obtain the weights of the emotion topic words;
[0102] In this embodiment, the terminal device identifies emotional theme words in the extracted text content by referring to a preset emotional theme word library in its own system, and obtains the weight of the emotional theme word in the word library.
[0103] Step S30: Calculate the score of the emotional topic represented by the emotional topic word according to the weight of the emotional topic word.
[0104] In this embodiment, after the terminal device obtains all the emotion topic words and their corresponding weights in a text content, since one emotion topic corresponds to multiple emotion topic words, which can be words, phrases, regular expressions, etc., the terminal device sums the weights of multiple emotion topic words under the same emotion topic, and the summation result is the score of the emotion topic.
[0105] For example, in one feasible embodiment, if the terminal device calculates that a customer's emotion recognition result shows that the "anger" theme has the highest score, the business personnel will be more cautious and gentle when communicating with the customer in the future. Alternatively, if the result shows that the customer has a high score for personal attacks or complaints, the business personnel will also reduce their initiative to contact the customer in the future.
[0106] Compared to traditional dialogue-based emotion topic recognition methods, this invention pre-sets multiple emotion topics containing seed words, then utilizes the structural characteristics of dialogue information to mine emotion topic patterns, i.e., emotion topic words, and assigns weights to each pattern. Finally, the weights of multiple patterns representing the same emotion topic are merged into an emotion topic score for output, which can represent the intensity of dialogue information on that emotion topic.
[0107] Thus, this embodiment of the invention reduces the manual operation of business personnel in identifying emotional themes, and its output reflects the intensity of the customer's emotions on that emotional theme, which is beneficial for business personnel to utilize the identification results in the future.
[0108] Furthermore, based on the first embodiment of the dialogue-based emotion topic recognition method of the present invention described above, a second embodiment of the dialogue-based emotion topic recognition method of the present invention is proposed.
[0109] In this embodiment, after step S10 of the first embodiment above: receiving dialogue information and extracting text content from the dialogue information, the emotion topic recognition method based on dialogue of the present invention may further include:
[0110] Step S40: Based on a preset emotion topic thesaurus, perform emotion topic mining on the text content and assign weights to the newly mined emotion topic terms;
[0111] In this embodiment, the terminal device mines emotional keywords from the acquired text content based on its own stored emotional keyword library, and assigns weights to the new emotional keywords mined in the text.
[0112] Optionally, in a feasible embodiment, the aforementioned emotion topic lexicon stores multiple preset emotion topics and multiple seed words corresponding to each emotion topic. Based on this, step S40 includes:
[0113] Step S401: Based on a preset emotion theme lexicon, perform word vector training on the text content to mine new emotion theme words similar to the seed words;
[0114] In this embodiment, the terminal device trains word vectors on the text content based on its own stored emotion topic lexicon. Through training, the terminal device obtains new emotion topic words in the text content that are similar to the seed words in the lexicon.
[0115] It should be noted that in this embodiment, the emotion theme lexicon has multiple preset emotion themes, such as excitement and dissatisfaction. The type of emotion theme can be preset by the user, or new emotion themes can be added in real time based on dialogue information during the subsequent application of the lexicon. For each emotion theme in the emotion theme lexicon, there are preset seed words, that is, keywords or regular expressions of the emotion theme. The seed words can also be preset by the user or added in real time based on dialogue information during the subsequent application. This invention does not specifically limit the emotion themes and seed words in the emotion theme lexicon.
[0116] To perform word vector training, the terminal device first needs to segment the text content using a word segmentation tool and then map the segmented word list to a word vector space. The terminal device then uses the seed word as the start word and iterates through each start word in turn, using the position of the start word in the word vector space and a specified length radius to find similar new words. In this way, the terminal device obtains multiple new emotional theme words that are similar to the seed words in the text content and the word library through word vector training.
[0117] Step S402: Assign weights to the new emotional keywords.
[0118] In this embodiment, after obtaining multiple new emotional topic words similar to seed words in the text content and the word library through word vector training, the terminal device assigns weights to each of the multiple new emotional topic words and adds them to the emotional topic word library.
[0119] In another embodiment, step S40 above, which involves mining emotional themes from the text content based on a preset emotional theme thesaurus and assigning weights to the newly mined emotional themes, may further include:
[0120] Step S403: Distinguish the role and dialogue time of the text content;
[0121] In this embodiment, after obtaining the text content in the dialogue information, the terminal device distinguishes the role to which each text content belongs and the time of its dialogue. Taking advantage of the thematic consistency and expressive diversity of the emotions in the dialogue information, the terminal device mines emotional theme words through multi-role collaborative learning.
[0122] Step S404: Based on the preset emotional topic lexicon, emotional topic words are mined for the text content of different characters according to the dialogue time, and the newly mined emotional topic words are assigned weights.
[0123] In this embodiment, the terminal device mines emotional themes based on a preset emotional theme lexicon and according to the time of the dialogue, targeting the text content of different characters, and assigns weights to the newly mined emotional themes.
[0124] Furthermore, in one feasible embodiment, if the terminal device identifies only one character in the dialogue information, it can also mine the emotional theme words of that character. The present invention does not specifically limit the number of characters involved in the dialogue information.
[0125] Optionally, in a feasible embodiment, step S404 above may include:
[0126] Step S4041: Based on the preset emotion topic lexicon, use an iterative algorithm to obtain the target text content of different characters for the same emotion topic one by one;
[0127] In this embodiment, the terminal device uses an iterative algorithm based on a preset emotion topic lexicon to obtain the target text content of different characters for the same emotion topic according to the time of the dialogue.
[0128] Exemplarily, in one feasible embodiment, such as Figure 3 As shown, the dialogue information received by the terminal device is a dialogue between Role 1 and Role 2. The terminal device has matched the dialogue record K of Role 1 regarding emotional theme A, that is, the dialogue record K contains the emotional theme words corresponding to emotional theme A. Then, the terminal device finds the dialogue records before and after dialogue record K (corresponding to Role 2) based on the dialogue time of the text content. It uses the records before and after dialogue record K to mine the emotional keywords of Role 2 regarding emotional theme A. Then, through the same process, it mines the emotional theme words of Role 1 in emotional theme A by using the context of the matched dialogue record of Role 2 regarding emotional theme A, until the entire process converges or reaches the preset number of rounds of the terminal device.
[0129] Step S4042: Use the frequent itemset algorithm to find frequent patterns in the target text content;
[0130] In this embodiment, the terminal device uses the frequent itemset algorithm to find the frequent patterns in the target text content of any character for the same emotional topic, that is, to find the frequently occurring topic patterns in the target text content. The topic patterns can be keywords, phrases or regular expressions, etc.
[0131] Step S4043: Perform word frequency-inverse document frequency calculation on the frequent patterns to obtain multiple emotional topic words for the same emotional topic for different roles.
[0132] In this embodiment, the terminal device performs term frequency-inverse document frequency (TF-IDF) calculation on the frequent patterns of different roles for the same emotional topic, and obtains multiple emotional topic words for different roles for the same emotional topic.
[0133] It should be noted that in this embodiment, the terminal device corrects the obtained frequent patterns by word frequency-inverse document frequency calculation. That is, it first obtains the occurrence frequency of all keywords, and then deletes words that have a high occurrence frequency but have no practical meaning or are not important in the current text content. The terminal device can also combine manual annotation to filter out the emotional theme words in the frequent patterns that are semantically consistent.
[0134] Step S50: Add the weighted new emotion keywords to the emotion keyword library;
[0135] In this embodiment, the terminal device assigns weights to the new emotional keywords it discovers in the text content, and then adds the new emotional keywords and their weights to its stored emotional keyword library.
[0136] It should be noted that, compared to the keywords constructed by existing solutions, the emotional keywords added to the emotional thesaurus through the above steps are semantically more in line with the characteristics of the business that business personnel need to handle, and the resulting emotional keywords can more accurately and completely cover the business to be handled.
[0137] Based on this, in this embodiment, step S20 above: identifying emotional keywords in the text content and obtaining the weights of the emotional keywords based on a preset emotional keyword library, may include:
[0138] Step S201: Based on the historical and new emotional themes stored in the emotional theme lexicon, identify the emotional themes in the text content and obtain the weights of the emotional themes.
[0139] In this embodiment, the terminal device identifies the emotional keywords in the extracted text content by comparing the historical and new emotional keywords stored in the emotional keyword database with the database, and obtains the weight of the emotional keyword in the database.
[0140] For example, in one feasible embodiment, the terminal device discovers a new emotional topic word, "I'm really angry," which represents the emotion of anger and has a weight of 80%. The terminal device adds this word to the emotional topic word library. At the same time, words representing the emotion of anger in the word library also include "Please calm down" and "I'm very angry." Then, the terminal device re-matches and assigns emotional topic words to the dialogue information based on the emotional topic word library. When the terminal device matches "I'm really angry" in the dialogue information, it obtains its weight and records it. When the terminal device matches "Please calm down" in the dialogue information, it also obtains its weight and records it. Finally, the terminal device adds up the weights of all emotional topic words related to the emotion of anger matched in this dialogue information, and the result is the score of the emotion of anger in this dialogue information.
[0141] In this embodiment, the terminal device mainly extracts emotional theme keywords from dialogue information in two ways. The first method is to use word vectors to calculate similarity and semantically expand the seed words in the emotional theme lexicon to obtain more text patterns related to emotional themes. The second method is to utilize the structural characteristics of dialogue data and, based on the assumption of theme consistency and expression diversity before and after the dialogue, use a multi-role collaborative mining approach and iterative algorithms to continuously mine different theme patterns of different roles for the same emotional theme.
[0142] In this way, the terminal device combines semantics to expand the emotional topic words in the emotional topic lexicon. This allows the emotional topic lexicon to continuously expand its pattern scale while keeping the semantics of the topic patterns unchanged, thereby achieving the goal of efficient mining and improving the efficiency of business personnel in recognizing customer emotional topics.
[0143] Furthermore, based on the first and / or second embodiments of the dialogue-based emotion topic recognition method of the present invention described above, a third embodiment of the dialogue-based emotion topic recognition method of the present invention is proposed.
[0144] In this embodiment, the step of "assigning weights to newly discovered emotion topic words" in the dialogue-based emotion topic recognition method of the present invention includes:
[0145] Step A10: Obtain the number of times N, representing the newly discovered emotional themes, appears in the text content;
[0146] In this embodiment, the terminal device extracts the text content from the received dialogue information, then mines emotional themes in the text content based on the emotional theme thesaurus, and simultaneously obtains the number of times N of the newly mined emotional themes appear in the text content.
[0147] Step A20: Obtain the number of times, S, that the new emotional topic word matches the emotional topic represented by the new emotional topic word;
[0148] In this embodiment, the terminal device receives a matching signal input by the user to obtain the number of times, S, that new emotional topic words mined from the text content match the emotional topic they represent.
[0149] Step A30: Assign weights to the new emotional topic words as S / N.
[0150] In this embodiment, the terminal device assigns a weight S / N to each of the newly discovered emotion keywords. That is, the number of times the emotion keyword matches an emotion topic is divided by the number of times the emotion keyword appears in the text content, and the result is the weight of the emotion keyword.
[0151] For example, in one feasible embodiment, for pattern K of emotional theme A, pattern k is an emotional theme word. The terminal device extracts n dialogue messages that match pattern k from several dialogue messages, and manually labels them to obtain s messages that are related to theme A. Then the weight of pattern k is defined as s / n.
[0152] Optionally, in a feasible embodiment, after step S10: receiving dialogue information and extracting text content from the dialogue information, the following may be included:
[0153] Step B10: Add the emotion theme words stored in the preset emotion theme lexicon to the preset word segmentation lexicon;
[0154] In this embodiment, the terminal device stores a word segmentation lexicon. The terminal device adds emotion theme words stored in the emotion theme lexicon to the word segmentation lexicon to improve the word segmentation lexicon, so that the results of subsequent word segmentation processing of text content are more in line with business characteristics and more targeted.
[0155] Step B20: Perform word segmentation on the text content based on the word segmentation dictionary to obtain the word sequence of the text content;
[0156] In this embodiment, the terminal device performs word segmentation on the text content it acquires based on a word segmentation dictionary with added emotion theme words to obtain the word sequence of the text content. By using a word segmentation dictionary with added emotion theme words, the terminal device is less likely to lose the original semantics during the word segmentation process of the text content, and can more completely cover the emotion themes contained in the text content.
[0157] Step B30: Based on a preset emotion topic lexicon, identify emotion topic words in the word sequence and obtain the weights of the emotion topic words;
[0158] In this embodiment, the terminal device identifies emotional topic words in a word sequence based on its own stored emotional topic word library and obtains the weight of the identified emotional topic words.
[0159] Step B40: Calculate the score of the emotional topic represented by the emotional topic word based on the weight of the emotional topic word.
[0160] In this embodiment, after obtaining all the emotion topic words and their corresponding weights in the word sequence, the terminal device sums the weights of multiple emotion topic words under the same emotion topic, and the summation result is the score of the emotion topic.
[0161] For example, such as Figure 4As shown, after receiving dialogue information, the terminal device performs topic word mining and weighting based on the dialogue information, and then adds the mined emotional topic words and their weights to the emotional topic word library. On the other hand, the terminal device performs Chinese word segmentation on the received dialogue information to obtain the word sequence corresponding to the dialogue information. Then, based on the emotional topic word library, it matches topic words in the word sequence and assigns weights to calculate the dialogue topic score. That is, the weights of the emotional topic words that match the emotional topic are summed, and the result of the weight summation is the score of the emotional topic. Since the same dialogue information can contain multiple emotional topics, the terminal device can output multiple topic scores based on the dialogue information. Users can judge the intensity of a customer's emotional topic based on the scores of the same customer on multiple emotional topics.
[0162] In this embodiment, by outputting the final score of the emotion theme obtained from a dialogue, the terminal device can more intuitively represent the intensity of the dialogue information on the emotion theme. This is beneficial for business personnel to use the output results later. Furthermore, when the terminal device performs word segmentation on the text content, it adds emotion theme words to the word segmentation lexicon, which can reduce semantic loss in the text content. Even if different roles in the dialogue express the same emotion theme differently, the terminal device can obtain more word sequences suitable for this business through the word segmentation lexicon. This helps business personnel to more accurately and completely identify the customer's emotion theme and improve the efficiency of business personnel in identifying the customer's emotion theme.
[0163] Furthermore, this invention also proposes a dialogue-based emotion topic recognition device.
[0164] Please refer to Figure 5 The present invention provides a dialogue-based emotion topic recognition device comprising:
[0165] The receiving module 10 is used to receive dialogue information and extract the text content from the dialogue information;
[0166] The identification module 20 is used to identify emotional theme words in the text content and obtain the weight of the emotional theme words based on a preset emotional theme word library;
[0167] The calculation module 30 is used to calculate the score of the emotional topic represented by the emotional topic word according to the weight of the emotional topic word.
[0168] Optionally, the dialogue-based emotion topic recognition device of the present invention further includes:
[0169] The mining module is used to mine emotional keywords from the text content based on a preset emotional keyword library and assign weights to the newly mined emotional keywords; and is used to add the weighted new emotional keywords to the emotional keyword library.
[0170] Optionally, the mining module also includes:
[0171] The first mining unit is used to perform word vector training on the text content based on a preset emotion topic lexicon to mine new emotion topic words similar to the seed words; and is used to assign weights to the new emotion topic words.
[0172] The second mining unit is used to distinguish the role and dialogue time of the text content; and is used to mine emotional theme words for the text content of different roles based on a preset emotional theme word library and according to the dialogue time, and to assign weights to the newly mined emotional theme words; and is used to obtain the target text content of different roles for the same emotional theme one by one using an iterative algorithm based on the preset emotional theme word library; and is used to find frequent patterns in the target text content using a frequent itemset algorithm; and is used to calculate the term frequency-inverse document frequency of the frequent patterns to obtain multiple emotional theme words for the same emotional theme for different roles.
[0173] Optionally, the identification module 20 is further configured to identify emotional keywords in the text content and obtain the weight of the emotional keywords based on the historical and new emotional keywords stored in the emotional keyword library; and to identify emotional keywords in the word sequence and obtain the weight of the emotional keywords based on a preset emotional keyword library.
[0174] Optionally, the dialogue-based emotion topic recognition device of the present invention further includes:
[0175] The weighting module is used to obtain the number of times N, the newly mined emotional topic words appear in the text content; and to obtain the number of times S, the new emotional topic words match the emotional topic represented by the new emotional topic words; and to assign a weight of S / N to the new emotional topic words.
[0176] Optionally, the dialogue-based emotion topic recognition device of the present invention further includes:
[0177] The word segmentation module is used to add emotion-themed words stored in a preset emotion-themed word library to a preset word segmentation word library; and to perform word segmentation processing on the text content based on the word segmentation word library to obtain the word sequence of the text content.
[0178] The functions of each module in the above-mentioned dialogue-based emotion topic recognition device correspond to the steps in the above-mentioned dialogue-based emotion topic recognition method embodiment, and their functions and implementation processes will not be described in detail here.
[0179] Furthermore, the present invention also proposes a storage medium storing a dialogue-based emotion topic recognition program, which, when executed by a processor, implements the steps of the dialogue-based emotion topic recognition method of the present invention as described above.
[0180] The specific embodiments of the storage medium of the present invention are basically the same as the embodiments of the dialogue-based emotion topic recognition method described above, and will not be repeated here.
[0181] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0182] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0183] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0184] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A dialogue-based emotion topic recognition method, characterized in that, The dialogue-based emotion topic recognition method includes: Receive dialogue information and extract the text content from the dialogue information; Based on a pre-defined emotion topic lexicon, the emotion topic words in the text content are identified and their weights are obtained. The score of the emotional topic represented by the emotional topic term is calculated based on the weight of the emotional topic term. The method further includes, after the step of receiving dialogue information and extracting text content from the dialogue information: Based on a pre-defined emotional topic lexicon, emotional topic terms are mined from the text content and weights are assigned to the newly mined emotional topic terms. Add the new, weighted emotion themes to the emotion theme library; The step of identifying emotion-related keywords in the text content and obtaining the weights of the emotion-related keywords based on a preset emotion-related keyword database includes: Based on the historical and new emotional thesaurus stored in the emotional thesaurus, the emotional thesaurus in the text content is identified and the weight of the emotional thesaurus is obtained; The step of mining emotional themes from the text content based on a preset emotional theme lexicon and assigning weights to the newly mined emotional themes further includes: Distinguish the roles and conversation times associated with the text content; Based on a pre-set emotional theme lexicon, emotional theme words are mined for the text content of different characters according to the dialogue time, and the newly mined emotional theme words are assigned weights.
2. The dialogue-based emotion topic recognition method as described in claim 1, characterized in that, The emotion theme lexicon stores multiple preset emotion themes and multiple seed words corresponding to each emotion theme; The steps of mining emotional themes from the text content based on a preset emotional theme lexicon and assigning weights to the newly mined emotional themes include: Based on a pre-defined emotional theme lexicon, word vectors are trained on the text content to mine new emotional theme words similar to the seed words; Assign weights to the new emotional themes.
3. The dialogue-based emotion topic recognition method as described in claim 1, characterized in that, The emotion theme lexicon stores multiple preset emotion themes; the step of mining emotion theme words based on the preset emotion theme lexicon and according to the dialogue time for different characters' respective text content includes: Based on a pre-defined emotional theme lexicon, an iterative algorithm is used to obtain the target text content of different characters for the same emotional theme one by one. The frequent itemset algorithm is used to find frequent patterns in the target text content; The frequent patterns are calculated using word frequency-inverse document frequency to obtain multiple emotional topic words for the same emotional topic for different roles.
4. The dialogue-based emotion topic recognition method as described in any one of claims 1 to 3, characterized in that, The step of assigning weights to newly discovered emotional themes includes: Obtain the number of times N, the newly discovered emotional keywords, appear in the text content; The number of times, S, the new emotional topic term matches the emotional topic represented by the new emotional topic term; The new emotional themes are weighted as S / N.
5. The dialogue-based emotion topic recognition method as described in claim 1, characterized in that, After the steps of receiving dialogue information and extracting text content from the dialogue information, the method further includes: Add the emotion-related terms stored in the preset emotion-related terminology library to the preset word segmentation terminology library; The text content is segmented based on the aforementioned word segmentation dictionary to obtain a word sequence of the text content; Based on a pre-defined emotional topic lexicon, emotional topic words in the word sequence are identified and their weights are obtained. The score of the emotional topic represented by the emotional topic is calculated based on the weight of the emotional topic.
6. A dialogue-based emotion topic recognition device, characterized in that, The dialogue-based emotion topic recognition device includes: The receiving module is used to receive dialogue information and extract the text content from the dialogue information; The recognition module is used to identify emotional theme words in the text content and obtain the weight of the emotional theme words based on a preset emotional theme word library; The calculation module is used to calculate the score of the emotional topic represented by the emotional topic word based on the weight of the emotional topic word; The dialogue-based emotion topic recognition device also includes a mining module: The mining module is used to mine emotional keywords from the text content based on a preset emotional keyword library and assign weights to the newly mined emotional keywords; and to add the weighted new emotional keywords to the emotional keyword library. The mining module is also used to distinguish the role and dialogue time of the text content; and to mine emotional keywords for the text content of different roles based on a preset emotional keyword library and according to the dialogue time, and to assign weights to the newly mined emotional keywords.
7. A terminal device, characterized in that, The terminal device includes: a memory, a processor, and a dialogue-based emotion topic recognition program stored in the memory and executable on the processor. When the dialogue-based emotion topic recognition program is executed by the processor, it implements the steps of the dialogue-based emotion topic recognition method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a dialogue-based emotion topic recognition program, which, when executed by a processor, implements the steps of the dialogue-based emotion topic recognition method as described in any one of claims 1 to 5.