A method, device and electronic device for constructing event knowledge graph
By building an event knowledge graph, integrating event map and open source knowledge graph, and obtaining and reducing dimensionality feature vectors, the problem of sparse relationships between entities in the event map is solved, the richness and comprehensiveness of knowledge representation is improved, and the computing overhead is reduced.
Patent Information
- Application Number
- CN202411434591.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-10-15
AI Technical Summary
Due to the preference for information expression and the performance of knowledge extraction methods, the existing event maps have relatively sparse relationships between entities, which affect the richness of entity description and algorithm improvement.
By building an event graph based on the source text dataset and fusing it with the open source knowledge graph, obtaining the feature vectors of nodes and directed edges, performing knowledge representation and dimensionality reduction processing, forming an event knowledge graph, fusing entity relationship triple information, and reducing calculations Overhead.
The deep integration of event maps and knowledge maps is achieved, which makes up for the limitations of data coverage, promotes the richness and comprehensiveness of knowledge representation, and reduces the computing overhead of subsequent algorithms.
Smart Images

Figure CN118940826B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and in particular to a method, device and electronic device for constructing an event knowledge graph. Background Art
[0002] An event graph is an event-centric graph that describes event-related information and various relationships between events. The event graph includes two types of nodes: events and entities, and three types of directed edges: event-event, event-entity, and entity-entity. Among them, the event-entity relationship represents the argument of the event, and the edge represents the role played by the corresponding argument (entity) in the connected event. Compared with the knowledge graph, the event graph has a deeper, richer, and more accurate semantic representation capability, but the richness of the expression of information often has preferences, and is limited by the performance issues of the knowledge extraction method itself or some other reasons. The relationship between entities is often incomplete. Therefore, most of the current event graphs have sparse relationships between nodes, which affects the richness of the entity description and restricts the further improvement of the algorithm. Summary of the invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to a first aspect of the present invention, a method for constructing an event knowledge graph is provided, the method comprising the following steps:
[0005] S100, build an event graph based on the source text dataset.
[0006] S200, based on the common entities between the event graph and the open source knowledge graph, the event graph and the open source knowledge graph are merged to obtain an event knowledge graph that merges the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edges represent the relationship between the head entity and the tail entity.
[0007] S300, obtaining feature vectors of nodes and directed edges in the event knowledge graph to obtain an event knowledge graph with knowledge representation.
[0008] Among them, S300 specifically includes:
[0009] S310, respectively obtaining the initial feature vector of the head entity, the relationship feature vector, the tail entity feature vector in the event knowledge graph, and obtaining the feature vector corresponding to the relationship-tail entity in the event knowledge graph;
[0010] S320, based on the feature vectors corresponding to all the relationship-tail entities corresponding to any head entity, obtain the relationship-tail entity feature vector corresponding to the head entity, and update the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain an updated feature vector as the head entity feature vector of the head entity;
[0011] S330, perform dimensionality reduction processing on the head entity feature vector, relationship feature vector, and tail entity feature vector corresponding to the event knowledge graph to obtain the reduced-dimensional feature vectors as the feature vectors of the nodes and directed edges in the event knowledge graph, thereby obtaining the event knowledge graph with knowledge representation.
[0012] According to a second aspect of the present invention, a device for constructing an event knowledge graph is provided, the device comprising:
[0013] The event graph construction module is used to build an event graph based on the source text dataset.
[0014] A graph fusion module is used to fuse the event graph and the open source knowledge graph based on the common entities between the event graph and the open source knowledge graph to obtain an event knowledge graph that fuses the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edges represent the relationship between the head entity and the tail entity.
[0015] The event knowledge graph construction module is used to obtain the feature vectors of the nodes and directed edges in the event knowledge graph to obtain the event knowledge graph with knowledge representation.
[0016] The event knowledge graph construction module is specifically used for:
[0017] Obtain the initial feature vector of the head entity, the relationship feature vector, the tail entity feature vector in the event knowledge graph, and obtain the feature vector corresponding to the relationship-tail entity in the event knowledge graph;
[0018] Based on the feature vectors corresponding to all the relationship-tail entities corresponding to any head entity, the relationship-tail entity feature vector corresponding to the head entity is obtained, and the initial feature vector of the head entity is updated based on the relationship-tail entity feature vector corresponding to the head entity to obtain the updated feature vector as the head entity feature vector of the head entity;
[0019] The head entity feature vector, relationship feature vector, and tail entity feature vector corresponding to the event knowledge graph are subjected to dimensionality reduction processing to obtain the reduced-dimensional feature vectors, which are used as the feature vectors of the nodes and directed edges in the event knowledge graph, thereby obtaining an event knowledge graph with knowledge representation.
[0020] According to a third aspect of the present invention, there is provided an electronic device comprising a processor and a memory; the processor is used to execute the steps of the method described in the first aspect of the present invention by calling a program or instruction stored in the memory.
[0021] The present invention has at least the following beneficial effects:
[0022] The event knowledge graph construction method provided by the embodiment of the present invention first constructs an event graph based on a source text data set, then, based on the common entities between the event graph and the open source knowledge graph, fuses the event graph and the open source knowledge graph to obtain an event knowledge graph that fuses the event graph and the open source knowledge graph, and finally, obtains the feature vectors of the nodes and directed edges in the event knowledge graph to obtain an event knowledge graph that has been represented. Among them, in the knowledge representation process of the event knowledge graph, the acquired head entity feature vector fuses the entity relationship triple information, and performs dimensionality reduction processing, converting a large number of feature vectors containing potentially associated head entities, relationships, and tail entities into a set of low-dimensional vectors that are unrelated to each other and have non-overlapping information, which can reduce the computational overhead of subsequent algorithms. In addition, by deeply fusing the event graph with the knowledge graph, the complementary and mutually promoting effects between the two are achieved. This fusion not only makes up for the limitations of each in data coverage, but also promotes the richness and comprehensiveness of knowledge representation.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A flowchart of a method for constructing an event knowledge graph provided by an embodiment of the present invention;
[0026] Figure 2 Schematic diagram of the fusion of event graph and knowledge graph. DETAILED DESCRIPTION
[0027] 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 only 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0029] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0030] The embodiment of the present invention provides an event knowledge graph construction method for constructing an event knowledge graph with knowledge representation based on an event graph and an open source knowledge graph. In the embodiment of the present invention, knowledge representation learning is representation learning for entities and relationships in a knowledge base, with the purpose of representing entities and relationships as low-dimensional real-valued vectors, aiming to alleviate the data sparsity problem of large-scale knowledge graphs and reduce computational complexity.
[0031] like Figure 1 As shown, an embodiment of the present invention provides a method for constructing an event knowledge graph, which may include the following steps:
[0032] S100, build an event graph based on the source text dataset.
[0033] In an embodiment of the present invention, the source text data may be text data obtained by a web crawler. In an exemplary embodiment, the source text data may be news text data.
[0034] Furthermore, S100 may specifically include:
[0035] S101, preprocessing the source text data set to obtain data containing events as a candidate data set.
[0036] The purpose of S101 is to remove redundant information that does not contain events in the source text data to reduce noise interference and thereby improve the accuracy of event extraction.
[0037] In the embodiment of the present invention, the event format is <event type, trigger word, event element>.
[0038] In an embodiment of the present invention, the event type is determined based on the content contained in the event, the trigger word is the verb in the event, and the event element is the noun in the event. For example, for the event "A meeting is held at location B", the corresponding event type is meeting development, held is the trigger word, and the event elements are A meeting and B location.
[0039] Furthermore, S101 may specifically include:
[0040] S1011, segmenting the source text data set to obtain corresponding multiple paragraphs.
[0041] It is known to those skilled in the art that any method for segmenting a text falls within the protection scope of the present invention. For example, the text may be segmented according to punctuation marks or length in the text.
[0042] S1012, input each paragraph into a preset event type recognition model, and if a corresponding event type is obtained, add the paragraph as a candidate paragraph to the current candidate paragraph set.
[0043] The initial value of the current candidate paragraph set is empty. It is known to those skilled in the art that if a paragraph is not identified as an event type, it will not be added to the current candidate paragraph set.
[0044] S1013, input any candidate paragraph in the current candidate paragraph set into a preset event recognition model, and if the recognition result indicates that the candidate paragraph contains an event, use the candidate paragraph as data containing the event; and obtain a candidate data set.
[0045] In an embodiment of the present invention, the preset event type recognition model and the preset event recognition model are both trained mT5 models. In an embodiment of the present invention, a complete version of ACE (Automatic Content Extraction) data set can be used to train the mT5 model.
[0046] Those skilled in the art are aware that any method of using a data set to train mT5 to obtain a preset event type recognition model and a preset event recognition model falls within the protection scope of the present invention.
[0047] S102: extracting the event description of any candidate data in the candidate data set to obtain an event description set corresponding to the candidate data set.
[0048] In an embodiment of the present invention, the event description is a summary description of the event, which can be obtained based on a preset event description model. In an exemplary embodiment of the present invention, the preset event description model can be a trained T7 model.
[0049] S103, extracting trigger words and event elements of any event description in the event description set to obtain corresponding event triples, and constructing corresponding event graphs based on the event triples corresponding to all event descriptions in the event description set, wherein the event triples include a head entity, a relationship, and a tail entity, wherein the head entity is the event description, the relationship is the trigger word in the event description, and the tail entity is the event element in the event description.
[0050] In the embodiment of the present invention, the method for extracting trigger words and event elements from any event description in the event description set may be the prior art.
[0051] Those skilled in the art know that a node in an event graph is a head entity or a tail entity, and a directed edge represents the relationship between a head entity and a tail entity.
[0052] In an embodiment of the present invention, in the process of constructing an event knowledge graph, a collaborative strategy of event detection and event extraction is used to preprocess the source text data to obtain data containing events, which can significantly improve the efficiency and accuracy of locating the core content in the text and ensure rapid and effective focus on the effective parts of the article.
[0053] S200, based on the common entities between the event graph and the open source knowledge graph, the event graph and the open source knowledge graph are merged to obtain an event knowledge graph that merges the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edges represent the relationship between the head entity and the tail entity.
[0054] In an embodiment of the present invention, the open source knowledge graph may be an existing open source knowledge graph.
[0055] Furthermore, S200 may specifically include:
[0056] S201, obtaining the intersection between the entity set of the event graph and the entity set of the open source knowledge graph, that is, the completely identical entities, and using the corresponding entities of the obtained intersection as the common entities of the event graph and the open source knowledge graph.
[0057] Those skilled in the art know that the entity set in the event graph is the entity corresponding to all nodes, including the head entity and the tail entity.
[0058] S202, for any common entity, one of the two entities corresponding to the common entity in the event graph and the open source knowledge graph is taken as a retained entity, and the other is taken as a non-retained entity, and the node corresponding to the non-retained entity is deleted from the corresponding graph, and the directed edge connecting the node corresponding to the non-retained entity is connected to the node corresponding to the retained entity; an event knowledge graph that integrates the event graph and the open source knowledge graph is obtained.
[0059] In the embodiment of the present invention, the reserved entity and the non-reserved entity can be determined based on actual needs, and the present invention does not specifically limit this. Figure 2 As shown in the left figure in , the common entity in the event graph and the open source knowledge graph is entity 1. Entity 1 in the event graph can be used as a retained entity, and entity 1 in the open source knowledge graph can be used as a non-retained entity. Then, the non-retained entity is deleted, and the relationship corresponding to the retained entity is connected to the retained entity, as shown in Figure 2 As shown in the right figure, Figure 2 The dashed line in the represents a deletion.
[0060] S300, obtaining feature vectors of nodes and directed edges in the event knowledge graph, and obtaining an event knowledge graph with knowledge representation as a target event knowledge graph.
[0061] In an exemplary embodiment of the present invention, the feature vectors of the nodes and directed edges in the event knowledge graph can be obtained by a supervised learning method, and specifically can be obtained by the following steps:
[0062] S301, based on the sentence encoding model, obtain the initial feature vectors corresponding to the head entity, relationship and tail entity in the event knowledge graph.
[0063] Compared with Onehot encoding, the sentence encoding model can better preserve the semantic information of the text. The model represents the semantics of the input by converting texts of different lengths into embedded vectors of fixed length. The sentence encoding model consists of two layers: The first layer is a transformer model that inputs text or sentences and outputs the encoding vector of the corresponding position of each input word. The second layer inputs the encoding vector into the pooling layer to obtain a fixed-length encoding result.
[0064] Those skilled in the art know that any method for obtaining the initial feature vectors corresponding to the head entity, relationship and tail entity in the event knowledge graph based on the sentence encoding model falls within the protection scope of the present invention.
[0065] S302, input the initial feature vectors corresponding to the head entity, relationship and tail entity into the preset knowledge graph representation model, obtain the knowledge representation feature vectors corresponding to the head entity, relationship and tail entity, and use them as the target feature vectors corresponding to the head entity, relationship and tail entity, that is, the target feature vectors are vectors that integrate triple information, and obtain the feature vectors of the nodes and directed edges in the event knowledge graph. In an embodiment of the present invention, the preset knowledge graph representation model is a TransE model that can be used to describe triples in the knowledge base by using distributed representation. The representation method of the TransE model avoids the construction of a huge tree structure and can obtain semantic information through simple mathematical calculations.
[0066] Those skilled in the art know that the method of inputting the initial feature vectors corresponding to the head entity, the relationship and the tail entity into the TransE model to obtain the corresponding feature vectors may be an existing method.
[0067] In another embodiment of the present invention, the feature vectors of the nodes and directed edges in the event knowledge graph can be obtained by an unsupervised learning method, and can be obtained by the following steps:
[0068] S310, respectively obtain the initial feature vector of the head entity, the relationship feature vector, the tail entity feature vector in the event knowledge graph, and obtain the feature vector corresponding to the relationship-tail entity in the event knowledge graph.
[0069] In an embodiment of the present invention, the head entity initial feature vector, the relationship feature vector, the tail entity feature vector and the relationship-tail entity feature vector are obtained through a sentence encoding model. When obtaining the head entity initial feature vector, all head entities in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vector, and the head entity initial feature vector of each head entity is obtained. When obtaining the relationship feature vector, all relations in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vector, and the relationship feature vector of each relationship is obtained. When obtaining the tail entity feature vector, all tail entities in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vector, and the tail entity feature vector of each tail entity is obtained. When obtaining the feature vector corresponding to the relationship-tail entity, first, the character string corresponding to each head entity and the character string corresponding to the tail entity are concatenated to obtain a concatenated character string; then, the concatenated character string is input into the sentence encoding model to obtain the corresponding feature vector.
[0070] S320, based on the feature vectors corresponding to all the relationship-tail entities corresponding to any head entity, obtain the relationship-tail entity feature vector corresponding to the head entity, and update the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain the updated feature vector as the head entity feature vector of the head entity.
[0071] In an embodiment of the present invention, the relationship-tail entity feature vector corresponding to the head entity may be the average of the feature vectors corresponding to all relationship-tail entities corresponding to the head entity, that is, the average of the feature vectors corresponding to all relationship-tail entities connected to the head entity.
[0072] Further, the updating of the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain an updated feature vector as the head entity feature vector of the head entity specifically includes:
[0073] The relationship-tail entity feature vector corresponding to the head entity is average pooled to obtain the corresponding average pooling result, and the average pooling result is concatenated with the initial feature vector corresponding to the head entity to obtain a head entity vector that integrates the triplet information of the entity relationship as the head entity feature vector corresponding to the head entity.
[0074] S330, perform dimensionality reduction processing on the head entity feature vector, relationship feature vector, and tail entity feature vector corresponding to the event knowledge graph to obtain the reduced-dimensional feature vectors as the feature vectors of the nodes and directed edges in the event knowledge graph, thereby obtaining the event knowledge graph with knowledge representation.
[0075] Furthermore, S330 specifically includes:
[0076] S3301, based on the head entity feature vector, relationship feature vector and tail entity feature vector, construct an initial matrix of size n×m, where the value of n is the vector dimension corresponding to the head entity feature vector, relationship feature vector and tail entity feature vector, and the value of m is the number of vectors corresponding to the head entity feature vector, relationship feature vector and tail entity feature vector.
[0077] In an exemplary embodiment of the present invention, the vector dimension may be 768.
[0078] S3302, performing zero mean processing on each row of the initial matrix to obtain a processed initial matrix as an intermediate matrix.
[0079] S3303, obtaining the covariance matrix of the intermediate matrix, and obtaining the eigenvalues of the covariance matrix and the eigenvectors corresponding to the eigenvalues.
[0080] Those skilled in the art know that any method for obtaining the covariance matrix of the intermediate matrix, and obtaining the eigenvalues of the covariance matrix and the eigenvectors corresponding to the eigenvalues, falls within the protection scope of the present invention.
[0081] S3304, sorting the acquired eigenvalues in descending order, and obtaining eigenvectors corresponding to the first k eigenvalues in the sorted eigenvalues as target eigenvectors, and using the target eigenvectors as row vectors to form an eigenvector matrix.
[0082] In the embodiment of the present invention, the value of k can be set based on actual needs. In an exemplary embodiment, k=100.
[0083] S3305, taking a matrix obtained by multiplying the initial matrix and the eigenvector matrix as a target matrix;
[0084] S3306, based on the target matrix, obtain the characteristic vectors of the nodes and directed edges in the event knowledge graph, and then obtain the event knowledge graph with knowledge representation.
[0085] Through S310 to S330, the head entity feature vector obtained integrates the entity relationship triplet information and performs dimensionality reduction processing, converting a large number of feature vectors containing potentially associated head entities, relationships, and tail entities into a set of low-dimensional vectors that are unrelated to each other and have non-overlapping information, which can reduce the computational overhead of subsequent algorithms.
[0086] In the embodiment of the present invention, supervised and unsupervised learning methods are used to obtain the representation of the event knowledge graph, aiming to flexibly respond to data representation requirements in different scenarios, ensure that the event knowledge graph can adapt to diverse application environments, and effectively improve the accuracy and effectiveness of data representation.
[0087] Based on the same inventive concept, an embodiment of the present invention provides a device for constructing an event knowledge graph, wherein:
[0088] The event graph construction module is used to construct an event graph based on the source text dataset;
[0089] A graph fusion module, for fusing the event graph and the open source knowledge graph based on common entities between the event graph and the open source knowledge graph, to obtain an event knowledge graph that fuses the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edge represents the relationship between the head entity and the tail entity;
[0090] An event knowledge graph construction module is used to obtain feature vectors of nodes and directed edges in the event knowledge graph, and obtain an event knowledge graph with knowledge representation as a target event knowledge graph;
[0091] The event graph construction module includes:
[0092] A preprocessing unit, used for preprocessing the source text data set to obtain data containing events as a candidate data set;
[0093] An event description acquisition unit, configured to extract an event description of any candidate data in the candidate data set to obtain an event description set corresponding to the candidate data set;
[0094] An event graph construction unit is used to extract trigger words and event elements of any event description in the event description set to obtain corresponding event triples, and to construct a corresponding event graph based on the event triples corresponding to all event descriptions in the event description set. The event triples include a head entity, a relationship, and a tail entity. The head entity is the event description, the relationship is the trigger word in the event description, and the tail entity is the event element in the event description.
[0095] The device can be used to perform Figure 1 Therefore, for the functions that can be realized by each functional module of the device, please refer to Figure 1 The description of the illustrated embodiment is not repeated in detail.
[0096] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0097] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0098] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing an event knowledge graph, characterized in that: The method comprises the following steps: S100, builds an event graph based on the source text dataset; S200, based on the common entities between the event graph and the open source knowledge graph, the event graph and the open source knowledge graph are merged to obtain an event knowledge graph that merges the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edge represents the relationship between the head entity and the tail entity; S300, acquiring feature vectors of nodes and directed edges in the event knowledge graph to obtain an event knowledge graph with knowledge representation; Among them, S100 specifically includes: S101, preprocessing the source text data set to obtain data containing events as a candidate data set; S102, extracting an event description of any candidate data in the candidate data set to obtain an event description set corresponding to the candidate data set; S103, extracting trigger words and event elements of any event description in the event description set to obtain corresponding event triples, and constructing corresponding event graphs based on the event triples corresponding to all event descriptions in the event description set, wherein the event triples include a head entity, a relationship, and a tail entity, wherein the head entity is the event description, the relationship is the trigger word in the event description, and the tail entity is the event element in the event description; Among them, S300 specifically includes: S310, respectively obtaining the initial feature vector of the head entity, the relationship feature vector, the tail entity feature vector in the event knowledge graph, and obtaining the feature vector corresponding to the relationship-tail entity in the event knowledge graph; S320, based on the feature vectors corresponding to all the relationship-tail entities corresponding to any head entity, obtain the relationship-tail entity feature vector corresponding to the head entity, and update the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain an updated feature vector as the head entity feature vector of the head entity; S330, performing dimensionality reduction processing on the head entity feature vector, the relationship feature vector, and the tail entity feature vector corresponding to the event knowledge graph to obtain the reduced-dimensional feature vectors as the feature vectors of the nodes and directed edges in the event knowledge graph, thereby obtaining the event knowledge graph with knowledge representation; The updating of the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain an updated feature vector as the head entity feature vector of the head entity specifically includes: All the relationship-tail entity feature vectors corresponding to the head entity are average pooled to obtain the corresponding average pooling result, and the average pooling result is concatenated with the initial feature vector corresponding to the head entity to obtain a head entity vector that integrates the triplet information of the entity relationship as the head entity feature vector corresponding to the head entity.
2. The event knowledge graph construction method according to claim 1, characterized in that: The head entity initial feature vector, the relationship feature vector, the tail entity feature vector and the relationship-tail entity feature vector are obtained through a sentence encoding model.
3. The event knowledge graph construction method according to claim 1, characterized in that: S330 specifically includes: S3301, constructing an initial matrix of size n×m based on the head entity feature vector, the relationship feature vector, and the tail entity feature vector, wherein the value of n is the vector dimension corresponding to the head entity feature vector, the relationship feature vector, and the tail entity feature vector, and the value of m is the number of vectors corresponding to the head entity feature vector, the relationship feature vector, and the tail entity feature vector; S3302, performing zero mean processing on each row of the initial matrix to obtain a processed initial matrix as an intermediate matrix; S3303, obtaining a covariance matrix of the intermediate matrix, and obtaining eigenvalues of the covariance matrix and eigenvectors corresponding to the eigenvalues; S3304, sorting the acquired eigenvalues in descending order, and obtaining eigenvectors corresponding to the first k eigenvalues among the sorted eigenvalues as target eigenvectors, and forming an eigenvector matrix using the target eigenvectors as row vectors; S3305, taking a matrix obtained by multiplying the initial matrix and the eigenvector matrix as a target matrix; S3306, based on the target matrix, obtain the characteristic vectors of the nodes and directed edges in the event knowledge graph, and then obtain the event knowledge graph with knowledge representation.
4. The method according to claim 1, characterized in that: S101 specifically includes: S1011, segmenting the source text data set to obtain corresponding multiple paragraphs; S1012, input each paragraph into a preset event type recognition model, and if a corresponding event type is obtained, add the paragraph as a candidate paragraph to the current candidate paragraph set; S1013, input any candidate paragraph in the current candidate paragraph set into a preset event recognition model, and if the recognition result indicates that the candidate paragraph contains an event, use the candidate paragraph as data containing the event to obtain the candidate data set.
5. The method according to claim 4, characterized in that The preset event type recognition model and the preset event recognition model are both trained mT5 models.
6. The method according to claim 1, characterized in that S200 specifically includes: S201, obtaining the intersection between the entity set of the event graph and the entity set of the open source knowledge graph, and using the entity corresponding to the obtained intersection as the common entity of the event graph and the open source knowledge graph; S202, for any common entity, one of the two entities corresponding to the common entity in the event graph and the open source knowledge graph is taken as a retained entity, and the other is taken as a non-retained entity, and the node corresponding to the non-retained entity is deleted from the corresponding graph, and the directed edge connecting the node corresponding to the non-retained entity is connected to the node corresponding to the retained entity, so as to obtain an event knowledge graph that integrates the event graph and the open source knowledge graph.
7. An event knowledge graph construction device, characterized in that: The device comprises: The event graph construction module is used to construct an event graph based on the source text dataset; A graph fusion module, for fusing the event graph and the open source knowledge graph based on common entities between the event graph and the open source knowledge graph, to obtain an event knowledge graph that fuses the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edge represents the relationship between the head entity and the tail entity; An event knowledge graph construction module is used to obtain feature vectors of nodes and directed edges in the event knowledge graph to obtain an event knowledge graph with knowledge representation; Among them, the event graph construction module is specifically used for: Preprocessing the source text data set to obtain data containing events as a candidate data set; Extracting an event description of any candidate data in the candidate data set to obtain an event description set corresponding to the candidate data set; Extracting trigger words and event elements from any event description in the event description set to obtain corresponding event triples, and constructing corresponding event graphs based on the event triples corresponding to all event descriptions in the event description set, wherein the event triples include a head entity, a relationship, and a tail entity, wherein the head entity is the event description, the relationship is the trigger word in the event description, and the tail entity is the event element in the event description; The event knowledge graph construction module is specifically used for: Obtain the initial feature vector of the head entity, the relationship feature vector, the tail entity feature vector in the event knowledge graph, and obtain the feature vector corresponding to the relationship-tail entity in the event knowledge graph; Based on the feature vectors corresponding to all the relationship-tail entities corresponding to any head entity, the relationship-tail entity feature vector corresponding to the head entity is obtained, and the initial feature vector of the head entity is updated based on the relationship-tail entity feature vector corresponding to the head entity to obtain the updated feature vector as the head entity feature vector of the head entity; Performing dimensionality reduction processing on the head entity feature vector, the relationship feature vector, and the tail entity feature vector corresponding to the event knowledge graph to obtain the reduced-dimensional feature vectors as the feature vectors of the nodes and directed edges in the event knowledge graph, thereby obtaining the event knowledge graph with knowledge representation; The updating of the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain an updated feature vector as the head entity feature vector of the head entity specifically includes: All the relationship-tail entity feature vectors corresponding to the head entity are average pooled to obtain the corresponding average pooling result, and the average pooling result is concatenated with the initial feature vector corresponding to the head entity to obtain a head entity vector that integrates the triplet information of the entity relationship as the head entity feature vector corresponding to the head entity.
8. An electronic device, characterized in that: including a processor and a memory; The processor is used to execute the steps of the method according to any one of claims 1 to 6 by calling the program or instruction stored in the memory.
Citation Information
Patent Citations
Knowledge graph and affair graph fusion method, device and system
CN114417004A
Fusion map construction method
CN114661856A
Power equipment knowledge graph ontology construction method and system, equipment and medium
CN115712732A
Knowledge graph construction method and related equipment
CN117874252A
Domestic behavior knowledge graph construction method, model and detection device and method
CN118446292A
