Conversation emotion classification method, system, electronic device and storage medium

By extracting words from the pretrained word vector model and calculating word vectors, the problems of insufficient word coverage and uncertainty of word participle in the Chinese pretrained word vector model are solved, and the accuracy of emotional classification of conversation content is improved.

CN113282749BActive Publication Date: 2025-02-28BEIJING MININGLAMP SOFTWARE SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110552802.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-20
Publication Date
2025-02-28
Estimated Expiration
2041-05-20

AI Technical Summary

Technical Problem

The insufficient word coverage of Chinese open source pre-trained word vectors and the uncertainty brought by the Chinese word segmenter to the emotional classification of conversation contents lead to low classification accuracy.

Method used

By extracting words from the pretrained word vector model, dividing the words into words, and obtaining an adjacency table based on the word formation relationship between words and words, calculating the word vector, and finally inputting the word vector into the deep neural network model for emotional classification.

Benefits of technology

The errors caused by insufficient word coverage and uncertainty of word participle in Chinese pre-trained word vector model are solved, and the accuracy and stability of natural language processing are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113282749B_ABST
    Figure CN113282749B_ABST
Patent Text Reader

Abstract

The present application discloses a conversation emotion classification method, system, electronic device and storage medium. The conversation emotion classification method includes: conversation content processing step: after receiving the conversation content, text processing is performed on the conversation content; dictionary generation step: extracting words from the pre-trained word vector model, segmenting the words into characters, and forming a dictionary after processing the characters; character vector acquisition step: after obtaining an adjacency table according to the word formation relationship between the characters and the words, the character vector is calculated according to the adjacency table; conversation content emotion classification step: after inputting the character vector into a deep neural network model, the emotion classification result of the character vector is obtained. The present invention performs emotion classification on the conversation content, avoiding the uncertainty problem brought by Chinese word segmentation and open source Chinese pre-trained word vectors to the conversation content emotion classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of deep learning technology, and in particular to a conversation emotion classification method, system, electronic device and storage medium. Background Art

[0002] Conversational sentiment analysis is one of the most important research tasks in the field of natural language processing (NLP) in recent years. It has great applications in many fields such as human-computer dialogue, intelligent customer service, and intelligent marketing. However, because the characteristics of conversations themselves are small number of words, serious colloquialism, and high probability of typos, the sentiment classification of conversation content becomes more difficult. The deep learning-based sentiment analysis method is currently the most mainstream conversational sentiment method. This method mainly segments the conversation content into words, then uses the pre-trained model to learn the word vector of the corresponding word item, and then uses the word vector as the input of the deep neural network for training and prediction, and finally outputs the sentiment category. Since most of the natural language processing libraries are basically for English, there are even fewer open source pre-trained word vector models in terms of word vector pre-training, which results in the application of pre-trained word vector models in Chinese far less than in English. The main reasons are: the cost of pre-training a word vector model is extremely huge; there are fewer open source trained word vector models in Chinese; due to the different Chinese word segmenters, the word segmentation results obtained are different from the dictionary in the word vector model. In other words, due to the difference between the word segmenter used in the pre-trained model and the word segmenter used in the specific application, the dictionaries of both parties do not match, that is, the words are segmented but the corresponding vectors cannot be found. As a result, the errors are cascaded, and ultimately the subsequent classification algorithm has low accuracy. Summary of the invention

[0003] The embodiments of the present application provide a conversation sentiment classification method, system, electronic device and storage medium, so as to at least solve the problems of insufficient word coverage of Chinese open source pre-trained word vectors and uncertainty caused by Chinese word segmenters in conversation content sentiment classification through the present invention.

[0004] The present invention provides a conversation sentiment classification method, comprising:

[0005] Conversation content processing step: after receiving the conversation content, text processing is performed on the conversation content;

[0006] Dictionary generation step: extract words from the pre-trained word vector model, split the words into characters, and process the characters to form a dictionary;

[0007] The character vector acquisition step: after acquiring an adjacency table according to the word-forming relationship between the character and the word, the character vector is calculated according to the adjacency table;

[0008] Conversation content sentiment classification step: After the word vector is input into the deep neural network model, the sentiment classification result of the word vector is obtained.

[0009] In the above-mentioned conversation emotion classification method, the conversation content processing step includes:

[0010] Session content acquisition step: receiving the session content generated by the user end;

[0011] The text processing step of the conversation content: converting the non-text type content in the conversation content into text type;

[0012] Conversation content preprocessing step: standardizing the conversation content, and dividing the standardized conversation content into word sequences.

[0013] In the above-mentioned conversation sentiment classification method, the word vector acquisition step includes:

[0014] Dictionary acquisition step: after reading the pre-trained word vector model according to the word sequence, extract all the words from the pre-trained word vector model, and use the words to form a dictionary;

[0015] Dictionary acquisition step: dividing the words in the dictionary into separate characters, storing and removing duplicates from the separated characters, and using the processed characters to form the dictionary;

[0016] Adjacency list acquisition step: putting the character and the words corresponding to the character into the adjacency list, with the character as the table header and the words being put into a one-way linked list pointed to by the table header;

[0017] Word vector calculation step: traverse the adjacency list and calculate the word vector according to the adjacency list.

[0018] In the above-mentioned conversation sentiment classification method, the conversation content sentiment classification step includes inputting the word vector into the deep neural network model and performing sentiment classification on the word vector to obtain the sentiment classification result of the word vector.

[0019] The present invention also provides a conversation emotion classification system, wherein the conversation emotion classification method described above is applicable, and the conversation emotion classification system comprises:

[0020] Conversation content processing unit: after receiving the conversation content, performing text processing on the conversation content;

[0021] Dictionary generation unit: extracts words from the pre-trained word vector model, divides the words into characters, and processes the characters to form a dictionary;

[0022] A character vector acquisition unit: after acquiring an adjacency table according to the word-forming relationship between the character and the word, calculating the character vector according to the adjacency table;

[0023] Conversation content sentiment classification unit: after inputting the word vector into the deep neural network model, the sentiment classification result of the word vector is obtained.

[0024] In the above-mentioned conversation emotion classification system, the conversation content processing unit includes:

[0025] Session content acquisition module: receiving the session content generated by the user end;

[0026] Conversation content text processing module: converting non-text content in the conversation content into text type;

[0027] The conversation content preprocessing module is used to standardize the conversation content and divide the standardized conversation content into word sequences.

[0028] In the above-mentioned conversation sentiment classification system, the word vector acquisition unit includes:

[0029] Dictionary acquisition module: after reading the pre-trained word vector model according to the word sequence, extract all the words from the pre-trained word vector model, and use the words to form a dictionary;

[0030] Dictionary acquisition module: segmenting the words in the dictionary into individual characters, storing and deduplicating the segmented characters, and using the processed characters to form the dictionary;

[0031] Adjacency table acquisition module: putting the character and the words corresponding to the character into the adjacency table, wherein the character is the table header and the words are put into a one-way linked list pointed to by the table header;

[0032] A word vector calculation module traverses the adjacency list and calculates the word vector according to the adjacency list.

[0033] In the above-mentioned conversation sentiment classification system, the word vector is input into the deep neural network model and sentiment classification is performed on the word vector, and the sentiment classification result of the word vector is obtained through the conversation content sentiment classification unit.

[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor When the processor executes the computer program, Any of the above-mentioned conversation sentiment analysis Class methods.

[0035] The present invention also provides an electronic device readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by the processor, any of the above-mentioned conversation emotion classification methods is implemented.

[0036] Compared with the related art, the present invention realizes the conversion of word vectors into character vectors, and uses character vectors to construct sentence or paragraph vectors, thereby solving the problem of insufficient word coverage of Chinese open source pre-trained word vectors and the uncertainty caused by Chinese word segmenters. In addition, the method for obtaining character vectors proposed in the present disclosure is concise and efficient, the cost of character vector training and learning is extremely low, and the natural language processing capability is improved.

[0037] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0039] Figure 1 is a flow chart of a conversation sentiment classification method according to an embodiment of the present application;

[0040] Figure 2 is a framework diagram of a method for obtaining a word vector according to an embodiment of the present application;

[0041] Figure 3 is a framework diagram of a device for conversation emotion classification according to an embodiment of the present application;

[0042] Figure 4 It is a structural schematic diagram of the conversation emotion classification system of the present invention;

[0043] Figure 5 is a framework diagram of an electronic device according to an embodiment of the present application.

[0044] Wherein, the accompanying drawings are marked as follows:

[0045] Session content processing unit: 51;

[0046] Dictionary generation unit: 52;

[0047] Word vector acquisition unit: 53;

[0048] Conversation content sentiment classification unit: 54;

[0049] Session content acquisition module 511;

[0050] Conversation content text processing module: 512;

[0051] Session content preprocessing module: 513;

[0052] Dictionary acquisition module: 531;

[0053] Dictionary acquisition module: 532

[0054] Adjacency list acquisition module: 533;

[0055] Word vector calculation module: 534;

[0056] Bus:80;

[0057] Processor: 81;

[0058] Memory: 82;

[0059] Communication interface:83. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0061] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the disclosure of the present application, some changes in design, manufacturing or production based on the technical content disclosed in the present application are just conventional technical means, and should not be understood as the disclosure of the present application is insufficient.

[0062] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0063] Unless otherwise defined, the technical or scientific terms used in this application shall have the common meanings understood by persons with ordinary skills in the technical field to which this application belongs. The words "a", "an", "a", "the" and the like used in this application do not indicate quantity restrictions and may indicate the singular or plural. The terms "including", "comprising" and "comprising" used in this application shall not be construed as limiting the number of words or phrases. 、 "having" and any variations thereof are intended to cover a non-exclusive inclusion; e.g. For example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third" and the like involved in this application are merely to distinguish similar objects, and do not represent a specific ordering of objects.

[0064] The present invention provides a conversation content sentiment classification method, system, electronic device and storage medium, which does not need to perform Chinese word segmentation but only needs character segmentation, does not rely on word vectors, but uses an open source pre-trained word vector model to learn word vectors, thereby avoiding word segmentation errors caused by a Chinese word segmenter and cascade errors caused by insufficient words in an open source Chinese pre-trained word vector model.

[0065] The present invention is described below in conjunction with specific embodiments.

[0066] Embodiment 1

[0067] This embodiment provides a conversation sentiment classification method. Figure 1 to Figure 2 , Figure 1 is a flow chart of a conversation sentiment classification method according to an embodiment of the present application; Figure 2 : is a framework diagram of a method for obtaining a word vector according to an embodiment of the present application. As shown in the figure, the conversation sentiment classification method includes the following steps:

[0068] Conversation content processing step S1: after receiving the conversation content, text processing is performed on the conversation content;

[0069] Dictionary generation step S2: extracting words from the pre-trained word vector model, dividing the words into characters, and processing the characters to form a dictionary;

[0070] Word vector acquisition step S3: after acquiring an adjacency table according to the word-forming relationship between the word and the phrase, the word vector is calculated according to the adjacency table;

[0071] Conversation content sentiment classification step S4: After the word vector is input into the deep neural network model, the sentiment classification result of the word vector is obtained.

[0072] In an embodiment, the session content processing step S1 includes:

[0073] Session content acquisition step S11: receiving the session content generated by the user end;

[0074] Conversation content text processing step S12: converting non-text type content in the conversation content into text type;

[0075] Conversation content preprocessing step S13: standardizing the conversation content, and dividing the standardized conversation content into word sequences.

[0076] In the specific implementation, the conversation content generated by the user is received, and the non-text type content in the user's conversation input is converted into text. The conversation content generated by the user includes text, voice, video, emoticons, pictures, etc. This module is responsible for converting all non-text type content into text type using artificial intelligence technology. For the convenience of description, the following is an example of obtaining the enterprise WeChat conversation content "This notebook is very beautiful". The non-text content in the obtained conversation content is converted or extracted into text using voice recognition, OCR and other technologies. "This notebook is very beautiful" is pure text and does not need to be processed. Further, the conversation content is subjected to font standardization, symbol standardization, number recognition, time recognition, and word segmentation, that is, the conversation content is standardized and then segmented into word sequences. "This notebook is very beautiful" needs to be converted from traditional Chinese to simplified Chinese, and redundant spaces are removed. After text preprocessing, "This notebook is very beautiful" is converted into "This notebook is very beautiful", and then after word segmentation, the word sequence "this, a, pen, note, book, very, beautiful, bright" can be obtained.

[0077] In an embodiment, it is characterized in that the word vector acquisition step S3 includes:

[0078] Dictionary acquisition step S31: after reading the pre-trained word vector model according to the word sequence, extract all the words from the pre-trained word vector model, and use the words to form a dictionary;

[0079] Dictionary acquisition step S32: dividing the words in the dictionary into separate characters, storing and deduplicating the divided characters, and using the processed characters to form the dictionary;

[0080] Adjacency list acquisition step S33: putting the character and the words corresponding to the character into the adjacency list, with the character as the table header and the words being put into a one-way linked list pointed to by the table header;

[0081] Word vector calculation step S34: traverse the adjacency list and calculate the word vector according to the adjacency list.

[0082] In specific implementation, after traversing the character sequence to obtain all characters, a pre-trained Chinese word vector model is obtained. For the convenience of description, taking the pre-trained word vector model WordVect as an example, WordVector contains 10 words (respectively: 这 (this), 个 (one), 只 (only), 笔 (pen), 人 (person), 很 (very), 漂亮 (beautiful), 谢谢 (thank you), 笔记本 (notebook), 笔架山 (penholder mountain)), and each word is represented by a 200-dimensional vector. Further, in combination with the obtained pre-trained word vector model WordVector, all the words in it are read out and put into the list List_Word, that is, the 10 words "这 (this), 个 (one), 只 (only), 笔 (pen), 人 (person), 很 (very), 漂亮 (beautiful), 谢谢 (thank you), 笔记本 (notebook), 笔架山 (penholder mountain)" are read out. Further, WordVect is read and the words and their corresponding word vectors are stored in Map_Word_Vector<word, vector>. The words in this Map_Word_Vector are consistent with the words in the dictionary, and each word is represented by a 200-dimensional vector. Further, according to List_Word, the words are split into individual characters, and all the words in List_Word are split into single characters and then de-duplicated and uniformly put into the list List_Char. Further, there are 10 words and 16 characters in List_Word. After de-duplication, there are 13 characters (the "笔" characters are de-duplicated twice, and the "谢" character in "谢谢" is de-duplicated), that is, List_Char contains 16 characters: 这 (this), 个 (one), 只 (only), 笔 (pen), 人 (person), 很 (very), 漂 (float), 亮 (bright), 谢 (thank), 记 (record), 本 (book), 架 (frame), 山 (mountain). Further, according to List_Word and List_Char, an adjacency list Map_Char_AdjList of characters and words is constructed, with the character as the head of the list, pointing to a singly linked list composed of the words containing this character. Further, taking the character "笔" (pen) as an example, "笔" (pen) is the head of the list, pointing to the singly linked list "笔 (pen)->笔记本 (notebook)->笔架山 (penholder mountain)". Further, according to the relationship between the characters and words in Map_Char_AdjList, the vector corresponding to each character is calculated. Further, taking the calculation of the character vector of the character "笔" (pen) as an example, querying List_Word shows that the character "笔" (pen) can form a word alone and at the same time participates in the formation of the words "笔记本" (notebook) and "笔架山" (penholder mountain). Further, the vector of the character "笔" (pen) is obtained by taking the average of the vector of the character forming the word alone and the average of the vectors of the words containing the character "笔" (pen). For the convenience of description, W_Vector(term) is used to represent the vector of the word term, and C_Vector(term) is used to represent the vector of the character term. At this time, C_Vector(笔)=(W_Vector(笔)+(W_Vector(笔记本) / 3 + W_Vector(笔架山) / 3) / 2) / 2, where according to the above calculation formula and the word vectors in Map_Word_Vector, the character vectors of each character in List_Char can be calculated. Further, for the convenience of description, the first five dimensions of the word vectors in Map_Word_Vector are taken to demonstrate the process of calculating character vectors using word vectors.Further, take W_Vector(pen)=[0.23, 0.16, 0.71, 0.49, 0], W_Vector(notebook)=[0.58, 0.33, 0.27, 0.92, 0.05], and W_Vector(Mount Bijia)=[0.76, 0.35, 0.25, 0.46, 0.81] as examples. Further, the vector of "pen" divided from "notebook" is: W_Vector(notebook) / 3 = [0.58 / 3, 0.33 / 3, 0.27 / 3, 0.92 / 3, 0.05 / 3] = [0.19, 0.11, 0.09, 0.31, 0.01]. Further. ,Depend on The vector of the "pen" obtained by "Bijia Mountain" is: W_Vector(Bijia Mountain) / 3=[0.76 / 3, 0.35 / 3, 0.25 / 3, 0.46 / 3, 0.81 / 3] = [0.25, 0.12, 0.08, 0.15, 0.27]. Further, the vector of "pen" obtained by averaging the vector of "pen" divided from "notebook" and the vector of "pen" divided from "Mount Bijia" is: (W_Vector(notebook) / 3 + W_Vector(Mount Bijia) / 3) / 2 = [(0.19 + 0.25) / 2, (0.11 + 0.12) / 2, (0.09 + 0.08) / 2, (0.31 + 0.15) / 2, (0.01 + 0.27) / 2] = [0.22, 0.11, 0.09, 0.23, 0.14]. Further, the vector of "pen" obtained by averaging the vector of "pen" as a single word, the vector of "pen" divided from "notebook", and the vector of "pen" divided from "Mount Bijia", and then averaging again to obtain the final word vector of "pen" is: C_Vector(pen) = (W_Vector(pen) + (W_Vector(notebook) / 3 + W_Vector(Mount Bijia) / 3) / 2) / 2 = [(0.23 + 0.22) / 2, (0.16 + 0.11) / 2, (0.71 + 0.09) / 2, (0.49 + 0.23) / 2, (0 + 0.14) / 2] = [0.23, 0.14, 0.40, 0.36].

[0083] In the embodiment, the session content sentiment classification step S4 includes inputting the word vector into the deep neural network model and performing sentiment classification on the word vector to obtain the sentiment classification result of the word vector.

[0084] In a specific implementation, after obtaining the word vectors of each word in "this, a, pen, note, book, very, beautiful", the word vectors of each word in "this, a, pen, note, book, very, beautiful" are sequentially input into the deep learning classification model for sentiment classification, and the sentiment categories are output.

[0085] Embodiment 2

[0086] Please refer to Figure 3 to Figure 4 , Figure 3 is a framework diagram of a device for conversation emotion classification according to an embodiment of the present application; Figure 4 FIG. 1 is a schematic diagram of the structure of the conversation emotion classification system of the present invention. Figure 3 to Figure 4 As shown, the conversation emotion classification system of the invention is applicable to the above-mentioned conversation emotion classification method, and the conversation emotion classification system includes:

[0087] The conversation content processing unit 51 performs text processing on the conversation content after receiving the conversation content;

[0088] Dictionary generation unit 52: extracting words from the pre-trained word vector model, segmenting the words into characters, and processing the characters to form a dictionary;

[0089] A character vector acquisition unit 53: after acquiring an adjacency table according to the word-forming relationship between the character and the word, calculates a character vector according to the adjacency table;

[0090] Conversation content sentiment classification unit 54: input the word vector into the deep neural network After the model is built, the sentiment classification result of the word vector is obtained.

[0091] In an embodiment, the session content processing unit 51 includes:

[0092] The session content acquisition module 511 receives the session content generated by the user end;

[0093] The conversation content text processing module 512 converts the non-text type content in the conversation content into text type;

[0094] The conversation content preprocessing module 513 standardizes the conversation content and divides the standardized conversation content into word sequences.

[0095] In a specific implementation, in the conversation content processing unit 51, artificial intelligence technologies include but are not limited to speech recognition technology, OCR technology (Optical Character Recognition), etc.; font standardization includes but is not limited to converting traditional Chinese characters to simplified Chinese characters, etc.; symbol standardization includes but is not limited to standardizing English punctuation marks to Chinese punctuation marks, standardizing full-width characters to half-width characters, and using regular expressions to remove redundant punctuation marks, spaces, blank segments, and redundant symbols such as custom symbols in samples.

[0096] In an embodiment, the word vector acquisition unit 53 includes:

[0097] Dictionary acquisition module 531: after reading the pre-trained word vector model according to the word sequence, extract all the words from the pre-trained word vector model, and use the words to form a dictionary;

[0098] Dictionary acquisition module 532: segmenting the words in the dictionary into separate characters, storing and removing duplicates from the segmented characters, and using the processed characters to form the dictionary;

[0099] Adjacency table acquisition module 533: putting the character and the words corresponding to the character into the adjacency table, with the character as the table header and the words being put into a one-way linked list pointed to by the table header;

[0100] The word vector calculation module 534 traverses the adjacency list and calculates the word vector according to the adjacency list.

[0101] In an embodiment, the word vector is input into the deep neural network model and sentiment classification is performed on the word vector, and the sentiment classification result of the word vector is obtained through the conversation content sentiment classification unit.

[0102] In a specific implementation, the deep neural network model includes but is not limited to CNN, RNN, LSTM, etc.

[0103] Embodiment 3

[0104] Combination Figure 5 As shown, this embodiment discloses a specific implementation of an electronic device. The device may include a processor 81 and a memory 82 storing computer program instructions.

[0105] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0106] Among them, the memory 82 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 82 may be inside or outside the conversation emotion classification device. In a specific embodiment, the memory 82 is a non-volatile memory. In a specific embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (ErasableProgrammable Read-Only Memory, FPROM for short), an electrically erasable PROM (Electrically ErasableProgrammable Read-Only Memory, EFPROM for short), an electrically alterable ROM (ElectricallyAlterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0107] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 81 .

[0108] The processor 81 implements any conversation sentiment classification method in the above-mentioned embodiments by reading and executing computer program instructions stored in the memory 82 .

[0109] In some embodiments, the electronic device may further include a communication interface 83 and a bus 80. 5, The processor 81, the memory 82, and the communication interface 83 are connected through the bus 80 and complete the mutual Communication between.

[0110] The communication interface 83 is used to implement communication between the modules, devices, units and / or devices in the embodiment of the present application. The communication port 83 can also implement data communication with other components such as: external devices, image / conversation emotion classification devices, databases, external storage, and image / conversation emotion classification workstations.

[0111] The bus 80 includes hardware, software or both, and couples the components of the electronic device to each other. The bus 80 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 80 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0112] Electronic devices can be connected to conversation emotion classification systems to achieve integration Figure 1 to Figure 2 Describe the method.

[0113] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] In summary, the present invention uses an open source pre-trained word vector model to learn word vectors, thereby avoiding the word segmentation errors caused by the Chinese word segmenter and the cascade errors caused by insufficient words in the open source Chinese pre-trained word vector model, and realizes the conversion of word vectors into word vectors. Word vectors are used to construct sentence or paragraph vectors and conversation content sentiment classification, and sentiment classification of conversation content can be performed without Chinese word segmentation.

[0115] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the protection scope of the attached claims.

Claims

1. A conversation sentiment classification method, characterized in that: include: Conversation content processing step: after receiving the conversation content, text processing is performed on the conversation content; Dictionary generation step: extract words from the pre-trained word vector model, split the words into characters, and process the characters to form a dictionary; The character vector acquisition step: after acquiring an adjacency table according to the word-forming relationship between the character and the word, the character vector is calculated according to the adjacency table; Conversation content sentiment classification step: after inputting the word vector into the deep neural network model, obtaining the sentiment classification result of the word vector; The session content processing step includes: Session content acquisition step: receiving the session content generated by the user end; The text processing step of the conversation content: converting the non-text type content in the conversation content into text type; Conversation content preprocessing step: standardizing the conversation content, and dividing the standardized conversation content into word sequences; The word vector acquisition step includes: Dictionary acquisition step: after reading the pre-trained word vector model according to the word sequence, extract all the words from the pre-trained word vector model, and use the words to form a dictionary; Dictionary acquisition step: dividing the words in the dictionary into separate characters, storing and removing duplicates from the separated characters, and using the processed characters to form the dictionary; Adjacency list acquisition step: putting the character and the words corresponding to the character into the adjacency list, wherein the character is the table header and the words are put into a one-way linked list pointed to by the table header; Word vector calculation step: traversing the adjacency list and calculating the word vector according to the adjacency list; The word vector acquisition step further includes: Traverse the word sequence to get the words, obtain the pre-trained word vector model, and represent the words contained in the model through a 200-dimensional vector; Read words and add them to List_Word; read the pre-trained word vector model and store the words and corresponding word vectors in Map_Word_Vector. The words in Map_Word_Vector are consistent with the words in the dictionary, and each word is represented by a 200-dimensional vector; Decompose all words in List_Word into characters according to List_Word, remove duplicates and put them into List_Char; construct an adjacency list of characters and words according to List_Word and List_Char, with the character as the table header, pointing to a one-way linked list consisting of words containing the character; The vector of a single word is calculated based on the relationship between the characters and words in the word adjacency table. The word vector of a single word is obtained by averaging the vector of the single word as a separate word and the vector of the single word obtained by dividing the word containing the single word, and then averaging again to obtain the vector of the single word.

2. The conversation sentiment classification method according to claim 1, characterized in that: The conversation content sentiment classification step includes inputting the word vector into the deep neural network model and performing sentiment classification on the word vector to obtain the sentiment classification result of the word vector.

3. A conversation sentiment classification system, characterized in that: The conversation emotion classification method according to any one of claims 1 to 2 is applicable, wherein the conversation emotion classification system comprises: Conversation content processing unit: after receiving the conversation content, performing text processing on the conversation content; Dictionary generation unit: extracts words from the pre-trained word vector model, divides the words into characters, and processes the characters to form a dictionary; A character vector acquisition unit: after acquiring an adjacency table according to the word-forming relationship between the character and the word, calculating the character vector according to the adjacency table; Conversation content sentiment classification unit: after inputting the word vector into the deep neural network model, obtaining the sentiment classification result of the word vector; Wherein, the session content processing unit includes: Session content acquisition module: receiving the session content generated by the user end; Conversation content text processing module: converting non-text content in the conversation content into text type; A conversation content preprocessing module: standardizes the conversation content and divides the standardized conversation content into word sequences; Wherein, the word vector acquisition unit includes: Dictionary acquisition module: after reading the pre-trained word vector model according to the word sequence, extract all the words from the pre-trained word vector model, and use the words to form a dictionary; Dictionary acquisition module: segmenting the words in the dictionary into individual characters, storing and deduplicating the segmented characters, and using the processed characters to form the dictionary; Adjacency table acquisition module: putting the character and the words corresponding to the character into the adjacency table, wherein the character is the table header and the words are put into a one-way linked list pointed to by the table header; A word vector calculation module: traverses the adjacency list and calculates the word vector according to the adjacency list; The word vector acquisition unit further includes: Traverse the word sequence to get the words, obtain the pre-trained word vector model, and represent the words contained in the model through a 200-dimensional vector; Read words and add them to List_Word; read the pre-trained word vector model and store the words and corresponding word vectors in Map_Word_Vector. The words in Map_Word_Vector are consistent with the words in the dictionary, and each word is represented by a 200-dimensional vector; Decompose all words in List_Word into characters according to List_Word, remove duplicates and put them into List_Char; construct an adjacency list of characters and words according to List_Word and List_Char, with the character as the table header, pointing to a one-way linked list consisting of words containing the character; The vector of a single word is calculated based on the relationship between the characters and words in the word adjacency table. The word vector of a single word is obtained by averaging the vector of the single word as a separate word and the vector of the single word obtained by dividing the word containing the single word, and then averaging again to obtain the vector of the single word.

4. The conversation emotion classification system according to claim 3, characterized in that: The word vector is input into the deep neural network model and sentiment classification is performed on the word vector, and the sentiment classification result of the word vector is obtained through the conversation content sentiment classification unit.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the conversation sentiment classification method as described in any one of claims 1 to 2 is implemented.

6. An electronic device readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the conversation emotion classification method as described in any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • A character-based emotion analysis method for Chinese viewpoint elements

    CN109145304A

  • Enterprise public opinion analysis method and device based on self-attention

    CN109992668A