A data information extraction method and device, electronic equipment, and storage medium

By using a pre-trained entity and relation extraction model to extract entities and relations from documents, extracting data using the most frequent predicates, and updating the knowledge graph based on user feedback, this approach solves the problems of inaccurate extraction and excessive reliance on experts in existing technologies, and achieves efficient and accurate extraction of financial entity names and their associated entities.

CN115935966BActive Publication Date: 2025-12-12CHINA CONSTR BANK CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211593970.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2025-12-12
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

Existing technologies for extracting the names of financial entities and their associated entities from textual materials suffer from problems such as inaccurate extraction, excessive reliance on domain experts, low processing efficiency, and poor interpretability.

Method used

Using pre-trained entity extraction and relation extraction models, entities and relations are extracted from the documents to be extracted. Data is extracted using the most frequent predicates, and the knowledge graph is updated based on user feedback and selection instructions.

Benefits of technology

It enables more accurate and efficient extraction of financial entity names and their associated entities, improving the accuracy and interpretability of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115935966B_ABST
    Figure CN115935966B_ABST
Patent Text Reader

Abstract

The application discloses a data information extraction method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining a user-inputted document to be extracted; inputting the document to be extracted into a pre-trained entity extraction model to obtain an entity set of the document to be extracted; the entity extraction model is pre-trained by using a plurality of samples to be extracted; the entity set comprises at least a plurality of entity pairs; performing relation extraction on each entity pair in the entity set of the document to be extracted to obtain a predicate set between each entity pair; extracting a first target predicate between each entity pair from the predicate set between each entity pair; the first target predicate refers to a predicate with the highest frequency in the predicate set; feeding back an extraction result of the document to be extracted to the user; when receiving a first selection instruction sent by the user, updating a knowledge graph based on the first target predicate between each entity pair and the corresponding entity pair.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for extracting data information, an electronic device, and a storage medium. Background Technology

[0002] In the business operations of the financial industry, there is often a need to extract the names of financial entities from unstructured data such as text materials and to find other related financial entities.

[0003] Currently, three main methods are used for information extraction. The first is manual extraction, where individuals extract entity names from the data based on their experience and knowledge, and then find related entity names based on context. Another method is rule-based and template-based information extraction, where business domain experts set extraction rules based on their experience, and computer science experts solidify these rules into algorithms or templates, which are then used for information extraction. The third method is machine learning-based knowledge extraction, where the dataset is directly input into a pre-trained model for knowledge extraction, allowing the model to extract the desired results.

[0004] However, the first method, manual extraction, relies on human experience and knowledge, which can lead to inaccurate information and low processing efficiency. The second method, requiring domain experts to set extraction rules and computer science experts to solidify the process, is overly dependent on domain experts, and the experience-based rules also contribute to inaccurate information extraction. The third method, using machine learning models, demands significant data and computing power, and its poor interpretability results in difficult-to-understand extraction results. Summary of the Invention

[0005] In view of the shortcomings of the prior art, this application provides a data information extraction method and apparatus, electronic device and storage medium to solve the problem that the extraction results of the prior art are not accurate enough.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] The first aspect of this application provides a method for extracting data information, including:

[0008] Obtain the document to be extracted, as input by the user;

[0009] inputting the to-be-extracted document into a pre-trained entity extraction model to obtain an entity set of the to-be-extracted document, wherein the entity extraction model is obtained by pre-training using a plurality of to-be-extracted samples, and the entity set at least includes a plurality of entity pairs, and each entity pair at least includes two entities;

[0010] performing relation extraction on each entity pair in the entity set of the to-be-extracted document to obtain a predicate set between each entity pair;

[0011] extracting a first target predicate between each entity pair from the predicate set between each entity pair, wherein the first target predicate refers to a predicate with the highest frequency in the predicate set;

[0012] feeding back an extraction result of the to-be-extracted document to the user;

[0013] when receiving a first selection instruction sent by the user, updating a knowledge graph based on the first target predicate between each entity pair and the corresponding entity pair.

[0014] Optionally, in the data information extraction method, after the feeding back of the extraction result of the to-be-extracted document to the user, the method further includes:

[0015] when receiving a second selection instruction sent by the user, searching for a predicate list between each entity pair from the knowledge graph;

[0016] merging the predicate set between each entity pair and the predicate list between each entity pair to obtain a target predicate set between each entity pair;

[0017] extracting a second target predicate between each entity pair from the target predicate set between each entity pair, wherein the second target predicate refers to a predicate with the highest frequency in the target predicate set;

[0018] updating the knowledge graph based on the second target predicate between each entity pair and the corresponding entity pair.

[0019] Optionally, in the data information extraction method, the training method of the entity extraction model includes:

[0020] obtaining a plurality of to-be-extracted samples;

[0021] inputting each to-be-extracted sample into a pre-trained entity extraction model to obtain a sample entity set of each to-be-extracted sample through the entity extraction model;

[0022] determine whether the loss function of the entity extraction model converges based on the sample entity set of each of the samples to be extracted;

[0023] If it is determined that the loss function of the entity extraction model does not converge, the parameters of the entity extraction model are adjusted, and the method returns to inputting each of the samples to be extracted into the pre-trained entity extraction model, and obtaining the sample entity set of each of the samples to be extracted through the entity extraction model;

[0024] If it is determined that the loss function of the entity extraction model converges, the entity extraction model is determined as the trained entity extraction model.

[0025] Optionally, in the data information extraction method, the relationship extraction is performed on each of the entity pairs in the entity set of the document to be extracted to obtain a predicate set between each of the entity pairs, including:

[0026] Each of the entity pairs is obtained from the entity set of the document to be extracted;

[0027] The target sentence of each of the entity pairs is found from the document to be extracted, wherein the target sentence refers to the sentence in which the entity pair is located in the document to be extracted;

[0028] The target sentence of each of the entity pairs is subjected to syntax analysis to obtain a syntax relationship between each of the entity pairs and the target sentence of each of the entity pairs;

[0029] Based on the syntax relationship between each of the entity pairs and the target sentence of each of the entity pairs, a predicate between each of the entity pairs is found from the target sentence of each of the entity pairs;

[0030] The document to be extracted and each of the entity pairs of the document to be extracted are input into a trained relationship extraction model to obtain a first predicate set between each of the entity pairs, wherein the relationship extraction model is trained by using a plurality of samples to be extracted and a plurality of sample entity pairs thereof in advance;

[0031] The first predicate set between each of the entity pairs and the predicate between each of the entity pairs are merged to obtain a predicate set between each of the entity pairs.

[0032] Optionally, in the data information extraction method, the training method of the relationship extraction model includes:

[0033] A plurality of samples to be extracted and a plurality of sample entity pairs thereof are obtained;

[0034] input each of the sample entity pairs of each of the samples to be extracted into a pre-trained relation extraction model, and obtain a sample predicate set of each of the sample entity pairs through the relation extraction model;

[0035] determine whether the sample predicate set of each of the sample entity pairs conforms to an actual predicate set of each of the sample entity pairs;

[0036] if it is determined that the sample predicate set of each of the sample entity pairs conforms to the actual predicate set of each of the sample entity pairs, determine the relation extraction model as a trained relation extraction model;

[0037] if it is determined that the sample predicate set of each of the sample entity pairs does not conform to the actual predicate set of each of the sample entity pairs, adjust parameters of the relation extraction model, and return to execute the inputting of each of the sample entity pairs of each of the samples to be extracted into the pre-trained relation extraction model, and the obtaining of the sample predicate set of each of the sample entity pairs through the relation extraction model.

[0038] Optionally, in the data information extraction method described above, before the performing of the relation extraction on each of the entity pairs in the entity set of the document to be extracted to obtain the predicate set between each of the entity pairs, the method further includes:

[0039] detecting whether the relation extraction has been performed between each of the entity pairs in the entity set of the document to be extracted;

[0040] if it is detected that the relation extraction has been performed between each of the entity pairs in the entity set of the document to be extracted, ending the extraction of the document to be extracted;

[0041] if it is detected that the relation extraction has not been performed between each of the entity pairs in the entity set of the document to be extracted, performing the relation extraction on each of the entity pairs in the entity set of the document to be extracted to obtain the predicate set between each of the entity pairs.

[0042] The second aspect of the present application provides a data information extraction device, which includes:

[0043] a first obtaining unit configured to obtain a document to be extracted input by a user;

[0044] a first input unit configured to input the document to be extracted into a pre-trained entity extraction model to obtain an entity set of the document to be extracted; the entity extraction model is pre-trained by using a plurality of samples to be extracted; the entity set includes at least a plurality of entity pairs; each of the entity pairs includes at least two entities;

[0045] a relationship extraction unit, configured to perform relationship extraction on each of the entity pairs in the entity set of the to-be-extracted document, to obtain a predicate set between the respective entity pairs;

[0046] a first extraction unit, configured to extract a first target predicate between each of the entity pairs from the predicate set between the respective entity pairs; the first target predicate refers to a predicate with the highest occurrence frequency in the predicate set;

[0047] a feedback unit, configured to feed back an extraction result of the to-be-extracted document to the user;

[0048] a first updating unit, configured to update the knowledge graph based on the first target predicate between the respective entity pairs and the respective entity pairs corresponding to the first target predicate, when receiving a first selection instruction sent by the user.

[0049] Optionally, in the data information extraction device, the data information extraction device further includes:

[0050] a first finding unit, configured to find a predicate list between the respective entity pairs from the knowledge graph, when receiving a second selection instruction sent by the user.

[0051] a first merging unit, configured to merge the predicate set between the respective entity pairs and the predicate list between the respective entity pairs, to obtain a target predicate set between the respective entity pairs.

[0052] a second extraction unit, configured to extract a second target predicate between each of the entity pairs from the target predicate set between the respective entity pairs; the second target predicate refers to a predicate with the highest occurrence frequency in the target predicate set.

[0053] a second updating unit, configured to update the knowledge graph based on the second target predicate between the respective entity pairs and the respective entity pairs corresponding to the second target predicate.

[0054] Optionally, in the data information extraction device, the data information extraction device further includes:

[0055] a second acquisition unit, configured to acquire a plurality of to-be-extracted samples.

[0056] a second input unit, configured to input each of the to-be-extracted samples into a pre-trained entity extraction model, to obtain a sample entity set of each of the to-be-extracted samples through the entity extraction model.

[0057] a first judgment unit, configured to judge whether a loss function of the entity extraction model converges based on the sample entity set of each of the to-be-extracted samples.

[0058] The first adjusting unit is configured to adjust the parameters of the entity extraction model if it is determined that the loss function of the entity extraction model does not converge, and return to input each of the samples to be extracted into the pre-trained entity extraction model to obtain the sample entity set of each of the samples to be extracted by the entity extraction model.

[0059] The first determining unit is configured to determine the entity extraction model as the trained entity extraction model if it is determined that the loss function of the entity extraction model converges.

[0060] Optionally, in the data information extraction device, the relationship extraction unit includes:

[0061] The third obtaining unit is configured to obtain each of the entity pairs of the document to be extracted from the entity set of the document to be extracted.

[0062] The second finding unit is configured to find the target sentence of each of the entity pairs from the document to be extracted, where the target sentence refers to the sentence in which the entity pair is located in the document to be extracted.

[0063] The analysis unit is configured to perform syntactic analysis on the target sentence of each of the entity pairs to obtain the syntactic relationship between each of the entity pairs and the target sentence of each of the entity pairs.

[0064] The third finding unit is configured to find the predicate between each of the entity pairs from the target sentence of each of the entity pairs based on the syntactic relationship between each of the entity pairs and the target sentence of each of the entity pairs.

[0065] The third input unit is configured to input the document to be extracted and each of the entity pairs of the document to be extracted into the trained relationship extraction model respectively to obtain the first predicate set between each of the entity pairs, where the relationship extraction model is trained by using a plurality of the samples to be extracted and a plurality of sample entity pairs thereof.

[0066] The second merging unit is configured to merge the first predicate set between each of the entity pairs and the predicate between each of the entity pairs to obtain the predicate set between each of the entity pairs.

[0067] Optionally, in the data information extraction device, the relationship extraction unit includes:

[0068] The fourth obtaining unit is configured to obtain a plurality of the samples to be extracted and a plurality of the sample entity pairs thereof.

[0069] a fourth input unit, configured to respectively input each of the to-be-extracted sample and each of the sample entity pairs thereof into the pre-trained relation extraction model, and obtain a sample predicate set of each of the sample entity pairs through the relation extraction model;

[0070] a second judging unit, configured to judge whether the sample predicate set of each of the sample entity pairs conforms to the actual predicate set of each of the sample entity pairs;

[0071] a second determining unit, configured to, if it is judged that the sample predicate set of each of the sample entity pairs conforms to the actual predicate set of each of the sample entity pairs, determine the relation extraction model as the trained relation extraction model;

[0072] a second adjusting unit, configured to, if it is judged that the sample predicate set of each of the sample entity pairs does not conform to the actual predicate set of each of the sample entity pairs, adjust the parameters of the relation extraction model, and return to execute the operation of respectively inputting each of the to-be-extracted sample and each of the sample entity pairs thereof into the pre-trained relation extraction model, and obtaining a sample predicate set of each of the sample entity pairs through the relation extraction model.

[0073] Optionally, in the data information extraction device, further comprising:

[0074] a detecting unit, configured to detect whether relation extraction has been performed between each of the entity pairs in the entity set of the to-be-extracted document; wherein when the detecting unit detects that relation extraction has not been performed between each of the entity pairs in the entity set of the to-be-extracted document, the relation extraction unit performs the operation of respectively extracting the relation of each of the entity pairs in the entity set of the to-be-extracted document, to obtain a predicate set between each of the entity pairs;

[0075] an ending unit, configured to, if it is detected that relation extraction has been performed between each of the entity pairs in the entity set of the to-be-extracted document, end the extraction work on the to-be-extracted document.

[0076] The third aspect of the present application provides a computer storage medium, comprising:

[0077] a memory and a processor;

[0078] The memory is configured to store a program.

[0079] The processor is configured to execute the program, and the program is configured to, when executed, specifically implement the data information extraction method according to any one of the preceding aspects.

[0080] The fourth aspect of the present application provides an electronic device for storing a computer program, which, when executed, implements the data information extraction method according to any one of the preceding aspects.

[0081] The data information extraction method provided by the present application comprises the following steps: obtaining a to-be-extracted document input by a user; inputting the to-be-extracted document into a pre-trained entity extraction model to obtain an entity set of the to-be-extracted document, wherein the entity extraction model is pre-trained by using a plurality of to-be-extracted samples, and the entity set comprises at least a plurality of entity pairs, and each entity pair comprises at least two entities; performing relationship extraction on each entity pair in the entity set of the to-be-extracted document to obtain a predicate set between each entity pair; extracting a first target predicate between each entity pair from the predicate set between each entity pair, wherein the first target predicate refers to a predicate with the highest frequency in the predicate set; feeding back an extraction result of the to-be-extracted document to the user; and updating a knowledge graph based on the first target predicate between each entity pair and the corresponding each entity pair when receiving a first selection instruction sent by the user. Thus, the data can be accurately extracted through entity extraction and relationship extraction between entity pairs, and the problem of inaccurate extraction results is avoided. BRIEF DESCRIPTION OF DRAWINGS

[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.

[0083] Figure 1 A flowchart of the data information extraction method provided by the embodiment of the present application;

[0084] Figure 2 A flowchart of the training method of the entity extraction model provided by the embodiment of the present application;

[0085] Figure 3 A flowchart of the training method of the relationship extraction model provided by the embodiment of the present application;

[0086] Figure 4 A flowchart of the extraction method of the second target predicate provided by the embodiment of the present application;

[0087] Figure 5 A flowchart of another data information extraction method provided by the embodiment of the present application;

[0088] Figure 6A structural schematic diagram of a data information extraction device according to another embodiment of the present application is provided.

[0089] Figure 7 A structural schematic diagram of an electronic device according to another embodiment of the present application is provided. DETAILED DESCRIPTION

[0090] The technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0091] In the present application, the relationship terms such as first and second are only used 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 the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0092] The embodiments of the present application provide a data information extraction method, as shown in the method, the method specifically includes the following steps: Figure 1

[0093] S101, obtaining a to-be-extracted document input by a user.

[0094] Optionally, an input page of the document can be shown to the user through a front end, when the user performs an input operation of the to-be-extracted document on the input page, triggering the front end to send a processing request of extracting the document to the system, so that the system obtains the to-be-extracted document input by the user for subsequent extraction work.

[0095] S102, inputting the to-be-extracted document into a pre-trained entity extraction model to obtain an entity set of the to-be-extracted document.

[0096] The entity extraction model is pre-trained by using a plurality of to-be-extracted samples. The entity set can include a plurality of entity pairs, and each entity pair can include two entities. It should be noted that the two entities in the entity pair respectively refer to a subject and an object.

[0097] ​Optionally, a pre-training model BERT based on a Transformer can be used for entity extraction of the to-be-extracted document, wherein the BERT model has been pre-trained through large-scale unsupervised learning using a large amount of text, and a large number of model parameters have also been trained for processing text, and now only a small amount of domain data is needed for transfer learning to obtain an entity set of the to-be-extracted document.

[0098] Optionally, the embodiment of the present application provides a training method of an entity extraction model, as shown in the following. Figure 2 The method comprises the following steps:

[0099] S201, obtaining a plurality of to-be-extracted samples.

[0100] S202, inputting each to-be-extracted sample into a pre-trained entity extraction model, and obtaining a sample entity set of each to-be-extracted sample through the entity extraction model.

[0101] Optionally, the entity extraction model can be constructed based on a machine learning algorithm, or constructed using an unsupervised learning method such as word2vec or doc2vec, so in the embodiment of the present application, the entity extraction model can be trained based on a machine learning algorithm and an unsupervised learning method to obtain a training result.

[0102] S203, judging whether a loss function of the entity extraction model converges based on the sample entity set of each to-be-extracted sample.

[0103] Specifically, the smaller the loss function of the model, the better the training effect of the model, so in the embodiment of the present application, it is necessary to judge whether the loss function of the entity extraction model converges based on the sample entity set of each to-be-extracted sample, if it is judged that the loss function of the entity extraction model converges, it means that the training result of the model meets the expected requirement, and therefore step S205 needs to be executed. If it is judged that the loss function of the entity extraction model does not converge, it means that the entity extraction model needs to be iteratively trained, and then step S204 is executed.

[0104] S204, adjusting parameters of the entity extraction model.

[0105] It should be noted that when it is judged that the loss function of the entity extraction model does not converge, step S202 needs to be executed until the loss function of the entity extraction model converges.

[0106] S205, determining the entity extraction model as a trained entity extraction model.

[0107] S103, performing relation extraction on each entity pair in the entity set of the to-be-extracted document to obtain a predicate set between each entity pair.

[0108] Specifically, the main components of a sentence can include a subject, a predicate and an object, which are key entity components for composing a sentence, and there is a certain association relationship between each component. Therefore, in order to accurately and efficiently extract the entity names of the to-be-extracted document, in the embodiment of the present application, the to-be-extracted document is extracted based on the relationship between each entity pair, so that the predicate set between each entity pair can be accurately obtained.

[0109] Optionally, in another embodiment of the present application, a specific implementation of step S103 includes the following steps:

[0110] Obtaining each entity pair of the to-be-extracted document from the entity set of the to-be-extracted document.

[0111] Finding the target sentence of each entity pair from the to-be-extracted document.

[0112] The target sentence refers to the sentence in which the entity pair is located in the to-be-extracted document. It should be noted that in order to accurately extract other entities associated with the entity pair and know the relationship between the entity pairs, in the embodiment of the present application, the target sentence of each entity pair needs to be found from the to-be-extracted document, so as to fundamentally extract the associated other entities.

[0113] Performing syntax analysis on the target sentence of each entity pair to obtain the syntax relationship between each entity pair and the target sentence of each entity pair.

[0114] It should be noted that the main stem of a sentence and the association relationship between each component can be analyzed through syntax analysis. Therefore, in the embodiment of the present application, the target sentence of each entity pair is processed by syntax analysis, so that the subject-predicate, core, verb-object and other syntax relationships associated with the entity pair in the target sentence can be obtained, so as to facilitate the subsequent efficient extraction of other entities.

[0115] Based on the syntax relationship between each entity pair and the target sentence of each entity pair, the predicate between each entity pair is found from the target sentence of each entity pair.

[0116] Specifically, based on the subject-predicate, core, verb-object and other syntax relationships associated with each entity pair in each target sentence, the predicate between each entity pair can be more accurately and efficiently extracted.

[0117] Respectively inputting the to-be-extracted document and each entity pair of the to-be-extracted document into the trained relationship extraction model to obtain a first predicate set between each entity pair.

[0118] The relationship extraction model is obtained by pre-training a plurality of to-be-extracted samples and a plurality of sample entity pairs thereof.

[0119] Optionally, the embodiment of the present application provides a training method of a relation extraction model, as shown in the following. Figure 3 The method comprises the following steps:

[0120] S301, obtaining a plurality of to-be-extracted samples and a plurality of sample entity pairs of the to-be-extracted samples.

[0121] S302, inputting each to-be-extracted sample and each sample entity pair of the to-be-extracted sample into a pre-trained relation extraction model respectively, and obtaining a sample predicate set of each sample entity pair through the relation extraction model.

[0122] Optionally, the relation extraction model can be constructed based on a machine learning algorithm, or can be constructed using a neural network supervised learning method such as a recurrent neural network (RNN) or a long short-term memory (LSTM). Therefore, in the embodiment of the present application, the relation extraction model can be trained based on a machine learning algorithm and a neural network supervised learning method to obtain a training result.

[0123] S303, determining whether the sample predicate set of each sample entity pair conforms to an actual predicate set of each sample entity pair.

[0124] It should be noted that the sample predicate set of each sample entity pair obtained through the relation extraction model in step S302 may not conform to the actual extraction set, so it is necessary to further determine the sample predicate set of each sample entity pair, that is, to determine whether the sample predicate set of each sample entity pair conforms to the actual predicate set of each sample entity pair. If it is determined that the sample predicate set of each sample entity pair conforms to the actual predicate set of each sample entity pair, it is indicated that the sample predicate set of each sample entity pair conforms to the actual extraction set, and therefore step S304 is performed. If it is determined that the sample predicate set of each sample entity pair does not conform to the actual predicate set of each sample entity pair, it is indicated that the relation extraction model needs to be iteratively trained, and therefore step S305 is performed.

[0125] S304, determining the relation extraction model as a trained relation extraction model.

[0126] S305, adjusting the parameters of the relation extraction model.

[0127] It should be noted that when it is determined that the sample predicate set of each sample entity pair does not conform to the actual predicate set of each sample entity pair, step S302 needs to be returned to be executed until the sample predicate set of each sample entity pair conforms to the actual predicate set of each sample entity pair.

[0128] merge the first predicate set between each entity pair with the predicates between each entity pair to obtain a predicate set between each entity pair.

[0129] It should be noted that in order to improve the efficiency and accuracy of knowledge extraction, in the embodiments of the present application, the relationship extraction of the entity pair is performed by combining the rule template and machine learning, so the relationship extraction results of the two are integrated to obtain the best predicate set between each entity pair.

[0130] S104, extract a first target predicate between each entity pair from the predicate set between each entity pair.

[0131] The first target predicate refers to the predicate with the highest frequency in the predicate set. It should be noted that considering that there may be many predicates between each entity pair and there may be repeated predicates, the best predicate between each entity pair has not been accurately determined, so in the embodiments of the present application, each predicate in each predicate set is sorted according to the frequency of occurrence of each predicate, and the predicate with the highest frequency is selected from each predicate set as the predicate relationship between each entity pair for the user to view.

[0132] S105, feed back the extraction result of the to-be-extracted document to the user.

[0133] Specifically, when the system completes the extraction of the to-be-extracted document, the extraction result of the to-be-extracted document is fed back to the user.

[0134] Optionally, when the user views the extraction result of the to-be-extracted document, the system displays the options of the predicate set between all entity pairs of the to-be-extracted document and the options of viewing the target predicate between all entity pairs to the front end of the user for selection and viewing. Therefore, in another embodiment of the present application, after the step S105 is executed, as shown in Figure 4

[0135] S401, when receiving the second selection instruction sent by the user, find the predicate list between each entity pair from the knowledge graph.

[0136] The second selection instruction refers to the instruction of the user selecting to view the predicate set between all entity pairs of the to-be-extracted document. It should be noted that when the system receives the second selection instruction sent by the user, the system queries the predicate set between each entity pair from the existing data of the knowledge graph as a reference, so as to further ensure the accuracy of the extraction subsequently.

[0137] S402, merge the predicate set between each entity pair with the predicate list between each entity pair to obtain a target predicate set between each entity pair.​

[0138] Specifically, in order to flexibly and quickly determine the other entities associated with the entity pair from the predicate set and the predicate list between each entity pair, it is necessary to integrate the predicate set between each entity pair and the predicate list between each entity pair, so as to be processed efficiently subsequently.

[0139] S403, extracting a second target predicate between each entity pair from the target predicate set between each entity pair.

[0140] Among them, the second target predicate refers to the predicate with the highest frequency of occurrence in the target predicate set.

[0141] It should be noted that the specific implementation of step S403 can be correspondingly referred to step S104, which will not be described here.

[0142] S404, updating the knowledge graph based on the second target predicate between each entity pair and the corresponding entity pair.

[0143] Specifically, the second target predicate between each entity pair and the corresponding entity pair can be used to update the knowledge graph in the form of a triple. Among them, the triple is composed of two entities and a relationship, the entity is the subject and the object, and the relationship is the connection between the two entities, for example <subject, predicate, object>.

[0144] S106, when receiving the first selection instruction sent by the user, updating the knowledge graph based on the first target predicate between each entity pair and the corresponding entity pair.

[0145] Among them, the first selection instruction refers to the instruction of the user selecting to view the target predicate between all entity pairs. Specifically, the system will update the triple (subject, predicate, object) of the knowledge graph according to the user's selection, so as to assist the user to view, so that the knowledge extraction presents better accuracy and interpretability.

[0146] The application provides a data information extraction method. The method comprises the following steps: obtaining a to-be-extracted document input by a user; inputting the to-be-extracted document into a pre-trained entity extraction model to obtain an entity set of the to-be-extracted document, wherein the entity extraction model is obtained by pre-training using a plurality of to-be-extracted samples, and the entity set comprises at least a plurality of entity pairs, and each entity pair comprises at least two entities; performing relationship extraction on each entity pair in the entity set of the to-be-extracted document to obtain a predicate set between each entity pair; extracting a first target predicate between each entity pair from the predicate set between each entity pair, wherein the first target predicate refers to a predicate with the highest frequency in the predicate set; feeding back an extraction result of the to-be-extracted document to the user; and updating a knowledge graph based on the first target predicate between each entity pair and the corresponding entity pair when receiving a first selection instruction sent by the user. Thus, the data can be accurately extracted by performing entity extraction and relationship extraction between entity pairs, and the problem of inaccurate extraction result is avoided.

[0147] Another embodiment of the application provides another data information extraction method, as shown in the following table. Figure 5

[0148] S501, obtaining a to-be-extracted document input by a user.

[0149] It should be noted that the specific implementation of step S501 can be correspondingly referred to step S101 in the above method embodiment, and details are not repeated here.

[0150] S502, inputting the to-be-extracted document into a pre-trained entity extraction model to obtain an entity set of the to-be-extracted document.

[0151] The entity extraction model is obtained by pre-training using a plurality of to-be-extracted samples. The entity set comprises at least a plurality of entity pairs, and each entity pair comprises at least two entities.

[0152] It should be noted that the specific implementation of step S502 can be correspondingly referred to step S102 in the above method embodiment, and details are not repeated here.

[0153] S503, detecting whether relationship extraction has been performed between each entity pair in the entity set of the to-be-extracted document.

[0154] ​Specifically, considering that the user-inputted document to be extracted may have an extraction record left in the system, in order to avoid repeated extraction work and reduce resource waste, in the embodiment of the present application, it is detected whether the relationship extraction has been performed between each pair of entities in the entity set of the document to be extracted. If it is detected that the relationship extraction has been performed between each pair of entities in the entity set of the document to be extracted, it is indicated that the extraction result of the document to be extracted is left in the system, and thus step S504 needs to be performed. If it is detected that the relationship extraction has not been performed between each pair of entities in the entity set of the document to be extracted, step S505 is performed.

[0155] S504, ending the extraction work on the document to be extracted.

[0156] S505, performing relationship extraction on each pair of entities in the entity set of the document to be extracted respectively to obtain a predicate set between each pair of entities.

[0157] It should be noted that the specific implementation of step S505 can be correspondingly referred to step S103 in the above method embodiment, and will not be described here.

[0158] S506, extracting a first target predicate between each pair of entities from the predicate set between each pair of entities.

[0159] The first target predicate refers to the predicate with the highest frequency of occurrence in the predicate set.

[0160] It should be noted that the specific implementation of step S506 can be correspondingly referred to step S104 in the above method embodiment, and will not be described here.

[0161] S507, feeding back the extraction result of the document to be extracted to the user.

[0162] It should be noted that the specific implementation of step S507 can be correspondingly referred to step S105 in the above method embodiment, and will not be described here.

[0163] S508, when receiving the first selection instruction sent by the user, updating the knowledge graph based on the first target predicate between each pair of entities and the corresponding each pair of entities.

[0164] It should be noted that the specific implementation of step S508 can be correspondingly referred to step S106 in the above method embodiment, and will not be described here.

[0165] Another embodiment of the present application provides an extraction device of data information, as shown in Figure 6 The extraction device comprises the following units:

[0166] A first acquisition unit 601 is configured to acquire a user-inputted document to be extracted.

[0167] The first input unit 602 is configured to input a document to be extracted into a pre-trained entity extraction model to obtain an entity set of the document to be extracted.

[0168] The entity extraction model is pre-trained by using a plurality of samples to be extracted. The entity set includes at least a plurality of entity pairs. Each entity pair includes at least two entities.

[0169] The relationship extraction unit 603 is configured to perform relationship extraction on each entity pair in the entity set of the document to be extracted to obtain a predicate set between each entity pair.

[0170] The first extraction unit 604 is configured to extract a first target predicate between each entity pair from the predicate set between each entity pair.

[0171] The first target predicate refers to a predicate with the highest frequency in the predicate set.

[0172] The feedback unit 605 is configured to feed back the extraction result of the document to be extracted to the user.

[0173] The first updating unit 606 is configured to update the knowledge graph based on the first target predicate between each entity pair and the corresponding entity pair when receiving a first selection instruction sent by the user.

[0174] It should be noted that the specific working process of the above units in the embodiments of the present application can be correspondingly referred to steps S101-S106 in the above method embodiments, which will not be described here.

[0175] Optionally, another embodiment of the present application provides an extraction device of data information, which further comprises:

[0176] The first finding unit is configured to find a predicate list between each entity pair from the knowledge graph when receiving a second selection instruction sent by the user.

[0177] The first merging unit is configured to merge the predicate set between each entity pair and the predicate list between each entity pair to obtain a target predicate set between each entity pair.

[0178] The second extraction unit is configured to extract a second target predicate between each entity pair from the target predicate set between each entity pair.

[0179] The second target predicate refers to a predicate with the highest frequency in the target predicate set.

[0180] The second updating unit is configured to update the knowledge graph based on the second target predicate between each entity pair and the corresponding entity pair.

[0181] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can correspondingly refer to the corresponding steps in the above method embodiments, which will not be described here.

[0182] Optionally, another embodiment of the present application provides a data information extraction device, comprising:

[0183] The second acquisition unit is configured to acquire a plurality of samples to be extracted.

[0184] The second input unit is configured to respectively input each sample to be extracted into the pre-trained entity extraction model, and obtain a sample entity set of each sample to be extracted through the entity extraction model.

[0185] The first judgment unit is configured to judge whether the loss function of the entity extraction model converges based on the sample entity set of each sample to be extracted.

[0186] The first adjustment unit is configured to adjust the parameters of the entity extraction model if it is judged that the loss function of the entity extraction model does not converge, and return to execute the step of respectively inputting each sample to be extracted into the pre-trained entity extraction model, and obtaining a sample entity set of each sample to be extracted through the entity extraction model.

[0187] The first determination unit is configured to determine the entity extraction model as a trained entity extraction model if it is judged that the loss function of the entity extraction model converges.

[0188] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can correspondingly refer to the corresponding steps in the above method embodiments, which will not be described here.

[0189] Optionally, another embodiment of the present application provides a data information extraction device, comprising:

[0190] The third acquisition unit is configured to acquire each entity pair of the document to be extracted from the entity set of the document to be extracted.

[0191] The second finding unit is configured to find the target sentence of each entity pair from the document to be extracted.

[0192] The target sentence refers to the sentence in which the entity pair is located in the document to be extracted.

[0193] The analysis unit is configured to perform syntactic analysis on the target sentence of each entity pair to obtain the syntactic relationship between each entity pair and the target sentence of each entity pair.

[0194] The third finding unit is configured to find the predicate between each entity pair based on the syntactic relationship between each entity pair and the target sentence of each entity pair from the target sentence of each entity pair.

[0195] The third input unit is configured to input each of the to-be-extracted document and each of the entity pairs of the to-be-extracted document into the trained relation extraction model, to obtain a first predicate set between the entity pairs.

[0196] The relation extraction model is trained in advance by using a plurality of to-be-extracted samples and a plurality of sample entity pairs of the to-be-extracted samples.

[0197] The second merging unit is configured to merge the first predicate set between the entity pairs and the predicates between the entity pairs, to obtain a predicate set between the entity pairs.

[0198] It should be noted that the specific working processes of the various units provided in the above embodiments of the present application can correspondingly refer to the corresponding steps in the above method embodiments, which will not be described here in detail.

[0199] Optionally, another embodiment of the present application provides a data information extraction device, which further comprises:

[0200] The fourth acquisition unit is configured to acquire a plurality of to-be-extracted samples and a plurality of sample entity pairs of the to-be-extracted samples.

[0201] The fourth input unit is configured to input each of the to-be-extracted samples and each of the sample entity pairs of the to-be-extracted samples into the pre-trained relation extraction model, to obtain a sample predicate set of each of the sample entity pairs by using the relation extraction model.

[0202] The second judgment unit is configured to judge whether the sample predicate set of each of the sample entity pairs conforms to an actual predicate set of each of the sample entity pairs.

[0203] The second determination unit is configured to determine the relation extraction model as the trained relation extraction model if it is judged that the sample predicate set of each of the sample entity pairs conforms to the actual predicate set of each of the sample entity pairs.

[0204] The second adjustment unit is configured to adjust parameters of the relation extraction model and return to execute the operation of inputting each of the to-be-extracted samples and each of the sample entity pairs of the to-be-extracted samples into the pre-trained relation extraction model, to obtain the sample predicate set of each of the sample entity pairs by using the relation extraction model, if it is judged that the sample predicate set of each of the sample entity pairs does not conform to the actual predicate set of each of the sample entity pairs.

[0205] It should be noted that the specific working processes of the various units provided in the above embodiments of the present application can correspondingly refer to the corresponding steps in the above method embodiments, which will not be described here in detail.

[0206] Optionally, another embodiment of the present application provides a data information extraction device, which further comprises:

[0207] The detection unit is configured to detect whether relationship extraction has been performed between each pair of entities in the entity set of the document to be extracted.

[0208] The relationship extraction unit is configured to perform relationship extraction on each pair of entities in the entity set of the document to be extracted respectively to obtain a predicate set between each pair of entities, when the detection unit detects that relationship extraction has not been performed between each pair of entities in the entity set of the document to be extracted.

[0209] The ending unit is configured to end the extraction of the document to be extracted, when the detection unit detects that relationship extraction has been performed between each pair of entities in the entity set of the document to be extracted.

[0210] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can correspondingly refer to the corresponding steps in the above method embodiments, which will not be described here again.

[0211] Another embodiment of the present application provides an electronic device, as shown in the figure, comprising: Figure 7

[0212] The memory 701 and the processor 702.

[0213] The memory 701 is configured to store a program.

[0214] The processor 702 is configured to execute the program, and when the program is executed, it is specifically configured to implement the data information extraction method provided in any one of the above embodiments.

[0215] Another embodiment of the present application provides a computer storage medium for storing a computer program, and when the computer program is executed, it is used to implement the data information extraction method provided in any one of the above embodiments.

[0216] The computer storage medium includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition in this paper, computer readable medium does not include transitory computer readable medium, such as modulated data signal and carrier wave.​

[0217] Those skilled in the art will further appreciate that the units and algorithms described in connection with the examples disclosed herein can be embodied directly in hardware, in software, or in a combination of the two. For the sake of brevity, descriptions of a method of execution of the examples will not be repeated here in detail, as the general principles have already been described above. The skilled person can use different methods to implement the described functions, depending on the particular application and design constraints. However, such implementation should not be considered to be beyond the scope of the present application.

[0218] The above description of disclosed embodiments enables a person skilled in the art to implement or use the application. Numerous modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of extracting data information, characterized by, The method comprises the following steps: obtaining a user inputted document to be extracted; inputting the document to be extracted into a pre-trained entity extraction model to obtain an entity set of the document to be extracted; wherein the entity extraction model is pre-trained by using a plurality of samples to be extracted; the entity set comprises at least a plurality of entity pairs; each entity pair comprises at least two entities; performing relation extraction on each entity pair in the entity set of the document to be extracted to obtain a predicate set between each entity pair; extracting a first target predicate between each entity pair from the predicate set between each entity pair; wherein the first target predicate refers to the predicate with the highest frequency in the predicate set; feeding back the extraction result of the document to be extracted to the user; updating a knowledge graph based on the first target predicate between each entity pair and the corresponding entity pair when receiving a first selection instruction sent by the user; wherein the relation extraction on each entity pair in the entity set of the document to be extracted to obtain a predicate set between each entity pair comprises the following steps: obtaining each entity pair of the document to be extracted from the entity set of the document to be extracted; finding a target sentence of each entity pair from the document to be extracted; wherein the target sentence refers to the sentence where the entity pair is located in the document to be extracted; performing syntax analysis on the target sentence of each entity pair to obtain a syntax relationship between each entity pair and the target sentence of each entity pair; finding a predicate between each entity pair from the target sentence of each entity pair based on the syntax relationship between each entity pair and the target sentence of each entity pair; inputting the document to be extracted and each entity pair of the document to be extracted into a trained relation extraction model to obtain a first predicate set between each entity pair; wherein the relation extraction model is pre-trained by using a plurality of samples to be extracted and a plurality of sample entity pairs of the samples to be extracted; merging the first predicate set between each entity pair and the predicate between each entity pair to obtain a predicate set between each entity pair; the training method of the relation extraction model comprises the following steps: obtaining a plurality of samples to be extracted and a plurality of sample entity pairs of the samples to be extracted; inputting each sample to be extracted and each sample entity pair of the sample to be extracted into a pre-trained relation extraction model to obtain a sample predicate set of each sample entity pair by using the relation extraction model; judging whether the sample predicate set of each sample entity pair conforms to an actual predicate set of each sample entity pair; if it is judged that the sample predicate set of each sample entity pair conforms to the actual predicate set of each sample entity pair, the relation extraction model is determined as the trained relation extraction model. If it is judged that the sample predicate set of each sample entity pair does not conform to the actual predicate set of each sample entity pair, the parameters of the relation extraction model are adjusted, and the input of each of the to-be-extracted samples and each sample entity pair thereof into the pre-trained relation extraction model is performed again to obtain the sample predicate set of each sample entity pair through the relation extraction model.

2. The method of claim 1, wherein, After the feedback of the extraction result of the to-be-extracted document to the user, the method further includes: When the second selection instruction sent by the user is received, a predicate list between each entity pair in the knowledge graph is searched; The predicate set between each entity pair and the predicate list between each entity pair are merged to obtain a target predicate set between each entity pair; A second target predicate between each entity pair is extracted from the target predicate set between each entity pair; wherein the second target predicate refers to the predicate with the highest frequency of occurrence in the target predicate set; Based on the second target predicate between each entity pair and each corresponding entity pair, the knowledge graph is updated.

3. The method of claim 1, wherein, The training method of the entity extraction model includes: Obtaining a plurality of to-be-extracted samples; Each of the to-be-extracted samples is input into a pre-trained entity extraction model, and a sample entity set of each of the to-be-extracted samples is obtained through the entity extraction model; Based on the sample entity set of each of the to-be-extracted samples, it is judged whether the loss function of the entity extraction model converges; If it is judged that the loss function of the entity extraction model does not converge, the parameters of the entity extraction model are adjusted, and the input of each of the to-be-extracted samples into the pre-trained entity extraction model is performed again to obtain the sample entity set of each of the to-be-extracted samples through the entity extraction model; If it is judged that the loss function of the entity extraction model converges, the entity extraction model is determined as the trained entity extraction model.

4. The method of claim 1, wherein, Before the relation extraction on each of the entity pairs in the entity set of the to-be-extracted document is performed to obtain the predicate set between each of the entity pairs, the method further includes: Detecting whether the relation extraction between each of the entity pairs in the entity set of the to-be-extracted document has been performed; If it is detected that the relation extraction between each of the entity pairs in the entity set of the to-be-extracted document has been performed, the extraction work on the to-be-extracted document is ended; If it is detected that the relation extraction between each of the entity pairs in the entity set of the to-be-extracted document has not been performed, the relation extraction on each of the entity pairs in the entity set of the to-be-extracted document is performed to obtain the predicate set between each of the entity pairs.

5. An extracting apparatus of data information, characterized by comprising: It includes: A first obtaining unit is configured to obtain a to-be-extracted document input by a user; The first input unit is configured to input the document to be extracted into a pre-trained entity extraction model to obtain an entity set of the document to be extracted; the entity extraction model is pre-trained by using a plurality of samples to be extracted; the entity set comprises at least a plurality of entity pairs; each entity pair comprises at least two entities; The relationship extraction unit is configured to perform relationship extraction on each entity pair in the entity set of the document to be extracted to obtain a predicate set between each entity pair; The first extraction unit is configured to extract a first target predicate between each entity pair from the predicate set between each entity pair; the first target predicate refers to a predicate with the highest frequency in the predicate set; The feedback unit is configured to feed back an extraction result of the document to be extracted to the user; The first update unit is configured to update a knowledge graph based on the first target predicate between each entity pair and each entity pair corresponding to the first target predicate when receiving a first selection instruction sent by the user; The relationship extraction unit comprises: The third acquisition unit is configured to acquire each entity pair of the document to be extracted from the entity set of the document to be extracted; The second finding unit is configured to find a target sentence of each entity pair from the document to be extracted; the target sentence refers to a sentence in which the entity pair is located in the document to be extracted; The analysis unit is configured to perform syntactic analysis on the target sentence of each entity pair to obtain a syntactic relationship between each entity pair and the target sentence of each entity pair; The third finding unit is configured to find a predicate between each entity pair from the target sentence of each entity pair based on the syntactic relationship between each entity pair and the target sentence of each entity pair; The third input unit is configured to input the document to be extracted and each entity pair of the document to be extracted into a trained relationship extraction model respectively to obtain a first predicate set between each entity pair; the relationship extraction model is pre-trained by using a plurality of samples to be extracted and a plurality of sample entity pairs of the samples to be extracted; The second merging unit is configured to merge the first predicate set between each entity pair and the predicate between each entity pair to obtain a predicate set between each entity pair; Further comprising: The fourth acquisition unit is configured to acquire a plurality of samples to be extracted and a plurality of sample entity pairs of the samples to be extracted; The fourth input unit is configured to input each sample to be extracted and each sample entity pair of the sample to be extracted into a pre-trained relationship extraction model respectively to obtain a sample predicate set of each sample entity pair by using the relationship extraction model; The second judgment unit is configured to judge whether the sample predicate set of each sample entity pair conforms to an actual predicate set of each sample entity pair; The second determination unit is configured to determine the relationship extraction model as the trained relationship extraction model if it is judged that the sample predicate set of each sample entity pair conforms to the actual predicate set of each sample entity pair. The second adjusting unit is configured to adjust the parameters of the relation extraction model if it is determined that the sample predicate set of each sample entity pair does not conform to the actual predicate set of each sample entity pair, and return to input each of the to-be-extracted samples and each of the sample entity pairs thereof into the pre-trained relation extraction model to obtain the sample predicate set of each sample entity pair through the relation extraction model.

6. The apparatus of claim 5, wherein, Further comprising: The first searching unit is configured to search for a predicate list between each of the entity pairs from the knowledge graph when the second selection instruction sent by the user is received. The first merging unit is configured to merge the predicate set between each of the entity pairs and the predicate list between each of the entity pairs to obtain a target predicate set between each of the entity pairs. The second extracting unit is configured to extract a second target predicate between each of the entity pairs from the target predicate set between each of the entity pairs, wherein the second target predicate refers to a predicate with the highest frequency in the target predicate set. The second updating unit is configured to update the knowledge graph based on the second target predicate between each of the entity pairs and each of the corresponding entity pairs.

7. An electronic device, comprising: Comprise: A memory and a processor; The memory is configured to store a program; The processor is configured to execute the program, and the program, when executed, is specifically configured to implement the data information extraction method in any one of claims 1 to 4.

8. A computer storage medium, characterized in that A computer program is stored, and the computer program, when executed, is configured to implement the data information extraction method in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Self-adapting software defect positioning method based on predicate execution information analysis

    CN102622295A

  • Question' predicate determination method, device, equipment and storage medium

    CN110991183A