Method and apparatus for extracting structured knowledge from chinese natural language

By combining general knowledge base, relationship extraction rules and semantic embedding technology, structured knowledge is extracted from Chinese natural language, solving the problems of low recall rate and precision of Chinese open relationship extraction, and achieving efficient knowledge extraction and graph construction.

CN113868382BActive Publication Date: 2025-10-21BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110943375.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-17
Publication Date
2025-10-21
Estimated Expiration
2041-08-17

AI Technical Summary

Technical Problem

Existing Chinese open relation extraction technologies suffer from low recall and precision, and are unable to effectively extract structured knowledge from unstructured Chinese natural language.

Method used

Combining general knowledge base, relationship extraction rules and semantic embedding technology, structured knowledge is extracted from Chinese natural language through entity extraction, entity linking, relationship extraction and graph fusion methods, including candidate entity scoring, open entity linking, rule-based triple extraction and semantic embedding model screening to ensure the accuracy and richness of the extraction.

Benefits of technology

It significantly improves the recall and precision of entity and relationship extraction, and can generate knowledge graphs with high semantic restoration, which is suitable for knowledge extraction and graph construction in different fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113868382B_ABST
    Figure CN113868382B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for extracting structured knowledge from Chinese natural language, which comprises the following steps: extracting candidate entities from input text and scoring the candidate entities, extracting an entity set based on open entity extraction, retrieving the entity set in a knowledge base to complete open entity linking, reprocessing the input text based on the priority of the entities in the entity set, and adopting rule-based triple extraction to obtain candidate relationship triples, using a semantic embedding model to respectively perform vector embedding of the input text and the candidate relationship triples in a semantic space, screening the candidate triples according to semantic restoration degrees, determining relationship extraction results, and adding the relationship extraction results to the entity set through a fusion strategy to generate a graph atlas. The application can significantly improve the recall rate of entity and relationship extraction, greatly filter out knowledge triples with high semantic restoration degrees, improve the extraction accuracy, and automatically generate a knowledge graph in a specific field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a method and device for extracting structured knowledge from Chinese natural language. Background Art

[0002] Extracting structured knowledge from unstructured natural language is a crucial step in building a knowledge graph. Natural language text is characterized by irregularities, non-standardization, and high variability, making it extremely difficult to extract structured knowledge, such as triples. However, to exploit the valuable information contained in these texts, many traditional methods have been devised to extract the knowledge they contain. These traditional methods are generally based on limited grammatical templates or end-to-end models trained on specific corpora, resulting in poor stability and generalizability.

[0003] Traditional relationship extraction technology has the following two limitations: 1. It is often necessary to define the relationship template to be extracted before extraction; 2. The trained model can often only be used for corpus in a specific field and cannot be used in open extraction scenarios.

[0004] In view of the limitations of traditional relation extraction technology, people have tried to find a relation extraction algorithm that can be used in open domains and can extract unrestricted relations. Early on, Banko et al. proposed the first fully open English relation extraction system, TextRunner, which combined syntactic analysis and classifier training to extract English triples; Fader et al. proposed a completely rule-based relation extraction algorithm, ReVerb, which extracts triples based on syntactic and lexical constraints. In the Chinese field, the CORE system proposed by Tseng et al. can automatically annotate Chinese sentences using NLP technologies such as word segmentation, part-of-speech tagging, and syntactic analysis, and then complete the extraction of triples; Qin Bing et al. proposed an unsupervised open relation extraction model, UnCORE, based on distance constraints and positional relationships; Jia et al. proposed an open relation extraction model, DSNFs, based on the dependency semantic paradigm based on grammar trees.

[0005] Although it has been studied by many people, the open relation extraction technology for Chinese still has problems such as low recall and low precision. Summary of the Invention

[0006] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0007] To this end, one objective of this invention is to propose a method for extracting structured knowledge from Chinese natural language. This method innovatively combines a general knowledge base, relationship extraction rules, and semantic embedding technology to extract knowledge through five steps: entity extraction, entity linking, relationship extraction, relationship filtering, and graph fusion. The method demonstrates excellent performance in extracting knowledge and constructing graphs from corpora across diverse domains.

[0008] Another object of the present invention is to provide a device for extracting structured knowledge from Chinese natural language.

[0009] To achieve the above objectives, an embodiment of the present invention provides a method for extracting structured knowledge from Chinese natural language, the method comprising:

[0010] Extracting candidate entities from the input text and scoring the candidate entities; wherein the extraction of the candidate entities includes knowledge base-based entity extraction and open entity extraction;

[0011] Extracting an entity set extracted based on the open entity extraction, and retrieving the entity set in a knowledge base to complete open entity linking;

[0012] Processing the input text based on the entity set, and obtaining candidate relationship triples by using rule-based triple extraction;

[0013] Using a semantic embedding model to perform vector embedding of the input text and the candidate relationship triples in the semantic space, screening the candidate triples according to the degree of semantic restoration, and determining the relationship extraction result;

[0014] The relationship extraction results are added to the entity set through a fusion strategy to generate a fusion graph.

[0015] The embodiment of the present invention is a method for extracting structured knowledge from Chinese natural language, extracting candidate entities from input text and scoring the candidate entities, extracting the extracted entity set based on open entity extraction, searching the entity set in the knowledge base to complete open entity linking, processing the input text based on the entity set using rule-based triple extraction to obtain candidate relationship triples, using a semantic embedding model to perform vector embedding of semantic space on the input text and the candidate relationship triples, screening the candidate triples according to the semantic restoration degree, and determining the relationship extraction result, adding the relationship extraction result to the entity set through a fusion strategy to generate a fusion graph. The present invention is an open relationship extraction system that combines a general knowledge base, relationship extraction rules and semantic embedding technology. The system extracts entities and relationships by setting a series of relatively common grammatical rules, significantly improving the recall rate of entity and relationship extraction. At the same time, based on the general knowledge base matching and similarity filtering of the semantic embedding model, the system can also screen out knowledge triples with high semantic restoration degree to the greatest extent, improve the extraction accuracy, and automatically generate a knowledge graph for a specific field by fusing rich knowledge base information.

[0016] In addition, the method for extracting structured knowledge from Chinese natural language according to the above embodiment of the present invention may also have the following additional technical features:

[0017] Furthermore, in one embodiment of the present invention, extracting candidate entities from the input text and scoring the candidate entities includes:

[0018] Using a word segmentation tool to segment the input text, and adjusting the word segmentation result to obtain an adjusted word segmentation result;

[0019] Analyzing the adjusted word segmentation results to obtain analysis results, and extracting open entities based on the analysis results;

[0020] The extracted knowledge base-based entities and the open entities are scored according to a scoring principle, and are sorted according to the quality of the extracted entities.

[0021] Furthermore, in one embodiment of the present invention, extracting the entity set based on the open entity extraction, and retrieving the entity set in the knowledge base to complete the open entity linking, includes:

[0022] For an open entity, query the name of the open entity in the knowledge base and obtain a matching result; wherein the matching result includes a candidate concept and a candidate instance;

[0023] First match the candidate concepts. If there is a candidate concept that is consistent with the name of any open entity, mark the any open entity as a concept in the knowledge base and assign a unique identifier. If there is no candidate concept that meets the conditions, match the candidate instance and assign a unique identifier to the candidate instance.

[0024] Furthermore, in one embodiment of the present invention, the reprocessing of the input text based on the entity set and the use of rule-based triple extraction to obtain candidate relationship triples include:

[0025] Based on the priorities of the entities in the entity set, the input text is reprocessed using multiple natural language processing methods, and rule-based triple extraction is adopted to obtain candidate relationship triples.

[0026] Furthermore, in one embodiment of the present invention, the step of using a semantic embedding model to perform vector embedding of the input text and the candidate relationship triples in a semantic space, screening the candidate triples according to the degree of semantic restoration, and determining the relationship extraction result includes:

[0027] The candidate relationship triples are sorted based on the semantic restoration degree, and triples whose semantic restoration degree reaches a preset threshold level are selected as output to characterize the semantic restoration degree of the candidate relationship triples.

[0028] Furthermore, in one embodiment of the present invention, the step of adding the relationship extraction result to the entity set through a fusion strategy to generate a fusion graph includes:

[0029] The relationship extraction result is added to the entity set. If the head and tail of the triple are both in the entity set, the triple with both the head and tail in the entity set is stored as a relationship in the knowledge graph. If only the subject of the triple is in the entity set, the triple with only the subject in the entity set is stored as an entity attribute in the knowledge graph.

[0030] To achieve the above-mentioned object, another embodiment of the present invention provides a device for extracting structured knowledge from Chinese natural language, comprising:

[0031] An entity extraction module is used to extract candidate entities from the input text and score the candidate entities; wherein the extraction of the candidate entities includes knowledge base-based entity extraction and open entity extraction;

[0032] an open entity linking module for extracting an entity set extracted based on the open entity extraction, and retrieving the entity set in a knowledge base to complete the open entity linking;

[0033] A relation extraction module, configured to reprocess the input text based on the entity set and obtain candidate relation triples using rule-based triple extraction;

[0034] A screening module is used to use a semantic embedding model to perform vector embedding of the input text and the candidate relationship triples in the semantic space, screen the candidate triples according to the degree of semantic restoration, and determine the relationship extraction result;

[0035] The fusion graph generation module is used to add the relationship extraction results to the entity set through a fusion strategy to fuse and generate a graph.

[0036] The embodiment of the present invention provides a device for extracting structured knowledge from Chinese natural language, an entity extraction module for extracting candidate entities from input text and scoring the candidate entities, wherein the extraction of candidate entities includes knowledge base-based entity extraction and open entity extraction, an open entity linking module for extracting entity sets based on open entity extraction, retrieving entity sets in the knowledge base to complete open entity linking, a relationship extraction module for reprocessing input text based on entity sets, and obtaining candidate relationship triples using rule-based triple extraction, a screening module for using a semantic embedding model to perform vector embedding of semantic space on input text and candidate relationship triples respectively, screening candidate triples according to semantic restoration degree, and determining relationship extraction results, and a fusion generation graph module for adding relationship extraction results to the entity set through a fusion strategy to fuse and generate a graph. The present invention is an open relationship extraction system that combines a general knowledge base, relationship extraction rules and semantic embedding technology. The system extracts entities and relationships by setting a series of relatively general grammatical rules, which significantly improves the recall rate of entity and relationship extraction. At the same time, based on the similarity filtering of general knowledge base matching and semantic embedding model, the system can greatly screen out knowledge triples with high semantic restoration, improve the extraction accuracy, and automatically generate knowledge graphs for specific fields by integrating rich knowledge base information.

[0037] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0039] Figure 1 A schematic diagram of a process for extracting structured knowledge from Chinese natural language according to an embodiment of the present invention;

[0040] Figure 2A flowchart of a method for extracting structured knowledge from Chinese natural language according to one embodiment of the present invention;

[0041] Figure 3 Schematic diagram of the structure of an apparatus for extracting structured knowledge from Chinese natural language according to one embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0043] The following describes a method and apparatus for extracting structured knowledge from Chinese natural language according to an embodiment of the present invention with reference to the accompanying drawings. First, the method for extracting structured knowledge from Chinese natural language according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0044] The following is a brief introduction to some terms in this field.

[0045] Sentence division: Divide an article into a sequence of sentences according to rules such as sentence-ending punctuation.

[0046] Word segmentation: The process of recombining a continuous sequence of words (for example, a sentence) into a word sequence according to certain specifications.

[0047] Part-of-speech tagging: Part of speech is the basic grammatical attribute of vocabulary. Part-of-speech tagging is the process of determining the grammatical category of each word in a given sentence, determining its part of speech and tagging it.

[0048] Dependency parsing: determining the syntactic structure of a sentence and the dependency relationships between words in a sentence.

[0049] Semantic role analysis: A shallow semantic analysis technique that labels certain phrases in a sentence as arguments (semantic roles) of a given predicate, such as agent or patient.

[0050] Triple: A constraint relationship consisting of three elements in sequence, often expressed as (element 1, element 2, element 3).

[0051] Knowledge (relationship) triples: triples representing relationships between entities, often expressed as (entity 1, relationship, entity 2).

[0052] Knowledge graph: A semantic network that reveals the relationships between entities. Knowledge is represented as the relationships between entities.

[0053] Entity: An object or thing that exists objectively in the real world and can be distinguished from each other.

[0054] Concept: A unified abstract representation of a certain type of object or set of things.

[0055] Instance: refers to a specific object or thing under a certain concept.

[0056] Mention: If an instance or concept appears in a text, the location where it appears is called a "mention".

[0057] Entity extraction: Identify the entities (instances or concepts) contained in a text and the text scope (mentions) in which they are located.

[0058] Entity linking: linking an entity name with the corresponding entity in the background knowledge base.

[0059] Relation extraction: The process of identifying relationships between entities from a text and generating relationship triples.

[0060] Knowledge fusion: Merge descriptive information about the same entity from different sources into a knowledge graph.

[0061] Semantic embedding model: A type of representation learning model commonly used in NLP that embeds natural language words and sentences into a relatively low-dimensional continuous numerical vector space. While representing words and sentences as numerical vectors, it also maximizes the semantic similarity between two words and sentences. The pre-trained BERT[6] model and its extensions are currently one of the best performing semantic embedding models.

[0062] XLore: A general knowledge graph that integrates Chinese and English Wikipedia and Baidu Encyclopedia, structuring encyclopedia knowledge and linking it across languages.

[0063] XLink: An instance extraction and linking system based on the general knowledge graph XLore, which can identify instances in user input text and link to the corresponding instances in XLore.

[0064] The requirements addressed by this invention can be formally defined as follows: the input is an unstructured, natural language Chinese text string T, which contains the entity information to be extracted and the semantic relationships between entities. The output is a set of knowledge triples P = {(s,v,o)|s∈T,v∈Sem(T),o∈T} and a knowledge graph KG = (C,I,R).

[0065] In P, s and o represent entities appearing in T, v represents the semantic relationship depicted in T, and Sem(T) represents the set of relational semantics described by the text T. A knowledge graph (KG) consists of a concept set C, an instance set I, and a relationship set R. C = {c|c = (Des, Sup), c.Sup∈C}, meaning that concept c in the knowledge graph KG contains the concept description c.Des and the superordinate concept c.Sup; I = {i|i = (Att, Des, Cls), i.Cls∈C}, meaning that instance i in the KG contains the instance attribute i.Att, the description i.Des, and the category i.Cls; and R = {(e1, v, e2)|e1∈I∪C, e2∈I∪C}, meaning the set of relationships between two entities (instances or concepts) in the KG. Generally speaking, the relationship between instances and concepts comes from the results of text extraction, that is, {(s,v,o)|((s,v,o)∈R)∨(s.Cls=o∧v=InstanceOf)∨(s.Sup=o∧v=SubClassOf)∨(o=s.Att[v])}=P.

[0066] In order to effectively meet the requirements of the above formal definition, this paper proposes a method for automatically extracting knowledge triples P and knowledge graphs KG. This method innovatively combines a general knowledge base, relationship extraction rules, and semantic embedding technology. It uses the general knowledge base to extract and link entities, uses rules to extract open triple relationships, and uses a semantic embedding model to screen relationships that have high semantic consistency with the original text. The complete technical process is as follows: Figure 1 shown.

[0067] Figure 2 FIG is a flow chart of a method for extracting structured knowledge from Chinese natural language according to an embodiment of the present invention. Figure 2 As shown, the method includes:

[0068] S1, extract candidate entities from the input text and score the candidate entities; the extraction of candidate entities includes knowledge base-based entity extraction and open entity extraction.

[0069] Specifically, candidate entities are extracted from the input text. This extraction process is divided into two parts: knowledge-based entity extraction (which simultaneously completes entity linking while extracting knowledge-based entities) and open entity extraction. Knowledge-based entity extraction uses the XLink system to match text with entities in the encyclopedia. The extracted results are always instances, each with a unique identifier (the result of entity linking). Open extraction results can be instances or concepts, awaiting entity linking in the next step.

[0070] It is understandable that, compared to the traditional entity extraction algorithm, the present invention uses both the open entity extraction algorithm and the knowledge base entity extraction technology in step S1, ensuring that it can provide accurate extraction results (i.e., the knowledge base entities that have completed entity links synchronously) and can provide new entities that are not covered by the knowledge base as much as possible (candidate entities obtained by rule-based open extraction). In addition, step S1 also scores the entities to ensure that entities with high confidence have higher priority in relationship extraction. This also indirectly improves the accuracy of relationship extraction.

[0071] Specifically, step S1 first uses the XLink system to extract instances (and mentions of instances in the text) from the input text T. The input information and output results required by the XLink system are shown in Table 1 below:

[0072] Table 1

[0073]

[0074]

[0075] Input information and output results of the XLink system

[0076] After obtaining all the mentions of XLink output instances in the text, we use a word segmentation tool to segment the text. Common word segmentation tools include Jieba and LTP. In order to make the subsequent grammar-based extraction more accurate, this patent hopes to ensure that the semantics of each word in the word segmentation results are as complete as possible. Since the entities extracted by XLink usually have relatively complete semantics, this patent uses the entities extracted by XLink to adjust the word segmentation results. The specific method is as follows:

[0077] (1) Enumerate the mentions m extracted from each XLink

[0078] (2) Locate the position of m in the text

[0079] (3) If m is exactly equal to the combination of two or more consecutive participles, these participles are merged into one word, otherwise skip

[0080] (4) Repeat the above steps until all mentions are enumerated

[0081] Since the results of XLinks do not overwrite each other, the result of this process is independent of the order of operations of the instances. The specific example is as follows:

[0082] Sentence: "The Forbidden City in Beijing is the imperial palace of the Ming and Qing dynasties in China. It was formerly known as the Purple Forbidden City and is located at the center of Beijing's central axis."

[0083] Before adjustment: ['Beijing Forbidden City', 'is', 'China', 'Ming and Qing Dynasties', ',', 'royal', 'palace', ',',

[0084] Formerly known as the Forbidden City, it is located in the center of Beijing's central axis.

[0085] XLink examples: "Imperial Palace", "Beijing Central Axis"

[0086] After adjustment: [The Forbidden City in Beijing is the imperial palace of the Ming and Qing dynasties in China. It was formerly known as the Forbidden City and is located at the center of Beijing's central axis.]

[0087] It's worth noting that if the word segmentation tool you're using allows for user-defined dictionaries (such as Jieba), then the above process can be simplified by inputting the XLink-extracted instances into the word segmentation tool as a custom dictionary, and then performing the dictionary-based word segmentation directly on the text. Experiments have shown that both approaches ensure good semantic integrity in the word segmentation results.

[0088] After obtaining the word segmentation results, the word segmentation results are subjected to part-of-speech tagging, grammatical analysis, and semantic role analysis, and open entities are extracted based on the analysis results. The specific extraction rules are shown in Table 2:

[0089] Table 2

[0090]

[0091] Open entity extraction rules

[0092] In order to better extract relationships in subsequent steps, each extracted entity is scored in step S1. There are many ways to design the scoring principle, the purpose of which is to sort the entities according to their extraction quality, increase the influence of good entities on the relationship extraction algorithm, and reduce the influence of bad entities on the relationship extraction algorithm.

[0093] The scoring principles used in the present invention are shown in Table 3:

[0094] Table 3

[0095] Extraction Source Fraction XLink 16 NER Tools 8 Part-of-speech tagging 2 Semantic Role Analysis 2 Syntax analysis 2

[0096] Entity scoring principles

[0097] This scoring design ensures that entities extracted from knowledge bases and NER tools are given high priority. For example, if an entity is not extracted by XLink or NER tools, but is extracted by part-of-speech tagging, semantic analysis, and grammatical analysis, it can only receive a maximum score of 6.

[0098] S2, based on the entity set extracted by open entity extraction, retrieves the entity set in the knowledge base to complete the open entity linking.

[0099] Specifically, for the entity set obtained through open extraction in step S1 (candidate entities obtained through open extraction based on rules), these entities are retrieved in the knowledge base. The retrieved entities will obtain unique identifiers and be marked as instances or concepts to complete entity linking. Entities that are not successfully linked will be specially marked and treated as new knowledge added to the input text.

[0100] It is understandable that after step S1, there are still many open entities that cannot be matched by XLink, such as entities extracted using rules. In order to make full use of the existing knowledge in the encyclopedia to enrich the extraction results, for each open entity, the entity name is searched in the knowledge base and a matching result is obtained.

[0101] Furthermore, the query results of the knowledge base include candidate concepts and candidate instances. Since concepts in the knowledge base are often more general and universal than instances, and their number is relatively small, this patent chooses to match candidate concepts first. That is, if there is a concept that is exactly the same as the open entity name, the open entity is marked as a concept in the knowledge base and assigned a unique identifier; if there is no candidate concept that meets the conditions, the candidate instance is matched and assigned a unique identifier for the instance. Specific examples are shown in Table 4:

[0102] Table 4

[0103]

[0104] Example of results of XLore knowledge base search matching instances and concepts

[0105] As can be seen from Table 4 above, for unassociated entities, using their general meaning is usually more suitable for most scenarios (for example, in most scenarios, "State Council" refers to a central government agency rather than an APP). Therefore, the priority matching concept is usually more stable.

[0106] The main function of step S2 of the present invention is to supplement the XLink results and make up for the defect that the XLink system cannot match concepts. Experiments show that step S2 can extract entities at the concept level, which can improve the integrity of the knowledge graph.

[0107] For those open entities that are neither associated by XLink nor retrieved in the XLore knowledge base (hereinafter referred to as e free ) marks it as an instance, and e free .Des="",e freeCls = "Unknown", and "Unknown"∈C; for the instances associated with the knowledge base, extract their attributes, descriptions, and categories from the knowledge base; for the concepts associated with the knowledge base, extract their descriptions and hierarchical relationships from the knowledge base. This step ultimately results in a concept set C and an instance set I.

[0108] Thus, through steps S1 and S2, the present invention can obtain three types of entities: entities obtained from the XLink knowledge base, entities obtained from the character search knowledge base, and open entities. These three types of entities enrich the dimensions of the entity set, allowing the knowledge extracted through the present invention to be easily integrated into the existing knowledge system and to add new knowledge to the existing knowledge system.

[0109] S3, reprocessing the input text based on the entity set, and obtaining candidate relationship triples using rule-based triple extraction.

[0110] Specifically, based on the entity priorities in the entity set obtained in step S2, the text is reprocessed using a series of natural language processing techniques, and a rule-based triple extraction method is used to obtain candidate relationship triples. To ensure high recall, relatively common grammatical rules are used to extract relationships. For example, in addition to (subject, predicate, object) relationships, prepositional objects and appositives are also considered.

[0111] It is understandable that the entity set obtained in step S2 can be used to extract relation triples from the input text T. The specific steps are as follows:

[0112] (1) Dereferencing this article

[0113] (2) Traverse each sentence s in the text and select the entities contained in the sentence s from the entity set

[0114] (3) Segment the sentence s

[0115] (4) Select an entity i from the entity set and adjust the word segmentation result of s to ensure that entity i is divided into a complete word

[0116] (5) In descending order of scores, select an entity j belonging to sentence s (make sure j is not equal to i)

[0117] (6) If entity j can be jointly represented by two or more words in the word segmentation result, it is merged into one word, otherwise j is skipped.

[0118] (7) Repeat (5)-(6) until all entities belonging to sentence s are traversed in descending order of score. At this time, the word segmentation results of s are used to extract the relationship related to entity i, and perform part-of-speech tagging, grammatical analysis, and semantic role analysis on it.

[0119] (8) Extract the relationship between entity i in sentence s according to a series of rules

[0120] (9) Repeat (4)-(8) to obtain all the relation triples in sentence s

[0121] (10) Repeat (2)-(9) to obtain the relation triples of the entire article

[0122] Among them, for the reference resolution task in step (1), the present invention adopts a Pytorch implementation of Kenton Lee's E2E-Coref model, which can realize the end-to-end Chinese reference resolution task. The input is an article with good word segmentation, and the output is a series of sets, each set of which contains word examples with the same reference. The original E2E-Coref model will calculate the reference relationship between all word examples, but in order to ensure accuracy, the present invention only chooses to replace the pronouns in the text with the front-position pronouns closest to their positions. For example: "The center of the inner court is the Qianqing Palace, Jiaotai Hall, and Kunning Palace, collectively known as the three palaces behind, which are the main palaces where the emperor and the empress live. Behind them is the imperial garden." In the paragraph, the pronoun "its" is replaced with its pronoun "the center of the inner court". The extraction rules for step (8) are shown in Table 5:

[0123] Table 5

[0124]

[0125] Relation triple extraction rules

[0126] Step (8) extracts the triplet relationship related to the entity, so the extraction rules only focus on the semantic relationship and grammatical structure related to the entity, that is, the entity is used as the subject of the triple to extract the relationship. The expansion rules in Table 5 are shown in Table 6:

[0127] Table 6

[0128]

[0129] V and O expansion rules

[0130] S4 uses the semantic embedding model to embed the input text and candidate relationship triples into vectors in the semantic space, selects the candidate triples according to the degree of semantic restoration, and determines the relationship extraction results.

[0131] Specifically, since the accuracy of the relationship extracted based on the rules in step S3 is low, in order to ensure its accuracy, the semantic embedding model is used to embed the original sentence and triples in the semantic space respectively, and the candidate triples are screened according to the semantic similarity between the two to determine the final relationship extraction result P.

[0132] The relation triples extracted in step S3 have problems such as incomplete semantic extraction, too high semantic level or too low semantic level. As shown in the following example:

[0133] The semantic level of the triple is too high, resulting in incomplete semantics:

[0134] "The increasingly serious epidemic situation in a certain place in recent days has aroused public concern."

[0135] Expected knowledge → (The increasingly serious epidemic situation in a certain place has aroused public concern)

[0136] Incomplete knowledge → (situation, trigger, concern)

[0137] The semantic level of the triple is too low, causing the semantics to deviate from the topic of the sentence:

[0138] "The three main halls are where the state holds grand ceremonies."

[0139] Expected knowledge → (The three main halls are where the country holds grand ceremonies)

[0140] Deviant knowledge → (country, holding, grand ceremony)

[0141] To ensure that the relationship triples can retain the semantics of the original text to the greatest extent possible, this patent sorts the relationship triples based on the degree of semantic restoration and selects the triples that reach a certain level of restoration as the final output. The specific steps are as follows:

[0142] (1) Enumerate each sentence s and construct the syntax tree of s based on the results of its grammatical dependency analysis

[0143] (2) Starting from the bottom of the syntax tree, repeat (3)-(5) until you backtrack to the root node

[0144] (3) Obtain the word vector of the semantic embedding of the words in this layer

[0145] (4) Multiply the word vectors of this layer by a decay parameter a

[0146] (5) Aggregate the word vector of this layer and the word vector of the parent node and calculate the average value as the word vector of the new parent node

[0147] (6) Take the average word vector of the root node as the semantic vector describing the sentence s

[0148] (7) Enumerate each relation triple i belonging to sentence s: (s, v, o)

[0149] (8) Aggregate and average the semantic word vectors of s, v, and o to obtain the semantic description vector of triple i

[0150] (9) Calculate the similarity between the semantic vector of triple i and the semantic vector of sentence s as the restoration degree of triple i

[0151] (10) After all calculations are completed, sort all triples by degree of restoration and take the triples with the highest order as the final result.

[0152] Specific examples are shown in Table 7. The attenuation parameters are set as follows: the attenuation parameters of the modification relations (ATT, ADV), the complement relations (CMP), and the addition relations (RAD, LAD) are set to 0.5, and the attenuation parameters of the other relations (subject-predicate relations, verb-object relations, preposition-object relations, parallel relations, etc.) are set to 1.0.

[0153] As shown in Table 7 below, the present invention can well characterize the semantic restoration of triples. For example, the present invention considers the triple (three major halls, is, place) to be superior to the triple (country, held, grand ceremony) because this sentence itself describes and introduces the three major halls. Meanwhile, (three major halls, is, the place where the grand ceremony was held) is intuitively superior, and the similarity value also complies with this intuition.

[0154] Table 7

[0155]

[0156] Example of relation triple reduction

[0157] Therefore, based on the two viewpoints that "the low recall rate is caused by the variability of language structure" and "the low accuracy rate is due to the semantic errors and incompleteness of triples", the present invention innovatively proposes to improve the recall rate of triples at the grammatical level through step S3, and to improve the accuracy rate of triples at the semantic level through step S4, thereby alleviating the contradiction between accuracy and recall rate in many traditional methods.

[0158] S5, the relationship extraction results are added to the entity set through the fusion strategy to generate a fusion graph.

[0159] Specifically, all relations extracted in step S4 are added to the entity set from step S2. If both the head and tail of a triple are in the entity set, it is stored as a relation in the knowledge graph. If only the subject of a triple is in the entity set, it is stored as an entity attribute in the knowledge graph. This step allows newly extracted knowledge to be naturally incorporated into the existing knowledge system without affecting the original knowledge system's expression.

[0160] It is understood that step S4 of the present invention generates a set of relationship triples P, ensuring that the header s in each relationship is included in the entity set obtained in step S2. In this step, these relationship triples are appropriately merged into the entity set generated in step S2. The specific fusion strategy is shown in Table 8.

[0161] The knowledge integration in step S5 does not tamper with or affect any existing knowledge system. Instead, it simply adds new knowledge that is compatible with the original knowledge system (I, C, R), ensuring the relative stability of the original knowledge system. For example, if the new knowledge contains a relationship between an instance and a concept, instead of directly adding the relationship, a new instance of the concept with the same name is created. Only the triple is added as an "instance-instance" relationship between the instance and the new instance. This prevents other instances of the concept from being affected by the relationship.

[0162] Table 8

[0163]

[0164] Knowledge graph fusion strategy

[0165] In summary, this paper proposes a method for extracting knowledge triples from Chinese natural language and constructing a graph. This method innovatively combines a general knowledge base, relationship extraction rules, and semantic embedding technology to extract knowledge through five steps: entity extraction, entity linking, relationship extraction, relationship filtering, and graph fusion. This method demonstrates excellent performance in extracting knowledge and constructing graphs from corpora across diverse domains.

[0166] According to an embodiment of the present invention, a method for extracting structured knowledge from Chinese natural language is proposed. The method extracts candidate entities from input text and scores the candidate entities. Based on open entity extraction, the extracted entity set is extracted. The entity set is retrieved in the knowledge base to complete the open entity link. Based on the entity set, the input text is reprocessed using rule-based triple extraction to obtain candidate relationship triples. The input text and the candidate relationship triples are respectively embedded in the semantic space using a semantic embedding model. The candidate triples are screened according to the semantic restoration degree, and the relationship extraction results are determined. The relationship extraction results are added to the entity set through a fusion strategy to generate a fusion graph. The present invention is an open relationship extraction system that combines a general knowledge base, relationship extraction rules and semantic embedding technology. The system extracts entities and relationships by setting a series of relatively common grammatical rules, significantly improving the recall rate of entity and relationship extraction. At the same time, based on the general knowledge base matching and similarity filtering of the semantic embedding model, the system can greatly screen out knowledge triples with high semantic restoration degree, improve the extraction accuracy, and automatically generate a knowledge graph for a specific field by fusing rich knowledge base information.

[0167] Next, a device for extracting structured knowledge from Chinese natural language according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0168] Figure 3 It is a schematic diagram of the structure of extracting structured knowledge from Chinese natural language according to an embodiment of the present invention.

[0169] like Figure 3 As shown, the device 10 includes:

[0170] The entity extraction module 100 is used to extract candidate entities from the input text and score the candidate entities; wherein the extraction of candidate entities includes knowledge base-based entity extraction and open entity extraction;

[0171] An open entity linking module 200 is configured to retrieve entity sets from a knowledge base based on the entity sets extracted by the open entity extraction to complete the open entity linking;

[0172] The relation extraction module 300 is used to process the input text based on the entity set and obtain candidate relation triples using rule-based triple extraction;

[0173] The screening module 400 is used to use the semantic embedding model to perform vector embedding of the input text and the candidate relationship triples in the semantic space, screen the candidate triples according to the semantic restoration degree, and determine the relationship extraction result;

[0174] The fusion graph generation module 500 is used to add the relationship extraction results to the entity set through the fusion strategy to fuse and generate a graph.

[0175] Furthermore, the entity extraction module is also used to:

[0176] Use the word segmentation tool to segment the input text, and adjust the word segmentation results to obtain adjusted word segmentation results;

[0177] Analyze the adjusted word segmentation results to obtain analysis results, and extract open entities based on the analysis results;

[0178] The extracted knowledge base-based entities and open entities are scored according to the scoring principles, and are sorted according to the quality of the extracted entities.

[0179] Furthermore, the open entity linking module is further used to:

[0180] For open entities, the name of the open entity is searched in the knowledge base and matching results are obtained; wherein the matching results include candidate concepts and candidate instances;

[0181] First match the candidate concepts. If there is a candidate concept with the same name as any open entity, mark any open entity as a concept in the knowledge base and assign a unique identifier. If there is no candidate concept that meets the conditions, match the candidate instance and assign a unique identifier to the candidate instance.

[0182] Furthermore, the above relationship extraction module is also used to:

[0183] Based on the priorities of entities in the entity set, the input text is reprocessed using multiple natural language processing methods, and rule-based triple extraction is adopted to obtain candidate relationship triples.

[0184] It should be noted that the above explanations of the embodiment of the method for extracting structured knowledge from Chinese natural language are also applicable to the device for extracting structured knowledge from Chinese natural language in this embodiment, and will not be repeated here.

[0185] According to an embodiment of the present invention, a device for extracting structured knowledge from Chinese natural language is proposed. The entity extraction module is used to extract candidate entities from the input text and score the candidate entities. The extraction of candidate entities includes knowledge base-based entity extraction and open entity extraction. The open entity linking module is used to extract entity sets based on open entity extraction, retrieve entity sets in the knowledge base to complete open entity linking, and reprocess the input text based on the entity set. The rule-based triple extraction is used to obtain candidate relationship triples. The screening module is used to use a semantic embedding model to perform vector embedding in the semantic space for the input text and the candidate relationship triples, screen the candidate triples according to the semantic restoration degree, and determine the relationship extraction results. The fusion generation graph module is used to add the relationship extraction results to the entity set through a fusion strategy to fuse and generate a graph. The present invention is an open relationship extraction system that combines a general knowledge base, relationship extraction rules and semantic embedding technology. The system extracts entities and relationships by setting a series of relatively general grammatical rules, which significantly improves the recall rate of entity and relationship extraction. At the same time, based on the similarity filtering of general knowledge base matching and semantic embedding model, the system can greatly screen out knowledge triples with high semantic restoration, improve the extraction accuracy, and automatically generate knowledge graphs for specific fields by integrating rich knowledge base information.

[0186] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0187] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0188] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for extracting structured knowledge from Chinese natural language, characterized in that: The following steps are involved: Extracting candidate entities from the input text and scoring the candidate entities; wherein the extraction of the candidate entities includes knowledge base-based entity extraction and open entity extraction; Extracting an entity set extracted based on the open entity extraction, and retrieving the entity set in a knowledge base to complete open entity linking; Reprocessing the input text based on the entity set and extracting triples based on rules to obtain candidate relationship triples; Using a semantic embedding model to perform vector embedding of the input text and the candidate relationship triples in the semantic space, screening the candidate relationship triples according to the degree of semantic restoration, and determining the relationship extraction result; Adding the relationship extraction results to the entity set through a fusion strategy to fuse and generate a graph; The method of using the semantic embedding model to perform semantic space vector embedding on the input text and the candidate relationship triples, screening the candidate relationship triples according to the semantic restoration degree, and determining the relationship extraction result includes: The candidate relationship triples are sorted based on the semantic restoration degree, and triples whose semantic restoration degree reaches a preset threshold level are selected as output to characterize the semantic restoration degree of the candidate relationship triples.

2. The method for extracting structured knowledge from Chinese natural language according to claim 1, characterized in that: The step of extracting candidate entities from the input text and scoring the candidate entities includes: Using a word segmentation tool to segment the input text, and adjusting the word segmentation result to obtain an adjusted word segmentation result; Analyzing the adjusted word segmentation results to obtain analysis results, and extracting open entities based on the analysis results; The extracted knowledge base-based entities and the open entities are scored according to a scoring principle, and are sorted according to the quality of the extracted entities.

3. The method for extracting structured knowledge from Chinese natural language according to claim 1, characterized in that: Extracting an entity set based on the open entity extraction, and retrieving the entity set in a knowledge base to complete open entity linking, comprises: For an open entity, query the name of the open entity in the knowledge base and obtain a matching result; wherein the matching result includes a candidate concept and a candidate instance; First match the candidate concepts. If there is a candidate concept that is consistent with the name of any open entity, mark the any open entity as a concept in the knowledge base and assign a unique identifier. If there is no candidate concept that meets the conditions, match the candidate instance and assign a unique identifier to the candidate instance.

4. The method for extracting structured knowledge from Chinese natural language according to claim 1, characterized in that: The step of reprocessing the input text based on the entity set and extracting triples based on rules to obtain candidate relationship triples includes: Based on the priorities of the entities in the entity set, the input text is reprocessed using multiple natural language processing methods, and rule-based triple extraction is adopted to obtain candidate relationship triples.

5. The method for extracting structured knowledge from Chinese natural language according to claim 1, characterized in that: The step of adding the relationship extraction result to the entity set through a fusion strategy to generate a fusion graph includes: The relationship extraction result is added to the entity set. If the head and tail of the triple are both in the entity set, the triple with both the head and tail in the entity set is stored as a relationship in the knowledge graph. If only the subject of the triple is in the entity set, the triple with only the subject in the entity set is stored as an entity attribute in the knowledge graph.

6. A device for extracting structured knowledge from Chinese natural language, characterized in that: include: An entity extraction module is used to extract candidate entities from the input text and score the candidate entities; wherein the extraction of the candidate entities includes knowledge base-based entity extraction and open entity extraction; an open entity linking module for extracting an entity set extracted based on the open entity extraction, and retrieving the entity set in a knowledge base to complete the open entity linking; a relation extraction module, configured to reprocess the input text based on the entity set and extract triples based on rules to obtain candidate relation triples; A screening module is used to use a semantic embedding model to perform vector embedding of the input text and the candidate relationship triples in the semantic space, screen the candidate relationship triples according to the degree of semantic restoration, and determine the relationship extraction result; A fusion graph generation module, configured to add the relationship extraction results to the entity set to fuse and generate a graph; The screening module is also used to: sort the candidate relationship triples based on the semantic restoration degree, and select triples whose semantic restoration degree reaches a preset threshold level as output to characterize the semantic restoration degree of the candidate relationship triples.

7. The device for extracting structured knowledge from Chinese natural language according to claim 6, characterized in that: The entity extraction module is further used to: Using a word segmentation tool to segment the input text, and adjusting the word segmentation result to obtain an adjusted word segmentation result; Analyzing the adjusted word segmentation results to obtain analysis results, and extracting open entities based on the analysis results; The extracted knowledge base-based entities and the open entities are scored according to a scoring principle, and are sorted according to the quality of the extracted entities.

8. The device for extracting structured knowledge from Chinese natural language according to claim 6, characterized in that: The open entity linking module is further used to: For an open entity, query the name of the open entity in the knowledge base and obtain a matching result; wherein the matching result includes a candidate concept and a candidate instance; First match the candidate concepts. If there is a candidate concept that is consistent with the name of any open entity, mark the any open entity as a concept in the knowledge base and assign a unique identifier. If there is no candidate concept that meets the conditions, match the candidate instance and assign a unique identifier to the candidate instance.

9. The device for extracting structured knowledge from Chinese natural language according to claim 6, characterized in that: The relationship extraction module is further used to: Based on the priorities of the entities in the entity set, the input text is reprocessed using multiple natural language processing methods, and rule-based triple extraction is adopted to obtain candidate relationship triples.

Citation Information

Patent Citations

  • Entity linking method and device, equipment and storage medium

    CN111523326A

  • Text processing method and device

    CN112784590A