Fuzzy hypergraph generation method, device, computer equipment and storage medium

Through the fuzzy hypergraph generation method, the problem of uncertain emotional polarity in different contexts is solved. The generation of fuzzy hypergraphs improves the accuracy of emotional relationship extraction and achieves a rapid and comprehensive understanding of the emotional relationship in the text.

CN118228079BActive Publication Date: 2024-11-26XIANGJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410642415.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-11-26
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

The existing emotional relationship extraction technology has low accuracy in emotional relationship extraction due to the uncertain emotional polarity of emotional words in different contexts.

Method used

The fuzzy hypergraph generation method is adopted to determine the dependency tree and dependency matrix of the target sentence, obtain the fuzzy set and cluster center, generate the association matrix, and finally generate the fuzzy hypergraph based on the fuzzy set, dependency tree and dependency matrix to improve the emotional relationship extraction accuracy.

Benefits of technology

It achieves a rapid and comprehensive understanding of emotional relationships in the text, improves the accuracy of emotional relationship extraction, and can better handle the multiple emotional polarities of emotional words in different contexts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118228079B_ABST
    Figure CN118228079B_ABST
Patent Text Reader

Abstract

The present invention discloses a fuzzy hypergraph generation method, device, computer equipment and storage medium, the method comprising: determining a dependency tree of a target sentence of data to be analyzed based on the target sentence; determining a dependency matrix of the dependency tree, the dependency matrix being used to characterize the dependency relationship between different tree nodes; obtaining at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set; based on the cluster center, clustering the tree nodes of the dependency tree to generate an association matrix of the dependency tree; generating a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree, and using the present invention to quickly and comprehensively understand the sentiment relationship in the text and improve the accuracy of sentiment relationship extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a fuzzy hypergraph generation method, device, computer equipment and storage medium. Background Art

[0002] Text sentiment analysis technology includes the subtask of sentiment relationship extraction, which is used to identify the sentiment relationship between different entities, aspects or events from the text, and provide more detailed information support for more advanced sentiment classification tasks. Existing sentiment relationship extraction generally extracts sentiment relationships through an attention-based neural network model to obtain the contextual sentiment semantic features of the text, or reduces the computational complexity through a dependency tree to obtain the contextual sentiment semantic features of the text. However, since an emotional word has different sentiment polarities in different contexts, and even in the same context, it may have implicit meanings of multiple sentiment polarities, the result of sentiment relationship extraction is not accurate. Summary of the invention

[0003] The embodiments of the present invention provide a fuzzy hypergraph generation method, apparatus, computer equipment and storage medium to quickly and comprehensively understand the sentiment relationship in a text and improve the accuracy of sentiment relationship extraction.

[0004] In order to solve the above technical problems, the embodiment of the present application provides a fuzzy hypergraph generation method, comprising:

[0005] Based on a target sentence of the data to be analyzed, determining a dependency tree of the target sentence, wherein the dependency tree includes at least one tree node, and the tree node is used to represent a word vector of the target sentence;

[0006] Determine a dependency matrix of the dependency tree, wherein the dependency matrix is ​​used to characterize dependency relationships between different tree nodes;

[0007] Acquire at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set;

[0008] Based on the cluster centers, clustering is performed on the tree nodes of the dependency tree to generate an association matrix of the dependency tree;

[0009] A fuzzy hypergraph is generated based on the fuzzy set, the dependency tree, the incidence matrix of the dependency tree, and the dependency matrix of the dependency tree.

[0010] In order to solve the above technical problems, the embodiment of the present application further provides a fuzzy hypergraph generation device, comprising:

[0011] A dependency tree determination module, configured to determine a dependency tree of a target sentence based on the target sentence of the data to be analyzed, wherein the dependency tree includes at least one tree node, and the tree node is used to represent a word vector of the target sentence;

[0012] A dependency matrix determination module, used to determine the dependency matrix of the dependency tree, wherein the dependency matrix is ​​used to characterize the dependency relationship between different tree nodes;

[0013] A fuzzy set determination module, used to obtain at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set;

[0014] A clustering module, used for clustering the tree nodes of the dependency tree based on the cluster centers to generate an association matrix of the dependency tree;

[0015] A fuzzy hypergraph generation module is used to generate a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree.

[0016] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above fuzzy hypergraph generation method when executing the computer program.

[0017] In order to solve the above technical problems, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above fuzzy hypergraph generation method are implemented.

[0018] The fuzzy hypergraph generation method, device, computer equipment and storage medium provided by the embodiment of the present invention, by determining the dependency tree of the target sentence based on the target sentence of the data to be analyzed, wherein the dependency tree includes at least one tree node, and the tree node is used to represent the word vector of the target sentence; determining the dependency matrix of the dependency tree, and the dependency matrix is ​​used to represent the dependency relationship between different tree nodes; obtaining at least one fuzzy set for the data to be analyzed and the cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to represent the data contained in the data to be analyzed under the aspect category, and the cluster center is used to represent the cluster center under the aspect category corresponding to the fuzzy set; based on the cluster center, clustering the tree nodes of the dependency tree to generate the association matrix of the dependency tree; based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree, a fuzzy hypergraph is generated. The present invention is used to quickly and comprehensively understand the emotional relationship in the text and improve the accuracy of emotional relationship extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0020] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0021] Figure 2 is a flowchart of an embodiment of a fuzzy hypergraph generation method of the present application;

[0022] Figure 3 is a structural schematic diagram of an embodiment of a fuzzy hypergraph generating device according to the present application;

[0023] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0025] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] See also Figure 1 ,like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0028] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc.

[0029] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Eperts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Eperts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptop computers and desktop computers, etc.

[0030] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0031] It should be noted that the fuzzy hypergraph generation method provided in the embodiment of the present application is executed by a server, and accordingly, the fuzzy hypergraph generation device is arranged in the server.

[0032] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. The terminal devices 101, 102, 103 in the embodiment of the present application may specifically correspond to application systems in actual production.

[0033] See also Figure 2 , Figure 2 A fuzzy hypergraph generation method provided by an embodiment of the present invention is shown, and the method is applied in Figure 1 The server in is used as an example to illustrate the details as follows:

[0034] S201. Determine a dependency tree of a target sentence of the data to be analyzed, wherein the dependency tree includes at least one tree node, and the tree node is used to represent a word vector of the target sentence.

[0035] The data to be analyzed refers to text data with emotional relationships. The data to be analyzed can be articles or user comments. For example, the data to be analyzed is [Comment 1: "The beef in this restaurant is delicious and the service attitude is also very good.", Comment 2: "Their fish dishes are fresh, but the waiting time is too long.", Comment 3: "There are many vegetarian choices, but the environment and sanitation need to be improved."]. The specific content of the data to be analyzed can be adjusted according to the actual situation, and the embodiments of this application are not limited.

[0036] A sentiment word in the data to be analyzed may involve multiple aspect categories at the same time, and the same aspect category is usually associated with multiple sentiment words. A sentiment word has different sentiment polarities in different contexts, and even in the same context it may have implicit meanings of multiple sentiment polarities, that is, the sentiment polarity of the text is not only affected by a single sentiment word, but also related to the context and comment field, that is, there is a many-to-many fuzzy relationship in the data to be analyzed. Due to the many-to-many fuzzy relationship, the difficulty of sentiment relationship extraction task increases. Therefore, this application adopts the fuzzy hypergraph generated by the data to be analyzed to improve the accuracy of sentiment relationship extraction of many-to-many fuzzy relationships. Among them, the target sentence can be each sentence in the data to be analyzed, and the target sentence can also be a sentence under the target type in the data to be analyzed. For example, the target sentence is a sentence under the comment type of the data (article) to be analyzed. That is, the target sentence is the comment data in the data to be analyzed, and the comment data is divided into sentences. The specific selection of the target sentence can be adjusted according to the actual situation, and the embodiment of the present application is not limited.

[0037] Among them, based on the target sentence of the data to be analyzed, the process of determining the dependency tree of the target sentence can be: for each target sentence in the data to be analyzed, the word vector of the target sentence is extracted to obtain the word vector of the target sentence, and the dependency tree is constructed based on the word vector.

[0038] It should be noted that the number of tree nodes of the dependency tree does not exceed the number of words in the target sentence. For example, the target sentence includes 5 words, and word vectors are extracted for the 5 words in turn to obtain the word vector corresponding to each word. Based on the 5 word vectors, a dependency tree is constructed, and the dependency tree includes 5 tree nodes. For another example, the target sentence includes 6 words, and word vectors are extracted for the 6 words in turn to obtain the word vector corresponding to each word. Among them, there are two words with the same word vectors. Based on the 5 word vectors, a dependency tree is constructed, and the dependency tree includes 5 tree nodes.

[0039] The process of determining the dependency tree of the target sentence based on the data to be analyzed may also include: generating a dependency tree corresponding to the target sentence of the data to be analyzed based on a syntactic dependency parser.

[0040] By determining the dependency tree of the target sentence, the computational complexity can be reduced to increase the speed of extracting sentiment relations and improve the efficiency of generating fuzzy hypergraphs.

[0041] S202: Determine a dependency matrix of the dependency tree, where the dependency matrix is ​​used to represent dependency relationships between different tree nodes.

[0042] Among them, the dependency matrix can represent the dependency relationship between different tree nodes on the same dependency tree, and the dependency matrix can also be used to represent the dependency relationship between tree nodes on different dependency trees. The specific details can be adjusted according to actual conditions and are not limited in the embodiments of the present application.

[0043] The process of determining the dependency matrix of the dependency tree may be: determining dependency relationships between different tree nodes in the dependency tree; and determining the dependency matrix of the dependency tree based on the dependency relationships.

[0044] The process of determining the dependency matrix of the dependency tree may also be: determining dependency relationships between different tree nodes in the dependency tree based on a syntactic dependency parser; and determining the dependency matrix of the dependency tree based on the dependency relationships.

[0045] It should be noted that the dependency matrix for determining the dependency tree may be adjusted according to actual conditions, and the embodiment of the present application does not impose any limitation thereto.

[0046] Furthermore, based on the dependency tree corresponding to each target sentence and the dependency matrix of the dependency tree, a dependency tree set is constructed.

[0047] For example, is the set of dependency trees of all comment sentences (target sentences). Among them, Indicates The dependency tree of a sentence.

[0048] Indicates The first The word vector representation of the tree node (i.e. In the sentence word vector representation of words), is the dimension of the word vector.

[0049] Indicates The dependency matrix of a dependency tree has a size of OK Column, where Representation Node and The word vector representation of the dependency type between them, is the dimension of the word vector of the dependency type. If the node and There is no dependency relationship, then .

[0050] S203. Obtain at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set.

[0051] Among them, the fuzzy set is used to represent the aspect categories contained in the data to be analyzed. The cluster center is used to represent the cluster center under the aspect category of the corresponding fuzzy set. The cluster centers corresponding to the fuzzy set constitute the cluster center set.

[0052] The following example explains fuzzy sets. Assume that the comment domain U represents all tree nodes on the dependency tree. If there is an A, , then A represents There are fuzzy sets, each fuzzy set represents an aspect category. That is, A1 represents the first fuzzy set, A2 represents the second fuzzy set, and Am represents the mth fuzzy set.

[0053] Assume that Represents the set of aspect categories contained in the target sentence of the data to be analyzed. That is, a1 is the aspect category corresponding to A1, and a2 is the aspect category corresponding to A2. A and a are in a one-to-one correspondence, and Am is a set concept, which is used to indicate which words are in the fuzzy set of this aspect category and belong to this aspect category. For example, a1 is "dishes" and a2 is "service". Fuzzy set A1 includes words in the dish aspect category such as "beef", "fish" and "vegetarian dishes", and fuzzy set A2 includes words in the service aspect category such as "service attitude", "environmental hygiene" and "waiting time".

[0054] Assume that The cluster center aggregation corresponding to the set of aspect categories contained in the target sentence of the data to be analyzed, Represents the cluster center of the mth aspect category.

[0055] S204: Based on the cluster centers, cluster the tree nodes of the dependency tree to generate an association matrix of the dependency tree.

[0056] Among them, based on the cluster center, the tree nodes of the dependency tree are clustered to generate the association matrix of the dependency tree, including: based on the distance between the word vector of each tree node on the dependency tree and the cluster center, the tree nodes are clustered to obtain clustering results; based on the clustering results, the association matrix of the dependency tree is generated.

[0057] The clustering process can be mean clustering or weighted average clustering, which can be adjusted according to actual conditions. The present application preferably adopts the mean clustering algorithm.

[0058] By using the traditional fuzzy C-means clustering algorithm based on cluster center 𝐶 at the word scale, the tree nodes are initially clustered according to the word vector by minimizing the distance between the tree node and the cluster center of the aspect category where the corresponding fuzzy set is located, and an association matrix is ​​generated.

[0059] S205. Generate a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree.

[0060] Wherein, generating a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree includes:

[0061] Based on the association matrix and cluster centers of the dependency tree, determining the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set;

[0062] Based on the fuzzy mutual information and the fuzzy conditional entropy, updating the association matrix of the dependency tree to obtain an updated association matrix;

[0063] Determining a hyperedge based on the updated association matrix;

[0064] A fuzzy hypergraph is generated based on the dependency tree, the dependency matrix of the dependency tree, and the hyperedges.

[0065] Wherein, determining the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set includes: determining the target fuzzy mutual information between different fuzzy sets, and determining the target fuzzy conditional entropy between different fuzzy sets; obtaining a fuzzy mutual information matrix based on the target fuzzy mutual information, and obtaining a fuzzy conditional entropy matrix based on the target fuzzy conditional entropy; obtaining the fuzzy mutual information of the dependency tree under the corresponding fuzzy set based on the fuzzy mutual information matrix; and obtaining the fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set based on the fuzzy conditional entropy matrix.

[0066] Among them, fuzzy mutual information is an important indicator used to measure the correlation between fuzzy sets.

[0067] Specifically, determining the target fuzzy mutual information between different fuzzy sets includes: determining the target fuzzy mutual information between different fuzzy sets based on the joint membership.

[0068] The fuzzy mutual information between two fuzzy sets is calculated using the joint membership function instead of directly calculating the fuzzy mutual information of all fuzzy sets as a whole. This is because the membership of a tree node to a certain fuzzy set may be 0. If the fuzzy mutual information of all fuzzy sets is calculated directly, the joint membership of some tree nodes on all fuzzy sets will be 0, which will limit the calculation result of the fuzzy mutual information to even 0. The calculation of the joint membership function is represented by the minimum value of the membership of the corresponding position of the fuzzy set. By calculating the joint membership function between two fuzzy sets, the influence of the membership of 0 on the calculation of fuzzy mutual information can be better controlled, and the correlation between fuzzy sets can be more accurately evaluated.

[0069] According to the following formula (1), the target fuzzy mutual information between different fuzzy sets is determined:

[0070] (1)

[0071] in, Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. represents the Hadamard product, Represents element-wise division of vectors. It means calculating the joint membership of fuzzy sets, that is, taking the minimum value of each element in the same position between two vectors. Representing fuzzy sets and fuzzy sets The target fuzzy mutual information between , log represents the function.

[0072] According to the following formula (2), the fuzzy mutual information matrix is ​​obtained based on the target fuzzy mutual information between two fuzzy sets:

[0073]

[0074] Among them, M (R) is the fuzzy mutual information matrix, Representing fuzzy sets and fuzzy sets The target fuzzy mutual information between , the fuzzy mutual information matrix is ​​a symmetric matrix. Because the fuzzy mutual information has symmetry, that is .

[0075] It should be noted that the fuzzy mutual information of a fuzzy set itself is its fuzzy information entropy , a lower fuzzy information entropy indicates that the membership function distribution of the fuzzy set tends to be concentrated, while a higher entropy indicates that the distribution is more dispersed or uncertain. Maximizing the fuzzy information entropy will cause the fuzzy clustering algorithm to be unable to accurately assign nodes to classes. By setting the diagonal elements of the fuzzy mutual information matrix to 0, the interference of the fuzzy information entropy is reduced.

[0076] The fuzzy conditional entropy is the amount of information in a fuzzy set given another fuzzy set. To measure the difference between two fuzzy sets representing aspect categories, the larger its value, the Relative to The degree of difference is greater.

[0077] According to the following formula (3), the target fuzzy conditional entropy between different fuzzy sets is determined:

[0078]

[0079] in, Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. Represents element-wise division of vectors. It means calculating the joint membership of fuzzy sets, that is, taking the minimum value of each element in the same position between two vectors. Fuzzy Set and fuzzy sets The target fuzzy conditional entropy between , log represents the function.

[0080] According to the following formula (4), the fuzzy conditional entropy matrix is ​​obtained based on the target fuzzy conditional entropy between fuzzy sets:

[0081]

[0082] Among them, CH (R) is the fuzzy conditional entropy matrix, Fuzzy Set and fuzzy sets The target fuzzy conditional entropy between .

[0083] It should be noted that: Different from the standard conditional entropy, the conditional entropy of the fuzzy set itself It is usually not equal to 0. And affected by the fuzziness of the fuzzy set itself, strong fuzziness within the fuzzy set does not necessarily mean poor fuzzy clustering effect. By setting the diagonal elements of the fuzzy conditional entropy matrix to 0, the interference with the fuzzy hyperedge division in the process of maximizing the fuzzy conditional entropy is reduced.

[0084] It should be noted that the association matrix provides the degree of membership between nodes and hyperedges, which helps to identify the association between word vectors and the aspects they describe. In addition, some specific dependency types are more likely to express sentiment than other dependency types of tree edges. For example, adjective modification relationships or verb expression relationships are usually more able to present sentiment evaluations or opinions on specific aspects.

[0085] Therefore, in the process of generating a fuzzy hypergraph based on the dependency tree, the dependency matrix of the dependency tree, and the hyperedge, the dependency relationship and type P between the dependency tree nodes need to be retained in the hypergraph. The dependency matrix Pi of each dependency tree is calculated by the following formula (6):

[0086]

[0087] in, and Respectively represent matrices The row and column indices in , express Middle Line Elements of a column. The dependency matrix of each syntactic dependency tree It is obtained by splicing along the diagonal direction, and its rows and columns are ,in Indicates the statistics The number of nodes in the dependency tree.

[0088] The fuzzy hypergraph generation method further includes: calculating a loss value when generating the fuzzy hypergraph; adjusting the association matrix according to the loss value until the loss value satisfies the hypergraph generation condition, thereby obtaining the fuzzy hypergraph.

[0089] Specifically, the loss value is calculated according to the following formula (6):

[0090]

[0091] Among them, R is the correlation matrix, C is the cluster center, is the Lagrange multiplier, Lagrange multiplier of the j-th column vector. is the loss value calculated by the augmented Lagrangian function, Represents the incidence matrix No. The membership and incidence matrix of column vectors No. The membership degree of column vectors. J is the objective function, , is the fuzzy index, m is the number of fuzzy sets, k is the total number of tree nodes in all dependency trees, Is a tree node right The membership degree of the tree node Opponent category The strength of membership, is the fuzzy mutual information matrix, is the fuzzy conditional entropy matrix, is the i-th cluster center.

[0092] Objective Function The constraint condition is the normalization condition of the membership, which means that the sum of the membership of each node to all fuzzy sets is 1, which can ensure that each node completely belongs to a certain hyperedge or partially belongs to other hyperedges. The objective function with constraints cannot be directly gradient-descended. The constraints are introduced into the objective function by using the augmented Lagrangian method. The association matrix R, cluster center C and Lagrangian multiplier λ are updated respectively by gradient descent until convergence.

[0093] At the aspect category scale, the correlation between aspects is captured by maximizing the fuzzy mutual information between fuzzy sets, and maximizing the fuzzy conditional entropy can ensure the difference of fuzzy sets, which will help to better explore and understand the mutual influence between fuzzy sets of different representation aspects. In this embodiment, the sentiment hypergraph generation method based on dual-scale fuzzy clustering obtains the syntactic dependency structure through the syntactic dependency parser, calculates the fuzzy similarity and the fuzzy information entropy between aspect categories according to the word vector, and performs fuzzy clustering at the word and aspect category scales in turn. A pair of adversarial loss objective functions are newly introduced at the aspect category scale, including the fuzzy mutual information / conditional entropy upper bound loss, and hyperedges representing aspect-level sentiment categories are generated according to the potential semantic features of words. At the word scale, syntactic dependencies are modeled to represent the syntactic features between words in the form of ordinary edges, and the aspect categories are quickly divided in a human-like reasoning manner through intervention based on specific dependencies. Flexible fuzzy hypergraphs get rid of the limitation that general graphs can only describe deterministic relationships that are either this or that. It can achieve a faster and more comprehensive understanding of the sentiment relations in the text, and provide more accurate data analysis support for tasks such as aspect-level sentiment analysis, thereby achieving a faster and more comprehensive understanding of the sentiment relations in the text and improving the accuracy of sentiment relation extraction.

[0094] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0095] Figure 3 FIG. 1 is a block diagram showing a fuzzy hypergraph generation device corresponding to the fuzzy hypergraph generation method in the above embodiment. Figure 3 As shown, the fuzzy hypergraph generation device includes a dependency tree determination module 31, a dependency matrix determination module 32, a fuzzy set determination module 33, a clustering module 34 and a fuzzy hypergraph generation module 35. The functional modules are described in detail as follows:

[0096] A dependency tree determination module 31 is used to determine a dependency tree of a target sentence based on the target sentence of the data to be analyzed, wherein the dependency tree includes at least one tree node, and the tree node is used to represent a word vector of the target sentence;

[0097] A dependency matrix determination module 32, used to determine a dependency matrix of the dependency tree, wherein the dependency matrix is ​​used to characterize dependency relationships between different tree nodes;

[0098] A fuzzy set determination module 33, used to obtain at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set;

[0099] A clustering module 34, configured to perform clustering processing on the tree nodes of the dependency tree based on the cluster centers to generate an association matrix of the dependency tree;

[0100] The fuzzy hypergraph generation module 35 is used to generate a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree.

[0101] Optionally, in the apparatus provided in an embodiment of the present application, in the fuzzy hypergraph generation module 35, generating a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree includes:

[0102] A fuzzy information determination unit, configured to determine the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set based on the association matrix and cluster centers of the dependency tree;

[0103] An updating unit, configured to update the association matrix of the dependency tree based on the fuzzy mutual information and the fuzzy conditional entropy to obtain an updated association matrix;

[0104] A hyperedge determining unit, configured to determine a hyperedge based on the updated association matrix;

[0105] A fuzzy hypergraph generation unit is used to generate a fuzzy hypergraph based on the dependency tree, the dependency matrix of the dependency tree, and the hyperedge.

[0106] Optionally, in the apparatus provided by an embodiment of the present application, in the fuzzy information determining unit, the determining of the fuzzy mutual information and the fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set includes:

[0107] A first determining unit is used to determine target fuzzy mutual information between different fuzzy sets and determine target fuzzy conditional entropy between different fuzzy sets;

[0108] A matrix determination unit, configured to obtain a fuzzy mutual information matrix based on the target fuzzy mutual information, and to obtain a fuzzy conditional entropy matrix based on the target fuzzy conditional entropy;

[0109] A fuzzy mutual information determination unit, configured to obtain the fuzzy mutual information of the dependency tree under the corresponding fuzzy set based on the fuzzy mutual information matrix;

[0110] The fuzzy condition entropy determination unit is used to obtain the fuzzy condition entropy of the dependency tree under the corresponding fuzzy set based on the fuzzy condition entropy matrix.

[0111] Optionally, in the apparatus provided in an embodiment of the present application, in the first determining unit, determining the target fuzzy mutual information between different fuzzy sets includes:

[0112] Based on the joint membership, the target fuzzy mutual information between different fuzzy sets is determined;

[0113] According to the following formula, the target fuzzy mutual information between different fuzzy sets is determined:

[0114]

[0115] in, Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. represents the Hadamard product, Represents element-wise division of vectors. It means calculating the joint membership of fuzzy sets, that is, taking the minimum value of each element in the same position between two vectors. Representing fuzzy sets and fuzzy sets The target fuzzy mutual information between , log represents the function.

[0116] Optionally, in the device provided by an embodiment of the present application, in the first determining unit, determining the target fuzzy conditional entropy between different fuzzy sets includes:

[0117] According to the following formula, the target fuzzy conditional entropy between different fuzzy sets is determined:

[0118]

[0119] in, Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The degree of membership. Represents element-wise division of vectors. It means calculating the joint membership of fuzzy sets, that is, taking the minimum value of each element in the same position between two vectors. Fuzzy Set and fuzzy sets The target fuzzy conditional entropy between , log represents the function.

[0120] Optionally, the device provided in the embodiment of the present application further includes:

[0121] A loss calculation unit, used to calculate the loss value when generating a fuzzy hypergraph;

[0122] An adjustment unit, configured to adjust the association matrix according to the loss value until the loss value satisfies a hypergraph generation condition to obtain a fuzzy hypergraph;

[0123] The loss value is calculated according to the following formula:

[0124]

[0125] Among them, R is the correlation matrix, C is the cluster center, is the Lagrange multiplier, Lagrange multiplier of the j-th column vector. is the loss value calculated by the augmented Lagrangian function, Represents the incidence matrix No. The membership and incidence matrix of column vectors No. The membership degree of column vectors. J is the objective function, , is the fuzzy index, m is the number of fuzzy sets, k is the total number of tree nodes in all dependency trees, Is a tree node right The membership degree of the tree node Opponent category The strength of membership, is the fuzzy mutual information matrix, is the fuzzy conditional entropy matrix, is the i-th cluster center.

[0126] Optionally, in the device provided in the embodiment of the present application, the clustering module 34 includes:

[0127] A clustering unit, configured to cluster the tree nodes on the dependency tree based on the distance between the word vector of each tree node and the cluster center to obtain a clustering result;

[0128] The association matrix generating unit is used to generate the association matrix of the dependency tree based on the clustering result.

[0129] For the specific definition of the fuzzy hypergraph generation device, please refer to the definition of the fuzzy hypergraph generation method above, which will not be repeated here. Each module in the above-mentioned fuzzy hypergraph generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0130] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0131] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0132] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0133] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D interface display memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code for controlling electronic files, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0134] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the program code stored in the memory 41 or process data, such as running the program code for controlling the electronic file.

[0135] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0136] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an interface display program, and the interface display program can be executed by at least one processor to enable the at least one processor to perform the steps of the fuzzy hypergraph generation method as described above.

[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0138] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A fuzzy hypergraph generation method, characterized in that: The fuzzy hypergraph generation method comprises: Based on a target sentence of the data to be analyzed, determining a dependency tree of the target sentence, wherein the dependency tree includes at least one tree node, and the tree node is used to represent a word vector of the target sentence; Determine a dependency matrix of the dependency tree, wherein the dependency matrix is ​​used to characterize dependency relationships between different tree nodes; Acquire at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set; Based on the cluster centers, clustering is performed on the tree nodes of the dependency tree to generate an association matrix of the dependency tree; generating a fuzzy hypergraph based on the fuzzy set, the dependency tree, the incidence matrix of the dependency tree, and the dependency matrix of the dependency tree; The step of generating a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree comprises: Based on the association matrix and cluster centers of the dependency tree, determining the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set; Based on the fuzzy mutual information and the fuzzy conditional entropy, updating the association matrix of the dependency tree to obtain an updated association matrix; Determining a hyperedge based on the updated association matrix; Generate a fuzzy hypergraph based on the dependency tree, the dependency matrix of the dependency tree, and the hyperedge; Wherein, determining the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set includes: Determine the target fuzzy mutual information between different fuzzy sets, and determine the target fuzzy conditional entropy between different fuzzy sets; Obtaining a fuzzy mutual information matrix based on the target fuzzy mutual information, and obtaining a fuzzy conditional entropy matrix based on the target fuzzy conditional entropy; Based on the fuzzy mutual information matrix, obtaining the fuzzy mutual information of the dependency tree under the corresponding fuzzy set; Based on the fuzzy conditional entropy matrix, obtaining the fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set; Among them, when generating the fuzzy hypergraph, the loss value is calculated; The association matrix is ​​adjusted according to the loss value until the loss value satisfies a hypergraph generation condition to obtain a fuzzy hypergraph; The loss value is calculated according to the following formula: Among them, R is the correlation matrix, C is the cluster center, is the Lagrange multiplier, is the Lagrange multiplier corresponding to the jth column vector, is the loss value calculated by the augmented Lagrangian function, J is the objective function, , is the fuzzy index, m is the number of fuzzy sets, K is the total number of tree nodes in all dependency trees, Is a tree node right The membership degree of is the fuzzy mutual information matrix, is the fuzzy conditional entropy matrix, is the i-th cluster center.

2. The fuzzy hypergraph generation method according to claim 1, characterized in that: The determining of target fuzzy mutual information between different fuzzy sets includes: Based on the joint membership, the target fuzzy mutual information between different fuzzy sets is determined; According to the following formula, the target fuzzy mutual information between different fuzzy sets is determined: in, Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The membership degree of Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The membership degree of represents the Hadamard product, represents element-by-element division between vectors, It means calculating the joint membership of fuzzy sets, that is, taking the minimum value of each element in the same position between two vectors. Representing fuzzy sets and fuzzy sets The target fuzzy mutual information between , log represents the function.

3. The fuzzy hypergraph generation method according to claim 1, characterized in that: The step of determining target fuzzy conditional entropy between different fuzzy sets includes: According to the following formula, the target fuzzy conditional entropy between different fuzzy sets is determined: in, Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The membership degree of Represents the incidence matrix No. Column vectors, i.e., all tree node pairs represent aspect categories Fuzzy set The membership degree of represents element-by-element division between vectors, It means calculating the joint membership of fuzzy sets, that is, taking the minimum value of each element in the same position between two vectors. Fuzzy Set and fuzzy sets The target fuzzy conditional entropy between , log represents the function.

4. The fuzzy hypergraph generation method according to any one of claims 1 to 3, characterized in that: The step of clustering the tree nodes of the dependency tree based on the cluster centers to generate an association matrix of the dependency tree includes: Based on the distance between the word vector of each tree node on the dependency tree and the cluster center, clustering the tree nodes to obtain a clustering result; Based on the clustering result, an association matrix of the dependency tree is generated.

5. A fuzzy hypergraph generation device, characterized in that: The fuzzy hypergraph generating device comprises: A dependency tree determination module, configured to determine a dependency tree of a target sentence based on the target sentence of the data to be analyzed, wherein the dependency tree includes at least one tree node, and the tree node is used to represent a word vector of the target sentence; A dependency matrix determination module, used to determine the dependency matrix of the dependency tree, wherein the dependency matrix is ​​used to characterize the dependency relationship between different tree nodes; A fuzzy set determination module, used to obtain at least one fuzzy set for the data to be analyzed and a cluster center corresponding to the fuzzy set, wherein the fuzzy set corresponds to an aspect category, the fuzzy set is used to characterize the data contained in the data to be analyzed under the aspect category, and the cluster center is used to characterize the cluster center under the aspect category corresponding to the fuzzy set; A clustering module, used for clustering the tree nodes of the dependency tree based on the cluster centers to generate an association matrix of the dependency tree; A fuzzy hypergraph generation module, configured to generate a fuzzy hypergraph based on the fuzzy set, the dependency tree, the association matrix of the dependency tree, and the dependency matrix of the dependency tree; Wherein, the fuzzy hypergraph generation module includes: Based on the association matrix and cluster centers of the dependency tree, determining the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set; Based on the fuzzy mutual information and the fuzzy conditional entropy, updating the association matrix of the dependency tree to obtain an updated association matrix; Determining a hyperedge based on the updated association matrix; Generate a fuzzy hypergraph based on the dependency tree, the dependency matrix of the dependency tree, and the hyperedge; Wherein, determining the fuzzy mutual information and fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set includes: Determine the target fuzzy mutual information between different fuzzy sets, and determine the target fuzzy conditional entropy between different fuzzy sets; Obtaining a fuzzy mutual information matrix based on the target fuzzy mutual information, and obtaining a fuzzy conditional entropy matrix based on the target fuzzy conditional entropy; Based on the fuzzy mutual information matrix, obtaining the fuzzy mutual information of the dependency tree under the corresponding fuzzy set; Based on the fuzzy conditional entropy matrix, obtaining the fuzzy conditional entropy of the dependency tree under the corresponding fuzzy set; Among them, when generating the fuzzy hypergraph, the loss value is calculated; The association matrix is ​​adjusted according to the loss value until the loss value satisfies a hypergraph generation condition to obtain a fuzzy hypergraph; The loss value is calculated according to the following formula: Among them, R is the correlation matrix, C is the cluster center, is the Lagrange multiplier, is the Lagrange multiplier corresponding to the jth column vector, is the loss value calculated by the augmented Lagrangian function, J is the objective function, , is the fuzzy index, m is the number of fuzzy sets, K is the total number of tree nodes in all dependency trees, Is a tree node right The membership degree of is the fuzzy mutual information matrix, is the fuzzy conditional entropy matrix, is the i-th cluster center.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the fuzzy hypergraph generation method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the fuzzy hypergraph generation method according to any one of claims 1 to 4 is implemented.