A method, system and device for sentiment analysis based on a questionnaire
By constructing a questionnaire logic diagram and an improved graph neural network model, combined with a pre-trained language model and the PageRank concept, the challenges of dynamic contextual association and multiple-choice question sentiment analysis in questionnaire sentiment analysis were solved, achieving more accurate user sentiment analysis.
Patent Information
- Application Number
- CN202511261104.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Existing questionnaire sentiment analysis techniques are unable to effectively capture the dynamic contextual relationships generated by questionnaire jump logic, cannot accurately analyze the overall emotional trajectory of users with multiple-choice questions, and traditional graph neural network models cannot adapt to the differences in emotional relevance of different jump paths in survey questionnaires.
A questionnaire logic graph is constructed. A pre-trained language model is used to extract semantic vectors of the question text and co-occurrence frequency of multiple-choice options to generate node-level local features. An improved graph neural network model is used for dynamic reasoning. Global sentiment is calculated by combining the PageRank idea. Neighbor features are aggregated by weighting through dynamic attention coefficients.
It improves the reliability of grasping the overall emotional context of users, enhances the accuracy of sentiment analysis and context-related recall, especially in complex questionnaires with logical transitions.
Smart Images

Figure CN120805932B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field related to 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 satisfaction evaluation of the supply chain settlement service of the customer end, the cooperation process adaptability investigation of the supplier end, etc. Such questionnaire data shows a characteristic of large-scale growth, and the emotional tendencies contained therein, such as process pain points corresponding to negative feedback and 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 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:
[0009] In a first aspect, the present application provides a questionnaire-based emotion analysis method, comprising:
[0010] Taking the questions of the user questionnaire as nodes, modeling the question jump logic relationship as directed edges, and constructing a questionnaire logic graph;
[0011] 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;
[0012] 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;
[0013] According to the context-related question node features, using the PageRank idea to calculate the global emotion to obtain the final emotion analysis result.
[0014] In a second aspect, the present application provides a questionnaire-based emotion analysis system, comprising:
[0015] The graph construction module is configured to take the questions of the user questionnaire as nodes, model the question jump logic relationship as directed edges, and construct a questionnaire logic graph;
[0016] The extraction module is 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;
[0017] The reasoning module is 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;
[0018] The analysis module is 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.
[0019] Thirdly, the present invention provides an electronic device including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.
[0020] The above one or more technical solutions have the following beneficial effects:
[0021] In this invention, a questionnaire logic graph is constructed using questions as nodes and jump relationships as directed edges, transforming the complex structure of the questionnaire into computable graph data. A pre-trained language model extracts semantic vectors from the question text, and node-level local features are generated by combining the co-occurrence frequency of multiple-choice options. This addresses the shortcomings of traditional models that only focus on text and ignore structured option information, adapting to mixed structured and unstructured data scenarios in questionnaires. An improved graph neural network model is used for dynamic reasoning. Semantic similarity is calculated using the semantic vectors of the question text, and dynamic attention coefficients are calculated based on the jump probabilities between questions. Neighbor features are weighted and aggregated, solving the problem that traditional graph neural network models use fixed weights to aggregate neighbor features, which cannot adapt to the differences in emotional relevance across different jump paths in the questionnaire. This ensures that the aggregation of emotional features is more consistent with actual logic. Finally, global context is integrated based on the PageRank principle to improve the accuracy of global sentiment judgment.
[0022] In this invention, the improved graph neural network model is trained to learn the sentiment discrimination ability of a sentiment classifier while retaining its ability to model the contextual association of questionnaires. A dual-objective loss function, consisting of sentiment semantic loss and contextual association loss, is constructed and used to train the improved graph neural network model. The two loss functions work synergistically to compensate for the graph neural network model's weakness in sentiment semantics while preserving its advantage in contextual association. Compared to models trained with a single objective, the graph neural network model trained using this invention significantly improves sentiment discrimination accuracy and contextual association recall, especially in complex questionnaires with logical transitions, where the overall performance advantage is even more pronounced.
[0023] In this invention, during the training of the improved graph neural network model, a reinforcement learning model is introduced to dynamically adjust the weights of the dual-objective loss function, dynamically adapting to emotional and contextual needs; user feedback is incorporated into the state space of the reinforcement learning to ensure that the model optimization direction is consistent with the actual needs of users.
[0024] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0025] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0026] Figure 1 This is a flowchart of the sentiment analysis method based on a questionnaire in Embodiment 1 of the present invention. Detailed Implementation
[0027] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, 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 invention pertains.
[0028] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0029] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0030] Example 1
[0031] like Figure 1 As shown, this embodiment discloses a sentiment analysis method based on a questionnaire, including:
[0032] Using the questions in the user survey questionnaire as nodes, the logical relationship between questions is modeled as directed edges to construct a questionnaire logic graph;
[0033] The semantic vector of the question text is extracted using a pre-trained language model, and node-level local features are generated by combining the co-occurrence frequency of multiple-choice options.
[0034] Based on the questionnaire logic diagram and node-level local features, an improved graph neural network model is used for dynamic reasoning to obtain context-related question node features. In the dynamic reasoning process of the improved graph neural network model, the semantic similarity is calculated based on the semantic vector of the question text, and the dynamic attention coefficient is calculated based on the jump probability between questions, and the neighbor features are weighted and aggregated.
[0035] Based on the contextual characteristics of the question nodes, the global sentiment is calculated using the PageRank algorithm to obtain the final sentiment analysis results.
[0036] This embodiment constructs a questionnaire logic graph using questions as nodes and jump relationships as directed edges, transforming the complex structure of the questionnaire into computable graph data. It extracts semantic vectors from the question text using a pre-trained language model and generates node-level local features by combining the co-occurrence frequency of multiple-choice options. This addresses the shortcomings of traditional models that only focus on text and ignore structured option information, adapting to mixed structured and unstructured data scenarios in questionnaires. An improved graph neural network model is used for dynamic reasoning. Semantic similarity is calculated using the semantic vectors of the question text, and dynamic attention coefficients are calculated based on the jump probabilities between questions. Neighbor features are then weighted and aggregated, solving the problem that traditional graph neural network models use fixed weights to aggregate neighbor features, which cannot adapt to the differences in emotional relevance across different jump paths in the questionnaire. This ensures that the aggregation of emotional features is more consistent with actual logic. Finally, global context is integrated based on the PageRank principle to improve the accuracy of global sentiment judgment.
[0037] The following is combined Figure 1 This embodiment provides a detailed description of a sentiment analysis method based on a questionnaire:
[0038] Step 1: Using the questions in the user survey questionnaire as nodes, model the logical relationship between questions as directed edges to construct the questionnaire logic graph.
[0039] In this embodiment, the user survey questionnaire is preprocessed, including: converting the structured multiple-choice data using one-hot encoding into numerical data; standardizing the numerical data using z-score standardization; and normalizing the standardized dataset using deviation standardization.
[0040] In this embodiment, the questionnaire questions 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 as graph nodes, and the logical jump relationship between questions, such as "choosing A will jump to question 5", is modeled as directed edges to construct the questionnaire logic graph.
[0041] As an optional implementation, edge weights are calculated based on logical jump rules such as conditional branch probabilities and the frequency of user historical behaviors such as jump path frequencies. Specifically, the jump probability is determined by the theoretical trigger probability calculated according to the questionnaire design rules. For example, if the historical selection rate of option Q1 "1 - Very dissatisfied, 2 - Dissatisfied" is 30%, then the jump probability of edge "Q1→Q4" is 30%. The weights are calculated from the nodes corresponding to the preceding questions in the historical questionnaire data. i The actual jump to the corresponding node of the subsequent question j The frequency of historical behavior is determined by the frequency of the behavior.
[0042] Step 2: Use a pre-trained language model to extract the semantic vector of the question text, and combine it with the co-occurrence frequency of multiple-choice options to generate node-level local features.
[0043] In this embodiment, the co-occurrence frequency of multiple-choice questions is converted into a vector with 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 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 options are dynamically adjusted according to the similarity, and node-level local features are generated based on the adjusted weights.
[0044] As a specific implementation, the co-occurrence frequency of multiple-choice options is a low-dimensional feature, while the BERT semantic vector is a high-dimensional feature. If directly concatenated, the low-dimensional co-occurrence feature would be diluted by the high-dimensional semantic feature. This embodiment uses a fully connected layer to map the co-occurrence frequency of multiple-choice options into a vector of the same dimension as the semantic vector. The mapped co-occurrence frequency of multiple-choice options is then concatenated with the semantic vector of the question text and compressed using a learnable parameter vector. A similarity score is then obtained using LeakyReLU activation. After obtaining the similarity score, it needs to be converted into adaptive weights with a sum of 1 using the Softmax function to ensure that the weight allocation of the two types of features conforms to the probability distribution.
[0045] The corresponding formula is:
[0046]
[0047]
[0048] This embodiment dynamically adjusts the weights based on the similarity between the semantic vector and co-occurrence frequency vector of the question text. When the similarity score between the semantic vector and co-occurrence frequency vector of the question text is high, it indicates that the information conveyed by the two types of features is consistent, so the weight of the semantic vector of the question text is increased to enhance feature expression by utilizing its rich textual semantic details. When the similarity score between the semantic vector and co-occurrence frequency vector of the question text is low, it indicates that the semantic vector may be affected by the surface text, while the co-occurrence frequency is more likely to reflect the user's true choice tendency. In this case, the weight of the co-occurrence frequency vector is increased to prioritize the retention of objective data related to the options.
[0049] Step 3: Based on the questionnaire logic graph and node-level local features, an improved graph neural network model is used for dynamic reasoning to obtain the context-related question node features. In 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 dynamic attention coefficient calculated based on the jump probability between questions are used to weight and aggregate the neighbor features.
[0050] In this embodiment, 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 its neighboring nodes is calculated, and the attention coefficient is determined by combining the jump probability. The node-level local features of the neighboring nodes are weighted and aggregated according to the attention coefficient to obtain the neighbor feature aggregation result. The neighbor feature aggregation result is concatenated with the initial representation of the current node to obtain the updated context-related question node features of the current node.
[0051] As a specific implementation method, node-level local features serve as the initial representation of the corresponding node. Combined with the adjacency relationships of the questionnaire logic graph, the features of each node's neighboring nodes are sampled and aggregated, specifically including:
[0052] First, for each node v Neighbor set Perform a fixed number of samples, such as sampling 10 neighbors, to reduce computational complexity;
[0053] Use node-level local features as the initial feature representation of the corresponding node. ;
[0054] Based on the semantic vector of the question text of the current node and the semantic vector of the question text of the neighboring nodes, the semantic similarity is calculated through the learnable parameter vector and the shared weight matrix. At the same time, the jump probability between questions is incorporated to obtain the initial attention score, and the attention coefficient is obtained by Softmax normalization.
[0055] The node-level local features of the sampled neighbor nodes are weighted and aggregated based on the attention coefficient to obtain the neighbor feature aggregation result.
[0056] The neighbor feature aggregation result is concatenated with the node-level local features of the current node itself, and then linearly transformed and activated through a preset weight matrix to obtain the updated context-related question node features of the current node.
[0057] This embodiment introduces a dynamic attention coefficient during aggregation. It is calculated jointly by semantic similarity and jump probability:
[0058]
[0059] in, For learnable parameter vectors, To share the weight matrix, These are the weighting coefficients for the 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. Neighboring nodes u The semantic vector of the title text.
[0060] Use Softmax to normalize the coefficients to ensure that the sum of the weights is 1:
[0061]
[0062] in, For nodes v The set of neighbors.
[0063] Dynamic attention coefficient As weights, the neighbor features are weighted and aggregated:
[0064]
[0065] Node feature update:
[0066] )
[0067] in, The weight matrix is a learnable matrix. The result of aggregating neighbor features. This represents the node-level local feature of the current node, with the superscript k indicating the network layer number.
[0068] Step 4: Based on the contextual characteristics of the question nodes, calculate the global sentiment using the PageRank algorithm to obtain the final sentiment analysis results.
[0069] In this embodiment, edge weights are determined by integrating the probability of logical jump rules in the questionnaire with the frequency of jump paths in the user's historical behavior, and a transition probability matrix is obtained based on the edge weights. Node importance weights are defined according to the question type, and the transition probability matrix is integrated 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. Using the PageRank concept, the initial sentiment scores of the nodes are iteratively calculated based on the weighted transition probability matrix to simulate the user's sentiment transmission process in the questionnaire until the convergence condition is met, thus obtaining the global sentiment of each node. The final sentiment analysis result is obtained based on the global sentiment of each node.
[0070] As a specific implementation method, drawing on the PageRank concept, higher weights are assigned to key nodes such as open-ended questions and high-frequency multiple-choice questions. The global sentiment score is then iteratively updated by combining the semantic polarity of user responses calculated using the RoBERTa sentiment classifier.
[0071] (1) Weight allocation of key nodes:
[0072] Define node importance weights For example:
[0073]
[0074] (2) Construct the transition probability matrix M:
[0075]
[0076] in, Let be the edge weights of nodes i and j.
[0077] Merged node weights:
[0078]
[0079] in, Let k be the weight of node k.
[0080] (3) Initial sentiment score :
[0081]
[0082] The superscript T indicates transpose. This represents the contextual characteristics of the question node corresponding to node n.
[0083] (4) Iterative propagation based on the PageRank concept:
[0084]
[0085] Where β is the damping factor, controlling the global propagation intensity; in this embodiment, β = 0.85; t represents the number of iterations. This is the weighted transition probability matrix.
[0086] Iterate until convergence: .
[0087] (5) Overall sentiment score:
[0088]
[0089] Where n is the number of nodes. Let be the global sentiment value of the i-th node.
[0090] PageRank uses a transition probability matrix to simulate the transmission of user emotions in a questionnaire. It constructs edge weights based on the logical probability of question jumps and the frequency of historical behavior, as well as node weights based on the importance of question types. This allows emotional scores to be transmitted along the jump path, and the final output of global sentiment can restore the overall emotional changes of users from the beginning to the end of the questionnaire, avoiding emotional misjudgments caused by partial question analysis.
[0091] In this embodiment, the improved graph neural network model is trained using knowledge distillation: 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 between the questionnaire context, a dual-objective loss function is constructed, which includes sentiment semantic loss and context association loss function; the improved graph neural network model is then trained using the dual-objective loss function.
[0092] Specifically, sentiment classifiers such as RoBERTa serve as teacher networks to provide sentiment knowledge, while improved graph neural network models act as student models, updating their own parameters by learning the sentiment discrimination capabilities of the teacher models.
[0093] By inputting the answers to open-ended questions in the questionnaire into a pre-trained and frozen sentiment classifier, the classifier outputs sentiment labels such as ambivalent sentiment and sentiment polarity values (-1 to 1). The questionnaire logic graph corresponding to the questionnaire is then input into an improved graph neural network model to obtain context-dependent question node features. These features are processed through fully connected layers and a Softmax activation function to obtain sentiment scores and sentiment probability distributions. In the sentiment scores, negative values represent negative emotions, positive values represent positive emotions, and the absolute value reflects the intensity of the emotion.
[0094] Specifically, the mean squared error loss function is used to constrain the sentiment score after the improved graph neural network mapping to be consistent with the polarity value of the sentiment classifier. The sentiment semantic loss function is:
[0095]
[0096]
[0097]
[0098] in, To improve the sentiment score after mapping in the graph neural network, The polarity value output by the sentiment classifier. The probability distribution of the improved graph neural network constrained by the KL divergence loss function is consistent with RoBERTa, where N is the number of samples; To obtain the sentiment probability distribution using an improved graph neural network model; This represents the probability distribution of sentiment output by the sentiment classifier.
[0099] The context association loss function is:
[0100]
[0101] Where E is the set of edges in the questionnaire logic graph. This represents the attention coefficient.
[0102] Total loss function:
[0103]
[0104] in, , , For the corresponding weights, Let the mean squared error loss function be used. Let KL divergence loss function be used. The graph represents the structural loss.
[0105] This embodiment addresses the weakness of graph neural networks in sentiment discrimination by employing knowledge distillation. This allows graph neural networks to retain their contextual modeling capabilities while learning the discrimination logic of professional sentiment classifiers, thereby improving the sentiment accuracy of graph neural networks.
[0106] In this embodiment, the improved graph neural network training process further includes: obtaining sentiment scores based on the answers to open-ended questions in the questionnaire 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 sentiment semantic loss and context association loss in the bi-objective loss function based on the reinforcement learning model.
[0107] In one specific implementation, the state vector includes sentiment score difference data and user feedback data; the actions are two weights in the loss function; the reward function includes user satisfaction and model consistency score, where user satisfaction directly uses the user's rating of the sentiment analysis results, and the model consistency score is calculated based on the difference in sentiment scores between the two models. If the reward value increases after a certain action, i.e., weight adjustment, is executed, it indicates that the weight allocation is better, and the reinforcement learning model will retain this adjustment strategy through learning; if the reward value decreases, the weight allocation logic is optimized in reverse.
[0108] In this embodiment, reinforcement learning incorporates the difference in sentiment scores and user feedback data into the state space. With user satisfaction and model consistency as reward objectives, it dynamically adjusts the weights of the two types of losses. Guided by user feedback, it drives the model's subsequent analysis to better reflect the user's true intentions.
[0109] Example 2
[0110] The purpose of this embodiment is to provide a sentiment analysis system based on a questionnaire, including:
[0111] The graph construction module is configured to: use the questions of the user survey questionnaire as nodes, model the logical relationship between questions as directed edges, and construct the questionnaire logic graph.
[0112] The extraction module is configured to: extract semantic vectors from the question text using a pre-trained language model, and generate node-level local features by combining the co-occurrence frequency of multiple-choice options;
[0113] 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, in 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 dynamic attention coefficient calculated based on the jump probability between questions are used to weight and aggregate neighbor features.
[0114] The analysis module is configured to calculate global sentiment based on the contextually related question node features, using the PageRank algorithm to obtain the final sentiment analysis results.
[0115] In further embodiments, the following is also provided:
[0116] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When executed by the processor, the computer instructions perform the method described in Embodiment 1. For brevity, further details are omitted here.
[0117] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0118] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0119] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in Embodiment 1.
[0120] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0121] Those skilled in the art will recognize that the units and algorithm steps described in conjunction with the embodiments herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented 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 this application.
[0122] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A sentiment analysis method based on questionnaires, characterized in that, include: Using the questions in the user survey questionnaire as nodes, the logical relationship between questions is modeled as directed edges to construct a questionnaire logic graph; The semantic vector of the question text is extracted using a pre-trained language model, and node-level local features are generated by combining 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 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 its neighboring nodes is calculated, and the attention coefficient is determined by combining the jump probability. The node-level local features of the neighboring nodes are weighted and aggregated according to the attention coefficient to obtain the neighbor feature aggregation result. The neighbor feature aggregation result is concatenated with the initial representation of the current node to obtain the updated context-related question node features of the current node; In the improved graph neural network model, during dynamic reasoning, the semantic similarity is calculated based on the semantic vector of the question text, and the dynamic attention coefficient is calculated based on the jump probability between questions, and the neighbor features are weighted and aggregated. Based on the contextually related question node features, the global sentiment is calculated using the PageRank algorithm to obtain the final sentiment analysis result. Specifically, the edge weights are determined by integrating the probability of logical jump rules in the questionnaire with the frequency of jump paths in the user's historical behavior, and a transition probability matrix is obtained based on the edge weights. Node importance weights are defined according to the question type, and the transition probability matrix is fused with the node importance weights to obtain a weighted transition probability matrix. Using the contextually related question node features as the initial sentiment score of the corresponding node, the initial sentiment score of the node is iteratively calculated using the PageRank algorithm based on the weighted transition probability matrix to simulate the user's sentiment transmission process in the questionnaire until the convergence condition is met, obtaining the global sentiment of each node. The final sentiment analysis result is obtained based on the global sentiment of each node.
2. The sentiment analysis method based on a questionnaire as described in claim 1, characterized in that, The semantic vector of the question text is extracted using a pre-trained language model, and node-level local features are generated by combining the co-occurrence frequency of multiple-choice options. Specifically: The co-occurrence frequency of multiple-choice questions is converted 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 vector corresponding to the co-occurrence frequency of the multiple-choice options; The weights of the semantic vector of the question text and the co-occurrence frequency vector of the multiple-choice options are dynamically adjusted based on the similarity, and node-level local features are generated based on the adjusted weights.
3. The sentiment analysis method based on a questionnaire as described in claim 1, characterized in that, The improved graph neural network model is trained as follows: To enable the improved graph neural network model to learn the sentiment discrimination ability of the sentiment classifier, and to retain 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 bi-objective loss function.
4. The sentiment analysis method based on a questionnaire as described in claim 3, characterized in that, The improved graph neural network training process also includes: obtaining sentiment scores based on the answers to open-ended questions in the questionnaire through the improved graph neural network and the sentiment classifier, respectively; inputting the differences in the obtained sentiment scores and user feedback data into the reinforcement learning model; and dynamically adjusting the corresponding weights of sentiment semantic loss and context association loss in the bi-objective loss function based on the reinforcement learning model.
5. The sentiment analysis method based on a questionnaire as described in claim 4, characterized in that, The reinforcement learning model adjusts the weights in the dual-objective loss function based on a state space, an action space, and a reward function; wherein, the state space includes differential data of sentiment scores and user feedback data; the action space consists of the weight coefficients of sentiment semantic loss and contextual association loss; and the reward function includes user satisfaction and model consistency scores.
6. The sentiment analysis method based on a questionnaire as described in claim 1, characterized in that, Before constructing the questionnaire logic diagram for the user survey questionnaire, the process also includes preprocessing the user survey questionnaire. The preprocessing includes: converting the structured multiple-choice data using one-hot encoding into numerical data; standardizing the numerical data using the z-score standardization method; and normalizing the standardized dataset using the deviation standardization method.
7. A sentiment analysis system based on a questionnaire, characterized in that, include: The graph construction module is configured to: use the questions of the user survey questionnaire as nodes, model the logical relationship between questions as directed edges, and construct the questionnaire logic graph. The extraction module is configured to: extract semantic vectors from the question text using a pre-trained language model, and generate node-level local features by combining the co-occurrence frequency of multiple-choice 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. 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 its neighboring nodes is calculated, and the attention coefficient is determined by combining the jump probability. The node-level local features of the neighboring 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 concatenated to obtain the updated context-related question node features of the current node; wherein, in 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 dynamic attention coefficient calculated based on the jump probability between questions are used to weight and aggregate the neighbor features. The analysis module is configured to: calculate global sentiment based on the context-related question node features using the PageRank algorithm to obtain the final sentiment analysis result; specifically: determine edge weights by integrating the probability of logical jump rules in the questionnaire with the frequency of jump paths in the user's historical behavior, and obtain a transition probability matrix based on the edge weights; define node importance weights according to question type, and fuse the transition probability matrix with the node importance weights to obtain a weighted transition probability matrix; use the context-related question node features as the initial sentiment score of the corresponding node, and use the PageRank algorithm to iteratively calculate the initial sentiment score of the node based on the weighted transition probability matrix, simulating the user's sentiment transmission process in the questionnaire, until the convergence condition is reached to obtain the global sentiment of each node, and obtain the final sentiment analysis result based on the global sentiment of each node.
8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the method according to any one of claims 1-6.
Citation Information
Patent Citations
Content recommendation method, device and system and storage medium
CN113806620A
Text sentiment analysis method and device, equipment, storage medium and program product
CN118211594A