A method and system for extracting entity relations based on knowledge enhancement

By acquiring and integrating entity knowledge information, and using the PCNN model to train the entity relationship extraction model, it solves the problem of semantic ambiguity and noise in entity relationship extraction, improves the accuracy of relationship extraction, and is suitable for multi-domain natural language applications.

CN111832307BActive Publication Date: 2024-08-23ZHIBOYUN INFORMATION TECH (GUANGZHOU) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202010657829.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-09
Publication Date
2024-08-23
Estimated Expiration
2040-07-09

AI Technical Summary

Technical Problem

The existing technology ignores entity knowledge information in entity relationship extraction, which may cause semantic ambiguity in specific fields such as the medical field. In addition, remote supervision methods have noise problems that affect extraction performance.

Method used

By obtaining preprocessed domain ontology and unlabeled corpus, entity knowledge information is extracted, entity features, word features and entity location features are integrated, the PCNN model is used to train the entity relationship extraction model, and the softmax classifier is combined to classify entity relationship types and reduce noise. problems and improve extraction performance.

Benefits of technology

It effectively reduces entity semantic ambiguity and improves the accuracy of entity relationship extraction. It is suitable for natural language related applications and is widely used in multi-domain relationship extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111832307B
    Figure CN111832307B
Patent Text Reader

Abstract

The embodiment of the present invention provides an entity relationship extraction method and system based on knowledge enhancement. The method includes: obtaining a preprocessed domain ontology and an unlabeled corpus; obtaining entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and obtaining a labeled corpus through the entity knowledge information calculation; extracting entity features, word features and entity position features based on the entity knowledge information, and further fusing the position features to obtain fused features; obtaining a PCNN model, training the PCNN model based on the fused features, and obtaining an entity relationship extraction model; placing the result of the entity relationship extraction model into the PCNN model, and obtaining the entity relationship type classification result through a preset classifier. The embodiment of the present invention is trained based on the existing domain ontology and unlabeled corpus. The trained model can provide the relationship categories corresponding to entity pairs, can be widely used in natural language related applications, and improves the accuracy of 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 computer technology, and in particular to a method and system for extracting entity relations based on knowledge enhancement. Background Art

[0002] Entity relationship extraction is a subtask of information extraction, and its main purpose is to extract structured relationship information from unstructured text. Traditional relationship extraction methods are usually based on supervised learning, semi-supervised learning, and unsupervised learning. Relationship extraction methods based on supervised learning require a fully manually annotated corpus as a training set to train the relationship extraction model, which requires a lot of manpower and time, and has poor prediction capabilities for new entity relationships that are not in the training set. Relationship extraction methods based on semi-supervised learning use partially annotated corpora to extract entity relationships through iterative training. Although this method reduces the cost of manual annotation to a certain extent, it still requires some annotated data. Relationship extraction methods based on unsupervised learning do not require manually annotated corpora, and automatically classify relationships through clustering methods. This method usually obtains suboptimal results.

[0003] Distant supervision combines the advantages of semi-supervised and unsupervised methods, automatically annotating entity relationships by aligning unlabeled corpus with entities in existing domain ontologies. Although extracting entity information from domain ontology can greatly improve the performance of entity relationship extraction and reduce labor costs. However, there are still the following challenges: The main idea of ​​​​distant supervision is that if an entity pair has a predefined relationship in the domain ontology, then in the unlabeled corpus, all sentences that mention this entity pair have this predefined relationship. Because this assumption is too certain, it is bound to introduce noise problems. For example: In 2016, Hao Zheng et al. published in AAAI proposed a ranking-based method to improve the performance of distant supervision for multi-label relationship extraction. In 2017, Chengsen Ru et al. solved the noise problem of distant supervision methods by calculating the similarity between the relationship words between entity pairs in the domain ontology and the dependency words between entity pairs in unlabeled text. In 2018, Peng Zhou et al. proposed a relation extraction model with a multi-layer attention mechanism, which improves the accuracy of remote supervision by combining sentence-level attention mechanism and word-level attention mechanism and selecting the most relevant sentences of entity relations through piecewise convolutional neural network (PCNN).

[0004] Although the above methods can improve the performance of remote supervision methods, they ignore entity knowledge information and may cause semantic ambiguity in some specific fields. For example, in the medical field, some entity types can be both diseases and symptoms. Summary of the invention

[0005] The embodiment of the present invention provides a method and system for extracting entity relations based on knowledge enhancement, so as to solve the problems existing in the prior art.

[0006] In a first aspect, an embodiment of the present invention provides a method for extracting entity relationships based on knowledge enhancement, comprising:

[0007] Obtain the preprocessed domain ontology and unlabeled corpus;

[0008] Acquire entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculate the labeled corpus through the entity knowledge information;

[0009] Based on the entity knowledge information, entity features, word features and entity position features are extracted respectively, and the entity features, word features and entity position features are fused by position features to obtain fused features;

[0010] Acquire a PCNN model, and train the PCNN model based on the fusion features to obtain an entity relationship extraction model;

[0011] The result of the entity relationship extraction model is put into the PCNN model, and the entity relationship type classification result is obtained through the preset classifier of the PCNN model.

[0012] Furthermore, the obtaining of the preprocessed domain ontology specifically includes:

[0013] Combine and expand the annotated corpus with the existing domain ontology;

[0014] The text to be processed is segmented into Chinese character strings according to entities, punctuation marks, numbers and space characters contained in the existing domain ontology, and stop words are removed to obtain the preprocessed domain ontology.

[0015] Furthermore, the acquiring entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculating the labeled corpus through the entity knowledge information, specifically includes:

[0016] Extracting entity self information from the preprocessed domain ontology, extracting entity type information from the unlabeled corpus, and fusing the entity self information and the entity type information to obtain the entity knowledge information;

[0017] The semantic similarity between the entity pairs in the preprocessed domain ontology and the entity pairs in the unlabeled corpus is calculated by using the entity knowledge information, and the labeled corpus is automatically labeled based on the semantic similarity.

[0018] Further, the extracting entity features, word features and entity position features based on the entity knowledge information respectively, fusing the entity features, word features and entity position features by position features to obtain fused features, specifically includes:

[0019] applying the entity knowledge information to the entity features;

[0020] Using the CBOW model, non-entity words in the unlabeled text are converted into preset dimension vectors to obtain the word features;

[0021] The overall features of the sentence are learned through a convolutional neural network, and the relative distance between each word and entity pair in the sentence is calculated to obtain the entity position features;

[0022] The entity feature, the word feature and the entity position feature are vector-concatenated to obtain a fusion feature.

[0023] Further, the obtaining of the PCNN model, training the PCNN model based on the fusion features, and obtaining the entity relationship extraction model specifically includes:

[0024] Based on the PCNN model, the sentence is segmented into several parts according to the positions of entity pairs, and fine-grained features in the sentence are extracted;

[0025] The PCNN model is trained based on the fine-grained features and the fusion features to obtain the entity relationship extraction model.

[0026] Furthermore, the result of the entity relationship extraction model is put into the PCNN model, and the entity relationship type classification result is obtained by the preset classifier of the PCNN model, which specifically includes:

[0027] The result of the entity relationship extraction model is placed in the classification layer of the PCNN model, and the entity relationship type classification result is generated through the softmax classifier.

[0028] In a second aspect, an embodiment of the present invention provides an entity relationship extraction system based on knowledge enhancement, comprising:

[0029] Data preprocessing module, used to obtain preprocessed domain ontology and unlabeled corpus;

[0030] A labeled corpus construction module, used to obtain entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculate the labeled corpus through the entity knowledge information;

[0031] A feature extraction module, used to extract entity features, word features and entity position features based on the entity knowledge information, and perform position feature fusion on the entity features, word features and entity position features to obtain fused features;

[0032] A training relationship extraction model module is used to obtain a PCNN model, and train the PCNN model based on the fusion features to obtain an entity relationship extraction model;

[0033] The entity relationship classifier module is used to put the result of the entity relationship extraction model into the PCNN model, and obtain the entity relationship type classification result through the preset classifier of the PCNN model.

[0034] Furthermore, the data preprocessing module is specifically used for:

[0035] Combine and expand the annotated corpus with the existing domain ontology;

[0036] The text to be processed is segmented into Chinese character strings according to entities, punctuation marks, numbers and space characters contained in the existing domain ontology, and stop words are removed to obtain the preprocessed domain ontology.

[0037] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0038] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the entity relationship extraction methods based on knowledge enhancement are implemented.

[0039] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the entity relationship extraction methods based on knowledge enhancement.

[0040] The entity relationship extraction method and system based on knowledge enhancement provided in the embodiment of the present invention are trained based on the existing domain ontology and unlabeled corpus. The trained model can provide relationship categories corresponding to entity pairs, can be widely used in natural language related applications, and improves the accuracy of relationship extraction. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] Figure 1 A flow chart of an entity relationship extraction method based on knowledge enhancement provided by an embodiment of the present invention;

[0043] Figure 2 The overall logical architecture diagram of the entity relationship extraction method based on knowledge enhancement provided by the embodiment of the present invention;

[0044] Figure 3 A structure diagram of an entity relationship extraction system based on knowledge enhancement provided by an embodiment of the present invention;

[0045] Figure 4 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.

[0047] In view of the problems existing in the prior art, the embodiment of the present invention provides an entity relationship extraction method based on knowledge enhancement, which can effectively reduce the ambiguity of entity semantics and the noise problem of remote supervision by considering the entity itself and entity type information. In addition, by integrating entity knowledge information, word features, and entity position features, it is possible to further select correctly labeled instances in the remote supervision method and improve the performance of relationship extraction.

[0048] Figure 1 A flow chart of an entity relationship extraction method based on knowledge enhancement provided by an embodiment of the present invention, such as Figure 1 As shown, including:

[0049] S1, obtain the preprocessed domain ontology and unlabeled corpus;

[0050] The existing domain ontology and annotated corpus are preprocessed, and the unannotated corpus is obtained.

[0051] S2, acquiring entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculating a labeled corpus through the entity knowledge information;

[0052] Based on the preprocessed domain ontology, entity knowledge information is obtained through entity knowledge information extraction, and then the annotated corpus is obtained through a remote supervision method based on knowledge enhancement.

[0053] S3, extracting entity features, word features and entity position features respectively based on the entity knowledge information, and fusing the entity features, the word features and the entity position features to obtain fused features;

[0054] Further feature extraction and feature fusion are performed to extract entity features, word features and entity position features respectively, and the above three features are fused to obtain fused features;

[0055] S4, obtaining a PCNN model, and training the PCNN model based on the fusion features to obtain an entity relationship extraction model;

[0056] The fused features are then input into the PCNN model for model training to obtain the entity relationship extraction model.

[0057] S5, putting the result of the entity relationship extraction model into the PCNN model, and obtaining the entity relationship type classification result through the preset classifier of the PCNN model.

[0058] Finally, the results of the entity relationship extraction model are put into the PCNN model, and the entity relationship type classification results are generated through the preset classifier in the PCNN model. The overall logical architecture diagram is as follows: Figure 2 shown.

[0059] The embodiment of the present invention is trained based on the existing domain ontology and unlabeled corpus. The trained model can provide relationship categories corresponding to entity pairs, can be widely used in natural language related applications, and improves the accuracy of relationship extraction.

[0060] Based on the above embodiment, step S1 in the method specifically includes:

[0061] Combine and expand the annotated corpus with the existing domain ontology;

[0062] The text to be processed is segmented into Chinese character strings according to entities, punctuation marks, numbers and space characters contained in the existing domain ontology, and stop words are removed to obtain the preprocessed domain ontology.

[0063] Specifically, the annotated corpus is combined with the existing domain ontology to expand the domain ontology, the text to be processed is segmented into Chinese character strings according to the entities, punctuation marks, numbers and spaces contained in the domain ontology, and stop words are removed.

[0064] Based on any of the above embodiments, step S2 in the method includes:

[0065] Extracting entity self information from the preprocessed domain ontology, extracting entity type information from the unlabeled corpus, and fusing the entity self information and the entity type information to obtain the entity knowledge information;

[0066] The semantic similarity between the entity pairs in the preprocessed domain ontology and the entity pairs in the unlabeled corpus is calculated by using the entity knowledge information, and the labeled corpus is automatically labeled based on the semantic similarity.

[0067] Specifically, entity knowledge information is first extracted by extracting entity information and its corresponding entity type information from the domain ontology and unlabeled corpus respectively, and then fusing them to obtain entity knowledge information.

[0068] For example, the domain ontology contains n entities, where E i ∈{E1...E n}, then there is a corresponding entity type E itype ∈{E 1type ...E ntype}. In the unlabeled corpus D, there are S n Sentences, {S1...S i ...S n}∈D,S i For m phrases S i = {W1...G i ...G o ...W m}, where {W1...W m} is the sentence S i The word in G i and G o is the entity contained in the sentence and has a corresponding entity type G itype and G otype . Secondly, word2vec is used to convert the entity itself and entity type information in the knowledge base and unlabeled corpus into a d-dimensional vector form. Finally, the entity itself and entity type information are fused to extract entity knowledge information. For example, the entity knowledge information in the domain ontology can be recorded as in, is the vector concatenation operation, e i For entity E i The vector, e itype For entity type E itype The entity knowledge information in the unlabeled corpus is denoted as where g i For entity G i The vector, g itype For entity type G itype Vector.

[0069] Next is the remote supervision method based on knowledge enhancement, which automatically constructs annotated corpus as training set by calculating the semantic similarity between entity pairs that incorporate knowledge information in the domain ontology and entity pairs that incorporate knowledge information in the unannotated corpus.

[0070] For example, the entity pair (q i ,q o ) and entity pairs in the unlabeled corpus (p i , p o ) are similar and q i and q o In the domain ontology, there is a relationship r, represented by r(q i ,q o ), then p i and p o It is also automatically labeled as relation r, represented by r(p i , p o ).

[0071] The similarity calculation method is:

[0072]

[0073] Among them, sim() means (q i ,q o ) and (p i , p o ), cosine() represents the calculation method of cosine similarity, α is the similarity threshold, the initial threshold is set to 0.85, and the gradient descent method is used to calculate the error, that is, to make the error function smooth and continuous to calculate the slope of the gradient descent. The closer to the minimum value, the smaller the gradient, until the slope of the gradient reaches the minimum value, which is the optimal threshold of the similarity.

[0074] Based on any of the above embodiments, step S3 in the method specifically includes:

[0075] applying the entity knowledge information to the entity features;

[0076] Using the CBOW model, non-entity words in the unlabeled text are converted into preset dimension vectors to obtain the word features;

[0077] The overall features of the sentence are learned through a convolutional neural network, and the relative distance between each word and entity pair in the sentence is calculated to obtain the entity position features;

[0078] The entity feature, the word feature and the entity position feature are vector-concatenated to obtain a fusion feature.

[0079] Specifically, the embodiment of the present invention mainly performs feature extraction and feature fusion, which is subdivided into four sub-steps: entity feature extraction, word feature extraction, entity position feature extraction and feature fusion.

[0080] Entity feature extraction is to directly use the entity knowledge information in the unlabeled corpus in entity knowledge information extraction for entity features.

[0081] The specific word feature extraction is: let S i ={W1...G i ...G o ...W m}, where {W1...W m} is S i The word in G i and G o For S i The CBOW model (continuous bag of words model) is used to convert the non-entity words in the sentence into d-dimensional word vectors to extract word features. The converted word vectors are recorded as {w1 ... w m}.

[0082] Entity position feature extraction is as follows: the relative distance between each word and entity pair in the sentence is calculated by learning the overall features of the sentence through a convolutional neural network (CNN). i ={w1...g i ... o ... m},s i is the sentence vector, each word vector w i With the entity vector g i and g o There are two relative distances between

[0083] Feature fusion is to concatenate entity features, word features, and entity position features to obtain new features as the input of PCNN to train the entity relationship extraction model. The formula for feature fusion is:

[0084]

[0085] Among them, p i is the entity feature, w i For word features, It is the entity location feature.

[0086] Based on any of the above embodiments, step S4 in the method specifically includes:

[0087] Based on the PCNN model, the sentence is segmented into several parts according to the positions of entity pairs, and fine-grained features in the sentence are extracted;

[0088] The PCNN model is trained based on the fine-grained features and the fusion features to obtain the entity relationship extraction model.

[0089] Specifically, since the PCNN model can divide the sentence into three parts according to the position of the entity pair and extract the fine-grained features in the sentence, the fused features are input into the PCNN to train the relationship extraction model. In order to prevent overfitting, the dropout operation is used in the convolution layer, and zero padding is used to maintain the effectiveness of the sentence. The specific formula is as follows:

[0090] Convolutional layer: There is a sentence s i ={w1, w2, ..., w m}, where w j It is a sentence i The jth word vector in h is the length of the convolution kernel, which means it contains h words. The convolution operation of the jth word is:

[0091] c j =f(k·w i:i+h-1 +b)

[0092] in is the matrix of the convolution kernel, b is the deviation, w i:i+h-1 It represents the combination of word vectors from the i-th to i+h-1, f(·) represents a nonlinear activation function, usually ReLU, c j Represents a feature map after the convolution operation, sentence s i The feature map is represented as: Assuming there are l convolution kernels of length h, the feature map is represented as:

[0093]

[0094] Segmented maximum pooling layer: First, c is pooled according to the position of the entity pair in the sentence. j Divided into three parts [c j1 , c j2 , c j3 ], and then the most important information in the sentence is obtained by calculating the maximum value of each part. The calculation formula is as follows: Finally, concatenate all feature maps after the volume operation to obtain sentence s i The final eigenvector b s =ReLU(v).

[0095] Based on any of the above embodiments, step S5 in the method specifically includes:

[0096] The result of the entity relationship extraction model is placed in the classification layer of the PCNN model, and the entity relationship type classification result is generated through the softmax classifier.

[0097] Specifically, the results of entity model training are put into the classification layer of PCNN, and the final entity relationship type classification results are generated through the softmax classifier. The formula is as follows:

[0098]

[0099] O = softmax(W o h i +b s )

[0100] r s = argmax(O)

[0101] Among them, p i is the entity feature, w i For word features, is the entity position feature, b s For sentence s i The eigenvector of o is the weight, O∈[1,n] means there are n relationship types, r s is the final relationship category label.

[0102] Figure 3 A structure diagram of an entity relationship extraction system based on knowledge enhancement provided by an embodiment of the present invention, such as Figure 3 As shown, it includes: a data preprocessing module 31, a labeled corpus construction module 32, a feature extraction module 33, a training relationship extraction model module 34 and an entity relationship classifier module 35; wherein:

[0103] The data preprocessing module 31 is used to obtain the preprocessed domain ontology and the unlabeled corpus; the labeled corpus construction module 32 is used to obtain entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and obtain the labeled corpus through the entity knowledge information; the feature extraction module 33 is used to extract entity features, word features and entity position features respectively based on the entity knowledge information, and perform position feature fusion on the entity features, the word features and the entity position features; the training relationship extraction model module 34 is used to obtain the PCNN model, train the PCNN model based on the fused features, and obtain the entity relationship extraction model; the entity relationship classifier module 35 is used to put the result of the entity relationship extraction model into the PCNN model, and obtain the entity relationship type classification result through the preset classifier of the PCNN model.

[0104] The system provided in the embodiment of the present invention is used to execute the corresponding method mentioned above. Its specific implementation method is consistent with the implementation method of the method, and the algorithm flow involved is the same as the corresponding method algorithm flow, which will not be repeated here.

[0105] The embodiment of the present invention is trained based on the existing domain ontology and unlabeled corpus. The trained model can provide relationship categories corresponding to entity pairs, can be widely used in natural language related applications, and improves the accuracy of relationship extraction.

[0106] Based on the above embodiment, the data preprocessing module 31 is specifically used for:

[0107] Combine and expand the annotated corpus with the existing domain ontology;

[0108] The text to be processed is segmented into Chinese character strings according to entities, punctuation marks, numbers and space characters contained in the existing domain ontology, and stop words are removed to obtain the preprocessed domain ontology.

[0109] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the following method: obtaining a preprocessed domain ontology and an unlabeled corpus; obtaining entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and obtaining a labeled corpus through the entity knowledge information; extracting entity features, word features and entity position features based on the entity knowledge information, and fusing the entity features, the word features and the entity position features with position features to obtain fused features; obtaining a PCNN model, training the PCNN model based on the fused features, and obtaining an entity relationship extraction model; putting the result of the entity relationship extraction model into the PCNN model, and obtaining the entity relationship type classification result through the preset classifier of the PCNN model.

[0110] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0111] On the other hand, an embodiment of the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the transmission methods provided by the above-mentioned embodiments, for example, including: obtaining a preprocessed domain ontology and an unlabeled corpus; obtaining entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and obtaining a labeled corpus through calculation of the entity knowledge information; extracting entity features, word features and entity position features based on the entity knowledge information, respectively, and performing position feature fusion on the entity features, the word features and the entity position features to obtain fused features; obtaining a PCNN model, training the PCNN model based on the fused features to obtain an entity relationship extraction model; placing the results of the entity relationship extraction model into the PCNN model, and obtaining an entity relationship type classification result through a preset classifier of the PCNN model.

[0112] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for extracting entity relations based on knowledge enhancement, characterized in that: include: Obtain the preprocessed domain ontology and unlabeled corpus; Acquire entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculate the labeled corpus through the entity knowledge information; Based on the entity knowledge information, entity features, word features and entity position features are respectively extracted, and the entity features, the word features and the entity position features are fused by position features to obtain fused features; Acquire a PCNN model, and train the PCNN model based on the fusion features to obtain an entity relationship extraction model; The result of the entity relationship extraction model is put into the PCNN model, and the entity relationship type classification result is obtained by the preset classifier of the PCNN model; The acquiring entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculating the labeled corpus through the entity knowledge information, specifically includes: Extracting entity self information from the preprocessed domain ontology, extracting entity type information from the unlabeled corpus, and fusing the entity self information and the entity type information to obtain the entity knowledge information; Calculating semantic similarities between entity pairs in the preprocessed domain ontology and entity pairs in the unlabeled corpus through the entity knowledge information, and automatically labeling the labeled corpus based on the semantic similarities; The extracting entity features, word features and entity position features based on the entity knowledge information respectively, fusing the entity features, word features and entity position features by position features to obtain fused features specifically includes: applying the entity knowledge information to the entity features; Using the CBOW model, non-entity words in the unlabeled text are converted into preset dimension vectors to obtain the word features; The overall features of the sentence are learned through a convolutional neural network, and the relative distance between each word and entity pair in the sentence is calculated to obtain the entity position features; Performing vector concatenation on the entity feature, the word feature and the entity position feature to obtain a fusion feature; The acquiring of the PCNN model and training of the PCNN model based on the fusion features to obtain an entity relationship extraction model specifically includes: Based on the PCNN model, the sentence is segmented into several parts according to the positions of entity pairs, and fine-grained features in the sentence are extracted; The PCNN model is trained based on the fine-grained features and the fusion features to obtain the entity relationship extraction model.

2. The entity relationship extraction method based on knowledge enhancement according to claim 1 is characterized in that: The obtaining of the preprocessed domain ontology specifically includes: Combine and expand the annotated corpus with the existing domain ontology; The text to be processed is segmented into Chinese character strings according to entities, punctuation marks, numbers and space characters contained in the existing domain ontology, and stop words are removed to obtain the preprocessed domain ontology.

3. The entity relationship extraction method based on knowledge enhancement according to claim 1 is characterized in that: The step of placing the result of the entity relationship extraction model into the PCNN model and obtaining the entity relationship type classification result through the preset classifier of the PCNN model specifically includes: The result of the entity relationship extraction model is placed in the classification layer of the PCNN model, and the entity relationship type classification result is generated through the softmax classifier.

4. A knowledge-enhanced entity relationship extraction system, characterized in that: include: Data preprocessing module, used to obtain preprocessed domain ontology and unlabeled corpus; A labeled corpus construction module, used to obtain entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculate the labeled corpus through the entity knowledge information; A feature extraction module, used to extract entity features, word features and entity position features based on the entity knowledge information, and perform position feature fusion on the entity features, word features and entity position features to obtain fused features; A training relationship extraction model module is used to obtain a PCNN model, and train the PCNN model based on the fusion features to obtain an entity relationship extraction model; An entity relationship classifier module is used to put the result of the entity relationship extraction model into the PCNN model, and obtain the entity relationship type classification result through the preset classifier of the PCNN model; The acquiring entity knowledge information based on the preprocessed domain ontology and the unlabeled corpus, and calculating the labeled corpus through the entity knowledge information, specifically includes: Extracting entity self information from the preprocessed domain ontology, extracting entity type information from the unlabeled corpus, and fusing the entity self information and the entity type information to obtain the entity knowledge information; Calculating semantic similarities between entity pairs in the preprocessed domain ontology and entity pairs in the unlabeled corpus through the entity knowledge information, and automatically labeling the labeled corpus based on the semantic similarities; The extracting entity features, word features and entity position features based on the entity knowledge information respectively, fusing the entity features, word features and entity position features by position features to obtain fused features specifically includes: applying the entity knowledge information to the entity features; Using the CBOW model, non-entity words in the unlabeled text are converted into preset dimension vectors to obtain the word features; The overall features of the sentence are learned through a convolutional neural network, and the relative distance between each word and entity pair in the sentence is calculated to obtain the entity position features; Performing vector concatenation on the entity feature, the word feature and the entity position feature to obtain a fusion feature; The acquiring of the PCNN model and training of the PCNN model based on the fusion features to obtain an entity relationship extraction model specifically includes: Based on the PCNN model, the sentence is segmented into several parts according to the positions of entity pairs, and fine-grained features in the sentence are extracted; The PCNN model is trained based on the fine-grained features and the fusion features to obtain the entity relationship extraction model.

5. The entity relationship extraction system based on knowledge enhancement according to claim 4 is characterized in that: The data preprocessing module is specifically used for: Combine and expand the annotated corpus with the existing domain ontology; The text to be processed is segmented into Chinese character strings according to entities, punctuation marks, numbers and space characters contained in the existing domain ontology, and stop words are removed to obtain the preprocessed domain ontology.

6. The entity relationship extraction system based on knowledge enhancement according to claim 4 is characterized in that: The step of placing the result of the entity relationship extraction model into the PCNN model and obtaining the entity relationship type classification result through the preset classifier of the PCNN model specifically includes: The result of the entity relationship extraction model is placed in the classification layer of the PCNN model, and the entity relationship type classification result is generated through the softmax classifier.

7. An electronic 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 program, the steps of the entity relationship extraction method based on knowledge enhancement as described in any one of claims 1 to 3 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the entity relationship extraction method based on knowledge enhancement as described in any one of claims 1 to 3 are implemented.

Citation Information

Cited By

  • Information extraction with large language models

    US20240379200A1