Evaluation result recognition method, device, equipment and storage medium
By constructing a syntactic dependency tree and fusing positional weights with sentiment tags, and combining global and local self-attention mechanisms, the problem of insufficient accuracy in sentiment evaluation by multiple evaluators is solved, and high-accuracy sentiment recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TIANJIN UNIV
- Filing Date
- 2026-02-25
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, relying on a single, shallow analysis method is difficult to adapt to complex scenarios with multiple evaluators and intertwined viewpoints, resulting in insufficient accuracy in sentiment evaluation.
By analyzing the dependency relationships between multiple evaluators and descriptive texts, a syntactic dependency tree is constructed to determine the positional weights of words. Sentiment tags and syntactic matrices are integrated, and global and local self-attention mechanisms are used to generate evaluation results.
It achieves fine-grained and highly accurate sentiment evaluation for multiple evaluators, making full use of the syntactic and semantic features of text information to enhance the depth and dimensionality of sentiment recognition.
Smart Images

Figure CN121724013B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and more specifically to a method, apparatus, device, and storage medium for recognizing evaluation results. Background Technology
[0002] With the development of natural language processing technology, text sentiment assessment technology for multiple evaluators has become a core supporting technology in the field of text semantic analysis. Among related technologies, text sentiment assessment often adopts keyword matching or shallow syntactic analysis, matching opinion words through a pre-set sentiment dictionary and combining simple positional rules to achieve a basic sentiment judgment of the evaluators.
[0003] In the process of realizing the concept of this invention, it was found that the related technologies have at least the following problems: relying on a single shallow analysis method makes it difficult to adapt to complex scenarios with multiple evaluation subjects and multiple viewpoints intertwined, resulting in insufficient accuracy of sentiment evaluation. Summary of the Invention
[0004] In view of the above problems, the present invention provides a method, apparatus, device and storage medium for identifying evaluation results.
[0005] According to a first aspect of the present invention, an evaluation result recognition method is provided, comprising: analyzing the dependency relationships among multiple words in text information including multiple evaluation subjects and descriptive text associated with each of the evaluation subjects, and constructing a syntactic dependency tree, wherein the multiple words include words constituting each of the evaluation subjects; determining the positional weight of each word relative to each of the evaluation subjects based on the relative positional relationships between each word in the text information other than the words constituting each of the evaluation subjects and each of the evaluation subjects; for each of the evaluation subjects, fusing the weight matrix constructed based on the multiple positional weights corresponding to the evaluation subject with the sentiment tags of each of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject, wherein the sentiment tags are obtained by matching the opinion words with sample words in a sentiment database, and the sentiment database stores the mapping relationship between sample words and sentiment tags; fusing and transforming the syntactic matrix obtained by feature transformation of the syntactic dependency tree with the semantic matrix of each of the evaluation subjects, and outputting the evaluation result for each of the evaluation subjects.
[0006] According to an embodiment of the present invention, the method further includes: extracting features from the syntactic dependency tree to generate a syntactic dependency feature matrix and a query matrix, wherein the dimension of the syntactic dependency feature matrix is jointly determined by the number of multiple words in the text information and the dimension of a preset syntactic feature vector, and the dimension of the query matrix is related to the dimension of the preset syntactic feature vector; calculating the syntactic dependency feature matrix and the query matrix through a global self-attention mechanism to obtain a global weight matrix, wherein the global weight matrix is used to characterize the cross-text global syntactic dependency features between multiple words in the text information; calculating the syntactic dependency feature matrix and the query matrix through a local self-attention mechanism to obtain a local weight matrix, wherein the local weight matrix is used to characterize the local dependency features between word pairs with direct syntactic associations in the text information; and fusing the global weight matrix and the local weight matrix to generate the syntactic matrix.
[0007] According to an embodiment of the present invention, the above-described fusion of the global weight matrix and the local weight matrix to generate the syntactic matrix includes: normalizing the local weight matrix to obtain a normalized local weight matrix; using a syntactic mask matrix, performing element-wise multiplication masking on the global weight matrix and the normalized local weight matrix respectively to obtain a global target matrix and a local target matrix, wherein the syntactic mask matrix is generated based on the syntactic dependency tree and is used to mask the matrix elements corresponding to word pairs that do not have direct syntactic dependencies; and fusing the global target matrix and the local target matrix to generate the syntactic matrix.
[0008] According to an embodiment of the present invention, the determination of the positional weight of each word relative to each evaluation subject based on the relative positional relationship between each word (excluding the words constituting each evaluation subject) and each evaluation subject in the above-mentioned text information includes: generating a word position sequence based on the order of multiple words in the above-mentioned text information; determining a continuous word subset corresponding to each evaluation subject in the word position sequence for each evaluation subject, wherein the continuous word subset consists of one or more continuous words constituting the evaluation subject; and determining the positional weight of each word relative to the evaluation subject based on the relative positional relationship between the word's position in the word position sequence and the continuous word subset corresponding to the evaluation subject for each word in the above-mentioned text information (excluding the words constituting the evaluation subject).
[0009] According to an embodiment of the present invention, determining the position weight of each word relative to the evaluation subject based on the relative positional relationship between the word's position in the word position sequence and the continuous word subset corresponding to the evaluation subject includes: in response to the word's position in the word position sequence being before the position of the continuous word subset, calculating the position weight based on a first relative distance between the word's position and the starting position of the continuous word subset in the word position sequence; in response to the word's position in the word position sequence being within the position of the continuous word subset, determining the position weight as a preset maximum weight value; and in response to the word's position in the word position sequence being after the position of the continuous word subset, calculating the position weight based on a second relative distance between the word's position and the ending position of the continuous word subset in the word position sequence.
[0010] According to an embodiment of the present invention, the above-mentioned fusion of the weight matrix with the sentiment tags of each of the multiple opinion words identified from the above-mentioned descriptive text to obtain a semantic matrix corresponding to the above-mentioned evaluation subject includes: determining the association weight between each of the above-mentioned opinion words and the above-mentioned evaluation subject based on the tag value corresponding to the sentiment tag of each of the above-mentioned opinion words and the position weight corresponding to the above-mentioned opinion words in the above-mentioned weight matrix; and updating the weight matrix using the multiple of the above-mentioned association weights to generate the above-mentioned semantic matrix.
[0011] According to an embodiment of the present invention, the syntactic matrix obtained by feature transformation of the syntactic dependency tree is fused and transformed with the semantic matrix of each of the aforementioned evaluation subjects to output the evaluation result for each of the aforementioned evaluation subjects, including: for each of the aforementioned evaluation subjects, fusing the syntactic matrix and the semantic matrix corresponding to the aforementioned evaluation subject to obtain a target matrix; encoding the aforementioned text information through a pre-trained language model to generate a word vector sequence; using the aforementioned word vector sequence as the initial features of nodes in the graph neural network, and using the aforementioned target matrix as the adjacency relation matrix between nodes in the aforementioned graph neural network; inputting the aforementioned initial features and the aforementioned adjacency relation matrix into a multi-layer graph convolutional network to iteratively aggregate and update the node features through the aforementioned multi-layer graph convolutional network to obtain the feature representation of the aforementioned evaluation subject; inputting the feature representation of the aforementioned evaluation subject into a classification layer to output the evaluation result for the evaluation subject.
[0012] A second aspect of the present invention provides an evaluation result recognition device, comprising: a syntactic analysis module, configured to analyze the dependency relationships between multiple words in text information including multiple evaluation subjects and descriptive text associated with each of the evaluation subjects, and construct a syntactic dependency tree, wherein the multiple words include words constituting each of the evaluation subjects; a position determination module, configured to determine the position weight of each word relative to each of the evaluation subjects based on the relative positional relationships between each word (excluding words constituting each of the evaluation subjects) and each of the evaluation subjects in the text information; a semantic analysis module, configured to, for each of the evaluation subjects, fuse the weight matrix constructed based on the multiple position weights corresponding to the evaluation subject with the sentiment tags of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject, wherein the sentiment tags are obtained by matching the opinion words with sample words in a sentiment database, and the sentiment database stores the mapping relationship between sample words and sentiment tags; and a result determination module, configured to fuse and transform the syntactic matrix obtained by feature transformation of the syntactic dependency tree with the semantic matrix of each of the evaluation subjects, and output the evaluation result for each of the evaluation subjects.
[0013] A third aspect of the present invention provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0014] A fourth aspect of the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0015] A fifth aspect of the present invention also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0016] According to embodiments of the present invention, a syntactic dependency tree is constructed by analyzing the word dependency relationships of multiple evaluators and their related descriptive texts in the text information. This accurately captures the structural connections between words, laying the foundation for subsequent semantic analysis. Simultaneously, based on the relative positional relationship between each word and the evaluator, positional weights are determined, effectively quantifying the importance of words to the evaluators. For each evaluator, a weight matrix is constructed using the positional weights and fused with the sentiment tags of opinion words identified from the descriptive text to form a semantic matrix. This fusion process not only preserves the semantic information of the words but also assigns sentiment tendencies, making the evaluation results more in-depth and dimensional. The syntactic matrix obtained by feature transformation of the syntactic dependency tree is fused and transformed with the semantic matrix of each evaluator to output the evaluation results for each evaluator. This method not only fully utilizes the syntactic and semantic information of the text information but also achieves fine-grained and highly accurate sentiment evaluation recognition of multiple evaluators in the text information through the introduction of sentiment tags. Attached Figure Description
[0017] The above-mentioned contents, as well as other objects, features and advantages of the present invention, will become clearer from the following description of embodiments of the present invention with reference to the accompanying drawings.
[0018] Figure 1 The illustration shows an application scenario of the evaluation result identification method, apparatus, device, medium, and program product according to embodiments of the present invention.
[0019] Figure 2 A flowchart of an evaluation result identification method according to an embodiment of the present invention is shown.
[0020] Figure 3 A schematic diagram of the joint processing of global and local self-attention mechanisms in the evaluation result recognition method according to an embodiment of the present invention is shown.
[0021] Figure 4 A schematic diagram of the model processing of the evaluation result recognition method according to an embodiment of the present invention is shown.
[0022] Figure 5 A structural block diagram of an evaluation result recognition device according to an embodiment of the present invention is shown.
[0023] Figure 6 A block diagram of an electronic device suitable for implementing an evaluation result identification method according to an embodiment of the present invention is shown. Detailed Implementation
[0024] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0027] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0028] In the technical solution of this invention, the data involved (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of related data all comply with relevant laws, regulations and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse.
[0029] An embodiment of the present invention provides a method for identifying evaluation results, comprising: analyzing the dependency relationships among multiple words in text information including multiple evaluation subjects and descriptive text associated with each evaluation subject, and constructing a syntactic dependency tree, wherein the multiple words include words constituting each evaluation subject; determining the positional weight of each word relative to each evaluation subject based on the relative positional relationships between each word in the text information other than the words constituting each evaluation subject and each evaluation subject; for each evaluation subject, fusing a weight matrix constructed based on the multiple positional weights corresponding to the evaluation subject with the sentiment tags of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject, wherein the sentiment tags are obtained by matching opinion words with sample words in a sentiment database, and the sentiment database stores the mapping relationship between sample words and sentiment tags; fusing and transforming the syntactic matrix obtained by feature transformation of the syntactic dependency tree with the semantic matrix of each evaluation subject, and outputting the evaluation result for each evaluation subject.
[0030] Figure 1 The illustration shows an application scenario of the evaluation result identification method, apparatus, device, medium, and program product according to embodiments of the present invention.
[0031] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, and a server 105. Network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0032] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0034] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0035] It should be noted that the evaluation result identification method provided in the embodiments of the present invention can generally be executed by server 105. Correspondingly, the evaluation result identification device provided in the embodiments of the present invention can generally be located in server 105. The evaluation result identification method provided in the embodiments of the present invention can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the evaluation result identification device provided in the embodiments of the present invention can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0036] It should be understood that Figure 1 The number of first terminal devices, second terminal devices, third terminal devices, networks, and servers in the system is only a certain number. Depending on the implementation requirements, any number of first terminal devices, second terminal devices, third terminal devices, networks, and servers can be included.
[0037] The following will be based on Figure 1 The described scene, through Figures 2-4 The evaluation result identification method of the disclosed embodiments is described in detail.
[0038] Figure 2 A flowchart of an evaluation result identification method according to an embodiment of the present invention is shown.
[0039] like Figure 2 As shown, this embodiment includes operations S210 to S240.
[0040] In operation S210, the dependency relationships between multiple words in the text information, which includes multiple evaluation subjects and descriptive text associated with each evaluation subject, are analyzed, and a syntactic dependency tree is constructed, wherein the multiple words include the words that constitute each evaluation subject.
[0041] In operation S220, based on the relative positional relationship between each word in the text information (excluding the words constituting each evaluation subject) and each evaluation subject, the positional weight of each word relative to each evaluation subject is determined.
[0042] In operation S230, for each evaluation subject, a weight matrix is constructed based on the multiple position weights corresponding to the evaluation subject. The weight matrix is then fused with the sentiment tags of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject. The sentiment tags are obtained by matching opinion words with sample words in the sentiment database, which stores the mapping relationship between sample words and sentiment tags.
[0043] In operation S240, the syntactic matrix obtained by feature transformation of the syntactic dependency tree is fused and transformed with the semantic matrix of each evaluator, and the evaluation results for each evaluator are output.
[0044] According to embodiments of the present invention, text information is obtained, which includes multiple evaluation subjects and descriptive text associated with each evaluation subject. The text information can be natural language text such as user comments, social media text, or news clips; the evaluation subject refers to a specific text fragment for which sentiment polarity needs to be analyzed, and can consist of a single word (e.g., "plot") or multiple consecutive words (e.g., "customer service").
[0045] As an example, the text message could be "The plot is interesting but the graphics are bad," with "plot" and "graphics" as the evaluation subjects and the rest as descriptive content.
[0046] For textual information, a dependency parsing algorithm from the field of natural language processing is employed to systematically analyze the dependency relationships between all words in the text. Specifically, by parsing the syntactic association types between words, such as subject-verb, verb-object, attributive-head, adverbial-head, and complement, the interaction relationships between each word in the semantic structure of the text are clarified. This leads to the construction of a syntactic dependency tree covering all words in the text, which must fully encompass the words constituting each evaluator and the syntactic association paths between these words and other words.
[0047] Using the character sequence position or word arrangement position of the words constituting each evaluation subject in the text information as a reference point, each word in the text information, excluding the words constituting the evaluation subject, is analyzed one by one. The relative positional relationship between these words and each evaluation subject is determined. Combining a preset positional distance decay rule, differentiated positional weights are assigned to words in different relative positions. Specifically, words closer to the evaluation subject can correspond to higher positional weights, thus completing the determination of the positional weight of each word relative to its corresponding evaluation subject.
[0048] For each evaluator, the positional weights of all words corresponding to that evaluator are ordered and matrixed to form a weight matrix matching that evaluator. Simultaneously, opinion words are identified and extracted from the descriptive text, and these extracted opinion words are matched against sample words in a pre-defined sentiment database. When a sample word corresponding to an opinion word is matched, its corresponding sentiment tag is assigned to the successfully matched opinion word. The sentiment database pre-establishes and stores a one-to-one mapping relationship between a massive number of sample words and sentiment tags representing different sentiment tendencies such as positive, negative, and neutral.
[0049] Subsequently, the constructed weight matrix and the sentiment tags corresponding to each opinion word are numerically fused and calculated. Specifically, the position weights and the feature information of the sentiment tags can be integrated through weighted operations to finally obtain a semantic matrix that corresponds one-to-one with the evaluation subject.
[0050] Feature extraction and transformation are performed on the constructed syntactic dependency tree, converting the dependency relationship types, word hierarchy associations, syntactic path lengths, and other feature information contained in the tree structure into a syntactic matrix that can be numerically computed. Then, this syntactic matrix is dimensionally aligned and feature-fused with the semantic matrix corresponding to each evaluator. Deep fusion of the two matrices is achieved through matrix multiplication or feature concatenation. Subsequent transformations such as dimensionality reduction and normalization are then performed on the fused matrix, ultimately outputting evaluation results that accurately represent the sentiment tendencies or evaluation dimensions of each evaluator.
[0051] By analyzing the word dependency relationships among multiple evaluators and their related descriptive texts in the text, a syntactic dependency tree is constructed to accurately capture the structural connections between words, laying a solid foundation for subsequent semantic analysis. Based on this, positional weights are determined according to the relative positional relationship between each word and the evaluator, effectively quantifying the importance of words to the evaluator and making the evaluation results closer to the true semantics of the text. For each evaluator, a weight matrix is constructed using positional weights and fused with the sentiment tags of opinion words identified from the descriptive text to form a semantic matrix. This fusion process not only preserves the semantic information of the words but also assigns sentiment tendencies, making the evaluation results more in-depth and multi-dimensional. Finally, the syntactic matrix obtained by feature transformation of the syntactic dependency tree is fused and transformed with the semantic matrix of each evaluator to output the evaluation results for each evaluator. This method not only fully utilizes the syntactic and semantic information of the text but also achieves fine-grained and highly accurate sentiment tendency identification for multiple evaluators in the text through the introduction of sentiment tags.
[0052] According to an embodiment of the present invention, the evaluation result identification method further includes: extracting features from the syntactic dependency tree to generate a syntactic dependency feature matrix and a query matrix, wherein the dimension of the syntactic dependency feature matrix is jointly determined by the number of multiple words in the text information and the dimension of a preset syntactic feature vector, and the dimension of the query matrix is related to the dimension of the preset syntactic feature vector; calculating the syntactic dependency feature matrix and the query matrix through a global self-attention mechanism to obtain a global weight matrix, wherein the global weight matrix is used to characterize the cross-text global syntactic dependency features between multiple words in the text information; calculating the syntactic dependency feature matrix and the query matrix through a local self-attention mechanism to obtain a local weight matrix, wherein the local weight matrix is used to characterize the local dependency features between word pairs with direct syntactic associations in the text information; and fusing the global weight matrix and the local weight matrix to generate a syntactic matrix.
[0053] A comprehensive and systematic feature extraction process is performed on the constructed syntactic dependency tree to generate a syntactic dependency feature matrix and a query matrix. The dimension of the syntactic dependency feature matrix is determined by the total number of words in the text and the dimension of the preset syntactic feature vector; while the dimension of the query matrix is directly and closely related to the dimension of the preset syntactic feature vector.
[0054] In the implementation, the syntactic dependency feature matrix is a trainable parameter, initially initialized using a random normal distribution. This parameter is continuously optimized and adjusted during the model's backpropagation. The query matrix is defined through a linear layer, whose weights are also initialized using a certain distribution by default, and are progressively optimized and adjusted during the model's backpropagation training.
[0055] A global self-attention mechanism is employed, using a syntactic dependency feature matrix and a query matrix as input, and calculating a global weight matrix through attention operations. This mechanism overcomes the limitations of local syntactic associations during computation, capturing cross-textual associations between all words in the text. Through a series of computational steps, including attention weight allocation and normalization, the global weight matrix is finally obtained. This global weight matrix can completely and accurately represent the cross-textual global syntactic dependencies between multiple words in the text.
[0056] Simultaneously, a local self-attention mechanism is employed, using the syntactic dependency feature matrix and query matrix as input, and calculating the local weight matrix through a linear attention module. This mechanism focuses on word pairs with direct syntactic relationships in the syntactic dependency tree, ignoring distant words without direct syntactic connections, thus accurately capturing the syntactic interaction information between these directly related words. Through targeted attention weight calculation and feature extraction, a local weight matrix is generated. This local weight matrix is specifically used to characterize the local dependency features between word pairs with direct syntactic relationships in the text information.
[0057] After obtaining the global and local weight matrices, a pre-defined matrix fusion strategy is used to deeply integrate these two matrices. During the fusion process, the comprehensiveness of global syntactic dependency features and the accuracy of local syntactic dependency features are considered. Through numerical computation and feature complementation, the effective information from the two matrices is integrated and refined, ultimately generating a syntactic matrix that can fully represent the overall syntactic structure features of the text. By combining global and local self-attention mechanisms, a comprehensive capture of multi-level features of the text's syntactic structure is achieved, enhancing the representational ability of syntactic features.
[0058] According to an embodiment of the present invention, fusing the global weight matrix and the local weight matrix to generate a syntactic matrix includes: normalizing the local weight matrix to obtain a normalized local weight matrix; using a syntactic mask matrix, performing element-wise multiplication masking on the global weight matrix and the normalized local weight matrix respectively to obtain a global target matrix and a local target matrix, wherein the syntactic mask matrix is generated based on the syntactic dependency tree and is used to mask the matrix elements corresponding to word pairs that do not have direct syntactic dependencies; and fusing the global target matrix and the local target matrix to generate the syntactic matrix.
[0059] A normalization algorithm is used to normalize the local weight matrix. By eliminating the scale differences of feature values of different dimensions within the matrix, the stability and accuracy of subsequent matrix operations are improved, thus obtaining the normalized local weight matrix.
[0060] Subsequently, a corresponding syntactic mask matrix is generated based on the constructed syntactic dependency tree. In this syntactic mask matrix, values that are valid for computation can be assigned to the corresponding matrix positions of words with direct syntactic dependencies in the text information; and values of zero can be assigned to the corresponding matrix positions of words without direct syntactic dependencies, thereby clearly defining the range of matrix elements that need to be retained and masked.
[0061] The generated syntactic mask matrix is then multiplied element-wise with both the global weight matrix and the normalized local weight matrix for masking. During the computation, the zero-value elements of the syntactic mask matrix are used to mask the weight features corresponding to word pairs without direct syntactic dependencies, while retaining the effective weight features corresponding to word pairs with direct syntactic dependencies. This process yields the masked global target matrix and local target matrix, respectively.
[0062] Finally, a matrix fusion algorithm is used to deeply integrate the cross-text global syntactic dependency features represented in the global target matrix with the local syntactic dependency features represented by directly related words in the local target matrix. Through feature complementarity and numerical operation, a syntactic matrix with both global and local syntactic features is generated. By using a syntactic mask matrix to filter irrelevant dependencies, it is possible to ensure that the syntactic matrix accurately focuses on effective syntactic connections and reduces noise interference. The specific calculation formulas are shown in formulas (1) to (3).
[0063] (1)
[0064] (2)
[0065] = (3)
[0066] in, Represents the global weight matrix. This represents the normalized local weight matrix. Represents the syntax mask matrix, Represents the global objective matrix. Represents the local target matrix. Represents the syntax matrix.
[0067] Figure 3 A schematic diagram of the joint processing of global and local self-attention mechanisms in the evaluation result recognition method according to an embodiment of the present invention is shown.
[0068] like Figure 3 As shown, using the word units corresponding to the text information as input, feature operations are performed on the word units through global self-attention mechanism and local self-attention mechanism respectively, generating a global weight matrix that can represent the global association of words across text, and a local weight matrix that represents the local features of words with direct syntactic association.
[0069] Subsequently, these two weight matrices are fed into the syntax masking layer. After masking, the features corresponding to effective syntactic associations are filtered out, resulting in the global target matrix and the local target matrix. Finally, these two target matrices are input into the fusion syntax matrix layer, and a syntax matrix integrating global and local syntactic dependency features is generated through matrix fusion operations.
[0070] This implementation method can simultaneously capture global syntactic relationships and local syntactic features between words in a text. By using a grammatical mask layer to shield against interference from invalid relationships, the final generated syntactic matrix has both the integrity of the global structure and the accuracy of local relationships, providing more comprehensive and accurate syntactic feature support for subsequent tasks such as text semantic analysis and sentiment evaluation.
[0071] According to an embodiment of the present invention, based on the relative positional relationship between each word in the text information (excluding the words constituting each evaluation subject) and each evaluation subject, the positional weight of each word relative to each evaluation subject is determined. This includes generating a word position sequence based on the order of multiple words in the text information; for each evaluation subject, determining a continuous subset of words corresponding to the evaluation subject in the word position sequence, wherein the continuous subset of words consists of one or more continuous words constituting the evaluation subject; and for each word in the text information (excluding the words constituting the evaluation subject), determining the positional weight of each word relative to the evaluation subject based on the relative positional relationship between the word's position in the word position sequence and the continuous subset of words corresponding to the evaluation subject.
[0072] The text information is segmented into words, and each word is assigned a unique position index based on its natural order within the original text, thus generating an ordered sequence of word positions. This sequence of word positions fully preserves the spatial distribution information of each word within the text.
[0073] For each evaluation subject, firstly, all words constituting the evaluation subject are identified from the word segmentation results. Then, the position indices corresponding to these constituent words are located in the generated word position sequence. If the constituent words exhibit a continuous arrangement in the sequence, the position indices corresponding to these continuous constituent words and their associated words are combined to form a continuous word subset uniquely corresponding to the evaluation subject. If a constituent word is a single word, the position index and associated words corresponding to that single word are considered as a continuous word subset.
[0074] For example, word position sequence The word position sequence contains n words. This represents the word at the i-th position in the word position sequence. The subset of consecutive words corresponding to the evaluator is... .
[0075] For each word in the text information other than the words constituting the current evaluation subject, first determine the position index corresponding to the word in the word position sequence, and then calculate the relative positional relationship between the position index of the word and the position index range of the continuous word subset corresponding to the current evaluation subject. Specifically, the relative distance can be represented by calculating the difference between the nearest boundary position index of the word and the continuous word subset, while a position weight decay rule is preset, that is, the smaller the relative distance, the greater the corresponding position weight, and vice versa.
[0076] Finally, based on the calculated relative positional relationships and positional weight decay rules, the relative positional information is mapped to specific weight values, thus determining the positional weight of each word relative to the evaluation subject. Repeating the above process for each evaluation subject yields the positional weights of all non-evaluation subject-constituting words relative to each evaluation subject. Calculating positional weights based on the relative positional relationships between words and evaluation subjects enhances the model's ability to perceive the distance and relevance between the evaluation target and contextual words.
[0077] According to an embodiment of the present invention, determining the position weight of each word relative to the evaluation subject based on the relative positional relationship between the word's position in the word position sequence and the continuous word subset corresponding to the evaluation subject includes: in response to the word's position in the word position sequence being before the position of the continuous word subset, calculating the position weight based on a first relative distance between the word's position and the starting position of the continuous word subset in the word position sequence; in response to the word's position in the word position sequence being within the position of the continuous word subset, determining the position weight as a preset maximum weight value; and in response to the word's position in the word position sequence being after the position of the continuous word subset, calculating the position weight based on a second relative distance between the word's position and the ending position of the continuous word subset in the word position sequence.
[0078] The starting and ending position indices of the consecutive word subset within the word position sequence are clearly defined and used as the benchmark for relative position determination. When the position index of the target word in the word position sequence is less than the starting position index of the consecutive word subset, it is determined that the word precedes the consecutive word subset. In this case, the difference between the word's position index and the starting position index of the consecutive word subset is calculated. This difference is used as the first relative distance and substituted into the distance weight decay function to calculate the corresponding position weight. This distance weight decay function follows the rule of "the smaller the distance, the greater the weight," ensuring that words closer to the beginning of the consecutive word subset receive a higher weight allocation.
[0079] When the position index of a target word is detected to be between the start and end position indices (including boundary values) of a continuous word subset, the word is determined to be within the continuous word subset, and the preset highest weight value is directly assigned to the word. This highest weight value is a pre-set fixed value used to highlight the importance of the core words constituting the evaluation subject.
[0080] When the position index of the target word is detected to be greater than the end position index of the continuous word subset, it is determined that the word is located after the continuous word subset. The difference between the position index of the target word and the end position index of the continuous word subset is calculated as the second relative distance. Similarly, it is substituted into the distance weight decay function mentioned above to calculate the position weight, ensuring that words closer to the end of the continuous word subset receive higher weights, thus realizing differentiated weight allocation based on relative position. The specific calculation method is shown in formulas (4) to (6).
[0081] when hour, (4)
[0082] when hour, (5)
[0083] when hour, (6)
[0084] in, and Both represent the position index of the word. This represents the positional weight, where n represents the total number of words, and m represents the window length.
[0085] After obtaining the position weights, a position weight matrix is constructed based on these weights. For example, the weight matrix is... ,in, , By setting distance attenuation rules and finely adjusting the influence of words in different positions, the role of nearby words can be highlighted while suppressing distant noise.
[0086] According to an embodiment of the present invention, the weight matrix is fused with the sentiment tags of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject. This includes: determining the association weight between each opinion word and the evaluation subject based on the tag value corresponding to the sentiment tag of each opinion word and the position weight corresponding to the opinion word in the weight matrix; and updating the weight matrix using multiple association weights to generate the semantic matrix.
[0087] The sentiment tags corresponding to each opinion term are numerically processed. Based on a preset mapping rule between sentiment tags and tag values, sentiment tags representing different sentiment tendencies such as positive, negative, and neutral are converted into corresponding tag values. For example, a positive tag is mapped to 1, a negative tag to -1, and a neutral tag to 0.
[0088] Subsequently, within the constructed weight matrix, the positional weight associated with each opinion word's location in the text information is determined, and this positional weight is then fused with the corresponding opinion word's tag value. A weighted product is used to obtain the association weight between each opinion word and the current evaluator. For example, if the opinion word's tag value is... The association weight is This association weight includes both information on the positional importance of opinion terms relative to the evaluator and information on the sentiment of opinion terms.
[0089] After calculating the association weights of all opinion words, the initially constructed weight matrix is updated using these association weights as the core. Specifically, the position weights corresponding to each opinion word in the weight matrix are replaced with the calculated association weights, while the weights of positions in the text that do not correspond to opinion words remain unchanged.
[0090] After the above update, the weight matrix, which originally only contained positional weight information, was transformed into a semantic matrix that combines positional importance with sentiment characteristics. This semantic matrix corresponds one-to-one with the current evaluator. By integrating external knowledge from the sentiment database with positional weights, a quantitative weighting of the semantic sentiment of opinion words is achieved, enhancing the sentiment discrimination capability of the semantic matrix.
[0091] According to an embodiment of the present invention, the syntactic matrix obtained by feature transformation of the syntactic dependency tree is fused and transformed with the semantic matrix of each evaluation subject to output the evaluation result for each evaluation subject. This includes: for each evaluation subject, fusing the syntactic matrix and the semantic matrix corresponding to the evaluation subject to obtain a target matrix; encoding text information using a pre-trained language model to generate a word vector sequence; using the word vector sequence as the initial features of nodes in a graph neural network, and using the target matrix as the adjacency relation matrix between nodes in the graph neural network; inputting the initial features and the adjacency relation matrix into a multi-layer graph convolutional network to iteratively aggregate and update the node features through the multi-layer graph convolutional network to obtain the feature representation of the evaluation subject; and inputting the feature representation of the evaluation subject into a classification layer to output the evaluation result for that evaluation subject.
[0092] For each evaluation subject, the syntactic matrix and the corresponding semantic matrix are first aligned in terms of dimensions to ensure consistency in feature dimensions and word count. Then, a matrix fusion strategy is used to fuse the two. Specifically, the syntactic structure features of the syntactic matrix and the position and sentiment fusion features of the semantic matrix can be concatenated horizontally or vertically through feature splicing; or the features of the two matrices can be weighted and integrated through weighted summation to finally obtain a target matrix that combines syntactic association information and sentiment position information. The specific calculation method is shown in formula (7).
[0093] A= + (7)
[0094] Where A represents the target matrix, Represents a semantic matrix.
[0095] Next, a suitable pre-trained language model is selected, and the original text information is preprocessed according to the model input format (including adding special tags, word segmentation, truncation or completion to a fixed length, etc.) and then input into the model. The model's encoder performs deep semantic encoding on the text to generate a high-dimensional word vector corresponding to each word. The word vectors of all words are combined according to the order of words in the text to form a word vector sequence.
[0096] The generated word vector sequence is directly used as the initial feature of the nodes in the graph neural network, where each node of the graph neural network corresponds one-to-one with each word in the text. At the same time, the previously obtained target matrix is used as the adjacency relation matrix between nodes in the graph neural network. The element values in the matrix are used to represent the association strength between two corresponding nodes (i.e., two words), thereby constructing graph structure data that fits the semantic and syntactic structure of the text.
[0097] The initial features of the nodes and the adjacency matrix are input into a pre-trained multi-layer graph convolutional network. Each layer of the network aggregates the features of each node's neighboring nodes based on the adjacency matrix and performs a non-linear transformation in combination with its own features to update the node features. In this example, the graph convolutional network adopts a 2-layer structure, and the feature update method of each layer is shown in Equation (8).
[0098] (8)
[0099] in, and This represents the learnable weights and biases of the l-th layer, and MEAS represents the summation aggregation function. This represents the feature transformation matrix from node q to node p in the l-th layer. This represents the activation function. This represents the feature representation of node p at layer (l+1). This represents the feature representation of node q at layer l. Through two layers of graph convolution operations, multi-hop dependencies between words can be captured, generating feature representations rich in structural and semantic information.
[0100] After multiple iterations and aggregations, node features corresponding to the current evaluation subject are selected and integrated into a comprehensive feature representation of the evaluation subject. This feature representation fully integrates multi-dimensional information such as the syntax, semantics, sentiment, and word association of the text.
[0101] Finally, the feature representation of the evaluator is input into a pre-defined classification layer. The classification layer performs dimensionality transformation on the feature representation through a fully connected layer, and then calculates the probability distribution of the evaluator belonging to different evaluation categories (such as positive, negative, and neutral) through an activation function. The category with the highest probability is selected as the final evaluation result and output. If it is necessary to quantify the degree of evaluation, a specific evaluation score can also be calculated based on the probability distribution. The graph neural network effectively integrates syntactic structure and semantic sentiment information, and realizes parallel feature modeling and accurate classification of multiple evaluators.
[0102] Specifically, the classification layer converts the feature representation into a probability distribution, and the loss function adopts cross-entropy loss, as shown in formulas (9) and (10).
[0103] (9)
[0104] (10)
[0105] in, and The learnable parameters of the classification layer, A semantic representation vector representing the input text. This represents the probability distribution predicted by the model. Let represent the probability of the t-th class in the true label of the s-th sample. Let represent the probability of the t-th class in the predicted probability distribution of the s-th sample. Represents the L2 regularization coefficient. This represents all learnable parameters of the model. The evaluation result is represented by C, where C represents the total number of categories and N represents the number of samples.
[0106] In another embodiment of the present invention, the specific parameter settings for model training are as follows: the optimizer uses the Adaptive Moment Estimation (Adam) algorithm, with a learning rate of 0.001; the batch size is 32; the number of training epochs is 20; the dropout rate is 0.3; and the L2 regularization coefficient is... The value is 0.0001; the hidden layer dimension of the graph convolutional network is 768.
[0107] Figure 4 A schematic diagram of the model processing of the evaluation result recognition method according to an embodiment of the present invention is shown.
[0108] like Figure 4 As shown, taking text information and the corresponding evaluation subject as input, the text information is first parsed syntactically to generate a syntactic dependency tree representing the syntactic relationships between words. Then, this syntactic dependency tree is input into a self-attention mechanism to extract a matrix representing word association features. Simultaneously, this matrix is combined with a matrix representing sentiment label information obtained from a sentiment database. The two matrices are then integrated through feature aggregation to form the target matrix. Meanwhile, the text information is fed into the embedding layer to generate initial word vectors for each word. These initial word vectors and the target matrix are then input into a two-layer graph convolutional network, and node features are updated through iterative aggregation of nodes and associated features. Finally, for the node features corresponding to the evaluation subject, core features are extracted through pooling and input into the classification module, outputting positive, negative, and neutral evaluation results.
[0109] This implementation method integrates multi-dimensional features such as text syntactic structure, sentiment, and word association, and strengthens the correlation between features by leveraging the iterative aggregation capability of graph convolutional networks. Simultaneously, by focusing feature processing on the evaluator, it ensures both the richness of feature information and improves the relevance and accuracy of the evaluation results, effectively distinguishing the sentiment tendencies of different evaluators.
[0110] Based on the above-described evaluation result identification method, this invention also provides an evaluation result identification device. The following will be combined with... Figure 5 The device is described in detail.
[0111] Figure 5 A structural block diagram of an evaluation result recognition device according to an embodiment of the present invention is shown.
[0112] like Figure 5 As shown, the evaluation result recognition device 500 of this embodiment includes a syntactic analysis module 510, a position determination module 520, a semantic analysis module 530, and a result determination module 540.
[0113] The syntactic analysis module 510 is used to analyze the dependency relationships between multiple words in text information, which includes multiple evaluation subjects and descriptive text associated with each evaluation subject, and to construct a syntactic dependency tree, wherein the multiple words include words constituting each evaluation subject. In one embodiment, the syntactic analysis module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0114] The position determination module 520 is used to determine the position weight of each word relative to each evaluation subject based on the relative positional relationship between each word in the text information (excluding the words constituting each evaluation subject) and each evaluation subject. In one embodiment, the position determination module 520 can be used to perform the operation S220 described above, which will not be repeated here.
[0115] The semantic analysis module 530 is used to construct a weight matrix based on multiple positional weights corresponding to each evaluation subject, and then fuse the weight matrix with the sentiment tags of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject. The sentiment tags are obtained by matching opinion words with sample words in a sentiment database, which stores the mapping relationship between sample words and sentiment tags. In one embodiment, the semantic analysis module 530 can be used to perform the operation S230 described above, which will not be repeated here.
[0116] The result determination module 540 is used to fuse and transform the syntactic matrix obtained by feature transformation of the syntactic dependency tree with the semantic matrix of each evaluator, and output the evaluation result for each evaluator. In one embodiment, the result determination module 540 can be used to perform the operation S240 described above, which will not be repeated here.
[0117] According to an embodiment of the present invention, the evaluation result recognition device 500 further includes a feature extraction module, a global extraction module, a local extraction module, and a feature fusion module.
[0118] The feature extraction module is used to extract features from the syntactic dependency tree to generate a syntactic dependency feature matrix and a query matrix. The dimension of the syntactic dependency feature matrix is determined by the number of multiple words in the text information and the dimension of the preset syntactic feature vector. The dimension of the query matrix is related to the dimension of the preset syntactic feature vector.
[0119] The global extraction module is used to calculate the syntactic dependency feature matrix and the query matrix through a global self-attention mechanism to obtain the global weight matrix. The global weight matrix is used to represent the cross-text global syntactic dependency features between multiple words in the text information.
[0120] The local extraction module is used to calculate the syntactic dependency feature matrix and the query matrix through a local self-attention mechanism to obtain the local weight matrix. The local weight matrix is used to represent the local dependency features between word pairs with direct syntactic association in the text information.
[0121] The feature fusion module is used to fuse the global weight matrix and the local weight matrix to generate the syntax matrix.
[0122] According to an embodiment of the present invention, the feature fusion module includes a normalization submodule, a masking submodule, and a fusion submodule.
[0123] The normalization submodule is used to normalize the local weight matrix to obtain the normalized local weight matrix.
[0124] The masking submodule is used to perform element-wise multiplication masking on the global weight matrix and the normalized local weight matrix using the syntactic masking matrix to obtain the global target matrix and the local target matrix. The syntactic masking matrix is generated based on the syntactic dependency tree and is used to mask the matrix elements corresponding to word pairs that do not have direct syntactic dependencies.
[0125] The fusion submodule is used to fuse the global target matrix and the local target matrix to generate the syntax matrix.
[0126] According to an embodiment of the present invention, the position determination module 520 includes a word sequence generation submodule, a subset generation submodule, and a weight determination submodule.
[0127] The word sequence generation submodule is used to generate a word position sequence based on the order of multiple words in the text information.
[0128] The subset generation submodule is used to determine, for each evaluation subject, a continuous subset of words corresponding to the evaluation subject in the word position sequence. The continuous subset of words consists of one or more continuous words that constitute the evaluation subject.
[0129] The weight determination submodule is used to determine the position weight of each word relative to the evaluation subject based on the relative positional relationship between the word's position in the word position sequence and the continuous word subset corresponding to the evaluation subject, for each word in the text information other than the words constituting the evaluation subject.
[0130] According to an embodiment of the present invention, the weight determination submodule includes a first determination unit, a second determination unit, and a third determination unit.
[0131] The first determining unit is used to calculate the position weight based on a first relative distance between the position of the word and the starting position of the continuous word subset in the word position sequence, in response to the word's position being located before the position of the continuous word subset in the word position sequence.
[0132] The second determining unit is used to determine the position weight as the preset highest weight value in response to the fact that the position of a word in the word position sequence is within the position of a continuous subset of words.
[0133] The third determining unit is used to calculate the position weight based on the second relative distance between the position of the word and the end position of the continuous word subset in the word position sequence, in response to the word's position being located after the position of the continuous word subset in the word position sequence.
[0134] According to an embodiment of the present invention, the semantic analysis module 530 includes an association determination submodule and a matrix update submodule.
[0135] The association determination submodule is used to determine the association weight between each opinion word and the evaluation subject based on the tag value corresponding to the sentiment tag of each opinion word and the position weight corresponding to the opinion word in the weight matrix.
[0136] The matrix update submodule is used to update the weight matrix using multiple associated weights to generate a semantic matrix.
[0137] According to an embodiment of the present invention, the result determination module 540 includes a matrix fusion submodule, a text encoding submodule, a graph neural network determination submodule, an aggregation update submodule, and a feature classification submodule.
[0138] The matrix fusion submodule is used to fuse the syntactic matrix and the semantic matrix corresponding to each evaluation subject to obtain the target matrix.
[0139] The text encoding submodule is used to encode text information using a pre-trained language model to generate word vector sequences.
[0140] The graph neural network determination submodule is used to use word vector sequences as initial features of nodes in the graph neural network and the target matrix as the adjacency relation matrix between nodes in the graph neural network.
[0141] The aggregation and update submodule is used to input the initial features and adjacency matrix into a multi-layer graph convolutional network, so as to iteratively aggregate and update the node features through the multi-layer graph convolutional network to obtain the feature representation of the evaluation subject.
[0142] The feature classification submodule is used to input the feature representation of the evaluation subject into the classification layer and output the evaluation result for that evaluation subject.
[0143] According to embodiments of the present invention, any plurality of modules among the syntactic analysis module 510, position determination module 520, semantic analysis module 530, and result determination module 540 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the syntactic analysis module 510, position determination module 520, semantic analysis module 530, and result determination module 540 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods or a suitable combination of any of them. Alternatively, at least one of the syntactic analysis module 510, the position determination module 520, the semantic analysis module 530, and the result determination module 540 may be implemented at least partially as a computer program module that can perform corresponding functions when the computer program module is run.
[0144] Figure 6 A block diagram of an electronic device suitable for implementing an evaluation result identification method according to an embodiment of the present invention is shown.
[0145] like Figure 6 As shown, an electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory ROM 602 or a program loaded from a storage portion 608 into a random access memory RAM 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0146] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 602 and / or RAM 603. It should be noted that programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in one or more memories.
[0147] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output (I / O) interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0148] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.
[0149] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0150] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the evaluation result identification method provided in the embodiments of the present invention.
[0151] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0152] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0153] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0154] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0155] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0156] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.
[0157] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.
Claims
1. A method for identifying evaluation results, characterized in that, The method includes: The dependency relationships between multiple words in text information, including multiple evaluation subjects and descriptive text associated with each of the evaluation subjects, are analyzed, and a syntactic dependency tree is constructed, wherein the multiple words include words that constitute each of the evaluation subjects; Based on the relative positional relationship between each word in the text information (excluding the words constituting each of the evaluation subjects) and each of the evaluation subjects, the positional weight of each word relative to each of the evaluation subjects is determined respectively; For each of the evaluation subjects, a weight matrix is constructed based on multiple position weights corresponding to the evaluation subject. The weight matrix is then fused with the sentiment tags of multiple opinion words identified from the description text to obtain a semantic matrix corresponding to the evaluation subject. The sentiment tags are obtained by matching the opinion words with sample words in a sentiment database, which stores the mapping relationship between sample words and sentiment tags. The syntactic matrix obtained by feature transformation of the syntactic dependency tree is fused and transformed with the semantic matrix of each of the evaluation subjects to output the evaluation results for each of the evaluation subjects.
2. The method according to claim 1, characterized in that, The method further includes: Feature extraction is performed on the syntactic dependency tree to generate a syntactic dependency feature matrix and a query matrix. The dimension of the syntactic dependency feature matrix is determined by the number of multiple words in the text information and the dimension of the preset syntactic feature vector. The dimension of the query matrix is related to the dimension of the preset syntactic feature vector. A global weight matrix is obtained by calculating the syntactic dependency feature matrix and the query matrix through a global self-attention mechanism. The global weight matrix is used to characterize the cross-text global syntactic dependency features between multiple words in the text information. The syntactic dependency feature matrix and the query matrix are calculated using a local self-attention mechanism to obtain a local weight matrix, wherein the local weight matrix is used to characterize the local dependency features between word pairs with direct syntactic association in the text information; The global weight matrix and the local weight matrix are fused to generate the syntax matrix.
3. The method according to claim 2, characterized in that, The process of fusing the global weight matrix and the local weight matrix to generate the syntax matrix includes: The local weight matrix is normalized to obtain the normalized local weight matrix; Using a syntactic mask matrix, the global weight matrix and the normalized local weight matrix are subjected to element-wise multiplication masking to obtain a global target matrix and a local target matrix. The syntactic mask matrix is generated based on the syntactic dependency tree and is used to mask the matrix elements corresponding to word pairs that do not have direct syntactic dependencies. The global target matrix and the local target matrix are fused to generate the syntax matrix.
4. The method according to claim 1, characterized in that, The determination of the positional weight of each word relative to each evaluation subject, based on the relative positional relationship between each word and each evaluation subject in the text information (excluding the words constituting each evaluation subject), includes: Based on the order of multiple words in the text information, a word position sequence is generated; For each of the aforementioned evaluation subjects, a subset of consecutive words corresponding to the evaluation subject is determined in the word position sequence, wherein the subset of consecutive words consists of one or more consecutive words constituting the evaluation subject; For each word in the text information other than the words constituting the evaluation subject, the position weight of each word relative to the evaluation subject is determined based on the relative positional relationship between the word's position in the word position sequence and the continuous word subset corresponding to the evaluation subject.
5. The method according to claim 4, characterized in that, The step of determining the positional weight of each word relative to the evaluation subject based on the relative positional relationship between the word's position in the word position sequence and the continuous word subset corresponding to the evaluation subject includes: In response to the fact that the position of the word in the word position sequence is before the position of the continuous word subset, the position weight is calculated based on a first relative distance between the position of the word and the starting position of the continuous word subset in the word position sequence; In response to the fact that the position of the word in the word position sequence is within the position of the continuous word subset, the position weight is determined to be a preset maximum weight value; In response to the word's position in the word position sequence being after the position of the consecutive word subset, the position weight is calculated based on the second relative distance between the word's position and the end position of the consecutive word subset in the word position sequence.
6. The method according to claim 1, characterized in that, The step of fusing the weight matrix with the sentiment tags of multiple opinion words identified from the descriptive text to obtain a semantic matrix corresponding to the evaluation subject includes: Based on the tag values corresponding to the sentiment tags of each opinion word, and the position weights corresponding to the opinion words in the weight matrix, the association weights between each opinion word and the evaluation subject are determined. The weight matrix is updated using multiple of the associated weights to generate the semantic matrix.
7. The method according to claim 1, characterized in that, The step of fusing and transforming the syntactic matrix obtained by feature transformation of the syntactic dependency tree with the semantic matrix of each of the evaluation subjects, and outputting the evaluation results for each of the evaluation subjects, includes: For each of the aforementioned evaluation subjects, the syntactic matrix and the semantic matrix corresponding to the evaluation subject are fused to obtain the target matrix; The text information is encoded using a pre-trained language model to generate a sequence of word vectors; The word vector sequence is used as the initial feature of the nodes in the graph neural network, and the target matrix is used as the adjacency matrix between the nodes in the graph neural network. The initial features and the adjacency matrix are input into a multi-layer graph convolutional network to iteratively aggregate and update the node features through the multi-layer graph convolutional network, thereby obtaining the feature representation of the evaluation subject. The feature representation of the evaluation subject is input into the classification layer, and the evaluation result for the evaluation subject is output.
8. An evaluation result recognition device, characterized in that, The device includes: The syntactic analysis module is used to analyze the dependency relationships between multiple words in text information, which includes multiple evaluation subjects and descriptive text associated with each of the evaluation subjects, and to construct a syntactic dependency tree, wherein the multiple words include words that constitute each of the evaluation subjects; The position determination module is used to determine the position weight of each word relative to each evaluation subject based on the relative positional relationship between each word in the text information (excluding the words constituting each evaluation subject) and each evaluation subject; The semantic analysis module is used to construct a weight matrix based on multiple position weights corresponding to each of the evaluation subjects, and to fuse the weight matrix with the sentiment tags of multiple opinion words identified from the description text to obtain a semantic matrix corresponding to the evaluation subject. The sentiment tags are obtained by matching the opinion words with sample words in the sentiment database, and the sentiment database stores the mapping relationship between sample words and sentiment tags. The result determination module is used to fuse and transform the syntactic matrix obtained by feature transformation of the syntactic dependency tree with the semantic matrix of each of the evaluation subjects, and output the evaluation result for each of the evaluation subjects.
9. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.