A knowledge extraction method, system, device and storage medium
By annotating and indexing the text corpus, building annotation corpus, setting seed data, calculating the weighting value and verification of verb phrases, the problems of poor universality and low recall in large-scale text data are solved, and high-quality knowledge extraction is achieved.
Patent Information
- Application Number
- CN202210609563.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-05-31
AI Technical Summary
When the prior art extracts knowledge in large-scale text data, there are problems such as poor universality, low recall, and low quality of the obtained knowledge examples.
By annotating and indexing the text corpus, building annotation corpus, setting seed data, determining the distance between sentence search words and grammar parsing tree, calculating the weighted values of verb phrases, selecting K target verb phrases for searching and verification, and summarizing them into knowledge extraction content.
It realizes high-quality knowledge extraction, improves recall and versatility, and can effectively obtain high-quality knowledge examples in large-scale text data.
Smart Images

Figure CN114840632B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a knowledge extraction method, system, device and storage medium. Background Art
[0002] With the development of big data, machine learning, and artificial intelligence in various application fields, information extraction technology has rapidly advanced. Knowledge extraction and knowledge graph construction technologies based on semi-structured data have been widely applied in search, recommendation, data analysis, natural language processing, image recognition, and other fields, and have achieved remarkable success. However, traditional knowledge extraction technologies for semi-structured data are unable to handle the massive amount of unstructured text data in big data environments, resulting in a significant waste of resources, restricting the further development of knowledge graphs, and negatively impacting the effectiveness of downstream tasks. Therefore, the task of knowledge extraction—the large-scale extraction of structured knowledge containing semantic information—has become a key research direction for many institutions in the industry.
[0003] The Max Planck Institute in Germany has proposed a graph-based pattern recognition technology that uses a label propagation algorithm to address semantic drift in small-scale text data. They have also proposed a tree-based pattern recognition technology that has been successfully applied to large-scale text data, enabling the extraction of multivariate relational knowledge in the medical field. Microsoft has constructed a complex knowledge instance evaluation framework using simple string patterns such as "including" to extract relational knowledge instances from massive amounts of text and apply it to search engines. Furthermore, several institutions have proposed various extraction methods based on remote supervision and statistically-based self-assessment of pattern quality, which can address the issue of excessive human involvement.
[0004] In general, pattern recognition technology, also known as pattern extraction technology, is a key technology for successfully solving knowledge extraction tasks. However, current knowledge extraction technologies based on pattern recognition for large-scale text data still suffer from problems such as poor versatility, low recall rate, and low-quality knowledge instances.
[0005] In summary, how to effectively extract knowledge to avoid poor universality, low recall rate, and low quality of knowledge instances is a technical problem that technicians in this field urgently need to solve. Summary of the Invention
[0006] The purpose of the present invention is to provide a knowledge extraction method, system, device and storage medium to effectively extract knowledge and avoid the situation where the generality is poor, the recall rate is low, and the quality of the knowledge instances obtained is not high.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] A knowledge extraction method, comprising:
[0009] Identify the text corpus;
[0010] Annotating the text corpus and constructing an index to obtain an annotated corpus;
[0011] Setting seed data for representing relationship information, and retrieving sentences including search terms in the seed data from the annotated corpus;
[0012] For any sentence, determine the search term distance of the sentence, and determine the parse tree distance of the search term of the sentence through the parse tree of the sentence, and find the verb phrase closest to each entity in the sentence and determine the parse tree distance of each verb phrase;
[0013] For any sentence, based on the determined distances of the sentence, determine the weighted values of the verb phrases in the sentence according to a preset weighting rule;
[0014] According to the weighted values of the verb phrases in each of the sentences, K verb phrases with the highest sum of weighted values are obtained by summing up, and the K target verb phrases are selected; K is a positive integer;
[0015] For any one of the target verb phrases, retrieve each sentence including the target verb phrase from the annotated corpus and verify it according to preset rules;
[0016] The sentences that have passed the verification are summarized into knowledge extraction content corresponding to the seed data.
[0017] Preferably, the tagging of the text corpus includes:
[0018] Entity annotation of text corpora to link text to entities;
[0019] Coreference resolution is performed on the text corpus to link pronouns in the text to their original nouns.
[0020] Preferably, the entity tagging of the text corpus includes:
[0021] Entity annotation is performed on the text corpus using entity recognition tools.
[0022] Preferably, performing coreference resolution on the text corpus includes:
[0023] Coreference resolution is performed on the text corpus using natural semantic processing tools.
[0024] Preferably, it also includes:
[0025] Based on the results of entity tagging and the results of coreference resolution, when any pronoun points to an unambiguous noun object, the pronoun is linked to the entity.
[0026] Preferably, before annotating the text corpus, the following steps are further included:
[0027] Data cleaning is performed on the text corpus to eliminate irrelevant information.
[0028] Preferably, finding the verb phrase closest to each entity in the sentence includes:
[0029] By using the nearest neighbor method, for each entity in the sentence, a verb phrase closest to the entity is found.
[0030] Preferably, for any sentence, based on the determined distances of the sentence, the weighted values of the verb phrases in the sentence are determined according to a preset weighting rule, including:
[0031] For any verb phrase determined in any sentence, summing the weighted value corresponding to the sentence's search term distance, the weighted value corresponding to the sentence's search term's grammatical parse tree distance, and the weighted value corresponding to the grammatical parse tree distance of the verb phrase to obtain a weighted value of the verb phrase;
[0032] Among them, the search term distance of a sentence is negatively correlated with the weighted value corresponding to the search term distance of the sentence, the grammatical parse tree distance of the search term of a sentence is negatively correlated with the weighted value corresponding to the grammatical parse tree distance of the search term of the sentence, and the grammatical parse tree distance of a verb phrase is negatively correlated with the weighted value corresponding to the grammatical parse tree distance of the verb phrase.
[0033] Preferably, after obtaining the sum of the weighted values of each verb phrase by summarizing, the method further includes:
[0034] For any one verb phrase, determining the frequency of occurrence of the verb phrase in each sentence retrieved from the annotated corpus and including the search term in the seed data, and determining a frequency score of the verb phrase based on the frequency of occurrence, and adding the sum of the frequency score and the weighted value of the verb phrase to obtain a final score of the verb phrase;
[0035] Accordingly, the K verb phrases with the highest sum of weighted values obtained by summing up are selected as the K target verb phrases, including:
[0036] The K verb phrases with the highest final scores are selected as the K target verb phrases.
[0037] Preferably, for any verb phrase determined in any sentence, the weighted value corresponding to the sentence's search term distance is determined by function f1, the weighted value corresponding to the sentence's search term parse tree distance is determined by function f2, and the weighted value corresponding to the parse tree distance of the verb phrase is determined by function f3;
[0038] Furthermore, function f1 is a function whose function value changes linearly based on the search term distance of the sentence, and both function f2 and function f3 are functions whose function values change exponentially based on the corresponding distance.
[0039] Preferably, the function f1 is set to f1=1-ax1, where a is a set coefficient and x1 is the search term distance of the sentence;
[0040] Function f2 is set to f2 = 1 / (W1*e x2 ), where W1 is the set coefficient and x2 is the parse tree distance of the search term in the sentence;
[0041] Function f3 is set to f3 = 1 / (W2*e x3 ), where W2 is the set coefficient and x3 is the parse tree distance of the verb phrase.
[0042] Preferably, the verification according to preset rules includes:
[0043] For any sentence to be verified, find the noun closest to the target verb phrase in the sentence through the grammatical parse tree of the sentence, and use it as the first noun;
[0044] Finding a verb closest to the first noun in the sentence, and determining whether the found verb is consistent with the target verb;
[0045] If so, the sentence to be verified passes the verification; otherwise, it fails the verification.
[0046] A knowledge extraction system, comprising:
[0047] A text corpus determination module, used for determining a text corpus;
[0048] a marked corpus determination module, configured to mark the text corpus and construct an index to obtain a marked corpus;
[0049] A retrieval module, configured to set seed data for representing relationship information, and retrieve from the annotated corpus individual sentences that include the search terms in the seed data;
[0050] a distance calculation module for determining, for any sentence, a search term distance of the sentence, and determining a parse tree distance of the search term of the sentence using a parse tree of the sentence, and for each entity in the sentence, finding a verb phrase closest to the entity, and determining a parse tree distance of each verb phrase;
[0051] A weighted value calculation module is used to determine, for any sentence, based on the determined distances of the sentence and in accordance with a preset weighting rule, the weighted values of the verb phrases in the sentence;
[0052] a target verb phrase determination module, configured to obtain K verb phrases with the highest sum of weighted values according to the weighted values of the verb phrases in each sentence, and select the K target verb phrases; K is a positive integer;
[0053] A verification module, configured to retrieve, for any one of the target verb phrases, sentences containing the target verb phrase from the annotated corpus and verify the sentences according to preset rules;
[0054] The knowledge extraction content determination module is used to summarize the sentences that have passed the verification into the knowledge extraction content corresponding to the seed data.
[0055] A knowledge extraction device, comprising:
[0056] Memory for storing computer programs;
[0057] A processor is used to execute the computer program to implement the steps of the knowledge extraction method as described above.
[0058] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the knowledge extraction method described above.
[0059] By applying the technical solution provided by the embodiment of the present invention, based on pattern recognition technology, high-quality knowledge extraction can be performed on large-scale text data. Specifically, the text corpus is annotated and indexed. After obtaining the annotated corpus, seed data for representing relationship information can be set, and each sentence including the search terms in the seed data can be retrieved from the annotated corpus. Afterwards, for any sentence, this application will determine the distances of the sentence. It can be understood that the search term distance of the sentence and the grammatical parse tree distance of the search terms of the sentence can effectively reflect the quality of the sentence, and the grammatical parse tree distance of the verb phrase can reflect the degree of connection between the verb phrase and the search terms in the seed data. Therefore, after summarizing the weighted values, the selected K target verb phrases can effectively reflect the characteristics of the seed data search terms. That is, according to the K target verb phrases, each sentence including the target verb phrase is retrieved from the annotated corpus, which is high-quality knowledge extraction content. And because the sentence verification is performed according to the preset rules, it is beneficial to further ensure the quality of the extracted knowledge content. Furthermore, the solution of the present application uses K target verb phrases as the search objects, so a large number of sentences containing the target verb phrases can be retrieved from the annotated corpus, resulting in a high recall rate for the solution of the present application. In addition, the solution of the present application does not limit the content of the text corpus, nor does it limit the search terms in the seed data. Therefore, the solution of the present application can be used for knowledge extraction in various fields and is highly versatile.
[0060] In summary, the solution of this application can effectively extract knowledge, and has high versatility and recall rate, and can obtain high-quality knowledge extraction content. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0062] Figure 1 This is a flow chart of an implementation of a knowledge extraction method in the present invention;
[0063] Figure 2 A schematic diagram of a process for obtaining an annotated corpus in a specific embodiment of the present invention;
[0064] Figure 3 A schematic diagram of the structure of a syntax tree in a specific embodiment of the present invention;
[0065] Figure 4A schematic diagram of the structure of a knowledge extraction system in the present invention;
[0066] Figure 5 This is a schematic diagram of the structure of a knowledge extraction device in the present invention;
[0067] Figure 6 Schematic diagram of the application environment of a knowledge extraction method in the present invention. DETAILED DESCRIPTION
[0068] The core of the present invention is to provide a knowledge extraction method that can effectively extract knowledge, has high versatility and high recall rate, and can obtain high-quality knowledge extraction content.
[0069] In order to enable those skilled in the art to better understand the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0070] Please refer to Figure 1 , Figure 1 The following is a flow chart of an implementation of a knowledge extraction method in the present invention. The knowledge extraction method may include the following steps:
[0071] Step S101: determining a text corpus;
[0072] The solution of the present application is highly versatile, and the specific content of the text corpus can be determined according to actual conditions. For example, it can be a text corpus in the fields of medicine, geography, science, finance, culture, etc., or it can be a text corpus that contains knowledge from multiple aspects at the same time.
[0073] In order to ensure the accuracy of the extracted knowledge, the content of the text corpus should be relatively accurate text content. For example, in a specific embodiment of the present invention, considering that news content is relatively accurate and there is a large amount of information on the Internet, among which the information on encyclopedia websites is relatively accurate, the text corpus can be a text corpus determined through news files and / or Internet encyclopedia data.
[0074] Step S102: annotate the text corpus and construct an index to obtain an annotated corpus.
[0075] Annotating text corpora helps eliminate ambiguity and helps computers understand text content.
[0076] By constructing an index, efficient search results can be obtained when performing searches in subsequent steps. There are various specific methods, for example, an inverted index can be implemented using a HashMap. Furthermore, in practical applications, considering the search methods in subsequent steps, a verb index, a noun index, and an entity index can typically be constructed when constructing an index. Of course, in other situations, more detailed index construction methods may be employed without affecting the implementation of the present invention.
[0077] In a specific embodiment of the present invention, the specific process of obtaining the annotated corpus can be found in Figure 2 .
[0078] Step S21: Clean the text corpus to eliminate irrelevant information.
[0079] Step S22: performing entity annotation on the text corpus to link the text to the entity;
[0080] Step S23: performing coreference resolution on the text corpus to link the pronouns in the text to their original nouns.
[0081] Step S24: Based on the results of entity tagging and coreference resolution, when any pronoun points to an unambiguous noun object, the pronoun is linked to the entity.
[0082] Step S25: Build an index to obtain annotated corpus.
[0083] Specifically, in this implementation, before the text corpus is annotated, data cleaning is performed on the text corpus to eliminate irrelevant information, which is beneficial to further improve the accuracy of the knowledge extracted subsequently.
[0084] When setting up specific data cleaning methods, developers can typically develop programs based on the data types, data features, and data sources of the text corpus to effectively eliminate irrelevant information. For example, if some of the data in the text corpus comes from web pages, developers can choose to use tools such as JAVA to clean the text data, removing irrelevant information such as web links, tables, and advertisements.
[0085] Figure 2 In the implementation of the present invention, entity annotation is performed on the text corpus to link the text to entities, which can effectively eliminate text ambiguity. Linking text to entities, also known as entity linking, is to identify words representing entities in text data and link them to entities in content such as knowledge graphs. For example, if the text word is "apple", the text can be linked to the entity Apple Inc. instead of Apple mobile phone or apple (fruit).
[0086] Furthermore, in a specific embodiment of the present invention, considering that entity labeling using an entity recognition tool can effectively improve efficiency and reduce manual participation, step S22 can be specifically: labeling the text corpus with entities using the entity recognition tool. Of course, there are many options for the specific entity recognition tool. For example, in one scenario, the open source toolkit Dexter can be used as the entity recognition tool of this application.
[0087] Figure 2 In addition to entity annotation, the text corpus also undergoes coreference resolution to link pronouns in the text to their original nouns. This helps resolve ambiguity and aids computer understanding of the text. Coreference resolution, or co-reference, involves identifying pronouns in text (e.g., he) and linking them to their original nouns (e.g., Zhang San).
[0088] Furthermore, in a specific embodiment of the present invention, considering that coreference resolution using a natural semantic processing tool can effectively improve efficiency and reduce manual intervention, step S23 can be specifically: coreference resolution of the text corpus can be performed using a natural semantic processing tool. Of course, there are many options for specific natural semantic processing tools. For example, in one scenario, Stanford's CoreNLP 2.0 toolkit can be used as the natural semantic processing tool of this application.
[0089] Figure 2 In this implementation, we not only perform entity tagging and coreference resolution to eliminate ambiguity, but also consider that in real applications, a large amount of text data may contain both entities to be tagged and noun reference issues. For example, in the sentence "Pitt met Friends actress Jennifer Anniston and he married her in 2005," the entity to be tagged, Pitt, and the pronouns "he" and "her" appear simultaneously. Figure 2 In the implementation method, a heuristic rule is set, that is, based on the results after entity labeling and the results after coreference resolution, when any pronoun points to an unambiguous noun object, the pronoun is linked to the entity.
[0090] Taking this sentence as an example, the pronoun he points to the noun Pitt (for example, through the natural semantic processing tool CoreNLP2.0 toolkit), and Pitt is linked to the entity "Brad Pitt" (through the entity recognition tool Dexter). Based on the results of entity annotation and coreference resolution, the pronoun he can be further linked to the entity "Brad Pitt". This joint annotation method can effectively increase the scope of the annotated data, and when subsequent related sentences are retrieved, the number of searches can be effectively increased, which further improves the accuracy and coverage of knowledge extraction in this application solution.
[0091] Step S103: setting seed data for representing the relationship information, and retrieving sentences including the search terms in the seed data from the annotated corpus.
[0092] Seed data can be pre-given by the user / developer to represent relationship information, that is, to represent a specific relationship. For example, the seed data of (Bill Gates, Melinda, Spouse) or (Brad Pitt, Angelina Julie, Spouse) both express the relationship (A, B, husband and wife). In the solution of this application, only a small amount of seeds is required to achieve high-quality knowledge extraction.
[0093] After setting the seed data, you can retrieve individual sentences that include the search terms in the seed data from the annotated corpus. It should be noted that in actual applications, when performing knowledge extraction, you can use one or more seed data. For each seed data, you can execute the solution of this application separately, and finally summarize the knowledge content corresponding to each seed data.
[0094] The seed data may contain one or more search terms, and the retrieved sentences must carry each search term in the seed data. Furthermore, in practical applications, seed data typically includes two nouns as search terms. If three or more search terms are required, it can usually be split into multiple seeds for knowledge extraction.
[0095] For example, Figure 3In the embodiment, the seed data is set to (Brad Pitt, Jennifer Aniston, Spouse), and one sentence retrieved from the annotated corpus that includes the search terms in the seed data is Pitt met Friends actress Jennifer Anniston in 1998 and married her in a private wedding ceremony in Malibu on July 29, 2000.
[0096] Step S104: For any sentence, determine the search term distance of the sentence, and determine the grammatical parse tree distance of the search term of the sentence through the grammatical parse tree of the sentence, and find the verb phrase closest to the entity for each entity in the sentence, and determine the grammatical parse tree distance of each verb phrase.
[0097] The search term distance of a sentence refers to the distance between the search terms in the sentence, i.e. token-distance. Figure 3 For example, there are three words between the search term Pitt (linked to the entity "Brad Pitt") and the search term Jennifer Aniston: met Friends actress. In this example, the search term distance of the sentence is 3.
[0098] In addition, as described above, the seed data usually includes two nouns as search terms. When the staff sets the seed data to contain one search term or two or more search terms, the distances of step S104 can be adaptively processed according to the actual situation. For example, when there is only one search term, the search term distance of the sentence and the grammatical parse tree distance of the search term are discarded, that is, the search term distance of the sentence and the grammatical parse tree distance of the search term are both regarded as 0. When there are more than two search terms, the search term distance of the sentence and the grammatical parse tree distance of the search term can be determined based on the two most recent search terms. Of course, as described above, in actual applications, when three or more search terms are needed, the solution usually chosen is to split it into multiple seeds for separate knowledge extraction, that is, to split it into multiple seed data, each seed data only including two search terms.
[0099] A parse tree is a tree structure that represents the dependencies between words. Leaf nodes are elements in a sentence, and non-leaf nodes are parts of speech for words or phrases. For example, you can use CoreNLP to generate a parse tree for a sentence.
[0100] Figure 3In the example, ROOT stands for root directory, and S stands for source, which refers to the source of each word in the sentence. NP (Noun Phrase), VP (Verb Phrase), NNP (Proper Noun singular), NNPS (Proper Noun plural), VBD (Verb Past Tense), NN (Noun), CC (Coordinating Conjunction), PP (Preposition Phrase), PRP (Personal Pronoun), IN (Preposition or Subordinating Conjunction), DT (Determiner, such as the, some, my, etc.), JJ (Adjective), and CD (Cardinal Number).
[0101] The parse tree distance of the search term, that is, the noun phrase tree-based distance. Figure 3 In the example, the seed data is (Brad Pitt, Jennifer Anision, Spouse). When determining the parse tree distance of the search term, the common ancestor of Pitt and Jennifer Anision on the parse tree is S, that is, Pitt-NNP-NP-S, JenniferAnision-NNP-NP-NP-VP-VP-S, that is, the parse tree distance of the search term is 3+6=9.
[0102] In this application, we also need to find the verb phrase closest to each entity in the sentence and determine the parse tree distance of each verb phrase, namely the verb phrase tree-based distance. This helps to effectively analyze the dependency relationship between verbs and nouns and discover verb phrases with directional meaning, such as the relationship between "married" and "marriage" and the relationship between "transfer to club" and "playing football."
[0103] In practical applications, the nearest neighbor method can be used to conveniently and quickly find the verb phrase closest to each entity in a sentence.
[0104] Still Figure 3For example, Jennifer Anision is an entity with two verbs next to it, met and married. The parse tree distance between Jennifer Anision and met is 6, and the parse tree distance between Jennifer Anision and married is 8. Therefore, the verb phrase closest to the entity Jennifer Anision is met, and the parse tree distance of the verb phrase met is 6.
[0105] In addition, in actual applications, when an entity is closest to multiple verb phrases and the distances are the same, these verb phrases can be regarded as the verb phrases closest to the entity, and the grammatical parse tree distance of each verb phrase can be determined. These verb phrases can also be directly discarded. The setting can be made according to actual needs, and it does not affect the implementation of the present invention.
[0106] It should also be noted that in the solution of the present application, the verb phrase can be composed of a single verb, such as met and married in the above text, or it can be composed of multiple words, such as transfer into club in the above text, and the verb phrase library can be pre-set by the staff.
[0107] Step S105: for any sentence, based on the determined distances of the sentence, determine the weighted values of the verb phrases in the sentence according to a preset weighting rule.
[0108] For any sentence, it is necessary to determine the weighted value of each verb phrase in the sentence based on the determined search term distance of the sentence, the grammatical parse tree distance of the search term of the sentence, and the grammatical parse tree distance of each verb phrase in the sentence, according to the preset weight rules.
[0109] The specific content of the preset weight rule can be set as needed. For example, a simple solution is to determine the weight value corresponding to each distance, and then perform linear superposition as the weight value of the verb phrase in the sentence. Taking the verb phrase met determined in the above example as an example, the weight value of the verb phrase met in the sentence = f1(3)+f2(9)+f3(6). Among them, 3 is the search term distance of the sentence, 9 is the grammatical parse tree distance of the search term, and 6 is the grammatical parse tree distance of the verb phrase met. Function f1 represents the functional relationship between the search term distance of the sentence and the weight value corresponding to the distance. Correspondingly, function f2 represents the functional relationship between the grammatical parse tree distance of the search term and the weight value corresponding to the distance. Function f3 represents the functional relationship between the grammatical parse tree distance of the verb phrase and the weight value corresponding to the distance.
[0110] It is understandable that the specific forms of function f1, function f2, and function f3 can be set and adjusted according to actual needs. However, it should be noted that the shorter the sentence, the higher the reliability of the sentence. The shorter the grammatical parse tree distance of the search term, the higher the reliability of the sentence. The shorter the grammatical parse tree distance of the verb phrase, the greater the correlation between the verb phrase and the seed data. Therefore, in a specific embodiment of the present invention, step S105 can specifically include:
[0111] For any verb phrase determined in any sentence, sum the weighted value corresponding to the sentence's search term distance, the weighted value corresponding to the sentence's search term's grammatical parse tree distance, and the weighted value corresponding to the grammatical parse tree distance of the verb phrase to obtain the weighted value of the verb phrase;
[0112] Among them, the search term distance of a sentence is negatively correlated with the weighted value corresponding to the search term distance of the sentence, the grammatical parse tree distance of the search term of a sentence is negatively correlated with the weighted value corresponding to the grammatical parse tree distance of the search term of the sentence, and the grammatical parse tree distance of a verb phrase is negatively correlated with the weighted value corresponding to the grammatical parse tree distance of the verb phrase.
[0113] That is, in this implementation, the shorter the sentence is, the higher the reliability of the sentence is, so the weighted value corresponding to the search term distance of the sentence is larger. Similarly, the shorter the grammatical parse tree distance of the search term is, the higher the reliability of the sentence is, so the weighted value corresponding to the grammatical parse tree distance of the search term of the sentence is larger. The greater the correlation between the verb phrase and the seed data, the shorter the grammatical parse tree distance of the verb phrase, and the higher the corresponding weighted value. This can make the accuracy of the target verb phrase selected subsequently higher, which is also conducive to improving the accuracy of the extracted knowledge.
[0114] Of course, the specific negative correlation function relationship can be set according to actual needs. For example, in order to further highlight the influence of distance in one scenario, when the distance decreases, the weighted value corresponding to the distance determined by the function can increase exponentially.
[0115] Furthermore, the present application takes into account that the search term distances of different sentences vary greatly, that is, the range of values of the search term distance of a sentence is relatively large, while the grammatical parse tree distance of the search term of a sentence and the grammatical parse tree distance of the verb phrase are both determined based on the grammatical parse tree, and therefore have a relatively small range of values. In order to avoid the influence of the search term distance of a sentence on the weighted values of each verb phrase of the sentence being too large, in one case, for any verb phrase determined in any sentence, the weighted value corresponding to the search term distance of the sentence is determined by function f1, the weighted value corresponding to the grammatical parse tree distance of the search term of the sentence is determined by function f2, and the weighted value corresponding to the grammatical parse tree distance of the verb phrase is determined by function f3;
[0116] Furthermore, function f1 is a function whose function value changes linearly based on the search term distance of the sentence, and both function f2 and function f3 are functions whose function values change exponentially based on the corresponding distance.
[0117] In this case, the function f1 can be set to a linearly varying function. For example, the function f1 can be set to f1=1-ax1, where a is a set coefficient and x1 is the search term distance of the sentence.
[0118] For functions f2 and f3, since the distances between the two items in different sentences do not vary much, the weighted values based on the corresponding distances can be changed exponentially to highlight the impact of the distance changes. For example, function f2 is set to f2 = 1 / (W1*e x2 ), where W1 is the set coefficient, e is the natural logarithm, and x2 represents the parse tree distance of the search term in the sentence. For another example, function f2 is set to f2=1-e x2 Etc. Similarly, for example, function f3 can be set to f3 = 1 / (W2*e x3 ), where W2 is the set coefficient, e is the natural logarithm, and x3 represents the parse tree distance of the verb phrase. For another example, function f3 is set to f3=1-e x3 etc.
[0119] Step S106: Based on the weighted values of the verb phrases in each sentence, K verb phrases with the highest sum of weighted values are obtained by summing up, and these are selected as K target verb phrases; K is a positive integer.
[0120] It is understood that after setting the seed data for representing the relationship information in step S102, multiple sentences including the search terms in the seed data can generally be retrieved from the annotated corpus. For example, 1,000 sentences can be retrieved in one instance. For each of these sentences, one or more verb phrases can be determined, and the weighted values of each verb phrase in the sentence can be obtained. For example, if "met" is determined as a verb phrase in 150 of the 1,000 sentences, then there are 150 weighted values for "met". The sum of these 150 weighted values is the sum of the weighted values of the verb phrase "met".
[0121] This application takes into account the inherent ambiguity and uncertainty of text. No system can guarantee 100% accuracy in extracting patterns. Therefore, by aggregating the K verb phrases with the highest sum of weighted values and selecting them as the K target verb phrases, the accuracy of the extracted knowledge instances can be effectively improved while maintaining a high level of knowledge instance coverage. Of course, the specific value of K can be set and adjusted as needed.
[0122] In the solution of the present application, the text corpus can be a text corpus in Chinese, English, Russian, etc. It is understandable that the language selected for the text corpus is the language of the seed data. In addition, in some languages, there are changes in the tense of verbs. In the solution of the present application, when summarizing the sum of weighted values, the different tenses of the verb phrases can be regarded as the same verb phrase for aggregation. That is, it is equivalent to converting the verb phrase into its original tense and part of speech, and then aggregating the weighted values of the verb phrase in each sentence.
[0123] Step S107: for any target verb phrase, retrieve all sentences including the target verb phrase from the annotated corpus and verify them according to preset rules.
[0124] Step S108: Summarize the sentences that have passed the verification into knowledge extraction content corresponding to the seed data.
[0125] For each target verb phrase among the K verb phrases, each sentence including the target verb phrase can be retrieved from the annotated corpus. In addition, in order to further improve the accuracy of knowledge extraction, verification will be performed according to preset rules in this implementation method. Only sentences that pass the verification will be summarized as knowledge extraction content corresponding to the seed data. In other words, when the sentence retrieved through the target verb phrase has a low correlation with the target verb phrase, it will not pass the verification and the sentence will be discarded.
[0126] Of course, the specific verification rules can be set according to actual needs, as long as they can effectively reflect the relevance between the sentence and the target verb phrase.
[0127] For example, in a specific embodiment of the present invention, the verification according to the preset rules described in step S108 may specifically include:
[0128] For any sentence to be verified, find the noun closest to the target verb phrase in the sentence through the sentence's grammatical parse tree and use it as the first noun;
[0129] Find the verb closest to the first noun in the sentence and determine whether the found verb agrees with the target verb;
[0130] If so, the sentence to be verified passes the verification, otherwise it fails the verification.
[0131] For example, in a scenario where the seed data is (Brad Pitt, Jennifer Anision, Spouse), and one of the target verb phrases is identified as "marry," a forward search is first performed. This involves using the sentence's parse tree to find the noun closest to the target verb phrase "marry," and this noun is used as the first noun. A reverse check is then performed, using the nearest neighbor method based on the parse tree to find the verb closest to the first noun in the sentence. This verb may or may not be "marry." If it is "marry," the sentence has a high correlation with the target verb phrase "marry," indicating a high probability of being high-quality knowledge, and therefore passes verification. Otherwise, it fails verification.
[0132] Each sentence that has passed the verification can be called a knowledge instance. These sentences are the knowledge extraction content corresponding to the seed data. As described above, when performing knowledge extraction, multiple sentences may be used. The knowledge extraction content corresponding to each of these sentences is the total extracted knowledge content.
[0133] In a specific embodiment of the present invention, considering that medical knowledge extraction, financial knowledge extraction, geographical knowledge extraction, and humanities knowledge extraction are often needed, in a specific embodiment of the present invention, the knowledge extraction content corresponding to the seed data can be summarized as medical knowledge extraction content, financial knowledge extraction content, geographical knowledge extraction content, or humanities knowledge extraction content.
[0134] Of course, due to the high versatility of this application, other types of knowledge extraction can also be performed in other situations. Taking the seed data (Brad Pitt, Jennifer Aniston, Spouse) mentioned above as an example, if a target verb phrase is selected as "marry," all sentences containing the target verb phrase "marry" retrieved from the annotated corpus are information related to "marry." That is, these sentences constitute knowledge instances about "marry," such as knowledge instances related to Bill Gates' marriage, Angelina Jolie's marriage, and David Beckham's marriage.
[0135] In a specific embodiment of the present invention, after obtaining the sum of the weighted values of each verb phrase by aggregation, the method further includes:
[0136] For any verb phrase, determine the frequency of occurrence of the verb phrase in each sentence retrieved from the annotated corpus that includes the search term in the seed data, and determine a frequency score for the verb phrase based on the frequency of occurrence. The frequency score is then added to the weighted value of the verb phrase to obtain the final score for the verb phrase.
[0137] Accordingly, the K verb phrases with the highest sum of weighted values are obtained by summing up and selected as the K target verb phrases, including:
[0138] The K verb phrases with the highest final scores are selected as the K target verb phrases.
[0139] This implementation takes into account that, in the aforementioned implementation, when a verb phrase appears in a sentence, it must be the closest verb phrase to an entity in the sentence in order for it to receive a weighted value. In some cases, certain verb phrases may appear more frequently, indicating a high relationship between the verb phrase and the seed data. Therefore, this implementation directly "adds points" to the verb phrase's weighted value based on its frequency. Specifically, the verb phrase's frequency of occurrence is determined in each sentence retrieved from the annotated corpus that includes the search terms in the seed data. This frequency of occurrence is converted into a verb phrase frequency score, which is then superimposed on the verb phrase's weighted value. This helps further improve the accuracy of the selected K target verb phrases. There are various specific methods for converting the frequency of occurrence into a verb phrase frequency score, for example, one method uses a simple proportional function.
[0140] By applying the technical solution provided by the embodiment of the present invention, based on pattern recognition technology, high-quality knowledge extraction can be performed on large-scale text data. Specifically, the text corpus is annotated and indexed. After obtaining the annotated corpus, seed data for representing relationship information can be set, and each sentence including the search terms in the seed data can be retrieved from the annotated corpus. Afterwards, for any sentence, this application will determine the distances of the sentence. It can be understood that the search term distance of the sentence and the grammatical parse tree distance of the search terms of the sentence can effectively reflect the quality of the sentence, and the grammatical parse tree distance of the verb phrase can reflect the degree of connection between the verb phrase and the search terms in the seed data. Therefore, after summarizing the weighted values, the selected K target verb phrases can effectively reflect the characteristics of the seed data search terms. That is, according to the K target verb phrases, each sentence including the target verb phrase is retrieved from the annotated corpus, which is high-quality knowledge extraction content. And because the sentence verification is performed according to the preset rules, it is beneficial to further ensure the quality of the extracted knowledge content. Furthermore, the solution of the present application uses K target verb phrases as the search objects, so a large number of sentences containing the target verb phrases can be retrieved from the annotated corpus, resulting in a high recall rate for the solution of the present application. In addition, the solution of the present application does not limit the content of the text corpus, nor does it limit the search terms in the seed data. Therefore, the solution of the present application can be used for knowledge extraction in various fields and is highly versatile.
[0141] See Figure 6 , which is a schematic diagram of an application environment of a knowledge extraction method in the present invention. The application environment includes a terminal 610, an analysis device 620, and a network device 630.
[0142] The terminal 610 can be a device that can interact with the user, such as a display, a computer, a smart phone, a tablet computer, and a laptop computer, and can display the knowledge extraction content corresponding to the seed data summarized. The analysis device 620 can be a server, or a server cluster consisting of several servers, etc., which can perform data analysis. Optionally, the analysis device 620 can be a cloud server (also known as a cloud computing server). The terminal 610 can establish a wired or wireless communication connection with the analysis device 620 through a communication network. The network device 630 can provide the data to be analyzed to the analysis device 620, so that the analysis device 620 performs knowledge extraction, and the terminal 610 can present the knowledge extraction results to the user or relevant staff. The communication network involved in the embodiment of the present application can be a second generation (2-Generation, 2G) communication network, a third generation (3rd Generation, 3G) communication network, a long term evolution (Long Term Evolution, LTE) communication network, or a fifth generation (5rd Generation, 5G) communication network. Optionally, the aforementioned application environment may further include a storage device for storing data required by the terminal 610 , the analysis device 620 and / or the network device 630 . The storage device may be a distributed storage device.
[0143] In summary, the solution of this application can effectively extract knowledge, and has high versatility and recall rate, and can obtain high-quality knowledge extraction content.
[0144] Corresponding to the above method embodiment, an embodiment of the present invention further provides a knowledge extraction system, which can be referred to in correspondence with the above.
[0145] See Figure 4 , is a schematic diagram of the structure of a knowledge extraction system in the present invention, including:
[0146] A text corpus determination module 401 is used to determine a text corpus;
[0147] The annotated corpus determination module 402 is used to annotate the text corpus and construct an index to obtain an annotated corpus;
[0148] A retrieval module 403 is configured to set seed data for representing relationship information and retrieve sentences containing the search terms in the seed data from the annotated corpus;
[0149] Distance calculation module 404 is used to determine the search term distance of any sentence, and determine the parse tree distance of the search term of the sentence through the parse tree of the sentence, and find the verb phrase closest to each entity in the sentence and determine the parse tree distance of each verb phrase;
[0150] The weighted value calculation module 405 is used to determine the weighted value of each verb phrase in any sentence based on the determined distances of the sentence and according to a preset weighting rule;
[0151] The target verb phrase determination module 406 is configured to determine, based on the weighted values of the verb phrases in each sentence, the K verb phrases with the highest sum of weighted values, and select them as the K target verb phrases; K is a positive integer;
[0152] Verification module 407 is used to retrieve all sentences containing any target verb phrase from the annotated corpus and verify them according to preset rules;
[0153] The knowledge extraction content determination module 408 is used to summarize the sentences that have passed the verification into knowledge extraction content corresponding to the seed data.
[0154] In a specific embodiment of the present invention, the annotated corpus determination module 402 includes:
[0155] A first annotation unit is used to perform entity annotation on the text corpus to link the text to the entity;
[0156] The second annotation unit is used to perform coreference resolution on the text corpus to link the pronouns in the text to their original nouns;
[0157] The index building unit is used to build an index and obtain an annotated corpus.
[0158] In a specific embodiment of the present invention, the first marking unit is specifically used to:
[0159] Entity annotation is performed on the text corpus using entity recognition tools.
[0160] In a specific embodiment of the present invention, the second marking unit is specifically used to:
[0161] Coreference resolution is performed on the text corpus using natural semantic processing tools.
[0162] In a specific embodiment of the present invention, it also includes:
[0163] The third tagging unit is used to link the pronoun to the entity based on the results of entity tagging and coreference resolution when any pronoun points to an unambiguous noun object.
[0164] In a specific embodiment of the present invention, before the first annotation unit annotates the text corpus, the method further includes:
[0165] The data cleaning unit is used to clean the text corpus to eliminate irrelevant information.
[0166] In a specific embodiment of the present invention, the distance calculation module 404 finds the verb phrase closest to each entity in the sentence, specifically for:
[0167] Using the nearest neighbor method, for each entity in the sentence, find the verb phrase that is closest to the entity.
[0168] In a specific embodiment of the present invention, the weighted value calculation module 405 is specifically configured to:
[0169] For any verb phrase determined in any sentence, sum the weighted value corresponding to the sentence's search term distance, the weighted value corresponding to the sentence's search term's grammatical parse tree distance, and the weighted value corresponding to the grammatical parse tree distance of the verb phrase to obtain the weighted value of the verb phrase;
[0170] Among them, the search term distance of a sentence is negatively correlated with the weighted value corresponding to the search term distance of the sentence, the grammatical parse tree distance of the search term of a sentence is negatively correlated with the weighted value corresponding to the grammatical parse tree distance of the search term of the sentence, and the grammatical parse tree distance of a verb phrase is negatively correlated with the weighted value corresponding to the grammatical parse tree distance of the verb phrase.
[0171] In a specific embodiment of the present invention, after the target verb phrase determination module 406 obtains the sum of the weighted values of each verb phrase by summing up, the target verb phrase determination module 406 is further configured to:
[0172] For any verb phrase, determine the frequency of occurrence of the verb phrase in each sentence retrieved from the annotated corpus that includes the search term in the seed data, and determine a frequency score for the verb phrase based on the frequency of occurrence. The frequency score is then added to the weighted value of the verb phrase to obtain the final score for the verb phrase.
[0173] The K verb phrases with the highest final scores are selected as the K target verb phrases.
[0174] In a specific embodiment of the present invention, for any verb phrase determined in any sentence, a weighted value corresponding to the distance to the search term of the sentence is determined by function f1, a weighted value corresponding to the distance to the parse tree of the search term of the sentence is determined by function f2, and a weighted value corresponding to the distance to the parse tree of the verb phrase is determined by function f3;
[0175] Furthermore, function f1 is a function whose function value changes linearly based on the search term distance of the sentence, and both function f2 and function f3 are functions whose function values change exponentially based on the corresponding distance.
[0176] In a specific embodiment of the present invention, the function f1 is set to f1=1-ax1, where a is a set coefficient and x1 is the search term distance of the sentence;
[0177] Function f2 is set to f2 = 1 / (W1*e x2 ), where W1 is the set coefficient and x2 is the parse tree distance of the search term in the sentence;
[0178] Function f3 is set to f3 = 1 / (W2*e x3 ), where W2 is the set coefficient and x3 is the parse tree distance of the verb phrase.
[0179] In a specific embodiment of the present invention, the verification module 407 performs verification according to preset rules, specifically for:
[0180] For any sentence to be verified, find the noun closest to the target verb phrase in the sentence through the sentence's grammatical parse tree and use it as the first noun;
[0181] Find the verb closest to the first noun in the sentence and determine whether the found verb agrees with the target verb;
[0182] If so, the sentence to be verified passes the verification, otherwise it fails the verification.
[0183] Corresponding to the above method and system embodiments, an embodiment of the present invention further provides a knowledge extraction device and a computer-readable storage medium, which can be referred to in correspondence with the above.
[0184] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the knowledge extraction method described in any of the above embodiments. The computer-readable storage medium herein includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.
[0185] See Figure 5 , the knowledge extraction device may include:
[0186] Memory 501, used for storing computer programs;
[0187] The processor 502 is configured to execute a computer program to implement the steps of the knowledge extraction method in any of the above embodiments.
[0188] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0189] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0190] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the technical solutions and core concepts of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A knowledge extraction method, characterized in that: include: Identify the text corpus; Annotating the text corpus and constructing an index to obtain an annotated corpus; Setting seed data for representing relationship information, and retrieving sentences including search terms in the seed data from the annotated corpus; For any sentence, determine the search term distance of the sentence, and determine the parse tree distance of the search term of the sentence through the parse tree of the sentence, and find the verb phrase closest to each entity in the sentence and determine the parse tree distance of each verb phrase; For any sentence, based on the determined distances of the sentence, determine the weighted values of the verb phrases in the sentence according to a preset weighting rule; According to the weighted values of the verb phrases in each of the sentences, K verb phrases with the highest sum of weighted values are obtained by summing up, and the K target verb phrases are selected; K is a positive integer; For any one of the target verb phrases, retrieve each sentence including the target verb phrase from the annotated corpus and verify it according to preset rules; Summarize the sentences that have passed the verification into knowledge extraction content corresponding to the seed data; For any sentence, based on the determined distances of the sentence, the weighted values of the verb phrases in the sentence are determined according to a preset weighting rule, including: For any verb phrase determined in any sentence, summing the weighted value corresponding to the sentence's search term distance, the weighted value corresponding to the sentence's search term's grammatical parse tree distance, and the weighted value corresponding to the grammatical parse tree distance of the verb phrase to obtain a weighted value of the verb phrase; Among them, the sentence's search term distance is negatively correlated with the weighted value corresponding to the sentence's search term distance, the sentence's search term grammar parse tree distance is negatively correlated with the weighted value corresponding to the sentence's search term grammar parse tree distance, and the verb phrase grammar parse tree distance is negatively correlated with the weighted value corresponding to the verb phrase grammar parse tree distance; For any verb phrase determined in any sentence, the weighted value corresponding to the sentence's search term distance is determined by function f1, the weighted value corresponding to the sentence's search term parse tree distance is determined by function f2, and the weighted value corresponding to the verb phrase parse tree distance is determined by function f3; Moreover, function f1 is a function whose function value changes linearly based on the search term distance of the sentence, and function f2 and function f3 are both functions whose function values change exponentially based on the corresponding distance; The verification according to the preset rules includes: For any sentence to be verified, find the noun closest to the target verb phrase in the sentence through the grammatical parse tree of the sentence, and use it as the first noun; Finding a verb closest to the first noun in the sentence, and determining whether the found verb is consistent with the target verb; If so, the sentence to be verified passes the verification; otherwise, it fails the verification.
2. The knowledge extraction method according to claim 1, characterized in that: The tagging of the text corpus includes: performing entity annotation on the text corpus to link text to entities; Coreference resolution is performed on the text corpus to link pronouns in the text to their original nouns.
3. The knowledge extraction method according to claim 2, characterized in that: The entity tagging of the text corpus includes: Entity annotation is performed on the text corpus using an entity recognition tool.
4. The knowledge extraction method according to claim 2, characterized in that: The performing coreference resolution on the text corpus includes: Coreference resolution is performed on the text corpus using natural semantic processing tools.
5. The knowledge extraction method according to claim 2, characterized in that: Also includes: Based on the results of entity tagging and the results of coreference resolution, when any pronoun points to an unambiguous noun object, the pronoun is linked to the entity.
6. The knowledge extraction method according to claim 1, characterized in that: Before annotating the text corpus, it also includes: Data cleaning is performed on the text corpus to eliminate irrelevant information.
7. The knowledge extraction method according to claim 1, characterized in that: The step of finding, for each entity in the sentence, a verb phrase closest to the entity, includes: By using the nearest neighbor method, for each entity in the sentence, a verb phrase closest to the entity is found.
8. The knowledge extraction method according to claim 1, characterized in that: Function f1 is set to f1=1-ax1, where a is the set coefficient and x1 is the search term distance of the sentence; Function f2 is set to f2 = 1 / (W1*e x2 ), where W1 is the set coefficient and x2 is the parse tree distance of the search term in the sentence; Function f3 is set to f3 = 1 / (W2*e x3 ), where W2 is the set coefficient and x3 is the parse tree distance of the verb phrase.
9. The knowledge extraction method according to claim 1, characterized in that: After summing up the weighted values for each verb phrase, it also includes: For any one verb phrase, determining the frequency of occurrence of the verb phrase in each sentence retrieved from the annotated corpus and including the search term in the seed data, and determining a frequency score of the verb phrase based on the frequency of occurrence, and adding the sum of the frequency score and the weighted value of the verb phrase to obtain a final score of the verb phrase; Accordingly, the K verb phrases with the highest sum of weighted values obtained by summing up are selected as the K target verb phrases, including: The K verb phrases with the highest final scores are selected as the K target verb phrases.
10. A knowledge extraction system, characterized in that: include: A text corpus determination module, used for determining a text corpus; a marked corpus determination module, configured to mark the text corpus and construct an index to obtain a marked corpus; A retrieval module, configured to set seed data for representing relationship information, and retrieve from the annotated corpus individual sentences that include the search terms in the seed data; a distance calculation module for determining, for any sentence, a search term distance of the sentence, and determining a parse tree distance of the search term of the sentence using a parse tree of the sentence, and for each entity in the sentence, finding a verb phrase closest to the entity, and determining a parse tree distance of each verb phrase; A weighted value calculation module is used to determine, for any sentence, the weighted value of each verb phrase in the sentence based on the determined distances of the sentence and in accordance with a preset weighting rule; a target verb phrase determination module, configured to obtain K verb phrases with the highest sum of weighted values according to the weighted values of the verb phrases in each sentence, and select the K target verb phrases; K is a positive integer; A verification module, configured to retrieve, for any one of the target verb phrases, sentences containing the target verb phrase from the annotated corpus and verify the sentences according to preset rules; A knowledge extraction content determination module is used to aggregate the sentences that have passed the verification into knowledge extraction content corresponding to the seed data; The weighted value calculation module is specifically used for: For any verb phrase determined in any sentence, sum the weighted value corresponding to the sentence's search term distance, the weighted value corresponding to the sentence's search term's grammatical parse tree distance, and the weighted value corresponding to the grammatical parse tree distance of the verb phrase to obtain the weighted value of the verb phrase; Among them, the sentence's search term distance is negatively correlated with the weighted value corresponding to the sentence's search term distance, the sentence's search term grammar parse tree distance is negatively correlated with the weighted value corresponding to the sentence's search term grammar parse tree distance, and the verb phrase grammar parse tree distance is negatively correlated with the weighted value corresponding to the verb phrase grammar parse tree distance; For any verb phrase determined in any sentence, the weighted value corresponding to the sentence's search term distance is determined by function f1, the weighted value corresponding to the sentence's search term parse tree distance is determined by function f2, and the weighted value corresponding to the verb phrase parse tree distance is determined by function f3; Moreover, function f1 is a function whose function value changes linearly based on the search term distance of the sentence, and function f2 and function f3 are both functions whose function values change exponentially based on the corresponding distance; The verification module performs verification according to preset rules, specifically for: For any sentence to be verified, find the noun closest to the target verb phrase in the sentence through the sentence's grammatical parse tree and use it as the first noun; Find the verb closest to the first noun in the sentence and determine whether the found verb agrees with the target verb; If so, the sentence to be verified passes the verification, otherwise it fails the verification.
11. A knowledge extraction device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the knowledge extraction method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the knowledge extraction method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Named entity relation extraction and construction method based on deep learning
CN104199972A
Data retrieval method and device, computer readable storage medium and electronic equipment
CN110598078A