Complaint classification and discrimination method based on natural language

By constructing the emotion classifier model and using the GNN network structure, combined with the RAG knowledge base, the problem of insufficient universality of AI natural language model in the complaint management system in the existing technology is solved, and the accuracy and efficiency of complaint classification and emotion analysis are improved. .

CN119166814AActive Publication Date: 2024-12-20STONE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411255303.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-20
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

In the existing complaint management system, the customized development of AI natural language models has led to weak versatility, users are disgusted with intelligent robot dialogue, and require manual intervention, and insufficient processing efficiency and accuracy.

Method used

Using a complaint classification and discrimination method based on natural language, by constructing an emotion classifier model, using GNN network structure and word embedding technology, classifying the complaint language, obtaining word embedding vectors and performing emotional label marking, combining RAG knowledge base and word vector information Mapping module to realize complaint type judgment and sentiment analysis.

Benefits of technology

It improves the accuracy and efficiency of complaint handling, optimizes the user's complaint sentiment analysis ability, can quickly identify difficult and escalate complaints, improves the efficiency of complaint identification, and has strong versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166814A_ABST
    Figure CN119166814A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a complaint classification and discrimination method based on a natural language. Comprising the following steps: S1, constructing an emotion classifier model; s2, obtaining to-be-processed complaint work order text content, obtaining a plurality of corresponding word embedding vectors, and obtaining an emotion label of a word corresponding to each word embedding vector; s3, obtaining a previous personal complaint record of the user and a complaint record of other people with the same type as the previous personal complaint record; s4, the complaint content, the complaint type, the personal complaint record and the other complaint record are integrated and stored; s5, converting the stored content into a text form; s6, each word in the complaint content converted into the text form is marked with an emotion label, and complaint classification is completed; according to the method, the vocabularies in the complaint content are classified more accurately, the complaint recognition efficiency is effectively improved, and the method has high universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a complaint classification and identification method based on natural language. Background Art

[0002] In the intelligent construction and transformation of community property complaint management systems, AI natural language processing technology will be applied in common complaint management systems; common complaint management systems include customer service management systems and work order management systems. The customer service management system can effectively respond to user questions through a preset QA system and manual customer service intervention; artificial intelligence and machine learning technologies are applied in the work order management system to achieve intelligent work order processing and services; however, in customer service management systems and work order management systems, AI natural language model capabilities are mostly customized development, and the overall performance is average in private deployments. Users are generally disgusted with intelligent robot conversations, and manual intervention is still required in most cases.

[0003] Prior art CN118093844A discloses a method for implementing intelligent government customer service based on a large artificial intelligence model, including the following steps: S1. Data tagging of text data in government services; S2. After the text data is tagged, the tagged text data is vectorized using a pre-trained word vector model; S3. The vectorized data is stored and the data structure is reorganized; S4. The query information input by the user is vectorized, and the similarity between the query vector and each vector is calculated; S5. The queried data with similarities is used as a context assembly prompt, and is called using the LLM SDK. However, in the above-mentioned method for implementing intelligent government customer service, the text data vectorized by the word vector model is directly stored and used, and the degree of customized development is relatively high, and the versatility is relatively weak.

[0004] Therefore, there is an urgent need to provide a complaint classification and identification method based on natural language. Compared with the existing technology, word embedding technology is used to classify complaint language to improve processing efficiency and accuracy. Summary of the invention

[0005] The present invention solves the technical problems existing in the prior art and provides a complaint classification and identification method based on natural language.

[0006] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0007] A complaint classification and discrimination method based on natural language comprises the following steps:

[0008] S1. Construct a sentiment classifier model, which includes the following steps:

[0009] S11. Obtain the text content of historical complaint work orders;

[0010] S12, performing word segmentation processing on the text content of the historical complaint ticket to obtain multiple words and a word embedding vector corresponding to each word;

[0011] S13, construct a GNN network structure based on the multiple words and multiple word embedding vectors obtained in step S12, obtain the sentiment label of each word embedding vector, and thus obtain the joint loss. According to the joint loss, update all network parameters of the GNN network structure to obtain the sentiment classifier model

[0012] S2. Obtain the text content of the complaint work order to be processed, use the method in step S12 to obtain multiple corresponding word embedding vectors, input the obtained word embedding vectors into the sentiment classifier model constructed in step S1, and obtain the sentiment label of the word corresponding to each word embedding vector, where the sentiment label includes positive words, negative words, and neutral words;

[0013] S3, input the word embedding vector generated in step S2 into the RAG knowledge base to obtain the user's previous personal complaint records and other people's complaint records of the same type as the previous personal complaint records;

[0014] S4. According to the word embedding vector in step S2, the complaint type of the complaint content is determined, and the complaint content, complaint type, and the personal complaint records and other people's complaint records obtained in step S3 are integrated together and output to the word vector information mapping module for storage;

[0015] S5, converting the content outputted to the word vector information mapping module in step S4 into text form;

[0016] S6. Based on the sentiment label corresponding to each word embedding vector obtained in step S2, mark the sentiment label for each word in the complaint content converted into text form to complete the complaint classification.

[0017] Furthermore, S13 specifically includes the following steps:

[0018] S131, set a fixed value and a default word, when the number of words obtained in step S12 is greater than or equal to the fixed value, intercept the first fixed value of words, when the number of words obtained in step S12 is less than the fixed value, use the default value to fill in, so that the number of words after filling is equal to the fixed value;

[0019] S132, for the words processed in step S131, use a sliding window to construct an adjacency graph, the adjacency graph includes multiple nodes and multiple edges, each node is provided with a corresponding word embedding vector, and each edge is provided with an edge weight;

[0020] S133, using the adjacency graph, constructing a GNN network structure, the GNN network structure including multiple hidden layers, multiple fully connected layers and an output layer, the number of fully connected layers is the same as the number of categories of the emotion label;

[0021] S134. Use the joint loss calculation model to calculate the joint loss of the GNN network structure constructed in step S133. According to the joint loss, through the back propagation process, the updated value of each network parameter in the GNN network structure is obtained, and the original network parameter is replaced with the updated value to obtain the sentiment classifier model.

[0022] Furthermore, S133 specifically includes the following steps:

[0023] S1331, the number of nodes in the first hidden layer of the GNN network structure is twice the number of all nodes in the adjacency graph, and the word embedding vectors of all nodes in the adjacency graph and the edge weights of all nodes in the adjacency graph are used as parameters of each node in the first hidden layer of the GNN network structure;

[0024] S1332, the number of nodes in the second hidden layer of the GNN network structure is the same as the number of nodes in the first hidden layer, and the node parameters of the second hidden layer and the node parameters of the first hidden layer form an association matrix through the model training parameter theta, thereby obtaining the parameters of each node in the second hidden layer, and so on to obtain the parameters of the nodes in all hidden layers;

[0025] S1333. Each fully connected layer uses the softmax function to obtain the probability of the word embedding vector under the corresponding sentiment label, and the output layer outputs the sentiment label with the highest probability for each word embedding vector.

[0026] Furthermore, step S1333 is specifically performed by the following formula:

[0027]

[0028] In the above formula, Represents the probability of the xth sentiment label of the word embedding vector of the current word, z x Represents the score value of the xth sentiment label of the current vocabulary word vector, z xg represents the score of the xth sentiment label of the word vector of the current vocabulary at the gth node of the fully connected layer, G represents the total number of nodes in the fully connected layer, y i Represents the sentiment label of the i-th word.

[0029] Furthermore, the expression of the joint loss calculation model in step S134 is:

[0030]

[0031] In the above formula, represents the joint loss, represents the word embedding loss, represents sentiment loss, i represents adjacent words, j represents the current word, and w j Represents the word embedding vector of the current word, w i Represents the word embedding vector of adjacent words, P(w j |w i ) indicates that w is known i In the case of w j The probability of y i represents the sentiment label of the i-th word, P(y i |w i ) indicates that w is known i In the case of y i probability.

[0032] Furthermore, the specific method for obtaining the updated value of each network parameter in step S134 is: firstly weighted average the network parameters corresponding to the first node, the network parameters of the nodes connected to the first node, and the network parameters of the first node representing the adjacent edge relationship to obtain the updated network parameters of the first node, and then obtain the updated gradient through the back propagation process, and add the updated gradient to the updated network parameters of the first node, so as to obtain the updated value of the network parameters of the first node;

[0033] And so on, the updated values ​​of the network parameters of all nodes are obtained.

[0034] Furthermore, S132 specifically includes the following steps:

[0035] S1321, defining the size of the sliding window;

[0036] S1322, for a word in the sliding window, associate the word with its two adjacent words in front and two adjacent words behind; when the word in the sliding window is a non-literal word, skip associating the word with it; when non-literal words exist among the four adjacent words corresponding to the word in the sliding window, do not associate the word with the adjacent words having non-literal words;

[0037] S1323, sliding the sliding window in sequence according to the order in which the words appear in the sentence, to obtain an adjacency table and an adjacency matrix;

[0038] S1324. Construct an adjacency graph based on the adjacency relationship table and the adjacency matrix.

[0039] Furthermore, S12 specifically includes the following steps:

[0040] S121, use jieba to split a sentence into multiple words;

[0041] S122, removing punctuation marks from the words split in step S121;

[0042] S123. Perform word embedding processing on the words processed by step S122, including sentiment word embedding processing and semantic word embedding processing, to obtain sentiment word vectors and semantic word vectors, and concatenate the sentiment word vectors and the semantic word vectors to obtain word embedding vectors.

[0043] Furthermore, in step S3, the RAG knowledge base constructs an Elasticsearch model and sets an index structure in the Elasticsearch model to perform vector similarity calculation and search. The index structure uses the HNSW algorithm to calculate vector similarity. The content corresponding to the vector most similar to the business word vector is the user's previous personal complaint record or other people's complaint record.

[0044] Furthermore, the index structure uses the HNSW algorithm to calculate the vector similarity by calculating the cosine similarity or the Euclidean distance.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] The present invention inputs the text content of historical complaint work orders into the GNN network model, trains and obtains a sentiment classifier model, and also updates the network parameters in the GNN network model through the back propagation method to obtain a sentiment classifier model with more accurate sentiment classification. The word embedding vector is used as the input of the sentiment classifier model to obtain the sentiment label of the word corresponding to the word embedding vector, and each word in the text content of the complaint work order is divided into positive words, negative words and neutral words, thereby optimizing the user complaint sentiment analysis capability, more accurately classifying the vocabulary in the complaint content, and can quickly locate and identify difficult and upgraded complaints, effectively improving the complaint recognition efficiency, and having strong versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a flow chart of the present invention.

[0048] Figure 2 It is a flow chart of word segmentation processing of the present invention.

[0049] Figure 3 It is a schematic diagram of the words of the present invention in the sliding window.

[0050] Figure 4 It is a schematic diagram of the adjacency graph of the present invention.

[0051] Figure 5 It is a structural schematic diagram of the first hidden layer of the GNN network structure of the present invention.

[0052] Figure 6It is a structural schematic diagram of the second hidden layer of the GNN network structure of the present invention.

[0053] Figure 7 It is a workflow diagram of the fully connected layer of the present invention. DETAILED DESCRIPTION

[0054] The technical solution of the present invention will be clearly described below in conjunction with the accompanying drawings. Obviously, the described embodiments are not all embodiments of the present invention, and all other embodiments obtained by ordinary technicians in the field without making creative work are within the protection scope of the present invention.

[0055] like Figure 1 As shown, the present invention provides a complaint classification and identification method based on natural language, comprising the following steps:

[0056] S1. Construct a sentiment classifier model, which includes the following steps:

[0057] S11. Obtain the text content of historical complaint work orders.

[0058] S12, such as Figure 2 As shown in the figure, the text content of the historical complaint ticket is segmented to obtain multiple corresponding word embedding vectors, which specifically includes the following steps:

[0059] S121. Segment the text content of historical complaint tickets, and use Jieba segmentation or other existing segmentation tools to split a sentence into multiple words.

[0060] For example: After segmenting the sentence "The lights in the corridor are often not on, which makes it very inconvenient to go out at night and poses a safety hazard. We have reported this to the property management many times, but it has not been resolved so far. There is often a peculiar smell in the elevator, and the cleaning work is not in place. I hope the property management can deal with it as soon as possible to protect our living environment.", we get: "The lights in the corridor are often not on, which makes it very inconvenient to go out at night and poses a safety hazard. We have reported this to the property management many times, but it has not been resolved so far. There is often a peculiar smell in the elevator, and the cleaning work is not in place. I hope the property management can deal with it as soon as possible to protect our living environment."

[0061] S122, removing special symbols such as punctuation marks in the sentence processed by step S121.

[0062] S123. Mark the part of speech of each word, which includes noun, verb, adjective, preposition, auxiliary word, etc.

[0063] S124. Use the pre-trained model to perform word embedding processing on the words processed by step S123. Word embedding refers to the method of converting a Chinese word into a digital vector representation of a specific length. The word embedding processing of the pre-trained model in this step includes sentiment word embedding processing and semantic word embedding processing, and sentiment word vectors and semantic word vectors are obtained respectively. Then, the sentiment word vector and semantic word vector of each word are concatenated to obtain the word embedding vector of the word.

[0064] For example, for the word "corridor", the sentiment word vector obtained in step S124 is represented as [1,2,3], and the semantic word vector is represented as [4,5,6]. Then the word embedding vector of the word is represented as [1,2,3,4,5,6].

[0065] S13, according to the word embedding vector obtained in step S12, the sentiment classifier model is trained. The specific training process of the sentiment classifier model is as follows:

[0066] S131. Set a fixed value M. When the number of words excluding punctuation marks is greater than or equal to M, extract the first M words. When the number of words excluding punctuation marks is less than M, use the set default words for filling. The set default words have corresponding word embedding vectors, so that the number of filled words is equal to M.

[0067] S132: Based on the words processed in step S131, an adjacency graph is constructed using a sliding window, specifically comprising the following steps:

[0068] S1321, such as Figure 3 As shown, the size of the sliding window is defined as L, and in this embodiment, L is 5.

[0069] S1322, when the sliding window slides, each word only focuses on the two words in front of it and the two words behind it, that is, each word needs to focus on 4 words, and each word is associated with the four words in front and behind. If the word currently focused on is a non-meaning word such as a preposition or an auxiliary word, the processing of the word is skipped. If there is a non-meaning word in the two words in front and behind the word currently focused on, the word is not associated with its adjacent non-meaning words. For example, Figure 3 The words associated with "light" include only "often" and "not bright".

[0070] S1323. According to the processing method in step S1322, the window is slid in the order in which the words appear in the sentence to obtain an adjacency table (as shown in Table 1 below) and an adjacency matrix (as shown in Table 2 below), in which long-term is the set default word.

[0071] Table 1 Adjacency table

[0072]

[0073]

[0074] Table 2 Adjacency matrix

[0075]

[0076]

[0077]

[0078] S1324, construct an adjacency graph (such as Figure 4 The constructed adjacency graph contains the word embedding vector of each node and the edge weights between each node and all other nodes.

[0079] S133, using the adjacency graph, constructing a GNN network structure; the GNN network structure includes m hidden layers, a fully connected layer and an output layer, specifically including the following steps:

[0080] S1331, summarize the word embedding vector and edge weight of each node in the adjacency graph to form the nodes of the first hidden layer (gnn-layer1) of the GNN network structure, that is, the nodes of the first layer of the GNN network structure are twice the number of all the nodes in the adjacency graph, such as Figure 5 As shown in the figure, when there are 6 nodes (word 1, word 2, word 3, word 4, word 5, word 6) in the adjacency graph, the first layer of the GNN network structure formed is represented as: word 1[a 11 ,a 12 ,…,a 1k ], word 2[a 21 ,a 22 ,…,a 2k ], word 3[a 31 ,a 32 ,…,a 3k ], word 4[a 41 ,a 42 ,…,a 4k ], word 5[a 51 ,a 52 ,…,a 5k ], word 6 [a 61 ,a 62 ,…,a 6k ], side 1[b 11 ,b 12 ,…,b 16 ], side 2[b 21 ,b 22 ,…,b 26 ], side 3[b31 ,b 32 ,…,b 36 ], side 4[b 41 ,b 42 ,…,b 46 ], side 5[b 51 ,b 52 ,…,b 56 ], side 6[b 61 ,b 62 ,…,b 66 ]; where a 11 、a 12 、a 1k Respectively represent the first, second, and kth values ​​of the word embedding vector of word 1, a 21 ,a 22 ,…,a 2k Respectively represent the first value, the second value, and the kth value of the word embedding vector of word 2; a 31 ,a 32 ,…,a 3k 、a 41 ,a 42 ,…,a 4k 、a 51 ,a 52 ,…,a 5k 、a 61 ,a 62 ,…,a 6k The meaning of can be deduced from the above content; b 11 ,b 12 ,…,b 16 They represent the edge weights between the first node and the six nodes. An edge weight of 0 indicates that the two nodes are not connected. An edge weight greater than 0 and less than or equal to 1 indicates that the two nodes are connected. An edge weight greater than 1 indicates that the two nodes are adjacent in multiple locations. 21 ,b 22 ,…,b 26 、b 31 ,b 32 ,…,b 36 、b 41 ,b 42 ,…,b 46 、b 51 ,b 52 ,…,b 56 、b 61 ,b 62 ,…,b 66 The meaning of can be deduced based on the above content.

[0081] S1332, such as Figure 6As shown in the figure, the number of nodes in the second hidden layer is the same as that in the first hidden layer, and the node parameters of the second hidden layer and the node parameters of the first hidden layer form an n×n association matrix through the model training parameter theta, where n represents the number of nodes in the first hidden layer. The n×n matrix is ​​composed of theta ef Composition, theta ef Represents the network parameters between the e-th node of the first hidden layer and the f-th node of the second hidden layer. Similarly, for the structure of m hidden layers, the word embedding vectors after processing by m hidden layers are represented as: m1, m2, ..., m12.

[0082] S1333, such as Figure 7 As shown, there are three fully connected layers, namely a1 layer, a2 layer, and a3 layer. A1 layer, a2 layer, and a3 layer correspond to three emotion labels respectively. In a1 layer, a2 layer, and a3 layer, the softmax function is used to calculate the probability of each word embedding vector in the corresponding emotion label. The calculated probabilities are c1, c2, and c3, and the emotion label Y with the highest probability corresponding to the word embedding vector is output. Finally, the output layer outputs the emotion label of the word. The emotion label with the highest probability is calculated by the following formula:

[0083]

[0084] In the above formula, Represents the probability of the xth sentiment label of the word embedding vector of the current word, z x Represents the score value of the xth sentiment label of the current vocabulary word vector, z xg Represents the score value of the xth sentiment label of the word vector of the current vocabulary at the gth node of the fully connected layer, where G represents the total number of nodes in the fully connected layer.

[0085] S134, use the joint loss calculation model to calculate the joint loss of the GNN network structure, and update each network parameter theta in the association matrix in step S1332 through the back propagation process according to the joint loss. ef Specifically, firstly, the network parameter theta1 of the first node, the network parameter theta2 of the second node connected to the first node, and the network parameter theta7 of the first node representing the adjacent edge relationship are weighted averaged to obtain the updated network parameter of the first node. Then, the updated gradient calculated by the back propagation process is added to the updated network parameter of the first node to obtain the final updated value. The updated values ​​of other nodes are obtained in the same way. After the network parameters of all nodes are updated, the final sentiment classifier model is obtained.

[0086] theta1=[theta 11 ,theta12 ,…,theta 112 ];

[0087] theta2=[theta 21 ,theta 22 ,…,theta 212 ];

[0088] theta7=[theta 71 ,theta 72 ,…,theta 712 ].

[0089] The joint loss calculation model is expressed by the following formula:

[0090]

[0091] In the above formula, represents the joint loss, represents the word embedding loss, Indicates emotional loss.

[0092] The word embedding loss and sentiment loss are calculated as follows:

[0093]

[0094] In the above formula, i represents the adjacent word, j represents the current word, and w j Represents the word embedding vector of the current word, w i Represents the word embedding vector of adjacent words, P(w j |w i ) indicates that w is known i In the case of w j The probability of y i represents the sentiment label of the i-th word, which can be positive, negative or central word. i |w i ) indicates that w is known i In the case of y i probability.

[0095] S2. Obtain the text content of the complaint ticket to be processed, use the method in step S12 to perform word segmentation on the text content of the complaint ticket to be processed, obtain multiple corresponding word embedding vectors, input all the word embedding vectors into the sentiment classifier model trained in step S13, and obtain the sentiment label of each word embedding vector. The sentiment labels include positive, negative and neutral words.

[0096] S3. Input the word embedding vector obtained in step S2 into the RAG knowledge base, use the public knowledge base, perform data retrieval on the private knowledge base content and the desensitized knowledge base, and obtain the user's previous personal complaint records and other people's complaint records. The obtained other people's complaint records are complaint events of the same type as the user's personal complaint records.

[0097] The private knowledge base includes various types of user private data such as historical complaint records, historical work order records, personal information reported in the community, personal property bill information, housing information, etc.; the desensitized knowledge base includes complaint records and work order record information of each user in the community, as well as blurred user identity information, user address, contact information, etc.

[0098] The RAG knowledge base uses the addition and subtraction retrieval generation technology to perform data retrieval, specifically: building an Elasticsearch model, setting an index structure in the Elasticsearch model for vector similarity calculation and search, using the HNSW algorithm in the index structure to calculate vector similarity, the Elasticsearch model stores the input word embedding vector in the index structure, and the index structure uses the HNSW algorithm to calculate the similarity of the input word vector. The content corresponding to the vector that is most similar (with the largest similarity value) to the input word vector in the private knowledge base content and the desensitized knowledge base is the user's previous personal complaint records and other people's complaint records. The index structure uses the HNSW algorithm to calculate vector similarity by calculating cosine similarity or Euclidean distance or other distance metrics. Cosine similarity or Euclidean distance are both existing technologies, and the specific algorithms will not be repeated here.

[0099] S4. Use the type discrimination model to compare the word embedding vector to determine the complaint type of the complaint content, and integrate the complaint content, complaint type, and the user's previous personal complaint records and other people's complaint records obtained in step S3, and output them to the word vector information mapping module for storage.

[0100] S5. Convert the content stored in the word vector information mapping module in step S4 into text form. The word vector information mapping module contains one-to-one mappings between multiple word vectors and text forms.

[0101] S6. According to the sentiment label of each word determined in step S2, the sentiment label of each word is marked on the content converted into text form in step S5, and the marked content is formatted and output through the LLM prompt to complete the complaint classification.

[0102] The present invention inputs the text content of historical complaint work orders into the GNN network model, trains and obtains a sentiment classifier model, and also updates the network parameters in the GNN network model through the back propagation method to obtain a sentiment classifier model with more accurate sentiment classification. The word embedding vector is used as the input of the sentiment classifier model to obtain the sentiment label of the word corresponding to the word embedding vector, and each word in the text content of the complaint work order is divided into positive words, negative words and neutral words, thereby optimizing the user complaint sentiment analysis capability, more accurately classifying the vocabulary in the complaint content, and can quickly locate and identify difficult and upgraded complaints, effectively improving the complaint recognition efficiency, and having strong versatility.

[0103] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions of the technical solution of the present invention by ordinary technicians in this field do not deviate from the essence and scope of the technical solution of the present invention.

Claims

1. A complaint classification method based on natural language, It is characterized in that The following steps are involved: S1. Construct a sentiment classifier model, which includes the following steps: S11. Obtain the text content of historical complaint work orders; S12, performing word segmentation processing on the text content of the historical complaint ticket to obtain multiple words and a word embedding vector corresponding to each word; S13, constructing a GNN network structure according to the multiple words and multiple word embedding vectors obtained in step S12, obtaining a sentiment label of each word embedding vector, thereby obtaining a joint loss, and updating all network parameters of the GNN network structure according to the joint loss to obtain a sentiment classifier model; S2. Obtain the text content of the complaint work order to be processed, use the method in step S12 to obtain multiple corresponding word embedding vectors, input the obtained word embedding vectors into the sentiment classifier model constructed in step S1, and obtain the sentiment label of the word corresponding to each word embedding vector, where the sentiment label includes positive words, negative words, and neutral words; S3, input the word embedding vector generated in step S2 into the RAG knowledge base to obtain the user's previous personal complaint records and other people's complaint records of the same type as the previous personal complaint records; S4. According to the word embedding vector in step S2, the complaint type of the complaint content is determined, and the complaint content, complaint type, and the personal complaint records and other people's complaint records obtained in step S3 are integrated together and output to the word vector information mapping module for storage; S5, converting the content outputted to the word vector information mapping module in step S4 into text form; S6. Based on the sentiment label corresponding to each word embedding vector obtained in step S2, mark the sentiment label for each word in the complaint content converted into text form to complete the complaint classification.

2. According to the complaint classification and discrimination method based on natural language according to claim 1, It is characterized in that S13 specifically includes the following steps: S131, set a fixed value and a default word, when the number of words obtained in step S12 is greater than or equal to the fixed value, intercept the first fixed value of words, when the number of words obtained in step S12 is less than the fixed value, use the default value to fill in, so that the number of words after filling is equal to the fixed value; S132, for the words processed in step S131, use a sliding window to construct an adjacency graph, the adjacency graph includes multiple nodes and multiple edges, each node is provided with a corresponding word embedding vector, and each edge is provided with an edge weight; S133, using the adjacency graph, constructing a GNN network structure, the GNN network structure including multiple hidden layers, multiple fully connected layers and an output layer, the number of fully connected layers is the same as the number of categories of the emotion label; S134. Use the joint loss calculation model to calculate the joint loss of the GNN network structure constructed in step S133. According to the joint loss, through the back propagation process, the updated value of each network parameter in the GNN network structure is obtained, and the original network parameter is replaced with the updated value to obtain the sentiment classifier model.

3. According to the complaint classification and discrimination method based on natural language according to claim 2, It is characterized in that S133 specifically includes the following steps: S1331, the number of nodes in the first hidden layer of the GNN network structure is twice the number of all nodes in the adjacency graph, and the word embedding vectors of all nodes in the adjacency graph and the edge weights of all nodes in the adjacency graph are used as parameters of each node in the first hidden layer of the GNN network structure; S1332, the number of nodes in the second hidden layer of the GNN network structure is the same as the number of nodes in the first hidden layer, and the node parameters of the second hidden layer and the node parameters of the first hidden layer form an association matrix through the model training parameter theta, thereby obtaining the parameters of each node in the second hidden layer, and so on to obtain the parameters of the nodes in all hidden layers; S1333. Each fully connected layer uses the softmax function to obtain the probability of the word embedding vector under the corresponding sentiment label, and the output layer outputs the sentiment label with the highest probability for each word embedding vector.

4. According to the complaint classification and discrimination method based on natural language of claim 3, It is characterized in that The S1333 step is specifically performed by the following formula: In the above formula, Represents the probability of the xth sentiment label of the word embedding vector of the current word, z x Represents the score value of the xth sentiment label of the current vocabulary word vector, z xg represents the score of the xth sentiment label of the word vector of the current vocabulary at the gth node of the fully connected layer, G represents the total number of nodes in the fully connected layer, y i Represents the sentiment label of the i-th word.

5. According to the natural language-based complaint classification method of claim 2, It is characterized in that The expression of the joint loss calculation model in step S134 is: In the above formula, represents the joint loss, represents the word embedding loss, represents sentiment loss, i represents adjacent words, j represents the current word, and w j Represents the word embedding vector of the current word, w i Represents the word embedding vector of adjacent words, P(w j |w i ) indicates that w is known i In the case of w j The probability of y i represents the sentiment label of the i-th word, P(y i |w i ) indicates that w is known i In the case of y i probability.

6. According to the method for classifying complaints based on natural language according to claim 5, It is characterized in that The specific method for obtaining the updated value of each network parameter in step S134 is: firstly, the network parameter corresponding to the first node, the network parameter of the node connected to the first node, and the network parameter of the first node representing the adjacent edge relationship are weighted averaged to obtain the updated network parameter of the first node, and then the updated gradient is obtained through the back propagation process, and the updated gradient is added to the updated network parameter of the first node, so as to obtain the updated value of the network parameter of the first node; And so on, the updated values ​​of the network parameters of all nodes are obtained.

7. According to the method for classifying complaints based on natural language as described in claim 2, It is characterized in that S132 specifically includes the following steps: S1321, defining the size of the sliding window; S1322, for a word in the sliding window, associate the word with its two adjacent words in front and two adjacent words behind; when the word in the sliding window is a non-literal word, skip associating the word with it; when non-literal words exist among the four adjacent words corresponding to the word in the sliding window, do not associate the word with the adjacent words having non-literal words; S1323, sliding the sliding window in sequence according to the order in which the words appear in the sentence, to obtain an adjacency table and an adjacency matrix; S1324. Construct an adjacency graph based on the adjacency relationship table and the adjacency matrix.

8. According to the method for classifying complaints based on natural language as described in claim 1, It is characterized in that S12 specifically includes the following steps: S121, use jieba to split a sentence into multiple words; S122, removing punctuation marks from the words split in step S121; S123. Perform word embedding processing on the words processed by step S122, including sentiment word embedding processing and semantic word embedding processing, to obtain sentiment word vectors and semantic word vectors, and concatenate the sentiment word vectors and the semantic word vectors to obtain word embedding vectors.

9. According to the method for classifying complaints based on natural language as described in claim 1, It is characterized in that In step S3, the RAG knowledge base constructs an Elasticsearch model and sets an index structure in the Elasticsearch model to perform vector similarity calculation and search. The index structure uses the HNSW algorithm to calculate vector similarity. The content corresponding to the vector most similar to the business word vector is the user's previous personal complaint record or other people's complaint record.

10. A complaint classification and discrimination method based on natural language according to claim 9, It is characterized in that The index structure uses the HNSW algorithm to calculate vector similarity by calculating cosine similarity or Euclidean distance.

Citation Information

Patent Citations

  • Text word feature double-line attention fusion risk prediction method

    CN114528395A

  • Complaint work order processing method and device, electronic equipment and storage medium

    CN115080732A

  • Multi-value chain problem text classification method and device

    CN115168574A

  • Graph classification method and system of spatial graph convolutional neural network, medium and equipment

    CN117349494A