Database field emotion filtering question-answering method and system based on bidirectional GRU network
By adopting a bidirectional GRU network-based emotion recognition algorithm in the database field question and answer system, using Hoffman tree coding and node vector sharing, the existing system's problems of difficulty in identifying and low computing efficiency when dealing with negative emotions questions are solved, and more efficient and accurate emotion recognition is achieved.
Patent Information
- Application Number
- CN202411730512.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
When the existing database field question-and-answer system handles questions with negative emotions, it is difficult to accurately identify emotions, resulting in misleading answers and poor user experience. The existing emotion recognition algorithm has high computational complexity and low processing efficiency.
The emotion recognition algorithm based on bidirectional GRU network is adopted to compress the dictionary scale through Hoffman tree coding, reduce the calculation complexity and parameter iteration amount, and improve the calculation efficiency through the sharing of node vectors and the step-by-step calculation of path condition probability.
It effectively reduces the computational complexity of conditional probability, improves the calculation efficiency of the model during large-scale corpus processing, and improves the accuracy of emotion recognition, especially when processing data that overlap or unevenly distributed among categories.
Smart Images

Figure CN119669449A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a database field sentiment filtering question-answering method and system based on a bidirectional GRU network, and belongs to the field of intelligent information processing. Background Art
[0002] With the continuous development of artificial intelligence technology, large-scale pre-trained models have demonstrated powerful capabilities in language generation and understanding, and have been widely used in multiple fields such as intelligent question and answer, dialogue systems, and text generation. Pre-trained models are trained on massive data to capture complex patterns and semantic relationships in language, and perform better when processing natural language tasks. In the database field, the question-answering system combines pre-trained models with domain knowledge fine-tuning to adapt to specific database environments. The fine-tuned vertical field large-model question-answering system not only improves the professionalism and accuracy of the system, but also better meets the specific needs of users.
[0003] However, the question-answering system in the database field still faces some challenges in practical applications. When users ask questions, they may have negative emotions for various reasons, which will have an adverse effect on the performance of the question-answering system. For example, negative emotions cause users to ask more pointed or unfriendly questions, and when the system answers these questions, it inadvertently spreads malicious information and intensifies users' dissatisfaction. This situation not only affects the user experience, but also has a negative impact on the management and operation of the database. In addition, the presence of negative emotions also causes the question-answering system to generate misleading answers. These answers not only deviate from the user's real needs, but also mislead users to a certain extent, causing errors or confusion in database operations. Therefore, how to effectively manage and deal with users' negative emotions in the question-answering system has become the key to ensuring the stability and reliability of the system.
[0004] Emotion recognition algorithms can effectively and timely identify users' negative emotions, maintain a healthy environment for question-answering systems, provide friendly and constructive interactive experiences, and ensure the quality of model output. However, existing mature emotion recognition algorithms still have shortcomings: they are not accurate enough when faced with diverse and complex emotional expressions. Traditional emotion recognition methods rely on manual feature extraction and shallow models, which make it difficult to capture the deep semantics and emotional nuances in text. Even emotion recognition models based on deep learning often perform poorly when dealing with extreme or implicit emotions and are prone to misjudgment.
[0005] Secondly, existing emotion recognition algorithms have obvious deficiencies in computational complexity and processing efficiency. Many algorithms use complex embedding vectorization and conditional probability calculation methods, which consume a lot of computing resources and time when processing large-scale corpora, while large language models have high requirements for real-time processing and response. In addition, existing algorithms often require multiple adjustments when updating and iterating parameters, which slows down model training and affects update efficiency.
[0006] Therefore, in order to ensure the healthy operation of the system and the positive experience of users, there is an urgent need for a more efficient and accurate emotion recognition algorithm that can detect and identify emotional tendencies in real time during the process of users asking questions, thereby effectively avoiding the generation and dissemination of misleading information. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 The figure is a flow chart of the system of the present invention.
[0008] Figure 2 This is a flow chart of the emotion recognition algorithm based on the bidirectional GRU network of the present invention. Summary of the invention
[0009] In view of the problems in the prior art of large computational and time overhead in calculating the conditional probability between the central word and the background words and a large number of parameter update iterations when the dictionary is large, the present invention proposes to compress the dictionary size by using Huffman tree coding, and reduce the computational complexity and parameter iteration amount by sharing node vectors and calculating the path conditional probability step by step, thereby solving the problem of insufficient efficiency of embedding vectorization in large-scale dictionary scenarios.
[0010] Based on this, the present invention proposes a database domain sentiment filtering question-answering method based on a bidirectional GRU network, which includes sentiment preprocessing and generative question-answering. The sentiment preprocessing uses sentiment recognition technology to perform sentiment analysis and classification on the content of user questions, accurately identifies the sentiment information in the user text, and obtains sentiment labels as "positive", "negative" and "neutral" respectively; according to the result of sentiment preprocessing, the generative question-answering uses the sentiment label as a part of the prompt in the database domain big model, and inputs it into the big model together with the user's question.
[0011] Furthermore, the sentiment preprocessing includes the following steps: (1) input data: taking the user's question text as the original input data to provide a basic data source for subsequent sentiment analysis;
[0012] (2) Embedding vectorization: converting words or characters in the input text into high-dimensional vector representations to capture the semantic information of the text;
[0013] (3) Extracting semantics: Extracting contextual semantic features from the embedding vector to generate a sentiment vector containing multi-dimensional information such as words, characters, and parts of speech;
[0014] (4) Output results: The extracted sentiment vector is input into the fully connected layer for classification and output of sentiment labels.
[0015] Furthermore, the process of embedding vectorization is as follows:
[0016] 2.1 Construct a Huffman tree based on word frequency, where the path of each word is the binary code from the root node to the leaf node of the word;
[0017] 2.2 Assign a vector representation to each node in the Huffman tree and update the node vector during training;
[0018] 2.3 For a given central word w c and background word w o , calculate the conditional probability between the central word and the background word to be predicted Among them, L(w o ) is the root node to word w o The path length, n(w o ,j) is the jth node on the path, is the binary direction of the path node, v c is the word vector of the center word, is the vector of the jth node on the path, and σ() is the sigmoid function.
[0019] Furthermore, when extracting semantics, the output word vector set E of the embedding vectorization layer is c And the word vector set E w As the input of the GRU network of this layer, the word context feature vector set y is obtained c and word context feature vector set y w ,calculate in, and are the hidden states of the forward GRU at time steps t and t-1, respectively. and are the hidden states of the backward GRU at time steps t and t+1, respectively, t is the input vector at time step t, y t is the context feature vector at time step t; after the attention mechanism weighted fusion output word-radical output vector V c And the word-radical output vector V w Then, compare it with V pos Splicing, where V pos is the part-of-speech vector set E pos and part-of-speech feature vector set Y pos The maximum pooling result of V c 、V w 、V pos Input into the bidirectional GRU network to obtain the final sentiment vector y final =Bi-GRU(V final ), where V final =[V c ,V w ,Vpos ]. Further, when outputting the result, the sentiment vector y final Input to the fully connected layer for classification, and get the output result y of sentiment analysis output , where y output =softmax(Wy final +b), W is the weight matrix, b is the bias matrix, For each sentiment category i and k, μ i ,μ k and β i ,β k Respectively represent all input features z belonging to this category in the training data i ,z k The mean and standard deviation of .
[0020] The softmax calculation method proposed in the present invention aims at the situation that there are overlapping or unevenly distributed data between categories in the emotion recognition task, which affects the classification performance. It combines the Gaussian distribution probability formula to improve the classification boundary, and solves the problem of decreased classification performance when the data distribution is uneven by adjusting the category distribution mean μ and standard deviation β.
[0021] Based on the above method, the present invention further proposes a database domain sentiment filtering question and answer system based on a bidirectional GRU network, the system comprising a sentiment preprocessing module and a generative question and answer module, wherein the sentiment preprocessing module uses sentiment recognition technology to perform sentiment analysis and classification on the content of user questions, accurately identifies the sentiment information in the user text, and obtains sentiment labels of "positive", "negative" and "neutral" respectively; according to the results of the sentiment preprocessing, the generative question and answer module uses the sentiment label as part of the prompt in the database domain big model, and inputs it into the big model together with the user's question.
[0022] Furthermore, the following methods are adopted in the sentiment preprocessing module: (1) Input data: the user’s question text is used as the original input data to provide the basic data source for the subsequent sentiment analysis;
[0023] (2) Embedding vectorization: converting words or characters in the input text into high-dimensional vector representations to capture the semantic information of the text;
[0024] (3) Extracting semantics: Extracting contextual semantic features from the embedding vector to generate a sentiment vector containing multi-dimensional information such as words, characters, and parts of speech;
[0025] (4) Output results: The extracted sentiment vector is input into the fully connected layer for classification and output of sentiment labels.
[0026] Furthermore, the process of embedding vectorization is as follows:
[0027] 2.1 Construct a Huffman tree based on word frequency, where the path of each word is the binary code from the root node to the leaf node of the word;
[0028] 2.2 Assign a vector representation to each node in the Huffman tree and update the node vector during training;
[0029] 2.3 For a given central word w c and background word w o , calculate the conditional probability between the central word and the background word to be predicted Among them, L(w o ) is the root node to word w o The path length, n(w o ,j) is the jth node on the path, is the binary direction of the path node, v c is the word vector of the center word, is the vector of the jth node on the path, and σ() is the sigmoid function.
[0030] Furthermore, when extracting semantics, the output word vector set E of the embedding vectorization layer is c And the word vector set E w As the input of the GRU network of this layer, the word context feature vector set y is obtained c and word context feature vector set y w ,calculate in, and are the hidden states of the forward GRU at time steps t and t-1, respectively. and are the hidden states of the backward GRU at time steps t and t+1, respectively, t is the input vector at time step t, y t is the context feature vector at time step t; after the attention mechanism weighted fusion output word-radical output vector V c And the word-radical output vector V w Then, compare it with V pos Splicing, where V pos is the part-of-speech vector set E pos and part-of-speech feature vector set Y pos The maximum pooling result of V c 、V w 、V pos Input into the bidirectional GRU network to obtain the final sentiment vector y final =Bi-GRU(V final ), where V final =[V c ,V w ,Vpos ]. Further, when outputting the result, the sentiment vector y final Input to the fully connected layer for classification, and get the output result y of sentiment analysis output , where y output =softmax(Wy final +b), W is the weight matrix, b is the bias matrix, For each sentiment category i and k, μ i ,μ k and β i ,β k Respectively represent all input features z belonging to this category in the training data i ,z k The mean and standard deviation of .
[0031] After adopting the present invention, the computational complexity of conditional probability can be effectively reduced, and the computational efficiency of the model can be improved when processing large-scale corpus. At the same time, the use of Huffman tree for path encoding helps to reduce the number of parameter updates during model training and improve update efficiency. Through the above-mentioned improved softmax function, the distribution characteristics of data can be better considered, and the accuracy of emotion recognition can be improved, especially when processing data with overlapping or uneven distribution between categories. DETAILED DESCRIPTION
[0032] Example 1
[0033] Large models in the database field are mainly used in application areas such as database operation and maintenance, SQL generation and optimization. However, in production environment applications, users' overly emotional questions will have a negative impact on the question-answering system, and users' excessive emotions will affect the model's understanding of the true purpose of the question, causing users to receive inappropriate or inaccurate answers, unable to solve actual problems, and triggering a series of malicious influences. Therefore, the present invention proposes a sentiment filtering question-answering method based on a bidirectional GRU network. The method uses the user's input and historical conversations as input data for the sentiment recognition algorithm, which are classified by the sentiment recognition model, and sentiment guidance and reconstruction are performed on malicious information. Based on the sentiment recognition algorithm, the present invention also proposes a sentiment filtering question-answering method, which includes two parts: sentiment preprocessing and generative question-answering, as follows:
[0034] 1. Emotional preprocessing: This module uses emotion recognition technology to analyze and classify the content of user questions, accurately identify the emotional information in the user text, and obtain emotional labels as "positive", "negative" and "neutral" respectively;
[0035] 2. Generative question answering: Based on the results of sentiment preprocessing, the sentiment label is used as part of the prompt in the database domain big model and input into the big model together with the user's question to ensure that the generated answer is highly consistent with the user's needs in terms of both content and sentiment.
[0036] Depend on Figure 1 It can be seen that the emotion recognition algorithm based on bidirectional GRU classifies user emotions in the emotion preprocessing part, which includes four parts: data input layer, embedding vectorization layer, semantic extraction layer, and result output layer. The specific process of the algorithm is as follows:
[0037] (1) Data input layer: This module is responsible for receiving and preprocessing natural language input from users or output from large models. It mainly converts Chinese text into five types of input data: characters, words, character-level radicals, word-level radicals, and part-of-speech text according to the characteristics of Chinese.
[0038] (2) Embedding vectorization layer: converts the preprocessed natural language data into high-dimensional embedding vectors that can capture the semantic features of the input data;
[0039] Specifically, the present invention proposes a new conditional probability calculation method between a central word and a background word to be predicted. The method reduces the computational complexity by constructing a Huffman tree, represents each word in the dictionary as a binary encoding path, and calculates the probability of each word through the path. The process is as follows:
[0040] 1) Construct Huffman tree: Construct Huffman tree according to word frequency. The higher the word frequency, the shorter its path. The path of each word is the binary code from the root node to the leaf node of the word.
[0041] 2) Calculate the vectors of the path nodes: Assign a vector representation to each node in the Huffman tree. These node vectors will be updated during the training process. Each node vector is used to represent a node on the path and participates in the calculation of conditional probability.
[0042] 3) Calculate conditional probability: For a given central word w c and background word w o , the conditional probability calculation formula between the central word and the background word to be predicted is:
[0043]
[0044] Among them, L(w o ) represents the distance from the root node to word w o The path length, n(w o ,j) is the jth node on the path, Indicates the binary direction (0 or 1) of the path node, v c The word vector representing the central word, is the vector of the jth node on the path, and σ() represents the sigmoid function.
[0045] Through the above steps, the computational complexity of conditional probability can be effectively reduced, and the computational efficiency of the model can be improved when processing large-scale corpus. At the same time, using Huffman tree for path encoding can help reduce the number of parameter updates during model training and improve update efficiency.
[0046] (3) Semantic extraction layer: This layer uses the bidirectional GRU network and attention mechanism to take the output of the embedding vector layer as the input of this layer and output the final sentiment vector y final .
[0047] Specifically, the output word vector set E of the embedding vectorization layer is c And the word vector set E w As input, it is input into the bidirectional GRU model to obtain the word context feature vector set y c and word context feature vector set y w , where the formula corresponding to the working principle of bidirectional GRU is:
[0048]
[0049] in, and denote the hidden states of the forward GRU at time steps t and t-1, respectively. and denote the hidden states of the backward GRU at time steps t and t+1, respectively, and x t represents the input vector at time step t, y t represents the context feature vector at time step t, which is concatenated from the hidden states of the forward and backward GRUs.
[0050] After the attention mechanism weighted fusion output word-radical output vector V c And the word-radical output vector V w Then, compare it with V pos Splicing, where V pos Represents the part-of-speech vector set E pos and part-of-speech feature vector set Y pos The maximum pooling result of , the three vectors are input into the bidirectional GRU network to obtain the final emotion vector y final , the specific workflow formula is as follows:
[0051] V final =[V c ,V w ,V pos ]
[0052] yfinal =Bi-GRU(V final )
[0053] Among them, V final Represents the character-radical output vector V c , word-radical output vector V w With V pos The concatenated vector.
[0054] (4) Result output layer: The result output layer is responsible for generating the final sentiment classification results.
[0055] Specifically, the sentiment vector y final Input to the fully connected layer for classification, and get the output result y of sentiment analysis output =softmax(Wy final +b), where W represents the weight matrix and b represents the bias matrix.
[0056] For the existing softmax function, the input value z i When normalizing, the distribution characteristics of the data are ignored, which makes it difficult to accurately distinguish different emotion categories when facing overlapping or unevenly distributed data in emotion recognition tasks; secondly, in the case of extreme values, the model is sensitive to noise or outliers in the input, which in turn affects the classification performance. Therefore, the present invention proposes a new softmax function calculation method:
[0057]
[0058] Where, for each sentiment category i and k, μ i ,μ k and β i ,β k Respectively represent all input features z belonging to this category in the training data i ,z k The mean and standard deviation of .
[0059] The improved softmax function calculation method can better consider the distribution characteristics of data and improve the accuracy of emotion recognition, especially when processing data with overlapping or uneven distribution between categories. Figure 2 .
[0060] Specifically, in the generative Q&A section, the sentiment classification result and the user Input are used as inputs. Facing different sentiment classifications, the LLM gives corresponding answers: 1) If it is a neutral emotion, the LLM maintains a professional and neutral tone and directly answers the user's question, providing a well-organized and detailed answer; 2) If it is a positive emotion, the LLM maintains a positive and encouraging tone and provides a detailed and useful answer; 3) If it is a negative emotion, the LLM should have a certain degree of empathy to soothe the user's emotions and at the same time provide targeted solutions to avoid further intensifying the user's dissatisfaction.
[0061] Example 2
[0062] In the Q&A system in the database field, the user inputs: "How to optimize the query speed of my database?" The sentiment recognition algorithm proposed by the present invention judges the input (Input), and the process is as follows:
[0063] (1) Data input layer, convert the user input into the following five types of input data:
[0064] Characters: ['如', '何', '优', '化', '我', '的', '数', '据', '库', '查', '询', '速', '度', '?']
[0065] Words: ['如何', '优化', '我的', '数据库', '查询', '速度']
[0066] Character-level radicals: ['女', '口', '亻', '化', '戈', '白', '曰', '攵', '禾', '讠', '言', '辶', '歹', '?']
[0067] Word-level radicals: ['女', '口', '亻', '化', '戈', '白', '曰', '攵', '禾', '讠', '言', '辶', '歹', '?']
[0068] Part-of-speech text: ['WP', 'VV', 'PN', 'NN', 'VV', 'NN']
[0069] (2) In the embedding vectorization layer, define the vector dimension of each character, word, character-level radical, word-level radical, and part-of-speech text as 50, and the output embedding vectors are as follows:
[0070] E c =[[0.15, 0.32, 0.23,..., 0.41], [0.59, 0.61,..., 0.85],..., [0.23, 0.45,..., 0.91]]
[0071] E w=[[0.27,0.34,0.46,...,0.51],[0.64,0.73...,0.95],...,[0.32,0.57,...,0.81]]
[0072] Among them, the Huffman tree is constructed and the conditional probabilities of the central word and the background word are calculated. Assuming that the Huffman code of the central word w1 is 01, the Huffman code of the background word w3 is 00, and the path length L(w3) = 2, then the conditional probability p(w3|w1) = 0.265;
[0073] (3) In the semantic extraction layer, the embedding vector is input and V is obtained after passing through the bidirectional GRU and attention mechanism. c =[0.19,0.28,0.33,...,0.45], V w =[0.24,0.31,0.44,...,0.52], assuming V pos =[0.32,0.38,0.46,...,0.56], then we get V final =[0.19, 0.28, 0.33, ..., 0.52, 0.32, ..., 0.56]. Input into the bidirectional GRU network to get the final sentiment vector y final =[0.26,0.48,0.55,...,0.71]
[0074] (4) In the result output layer, assume that the parameters of the fully connected layer are:
[0075] W=[[0.12,0.23,...,0.35],[0.41,0.52,...,0.63],...]
[0076] b=[0.10,0.21,...]
[0077] New softmax function calculation:
[0078] For each sentiment category i, calculate z i =W*y final + b, get z i =[1.45,2.35,0.95],softmax(z i )=[4.26 / 17.32,10.48 / 17.32,2.58 / 17.32]=[0.246,0.605,0.149]
[0079] The value with the largest output probability is selected as the emotion recognition result, the corresponding probability is 0.605, and the output classification result is 1 (positive emotion).
[0080] Give the classification result and input as prompt to LLM to get the answer to the question:
[0081] "There are multiple ways to optimize database query speed. First, make sure your indexes are configured properly, which can significantly improve query performance. Also, consider query optimization and hardware upgrades."
[0082] In summary, compared with the traditional technology of traversing a large-scale dictionary to update and calculate conditional probabilities, the present invention uses the Huffman tree to compress the dictionary, and reduces the computational complexity by calculating the path conditional probability step by step. The structure of the Huffman tree makes the update process only need to adjust the probability distribution corresponding to the path, which greatly reduces the redundant update of parameters in the iterative process. In addition, in emotion recognition, some emotion categories (such as "positive" or "neutral") may be significantly more than other categories. The traditional Softmax calculation may cause the model to be biased towards high-frequency categories. The present invention improves the category boundary judgment by adjusting the mean μ and the standard deviation β, which significantly reduces the impact of category imbalance on classification performance and improves the accuracy and reliability of emotion recognition.
[0083] The units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this application, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0084] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0085] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0086] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0087] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0088] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A database domain sentiment filtering question-answering method based on a bidirectional GRU network, the method comprising sentiment preprocessing and generative question-answering, wherein the sentiment preprocessing uses sentiment recognition technology to perform sentiment analysis and classification on the content of user questions, accurately identifies the sentiment information in the user text, and obtains sentiment labels of "positive", "negative" and "neutral" respectively; according to the result of sentiment preprocessing, the generative question-answering uses the sentiment label as part of the prompt in the database domain big model, and inputs it into the big model together with the user question, characterized in that: Huffman tree coding is used to compress the dictionary size, and node vectors are shared and path conditional probabilities are calculated level by level.
2. The database domain sentiment filtering question answering method based on a bidirectional GRU network as claimed in claim 1, characterized in that: The emotion preprocessing includes the following steps: (1) Input data: The user’s question text is used as the original input data to provide the basic data source for subsequent sentiment analysis; (2) Embedding vectorization: converting words or characters in the input text into high-dimensional vector representations to capture the semantic information of the text; (3) Extracting semantics: Extracting contextual semantic features from the embedding vector to generate a sentiment vector containing multi-dimensional information such as words, characters, and parts of speech; (4) Output results: The extracted sentiment vector is input into the fully connected layer for classification and output of sentiment labels.
3. The database domain sentiment filtering question answering method based on a bidirectional GRU network as claimed in claim 2, characterized in that: The process of embedding vectorization is as follows: 2.1 Construct a Huffman tree based on word frequency, where the path of each word is the binary code from the root node to the leaf node of the word; 2.2 Assign a vector representation to each node in the Huffman tree and update the node vector during training; 2.3 For a given central word w c and background word w o , calculate the conditional probability between the central word and the background word to be predicted Among them, L(w o ) is the root node to word w o The path length, n(w o ,j) is the jth node on the path, is the binary direction of the path node, v c is the word vector of the center word, is the vector of the jth node on the path, and σ() is the sigmoid function.
4. The database domain sentiment filtering question answering method based on a bidirectional GRU network as claimed in claim 2, characterized in that: When extracting semantics, the output word vector set E of the embedding vectorization layer is c And the word vector set E w As the input of the GRU network of this layer, the word context feature vector set y is obtained c and word context feature vector set y w ,calculate in, and are the hidden states of the forward GRU at time steps t and t-1, respectively. and are the hidden states of the backward GRU at time steps t and t+1, respectively, t is the input vector at time step t, y t is the context feature vector at time step t; after the attention mechanism weighted fusion output word-radical output vector V c And the word-radical output vector V w Then, compare it with V pos Splicing, where V pos is the part-of-speech vector set E pos and part-of-speech feature vector set Y pos The maximum pooling result of V c 、V w 、V pos Input into the bidirectional GRU network to obtain the final sentiment vector y final =Bi-GRU(V final ), where V final =[V c ,V w ,V pos ]. Further, when outputting the result, the sentiment vector y final Input to the fully connected layer for classification, and get the output result y of sentiment analysis output , where y output =softmax(Wy final +b), W is the weight matrix, b is the bias matrix, For each sentiment category i and k, μ i ,μ k and β i ,β k Respectively represent all input features z belonging to this category in the training data i ,z k The mean and standard deviation of .
5. A database domain sentiment filtering question-answering system based on a bidirectional GRU network, the system comprising a sentiment preprocessing module and a generative question-answering module, wherein the sentiment preprocessing module uses sentiment recognition technology to perform sentiment analysis and classification on the content of user questions, accurately identifies the sentiment information in the user text, and obtains sentiment labels of "positive", "negative" and "neutral" respectively; according to the result of sentiment preprocessing, the generative question-answering module uses the sentiment label as part of the prompt in the database domain big model, and inputs it into the big model together with the user question, characterized in that: Huffman tree coding is used to compress the dictionary size, and node vectors are shared and path conditional probabilities are calculated level by level.
6. A database domain sentiment filtering question answering system based on a bidirectional GRU network as claimed in claim 5, characterized in that: The following methods are used in the sentiment preprocessing module: (1) Input data: The user’s question text is used as the original input data to provide the basic data source for subsequent sentiment analysis; (2) Embedding vectorization: converting words or characters in the input text into high-dimensional vector representations to capture the semantic information of the text; (3) Extracting semantics: Extracting contextual semantic features from the embedding vector to generate a sentiment vector containing multi-dimensional information such as words, characters, and parts of speech; (4) Output results: The extracted sentiment vector is input into the fully connected layer for classification and output of sentiment labels.
7. The database domain sentiment filtering question answering system based on a bidirectional GRU network as claimed in claim 6, characterized in that: The process of embedding vectorization is as follows: 2.1 Construct a Huffman tree based on word frequency, where the path of each word is the binary code from the root node to the leaf node of the word; 2.2 Assign a vector representation to each node in the Huffman tree and update the node vector during training; 2.3 For a given central word w c and background word w o , calculate the conditional probability between the central word and the background word to be predicted Among them, L(w o ) is the root node to word w o The path length, n(w o ,j) is the jth node on the path, is the binary direction of the path node, v c is the word vector of the center word, is the vector of the jth node on the path, and σ() is the sigmoid function.
8. The database domain sentiment filtering question answering system based on a bidirectional GRU network as claimed in claim 6, characterized in that: When extracting semantics, the output word vector set E of the embedding vectorization layer is c And the word vector set E w As the input of the GRU network of this layer, the word context feature vector set y is obtained c and word context feature vector set y w ,calculate in, and are the hidden states of the forward GRU at time steps t and t-1, respectively. and are the hidden states of the backward GRU at time steps t and t+1, respectively, t is the input vector at time step t, y t is the context feature vector at time step t; after the attention mechanism weighted fusion output word-radical output vector V c And the word-radical output vector V w Then, compare it with V pos Splicing, where V pos is the part-of-speech vector set E pos and part-of-speech feature vector set Y pos The maximum pooling result of V c 、V w 、V pos Input into the bidirectional GRU network to obtain the final sentiment vector y final =Bi-GRU(V final ), where V final =[V c ,V w ,V pos ]. Further, when outputting the result, the sentiment vector y final Input to the fully connected layer for classification, and get the output result y of sentiment analysis output , where y output =softmax(Wy final +b), W is the weight matrix, b is the bias matrix, For each sentiment category i and k, μ i ,μ k and β i ,β k Respectively represent all input features z belonging to this category in the training data i ,z k The mean and standard deviation of .