Emotion analysis method, system and equipment based on questionnaire
By constructing a questionnaire logic diagram and an improved graph neural network model, combined with a pre-trained language model and PageRank ideas, the problem of dynamic context association in questionnaires is solved and more accurate sentiment analysis is achieved.
Patent Information
- Application Number
- CN202511261104.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Existing technologies find it difficult to effectively capture the dynamic contextual associations generated by questionnaire jump logic in questionnaires. In particular, in multiple-choice question scenarios, it is impossible to model the associated emotions behind users selecting multiple options at the same time, resulting in inaccurate sentiment analysis results.
An improved graph neural network model is adopted to construct a questionnaire logic diagram, and a pre-trained language model is used to extract the semantic vector of the question text and the co-occurrence frequency of multiple-choice options. The global sentiment is calculated by combining the PageRank idea, and the attention coefficient and weight are dynamically adjusted to achieve weighted aggregation of sentiment features.
It improves the accuracy of sentiment analysis and the recall rate of contextual association, adapts to the structured and unstructured mixed data scenarios of questionnaires, and enhances the grasp of the overall emotional context of users.
Smart Images

Figure CN120805932A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data analysis, and particularly relates to a method, system and device for sentiment analysis based on a questionnaire. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.
[0003] Carrying out sentiment analysis based on a questionnaire is a key means for converting qualitative subjective attitudes into quantitative and analyzable data, and its core value lies in mining the real emotions and needs of users hidden behind the text and scores to provide a scientific basis for decision-making.
[0004] At present, more and more companies establish a financial shared center in order to realize the standardization, scaling and cost optimization of financial processes. The financial shared center needs to process questionnaire data of multiple subjects and multiple scenarios: from the internal dimension, it covers the expense reimbursement process experience feedback of the employee end, the service quality score of the financial personnel, etc.; from the external dimension, it includes the supply chain settlement service satisfaction evaluation of the customer end, the cooperation process adaptability investigation of the supplier end, etc. Such questionnaire data shows a scaling growth feature, and the emotional tendencies contained therein, such as the process pain points corresponding to negative feedback and the service advantages corresponding to positive evaluation, are directly related to the operation optimization direction of the financial shared center.
[0005] The questionnaire sentiment analysis technology system currently used by the financial shared center mainly focuses on the static analysis of single modal data such as pure text sentiment classification, uses pre-trained models such as BERT, GPT series, etc. to make sentiment polarity judgments on the text, or combines rule libraries for keyword matching, but such methods usually treat the answers to each question as independent text segments for analysis, making it difficult to effectively capture the dynamic context association caused by the questionnaire jump logic and difficult to mine deep emotional tendencies from the overall answer logic of the user, resulting in a possible misalignment or fragmentation of the grasp of the overall emotional context of the user. In addition, for questionnaire scenarios containing special question types, such as survey questionnaires containing multiple-choice questions, existing models can only analyze the text semantics of each option independently, and cannot model the associated emotions behind the user's simultaneous selection of multiple options, ignoring the superimposed emotional tendencies reflected by the co-occurrence of multiple options; although LSTM sequence models can handle time-series text, they can only model dependency relationships based on the order of question numbers, and cannot adapt to the dynamic logic jump scenarios of questionnaires.
[0006] Therefore, how to perform sentiment analysis on a questionnaire is crucial for improving the reliability of the questionnaire results. SUMMARY
[0007] In order to overcome the above-mentioned deficiencies of the prior art, the present application provides a questionnaire-based emotion analysis method, system and device, which effectively captures the dynamic context association generated by the questionnaire jump logic and improves the reliability of grasping the overall emotional context of the user.
[0008] In order to achieve the above-mentioned purpose, the present application adopts the following technical solutions: In a first aspect, the present application provides a questionnaire-based emotion analysis method, comprising: Taking the questions of the user questionnaire as nodes, modeling the question jump logic relationship as a directed edge, and constructing a questionnaire logic graph; Using a pre-trained language model to extract the semantic vector of the question text, and combining the co-occurrence frequency of the multiple-choice question options to generate node-level local features; Based on the questionnaire logic graph and the node-level local features, using an improved graph neural network model for dynamic reasoning to obtain context-related question node features; wherein in the dynamic reasoning of the improved graph neural network model, the semantic similarity calculated based on the question text semantic vector and the question jump probability are used to calculate the dynamic attention coefficient, and the neighbor features are weighted and aggregated; According to the context-related question node features, using the PageRank idea to calculate the global emotion to obtain the final emotion analysis result.
[0009] In a second aspect, the present application provides a questionnaire-based emotion analysis system, comprising: A graph construction module configured to take the questions of the user questionnaire as nodes, model the question jump logic relationship as a directed edge, and construct a questionnaire logic graph; An extraction module configured to use a pre-trained language model to extract the semantic vector of the question text, and combine the co-occurrence frequency of the multiple-choice question options to generate node-level local features; An inference module configured to use an improved graph neural network model for dynamic reasoning based on the questionnaire logic graph and the node-level local features to obtain context-related question node features; wherein in the dynamic reasoning of the improved graph neural network model, the semantic similarity calculated based on the question text semantic vector and the question jump probability are used to calculate the dynamic attention coefficient, and the neighbor features are weighted and aggregated; An analysis module configured to use the PageRank idea to calculate the global emotion according to the context-related question node features to obtain the final emotion analysis result.
[0010] In a third aspect, the present application provides an electronic device comprising a memory and a processor, and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the method of the first aspect is completed.
[0011] The above one or more technical solutions have the following beneficial effects: In the present application, the questionnaire logic graph is constructed with the topic as the node and the jump relationship as the directed edge, the complex structure of the survey questionnaire is converted into computable graph data, the semantic vector of the topic text is extracted through the pre-trained language model, and the node-level local features are generated in combination with the co-occurrence frequency of the multiple-choice question options, so as to solve the defects of the traditional model that only pays attention to the text and ignores the structured option information, and adapt to the mixed data scene of structured and unstructured of the survey questionnaire; the improved graph neural network model is used for dynamic reasoning, the semantic similarity calculated by the semantic vector of the topic text, and the dynamic attention coefficient calculated by the jump probability between the topics are used to weight and aggregate the neighbor features, so as to solve the problem that the traditional graph neural network model uses fixed weights to aggregate neighbor features and cannot adapt to the difference in emotional relevance of different jump paths in the survey questionnaire, and ensure that the emotional feature aggregation is more in line with the actual logic; the global context is integrated based on the PageRank idea, and the accuracy of global emotional discrimination is improved.
[0012] In the present application, the improved graph neural network model learns the emotional discrimination ability of the emotion classifier, and the correlation modeling ability of the improved graph neural network model to the context of the survey questionnaire is retained as the target, a double-target loss function of emotional semantic loss and context correlation loss is constructed, and the improved graph neural network model is trained by the double-target loss function. The two kinds of loss functions work together, not only make up for the emotional semantic short board of the graph neural network model, but also retain its context correlation advantage. Compared with the model trained by a single target, the graph neural network model trained by the present application scheme significantly improves the emotional discrimination accuracy and the context correlation recall rate, especially in the complex survey questionnaire containing logical jumps, the comprehensive analysis performance advantage is more significant.
[0013] In the present application, in the training of the improved graph neural network model, a reinforcement learning model is introduced to dynamically adjust the weights of the double-target loss function, dynamically adapt to the emotional and context needs; the user feedback is included in the state space of the reinforcement learning, so as to ensure that the model optimization direction is consistent with the actual needs of the user.
[0014] The advantages of the additional aspects of the present application will be partially given in the following description, partially will become obvious from the following description, or will be known by the practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0015] The drawings accompanying the specification of the present application form a part thereof, serve to provide further understanding of the present application, and together with the description of the illustrative embodiments of the present application and its description serve to explain the present application. The present application should not be unduly limited to such embodiments.
[0016] Figure 1 The flow chart of the emotional analysis method based on the survey questionnaire in the present application embodiment one. DETAILED DESCRIPTION
[0017] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0018] It should be noted that the terms used herein are only intended to describe specific embodiments and are not intended to limit exemplary embodiments according to the present application.
[0019] In the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0020] Embodiment one As Figure 1 shown, the embodiment discloses a questionnaire-based sentiment analysis method, comprising: Taking the questions of the user questionnaire as nodes, modeling the question jump logic relationship as directed edges, and constructing a questionnaire logic graph; Using a pre-trained language model to extract semantic vectors of question texts, and generating node-level local features in combination with co-occurrence frequencies of multiple-choice question options; Based on the questionnaire logic graph and the node-level local features, using an improved graph neural network model for dynamic reasoning to obtain context-related question node features; wherein, in the dynamic reasoning of the improved graph neural network model, the semantic similarity calculated based on the question text semantic vectors, and the dynamic attention coefficient calculated based on the question jump probability, are used to weight and aggregate neighbor features; According to the context-related question node features, using the PageRank idea to calculate the global sentiment to obtain the final sentiment analysis result.
[0021] The embodiment constructs a questionnaire logic graph taking questions as nodes and jump relationships as directed edges, converts the complex structure of the questionnaire into computable graph data, extracts semantic vectors of question texts through a pre-trained language model, generates node-level local features in combination with co-occurrence frequencies of multiple-choice question options, solves the defects of traditional models that only focus on texts and ignore structured option information, and adapts to the mixed data scenarios of structured and unstructured questionnaire; uses an improved graph neural network model for dynamic reasoning, calculates the semantic similarity through question text semantic vectors, calculates the dynamic attention coefficient through question jump probability, and weights and aggregates neighbor features, solves the problem that traditional graph neural network models use fixed weights to aggregate neighbor features and cannot adapt to the sentiment correlation differences of different jump paths in the questionnaire, and ensures that the sentiment feature aggregation is more in line with the actual logic; integrates the global context based on the PageRank idea, and improves the accuracy of global sentiment discrimination.
[0022] The following will be combined with Figure 1The sentiment analysis method based on the questionnaire proposed in this embodiment is described in detail: Step 1: Take the questions of the user questionnaire as nodes, model the question jump logic relationship as directed edges, and construct the questionnaire logic graph.
[0023] In an embodiment, the user questionnaire is preprocessed, and the preprocessing includes: converting the structured multiple-choice question data into numerical data using one-hot encoding; standardizing the numerical data using the z-score standardization method; and normalizing the standardized data set using the deviation standardization method.
[0024] In the embodiment, the question types in the questionnaire are divided into structured questions and unstructured questions. Structured questions include single-choice questions and double-choice questions. The questions in the questionnaire are mapped to graph nodes, and the logical jump relationships between questions, such as "jump to question 5 if you choose A", are modeled as directed edges to construct a questionnaire logic graph.
[0025] As an optional implementation, edge weights are calculated based on logical jump rules such as conditional branch probability and user historical behavior frequency such as jump path frequency. The jump probability is determined based on the theoretical trigger probability calculated according to the questionnaire design rules. For example, if the historical selection rate of Q1 option "1 - Very dissatisfied, 2 - dissatisfied" is 30%, then the jump probability of edge "Q1→Q4" = 30%. In the statistical historical questionnaire data, the node corresponding to the previous question is i Actually jump to the corresponding node of the subsequent question j The frequency of historical behavior is determined by the frequency of
[0026] Step 2: Use the pre-trained language model to extract the semantic vector of the question text, and generate node-level local features based on the co-occurrence frequency of multiple-choice question options.
[0027] In this embodiment, the co-occurrence frequency of multiple-choice questions is converted into a vector of the same dimension as the BERT semantic vector; the similarity between the semantic vector of the question text and the vector corresponding to the co-occurrence frequency of the multiple-choice question options is calculated; the weights of the semantic vector of the question text and the vector corresponding to the co-occurrence frequency of the multiple-choice question options are dynamically adjusted according to the similarity, and node-level local features are generated based on the adjusted weights.
[0028] As a specific implementation, the co-occurrence frequency of the multiple-choice question options is a low-dimensional feature, and the BERT semantic vector is a high-dimensional feature. If they are directly spliced, the low-dimensional co-occurrence feature will be diluted by the high-dimensional semantic feature. In this embodiment, the co-occurrence frequency of the multiple-choice question options is converted into a vector of the same dimension as the semantic vector through a fully connected layer mapping. After splicing the mapped co-occurrence frequency of the multiple-choice question options and the semantic vector of the question text, the spliced result is compressed through a learnable parameter vector, and then a similarity score is obtained through LeakyReLU activation. After obtaining the similarity score, the similarity score needs to be converted into an adaptive weight with a sum of 1 through a Softmax function, so as to ensure that the weight distribution of the two types of features conforms to the probability distribution.
[0029] The corresponding formula is:
[0030]
[0031] In this embodiment, the similarity between the semantic vector of the question text and the co-occurrence frequency vector is dynamically adjusted. When the similarity score between the semantic vector of the question text and the co-occurrence frequency vector is high, it indicates that the information transmitted by the two types of features is consistent, and the weight of the semantic vector of the question text is increased to enhance the feature expression by using the rich text semantic details. When the similarity score between the semantic vector of the question text and the co-occurrence frequency vector is low, it indicates that the semantic vector may be disturbed by the surface text, and the co-occurrence frequency can better reflect the real selection tendency of the user. At this time, the weight of the co-occurrence frequency vector is increased to preferentially retain the objective data related to the options.
[0032] Step 3: Based on the questionnaire logical graph and the node-level local feature, an improved graph neural network model is used for dynamic reasoning to obtain the context-related question node feature; in the dynamic reasoning of the improved graph neural network model, the semantic similarity calculated based on the question text semantic vector and the jump probability between questions are used to calculate the dynamic attention coefficient, and the neighbor features are weighted and aggregated.
[0033] In this embodiment, the node-level local feature is used as the initial representation of the corresponding node. Based on the question text semantic vector, the semantic similarity between the current node and the neighbor nodes is calculated, and the attention coefficient is determined in combination with the jump probability. The node-level local features of the neighbor nodes are weighted and aggregated according to the attention coefficient to obtain the neighbor feature aggregation result. The neighbor feature aggregation result and the initial representation of the current node are spliced to obtain the updated context-related question node feature of the current node.
[0034] As a specific implementation, the node-level local feature is used as the initial representation of the corresponding node. Based on the adjacency relationship of the questionnaire logical graph, the neighbor node features of each node are sampled and aggregated, which specifically includes: First, the node-level local feature of each nodev Neighbor set Perform fixed number sampling, such as sampling 10 neighbors, to reduce computational complexity; Use node-level local features as the initial feature representation of the corresponding node ; Based on the semantic vector of the current node's title text and the semantic vector of the neighboring node's title text, the semantic similarity is calculated using a learnable parameter vector and a shared weight matrix. The jump probability between titles is also incorporated to obtain the initial attention score, which is then normalized using Softmax to obtain the attention coefficient. Perform weighted aggregation on the node-level local features of the sampled neighbor nodes according to the attention coefficient to obtain the neighbor feature aggregation result; The neighbor feature aggregation results are spliced with the node-level local features of the current node itself, and linear transformation and activation are performed through the preset weight matrix to obtain the updated context-related question node features of the current node.
[0035] This embodiment introduces dynamic attention coefficient during aggregation , which is calculated jointly by semantic similarity and jump probability:
[0036] in, is the learnable parameter vector, is the shared weight matrix, is the weight coefficient of jump probability, The conditional probability of jumping from node v to node u. " indicates vector concatenation, For the current node v The semantic vector of the title text, Neighbor nodes u The semantic vector of the title text.
[0037] Use Softmax to normalize the coefficients to ensure that the weight sum is 1:
[0038] in, For nodes v The set of neighbors.
[0039] The dynamic attention coefficient As weights, weighted aggregate neighbor features:
[0040] Node feature updates: ) in, is a learnable weight matrix, is a neighbor feature aggregation result, is a node-level local feature of the current node, and superscript k represents the number of network layers.
[0041] Step 4: According to the context-related question node features, the global sentiment is calculated by using the PageRank idea to obtain the final sentiment analysis result.
[0042] In the embodiment, the edge weight is determined by fusing the questionnaire logical jump rule probability and the jump path frequency of the user historical behavior, and the transition probability matrix is obtained according to the edge weight; the node importance weight is defined according to the question type, and the transition probability matrix and the node importance weight are fused to obtain the weighted transition probability matrix; the context-related question node features are taken as the initial sentiment scores of the corresponding nodes, the initial sentiment scores of the nodes are iteratively calculated according to the weighted transition probability matrix by using the PageRank idea, the emotion transmission process of the user in the questionnaire is simulated, until the convergence condition is reached, the global sentiment of each node is obtained, and the final sentiment analysis result is obtained according to the global sentiment of each node.
[0043] As a specific implementation, by referring to the PageRank idea, higher weight is given to key nodes such as open questions and high-frequency multiple-choice questions, and the semantic polarity of the user's answer calculated by the RoBERTa sentiment classifier is combined to iteratively update the global sentiment score.
[0044] (1) Key node weight distribution: Define node importance weight , for example:
[0045] (2) Construct transition probability matrix M:
[0046] wherein, is the edge weight of node i and node j.
[0047] Fuse node weight:
[0048] wherein, is the weight of node k.
[0049] (3) Initial sentiment score :
[0050] wherein, superscript T represents transposition, indicates the context-related question node features corresponding to node n.
[0051] (4) Iterative propagation based on PageRank idea:
[0052] wherein β is a damping factor, controlling the strength of global propagation, β = 0.85 in the embodiment; t represents the number of iterations, is the weighted transition probability matrix.
[0053] Iterate until convergence: .
[0054] (5) Global sentiment score:
[0055] wherein n is the number of nodes, is the global sentiment value of the ith node.
[0056] The PageRank idea simulates the emotion transmission of users in the questionnaire through the transition probability matrix, constructs the edge weight based on the jumping logic probability and historical behavior frequency of the question, and constructs the node weight based on the importance of the question type, so that the sentiment score can be transmitted along the jumping path, and the finally output global emotion can restore the overall emotional change of the user from the beginning to the end of the questionnaire, avoiding the emotional misjudgment caused by local question analysis.
[0057] In the embodiment, the improved graph neural network model is trained in a way of knowledge distillation: to make the improved graph neural network model learn the emotion discrimination ability of the emotion classifier, and to retain the ability of the improved graph neural network model to model the association of the context of the survey questionnaire as the target, a double-target loss function including an emotion semantic loss and a context association loss function is constructed; the improved graph neural network model is trained by using the double-target loss function.
[0058] Specifically, the emotion classifier such as RoBERTa is used as a teacher network to provide emotion knowledge, and the improved graph neural network model is used as a student model to update its own parameters by learning the emotion discrimination ability of the teacher model.
[0059] By inputting the answers of the open questions in the survey questionnaire into the pre-trained and frozen emotion classifier, the emotion classifier outputs emotion labels such as contradictory emotions and emotion polarity values (-1~1). The questionnaire logic graph corresponding to the survey questionnaire is input into the improved graph neural network model to obtain the context-associated question node features, and the context-associated question node features are processed through a full connection layer and a Softmax activation function to obtain emotion scores and emotion probability distributions, wherein the negative values in the emotion scores represent negative, the positive values represent positive, and the absolute value size reflects the emotion intensity.
[0060] Specifically, the mean square error loss function is used to constrain the improved graph neural network to map the sentiment score to be consistent with the polarity value of the sentiment classifier, and the sentiment semantic loss function is:
[0061]
[0062]
[0063] wherein, is the sentiment score mapped by the improved graph neural network, is the polarity value output by the sentiment classifier. The KL divergence loss function constrains the probability distribution of the sentiment label of the improved graph neural network to be consistent with RoBERTa, and N is the number of samples; is the sentiment probability distribution obtained by the improved graph neural network model, represents the sentiment probability distribution output by the sentiment classifier.
[0064] The context correlation loss function is:
[0065] wherein, E is a set of edges of the questionnaire logical graph, is an attention coefficient.
[0066] The total loss function is:
[0067] wherein, , , is a corresponding weight, is a mean square error loss function, is a KL divergence loss function, is a graph structure loss.
[0068] The embodiment aims at the weak problem of graph neural network sentiment discrimination, and the knowledge distillation makes the graph neural network retain the context correlation modeling capability while learning the discrimination logic of the professional sentiment classifier, thereby improving the sentiment precision of the graph neural network.
[0069] In the embodiment, in the improved graph neural network training process, the difference between the sentiment scores obtained by the improved graph neural network and the sentiment classifier based on the open question answers in the questionnaire and the user feedback data are input into the reinforcement learning model, and the corresponding weights of the sentiment semantic loss and the context correlation loss in the double-target loss function are dynamically adjusted based on the reinforcement learning model.
[0070] As a specific implementation, the state vector includes sentiment score difference data and user feedback data; the action is two weights of a loss function; the reward function includes user satisfaction and model consistency score, wherein the user satisfaction directly adopts the score of the user on the sentiment analysis result, and the model consistency score is calculated based on the difference between the sentiment scores of the double models. If the reward value increases after a certain action, i.e., weight adjustment, is executed, it means that the weight distribution is more optimal, and the reinforcement learning model will retain the adjustment strategy through learning; if the reward value decreases, the weight distribution logic is optimized in the opposite direction.
[0071] The reinforcement learning of the embodiment takes the sentiment score difference and the user feedback data into the state space, takes the user satisfaction and the model consistency as the reward target, dynamically adjusts the weights of the two types of losses, and guides the model subsequent analysis to be more in line with the real intention of the user based on the user feedback.
[0072] Embodiment two The purpose of the embodiment is to provide a sentiment analysis system based on a questionnaire, which includes: A graph construction module configured to model the topic jump logic relationship of the user questionnaire as a directed edge with the topic of the questionnaire as a node, and construct a questionnaire logic graph; An extraction module configured to extract a semantic vector of the topic text using a pre-trained language model, and generate node-level local features in combination with the co-occurrence frequency of multiple-choice question options; An inference module configured to perform dynamic inference based on the questionnaire logic graph and the node-level local features using an improved graph neural network model to obtain context-related topic node features; wherein in the dynamic inference of the improved graph neural network model, the semantic similarity calculated based on the topic text semantic vector and the topic jump probability are used to calculate a dynamic attention coefficient to weight and aggregate neighbor features; An analysis module configured to calculate global sentiment using the PageRank idea based on the context-related topic node features to obtain a final sentiment analysis result.
[0073] In more embodiments, there are also provided: An electronic device including a memory and a processor, and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the method described in embodiment one is completed. For brevity, it will not be repeated here.
[0074] It should be understood that the processor in the embodiments can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0075] The memory can include read-only memory and random access memory, and provide instructions and data to the processor, and a portion of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0076] A computer readable storage medium is used to store computer instructions, and the computer instructions are executed by a processor to complete the method described in Embodiment I.
[0077] The method in Embodiment I can be directly embodied by a hardware processor to complete, or be completed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads information in the memory to complete the steps of the above method in combination with the hardware. To avoid repetition, it will not be described in detail here.
[0078] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0079] The above describes the specific embodiments of the application in combination with the accompanying drawings, but is not a limitation on the protection scope of the application. Those skilled in the art should understand that various modifications or variations made by those skilled in the art on the basis of the technical solutions of the application without inventive labor are still within the protection scope of the application.
Claims
1. A sentiment analysis method based on questionnaire, characterized in that: include: Taking the questions of the user questionnaire as nodes, model the question jump logic relationship as directed edges to construct the questionnaire logic graph; Use the pre-trained language model to extract the semantic vector of the question text, and generate node-level local features based on the co-occurrence frequency of multiple-choice options; Based on the questionnaire logic diagram and the node-level local features, an improved graph neural network model is used to perform dynamic reasoning to obtain context-related question node features; wherein, during the dynamic reasoning of the improved graph neural network model, the semantic similarity calculated based on the semantic vector of the question text and the jump probability between questions are used to calculate the dynamic attention coefficient and weighted aggregate neighbor features; According to the context-related topic node features, the global sentiment is calculated using the PageRank idea to obtain the final sentiment analysis results.
2. The sentiment analysis method based on questionnaire according to claim 1, characterized in that: The pre-trained language model is used to extract the semantic vector of the question text, and the co-occurrence frequency of the multiple-choice question options is combined to generate node-level local features. Specifically: Convert the co-occurrence frequency of multiple-choice questions into a vector with the same dimension as the BERT semantic vector; Calculate the similarity between the semantic vector of the question text and the co-occurrence frequency vector of the multiple-choice question options; The weights of the semantic vector of the question text and the co-occurrence frequency vector of the multiple-choice question options are dynamically adjusted according to the similarity, and node-level local features are generated based on the adjusted weights.
3. The sentiment analysis method based on questionnaire according to claim 1, characterized in that: Based on the questionnaire logic diagram and the node-level local features, an improved graph neural network model is used for dynamic reasoning to obtain context-related question node features, specifically: The node-level local features are used as the initial representation of the corresponding node, Based on the semantic vector of the question text, the semantic similarity between the current node and the neighboring nodes is calculated, and the attention coefficient is determined based on the jump probability; Performing weighted aggregation on the node-level local features of neighboring nodes according to the attention coefficient to obtain a neighbor feature aggregation result; The neighbor feature aggregation result and the initial representation of the current node are concatenated to obtain the updated context-related question node features of the current node.
4. The sentiment analysis method based on questionnaire according to claim 1, characterized in that: Based on the contextually associated topic node features, the PageRank idea is used to calculate the global sentiment and obtain the final sentiment analysis results, which are as follows: The edge weights are determined by integrating the probability of logical jump rules in the questionnaire and the jump path frequency of the user's historical behavior, and the transition probability matrix is obtained based on the edge weights. Defining node importance weights according to the topic type, fusing the transition probability matrix with the node importance weights to obtain a weighted transition probability matrix; The context-related question node features are used as the initial sentiment scores of the corresponding nodes. The PageRank idea is used to iteratively calculate the initial sentiment scores of the nodes according to the weighted transition probability matrix, simulating the user's sentiment transmission process in the questionnaire until the convergence condition is reached. The global sentiment of each node is obtained, and the final sentiment analysis results are obtained based on the global sentiment of each node.
5. The sentiment analysis method based on questionnaire according to claim 1, characterized in that: The improved graph neural network model is trained as follows: With the goal of enabling the improved graph neural network model to learn the sentiment discrimination ability of the sentiment classifier and retaining the improved graph neural network model's ability to model the association of the questionnaire context, a dual-objective loss function including sentiment semantic loss and context association loss is constructed; The improved graph neural network model is trained using the dual-objective loss function.
6. The sentiment analysis method based on questionnaire according to claim 5, characterized in that: The improved graph neural network training process also includes: based on the answers to open questions in the questionnaire, obtaining sentiment scores respectively through the improved graph neural network and the sentiment classifier, inputting the differences in the obtained sentiment scores and user feedback data into the reinforcement learning model, and dynamically adjusting the corresponding weights of the sentiment semantic loss and the context association loss in the dual-objective loss function based on the reinforcement learning model.
7. The sentiment analysis method based on questionnaire according to claim 6, characterized in that: The reinforcement learning model adjusts the weights in the dual-objective loss function based on the state space, action space and reward function; wherein the state space includes the difference data of the sentiment score and the user feedback data; the dynamic space is the weight coefficient of the sentiment semantic loss and the context association loss; and the reward function includes the user satisfaction and the model consistency score.
8. The sentiment analysis method based on questionnaire according to claim 1, characterized in that: Before constructing the questionnaire logic diagram for the user questionnaire, the user questionnaire is also preprocessed. The preprocessing includes: converting the structured multiple-choice question data into numerical data using one-hot encoding; standardizing the numerical data using the z-score standardization method; and normalizing the standardized data set using the deviation standardization method.
9. A sentiment analysis system based on questionnaire, characterized in that: include: The graph construction module is configured to: use the questions of the user questionnaire as nodes, model the question jump logic relationship as directed edges, and construct the questionnaire logic graph; The extraction module is configured to: extract the semantic vector of the question text using the pre-trained language model, and generate node-level local features based on the co-occurrence frequency of the multiple-choice question options; The reasoning module is configured to: perform dynamic reasoning using an improved graph neural network model based on the questionnaire logic diagram and the node-level local features to obtain context-related question node features; wherein, during the dynamic reasoning of the improved graph neural network model, the semantic similarity calculated based on the semantic vector of the question text and the jump probability between questions are used to calculate the dynamic attention coefficient and weighted aggregate neighbor features; The analysis module is configured to calculate the global sentiment based on the context-related title node features using the PageRank idea to obtain the final sentiment analysis results.
10. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 8 is completed.
Citation Information
Patent Citations
Content recommendation method, device and system and storage medium
CN113806620A
Learner emotional evolution analysis method and system based on causal graph neural network
CN115374790A
Text sentiment analysis method and device, equipment, storage medium and program product
CN118211594A
Aspect-level sentiment analysis method and system based on question and answer text dependency and graph convolutional network
CN118350383A
Intelligent question and answer method and device, electronic equipment and storage medium
CN119646127A
Cited By
Multi-modal large model-based surface access volume quality control method and system
CN121808052A
A method and system for surface-access volume quality control based on a multimodal large model
CN121808052B
Psychological state recognition method based on multi-modal biological characteristic and scale data fusion
CN122272024A