Knowledge unit extraction method, apparatus, device, and medium

By extracting key-value pairs and structural information from documents, the association between entities and attributes is automatically established, solving the problems of automation and universality in the extraction of knowledge units from industry documents, and realizing efficient knowledge unit extraction without human intervention.

CN114265942BActive Publication Date: 2026-01-16BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111590166.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2026-01-16
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

Existing technologies for extracting knowledge units from industry documents suffer from poor generalization, require manual configuration of parsing rules, cannot be automated, are difficult to adapt to different fields, and consume a lot of manpower.

Method used

By directly extracting key-value pairs from the target document and retrieving entities based on document structure information, the association between entities and key-value pairs is established, reducing manual intervention and improving automation and versatility.

Benefits of technology

It enables the extraction of knowledge units in different fields without human intervention, improving the degree of automation and versatility, and reducing reliance on industry personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265942B_ABST
    Figure CN114265942B_ABST
Patent Text Reader

Abstract

The present disclosure provides a knowledge unit extraction method, device, equipment and medium, relates to the technical field of computer data processing, and particularly relates to artificial intelligence, natural language processing and deep learning technology. The specific implementation scheme is: a plurality of key-value pairs are recognized and acquired from a target document; document structure information to which the key-value pairs belong is acquired from the target document; entities are recognized and acquired from the document structure information; an association between the entities and the key-value pairs is established to form a knowledge unit comprising the entities and the key-value pairs. The present disclosure can improve the generality and automation degree of extracting knowledge units in a document.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer data processing, and in particular to artificial intelligence, natural language processing and deep learning technology. BACKGROUND

[0002] The knowledge extraction task is one of the most important tasks in the construction of a knowledge graph. The task is to extract useful knowledge units from natural text through automatic or semi-automatic technology to supplement entity attributes and entity relationships in the knowledge graph. The knowledge unit is usually in the form of an SPO triple, which generally includes three elements: S (entity), P (entity attribute) and O (entity attribute value).

[0003] For industry documents, there is also a need for SPO extraction. The generalization of industry extraction strategies is poor, and when migrating to a new industry, it is necessary to reconfigure parsing and filtering strategies according to industry knowledge. SUMMARY

[0004] The present disclosure provides a knowledge unit extraction method, device, equipment and medium to improve the generality and automation of extracting knowledge units from documents.

[0005] According to an aspect of the present disclosure, a knowledge unit extraction method is provided, the method comprising:

[0006] identifying and obtaining a plurality of key-value pairs from a target document;

[0007] obtaining document structure information to which the key-value pairs belong from the target document;

[0008] identifying and obtaining an entity from the document structure information;

[0009] establishing an association between the entity and the key-value pairs to form a knowledge unit comprising the entity and the key-value pairs.

[0010] According to another aspect of the present disclosure, a knowledge unit extraction device is provided, the device comprising:

[0011] a key-value pair obtaining module configured to identify and obtain a plurality of key-value pairs from a target document;

[0012] a structure information obtaining module configured to obtain document structure information to which the key-value pairs belong from the target document;

[0013] an entity identifying module configured to identify and obtain an entity from the document structure information;

[0014] a knowledge unit forming module configured to establish an association between the entity and the key-value pairs to form a knowledge unit comprising the entity and the key-value pairs.

[0015] According to another aspect of the present disclosure, an electronic device is provided, comprising:

[0016] at least one processor; and

[0017] a memory connected with the at least one processor in communication; wherein,

[0018] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the knowledge unit extraction method provided by any embodiment of the present disclosure.

[0019] According to another aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to perform the knowledge unit extraction method provided by any embodiment of the present disclosure.

[0020] The embodiments of the present disclosure can establish the association between the entities and the attributes and the values which are far away in position but have subordinate relationship in the original document by directly obtaining the key-value pairs in the target document, obtaining the document structure information based on the obtained key-value pairs, and then obtaining the entities by using the document structure information, and finally realizing the association between the entities and the key-value pairs to form the knowledge unit. In this process, the manual intervention is not required, the automation degree of the overall knowledge unit extraction is improved, and meanwhile, the underlying association between the key-value pairs and the entities based on the file structure information of the document itself reduces the need for industry personnel in the extraction process and improves the overall generality of the scheme in different fields.

[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0022] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0023] Figure 1A is a flowchart of a knowledge unit extraction method according to an embodiment of the present disclosure;

[0024] Figure 1B is a schematic diagram of the content of a power document according to an embodiment of the present disclosure;

[0025] Figure 2A is a flowchart of a knowledge unit extraction method according to an embodiment of the present disclosure;

[0026] Figure 2Bis a diagram for completing P based on document structure information according to an embodiment of the present disclosure;

[0027] Figure 2C is an architecture diagram of a knowledge unit extraction system according to an embodiment of the present disclosure;

[0028] Figure 3 is a flowchart of a knowledge unit extraction method according to an embodiment of the present disclosure;

[0029] Figure 4A is a flowchart of a knowledge unit extraction method according to an embodiment of the present disclosure;

[0030] Figure 4B is a model diagram of a classification model according to an embodiment of the present disclosure;

[0031] Figure 4C is a model structure diagram of model training according to an embodiment of the present disclosure;

[0032] Figure 5 is a flowchart of a knowledge unit extraction method according to an embodiment of the present disclosure;

[0033] Figure 6 is a flowchart of a knowledge unit extraction method according to an embodiment of the present disclosure;

[0034] Figure 7 is a device structure diagram of a knowledge unit extraction device according to an embodiment of the present disclosure;

[0035] Figure 8 is a block diagram of an electronic device for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings to assist in a comprehensive understanding of the present disclosure by those of ordinary skill in the art, and the exemplary embodiments of the present disclosure can be implemented in various ways. It should be understood that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the present disclosure. Wherever possible, the same reference numbers will be used throughout the specification to refer to the same or similar parts.

[0037] The embodiments of the present disclosure can be applied to knowledge extraction of a document to obtain effective knowledge units, and are particularly suitable for extracting industry knowledge units (SPO) from industry professional documents. The knowledge unit generally includes a triple relationship of an entity (S), an attribute (P) and a value (O), or can also be other triples such as an entity (S), an inter-entity relationship (P) and an associated entity (O). When SPO needs to be extracted from a document, the probability of PO content appearing in the same sentence is relatively high, and SPO can be directly extracted, while S may not appear in the same sentence as PO, and it is difficult to collect complete SPO. The embodiments of the present disclosure solve the above technical problems, can realize document-level SPO extraction for a document, and do not need to completely rely on preset extraction rules specific to the document for extraction, and have high universality and high portability.

[0038] Figure 1A A flowchart of a knowledge unit extraction method provided by an embodiment of the present disclosure. The embodiment can be applied to knowledge extraction of a document to obtain effective knowledge units. The method can be executed by a knowledge unit extraction device, which can be implemented in software and / or hardware. The device can be configured in an electronic device with corresponding processing capability. The method specifically includes:

[0039] S110, obtaining a plurality of key-value pairs from a target document.

[0040] The target document can be an unstructured document, such as a commonly used document format such as normal docx, pdf, xlsx, caj, etc. The target document can also be a semi-structured document, such as a log file, an XML document, a JSON document, an Email, etc. It can also be a structured document, such as a document information managed in the form of a relational database table. The key-value pair can be regarded as semi-structured text representing key-value (KV) information. Compared with unstructured pure text, semi-structured data has certain structural properties at the text level and the semantic level: at the text level, semi-structured data is distributed in a standard manner, and can be matched and extracted based on template rules to parse slots; at the semantic level, the text in the same slot belongs to the same category and contains the same meaning. The target of the above key-value pair identification is to obtain semi-structured text with two slots. The present disclosure can extract knowledge units based on document-form files, thereby improving the efficiency and finiteness of knowledge unit extraction.

[0041] Specifically, since the data in the target document is usually complex and cannot be directly extracted into available and effective knowledge units at one step, the semi-structured data in the form of key-value pairs is identified from the target document in the embodiments of the present disclosure to realize the initial processing of the target document. Optionally, a plurality of key-value pairs can be identified and obtained from each independent sentence in the target document.

[0042] In the embodiments of the present disclosure, the key-value pairs can be obtained as needed according to different requirements of extracting knowledge units. The key field and the value field in the key-value pair can be used to record text pairs with different relationships. The embodiments of the present disclosure are described by taking the extraction of knowledge units from industry documents as an example. For industry knowledge units, the focus is on the values of various attributes of entities in the industry, and therefore, the key-value pairs of “attribute-value” can be obtained as the target. The key field in the key-value pair can be used to store the attribute, and the value field in the key-value pair can be used to store the value of the attribute.

[0043] wherein the attribute is an entity attribute (P) in the SPO data, and the attribute value is an entity attribute value (O) in the SPO data.

[0044] Specifically, by storing the attribute and the attribute value in the form of key-value pairs, the one-to-one corresponding association storage of the attribute and the attribute value is ensured, and the key-value pair form is convenient for storage and easy to read, which can accelerate the subsequent knowledge unit extraction rate.

[0045] In addition, due to the limitation of the length, only the storage of the attribute-attribute value in the form of key-value pairs is described in the present disclosure. When the key-value pairs are actually used, the key-value pairs can also be used to store the text pairs with fixed structure semantic relationships such as the name-explanation and the annotation-content based on different requirements, to be used as P and O of the SPO respectively.

[0046] S120, obtaining document structure information to which the key-value pair belongs from the target document.

[0047] wherein the document structure information is the overall writing structure and context of the target document, which can be regarded as the outline information of the current document, and expresses the subordinate relationship between the texts in the target document.

[0048] Specifically, by obtaining the document structure information of the key-value pair, the deep structure connection between the key-value pair and the overall document structure can be obtained, which provides more effective information for the formation of the subsequent knowledge unit, and at the same time, the document structure and part not containing the effective key-value pair are excluded, which reduces the data processing amount and effectively avoids the influence of the invalid part on the document receiving information acquisition and the subsequent knowledge unit extraction process.

[0049] Optionally, the document structure information can include a structure chapter, a list title, a chapter title and a document name to which the key-value pair belongs.

[0050] Specifically, the list title, the chapter name and the document name are relatively simple to obtain, and most documents have the three, and the file structure information obtained based on the three is not only relatively high in obtaining efficiency, but also has strong universality. The structure chapter to which the key-value pair belongs is a chapter in the document for explaining the document structure. For example, in the power industry standard document, a "scope" chapter is usually set first, and the content of the chapter is used to explain the product range to which the document is applicable, that is, to generally explain the range of entities in the document. In addition, chapters such as "equipment specification" in the document also have similar functions and can be extracted as document structure information. The structure chapter can be identified by setting keywords such as "scope" and "equipment specification" to extract the paragraph content meeting the keyword requirements as the structure chapter.

[0051] S130, obtaining an entity from the document structure information.

[0052] The entity is the entity to which the key-value pair in the current document belongs. Specifically, on the basis of obtaining the key-value pair from the document, in order to finally extract the knowledge unit, the entity required to form the knowledge unit needs to be further obtained from the target document. If the key-value pair is subordinate to an entity in the document structure, the attribute in the key-value pair is probably to describe the entity.

[0053] For example, Figure 1B is a schematic diagram of the content of a power document, wherein the extractable KV includes: environmental temperature (key)-(23±5)℃ (value), and the entity "transformer" corresponding to the KV is not in the same sentence as the KV, so it cannot be extracted together. The document title to which the KV belongs can be found according to the document structure relationship to determine that the entity is "transformer".

[0054] S140, establishing an association between the entity and the key-value pair to form a knowledge unit including the entity and the key-value pair.

[0055] The knowledge unit is composed of the entity and the key-value pair, and the entity is described, limited or explained by the information stored in the key-value pair.

[0056] Specifically, after obtaining the entity and the key-value pair in the target document, the obtained entity and the key-value pair are associated. In this process, one entity can correspond to multiple key-value pairs, or each entity can correspond to one key-value pair.

[0057] In the related art, a developer reads industry documents to understand data distribution, determines extraction targets, and manually sets document parsing rules to complete extraction of SPOs according to the parsing rules. In addition, to improve the accuracy and completeness of the extracted SPOs, a filter rule and a semantic completion rule need to be manually set. Therefore, the existing knowledge unit extraction scheme for industry documents requires high human involvement, and the system cannot be automatically operated. The developer needs to manually participate in configuration, labeling, and rule setting, which consumes a lot of manpower and requires the developer to have industry knowledge. Therefore, when facing a new industry, the developer needs to have sufficient professional knowledge to manually set rules for extraction. The embodiments of the present disclosure directly obtain key-value pairs in the target document, obtain document structure information based on the obtained key-value pairs, and obtain entities using the document structure information, thereby establishing a relationship between entities and attributes and values that are far apart in position but have a subordinate relationship in the original document, and finally realizing the association between entities and key-value pairs to form knowledge units. In this process, no manual intervention is required, which improves the automation of the overall knowledge unit extraction. Meanwhile, the key-value pairs and entities are associated based on the underlying file structure information of the document itself, which reduces the need for industry personnel in the extraction process and improves the overall versatility of the scheme in different fields.

[0058] Figure 2A The flowchart of the knowledge unit extraction method provided by another embodiment of the present disclosure is based on the above-mentioned embodiments. After establishing the association between entities and key-value pairs, the technical feature of "performing semantic understanding on the document structure information to complete semantic completion of the key-value pairs" can be added, so that the key-value pairs record and express information more accurately and specifically.

[0059] Specifically, referring to Figure 2A The method can include:

[0060] S210, obtaining multiple key-value pairs from a target document.

[0061] S220, obtaining document structure information subordinate to the key-value pairs from the target document.

[0062] S230, obtaining entities from the document structure information.

[0063] S240, establishing an association between entities and key-value pairs.

[0064] S250, performing semantic understanding on the document structure information to complete semantic completion of the key-value pairs.

[0065] Specifically, because documents may store some important information in other places such as titles, chapters, and document names during the writing process, key-value pairs obtained based on partial text content in the target document may be semantically incomplete and unable to fully express a certain attribute of the current entity. Therefore, in this embodiment of the disclosure, semantic understanding is performed using the already obtained document structure information to complete the content of the key and / or value range of the key-value pairs.

[0066] For example, the parent chapter of the paragraph containing the current key-value pair is "A Brief Discussion on the Safe Peak Voltage of Electricity Used in Various Countries", and the text content of the key-value pair is: "my country requires a voltage of 220V". Before semantic completion, the key-value pair is "voltage-220V". After semantic completion based on the document structure information, it becomes "safe peak voltage-220V", making the semantics expressed by the key-value pair clearer.

[0067] Industry documents, as the extraction source, may retain attribute constraint information in the title structure; see [link / reference]. Figure 2B As shown, P can be completed based on document structure information.

[0068] Industry documents are organized in a document-writing structure, and the semantic information contained in the key is often incomplete. For example, the original text "maximum temperature: +40℃" can be expressed as "the highest temperature of the environment" or "the highest temperature of the environment under normal use conditions". Therefore, it is necessary to complete it by using the semantics of the title level to which the key-value pair belongs.

[0069] Furthermore, performing semantic understanding on the document structure information to semantically complete the key-value pairs may include:

[0070] Based on the prior rules of the document data of the industry to be extracted, the document structure information is semantically understood, and semantic completion is performed on the key fields in the key-value pairs based on the semantic understanding results; and / or

[0071] A summary is extracted from the document structure information, and semantic completion is performed on the key fields in the key-value pairs based on the summary extraction results.

[0072] The document data priori rule is an article data architecture habit of the to-be-extracted industry and is commonly used when a document is written. For example, for the use specification of a transformer, the normal use power is usually given first, then the safety threshold range of the current, voltage and other parameters is given, then the performance state of various configuration parameters in dangerous work is given, and finally the appropriate working humidity, altitude, temperature and other environmental requirements are given. For example, under the parent chapter of use power, the adjustment mode and data requirement of the rated power are usually given first, and then the adjustment mode and data requirement of the maximum power are given. Therefore, the document data priori rule can be set to extract the attribute content from the title content and complete the attribute in the key-value pair. For example, "environmental conditions" often appear in the title, and "environmental conditions" can be extracted according to the key word in the priori rule and supplemented to the content of the attribute. In the case where the data distribution of the industry document is unknown, the rewriting standard can be determined through manual annotation of part of the sample data, the basic data of the industry is accumulated, the data distribution is analyzed, and the solution is determined. If the data distribution has a unified direction, for example, the use condition class, the rewriting problem can be solved based on the rule; if the data distribution to be rewritten is uniform and the class is more, the rewriting problem can be solved based on the extractive summary model.

[0073] From the document structure information, the summary extraction manner can be based on a pre-trained summary extraction model to extract summary text from the document structure information and supplement the key field or the value field, so that the semantics is complete. The summary extraction manner has higher universality.

[0074] In S260, the key-value pair and the entity with the established association are formed into a knowledge unit including the entity and the key-value pair.

[0075] The technical solution of the embodiment of the present disclosure further supplements the semantic content of the key field or the value field based on the document structure information. The supplemented semantic content is relatively far from the position of the key-value pair and does not belong to the same independent sentence, but the dependent relationship can be established based on the document structure information, so that the semantic supplement is realized.

[0076] Of course, the KV obtained through the above extraction, recognition and supplement may still have a lot of noise, that is, mis-extracted content. First, the key and value information recognized with a high recall rate is obtained. Since the recognition strategy has low accuracy, the KV data contains a lot of noise of non-attribute-value, and the output data needs to be filtered to improve the accuracy of the output data. Therefore, the embodiment of the present disclosure further provides specific strategies for each link to improve the accuracy of the obtained recognition result.

[0077] As Figure 2CAn architecture diagram of a knowledge unit extraction system applicable to embodiments of the present disclosure is shown. The extraction system includes three processing links: KV identification, KV and S association, and KV completion. A structured document is input into the KV identification link, and can specifically pass through KV parsing, KV meta information (document structure information) acquisition, and KV filtering, and the KV basic data can be obtained through KV filtering; then the KV basic data is input into the KV and S association link, and the candidate S is obtained through S identification, and the S-KV basic data is obtained through S association; the S-KV basic data is input into the KV completion link, P completion is performed, and the SPO is output.

[0078] The above knowledge unit extraction system divides the strategy of the generalizable module into two parts: "general" and "industry". The general strategy can be defined in advance, and the general strategy has strong generalization, and can identify, associate, and rewrite the KV without being based on industry knowledge. The data output based on the general strategy can be combined with the industry extraction target, and the SPO that meets the industry demand can be obtained based on the industry strategy.

[0079] The subsequent embodiments of the present disclosure will introduce the specific implementation schemes of each link in detail.

[0080] Figure 3 A flowchart of a knowledge unit extraction method provided by another embodiment of the present disclosure is shown. The embodiment is based on the above-mentioned embodiments, and specifically introduces the KV Figure 2C The KV parsing link shown divides "identifying and obtaining a plurality of key-value pairs from a target document" into "identifying and obtaining a plurality of associated text pairs from a sentence of the target document based on a set identification strategy, and filling the associated text pairs into corresponding key-value pair slots according to slots in the set identification strategy to form key-value pairs", so as to efficiently and effectively obtain the key-value pairs.

[0081] Specifically, referring to Figure 3 The method can include:

[0082] S310, identifying and obtaining a plurality of associated text pairs from a sentence of the target document based on a set identification strategy, and filling the associated text pairs into corresponding key-value pair slots according to slots in the set identification strategy to form key-value pairs.

[0083] The set identification strategy can include at least one of the following: a set trigger, a key-value pair identification template, and a machine learning model.

[0084] Specifically, in the embodiments of the present disclosure, a preset trigger symbol can be set, when the trigger symbol is detected in the document text, the relevant content of the trigger symbol, such as the preceding text and the following text, is obtained as an associated text pair, and the key field slot and the value field slot are filled in according to a predetermined logic to obtain the corresponding key-value pair. By setting the trigger symbol as a set identification strategy, a high recall rate can be achieved, and the implementation is also relatively simple.

[0085] Alternatively, the KV analysis can also be performed by a key-value pair identification template. The identification template generally reflects the syntax structure or slot text structure. The document text is matched with the identification template, and the text meeting the structure requirement in the template is analyzed as an associated text pair, and then the key-value pair is obtained according to the associated text pair and the slot in the template.

[0086] A corresponding key-value pair identification machine learning model can also be set, and a complete model is obtained by selecting similar documents or text content as samples for training, and subsequently inputting the target document into the model to output multiple associated text pairs and their corresponding slots to further form the key-value pair.

[0087] Further, the set trigger symbol can include at least one of the following: a colon, a dash, and a bracket.

[0088] For example, a colon is used as a set trigger symbol, and the following example is given: a document introducing some standards and specifications in the current power industry records “maximum working temperature: 40 degrees Celsius; optimal environment humidity: 20%”. Then the two associated text pairs detected are “maximum working temperature and 40 degrees Celsius” and “optimal environment humidity and 20%”. The key identifier before the colon is determined as the key, and the key value after the colon is determined as the value, which are respectively filled into the corresponding slots, and finally the two key-value pairs “maximum working temperature-40 degrees Celsius” and “optimal environment humidity-20%” are obtained.

[0089] The set trigger symbol can also include other characters, such as adjectives that can express size relationships (greater than, less than, higher than, lower than, exceed) or similar mathematical symbols.

[0090] S320, obtaining document structure information to which the key-value pair belongs from the target document;

[0091] S330, identifying and obtaining an entity from the document structure information;

[0092] S340, establishing an association between the entity and the key-value pair to form a knowledge unit including the entity and the key-value pair.

[0093] The technical scheme of the embodiment of the present disclosure provides a general KV analysis method, which does not need to be specially designed for industry documents, has universal applicability, and can quickly recall full KV.

[0094] Figure 4A The flowchart of the knowledge unit extraction method provided by another embodiment of the present disclosure is based on the above embodiments, and provides an implementation scheme of a KV filtering link. After "identifying and obtaining a plurality of key-value pairs from a target document", the technical feature "filtering each key-value pair based on a filtering strategy; wherein the filtering strategy includes a general filtering strategy and / or an industry filtering strategy" is added, so as to effectively screen the key-value pairs in the initially obtained target document.

[0095] Specifically, referring to Figure 4A The method can include:

[0096] S410, identifying and obtaining a plurality of key-value pairs from a target document.

[0097] S420, filtering each key-value pair based on a filtering strategy; wherein the filtering strategy includes a general filtering strategy and / or an industry filtering strategy.

[0098] Specifically, the general filtering strategy is a filtering strategy applicable to each industry or field of the target document, and the introduction of the general filtering strategy is used to filter key-value pairs that have structures, semantics and other elements that may affect the normal expression of key-value pairs, that is, to filter the content of the key-value pairs.

[0099] For example, the key-value pairs "environment temperature-5V" and "environment temperature-40" do not correspond to the same entity, and the semantics is problematic. The latter does not indicate whether 40 corresponds to Celsius or Fahrenheit, and the semantics is questionable. For another example, the key-value pair "environment temperature: a physical quantity representing the degree of environmental coldness and heat" belongs to "noun: explanation", not "attribute: value", and can be filtered out by the general strategy.

[0100] The industry filtering strategy is a special filtering strategy for the industry and field to which the current target document belongs, and the introduction of the industry filtering strategy is used to filter key-value pairs that do not meet the extraction target of the industry, that is, to filter the extraction target of the key-value pairs. For example, the key-value pairs "Zhang San-Can be built tomorrow" and "Construction Department-XX Construction Group" are not filtered out even if there is no problem in the content, because they do not meet the extraction target of the power industry part of the standard specification. The industry filtering strategy can be customized according to task requirements to filter KV that does not belong to the target extraction range.

[0101] The general filtering strategy and the industry filtering strategy can be executed separately or in combination, and when executed in combination, can be executed in series or in parallel, and the execution order is not limited.

[0102] Further, the general filtering strategy and the industry filtering strategy can include prior rules and / or classification models. Alternatively, one of the general filtering strategy and the industry filtering strategy can include prior rules and / or classification models.

[0103] Specifically, the classification model can be a natural language processing model. By means of the classification model, the obtained key-value pairs are classified into two categories, and different labels are marked respectively, so as to determine whether the target key-value pair is a valid category or an invalid category, thereby realizing rapid screening of key-value pairs. The classification model can be trained by selecting samples, so that the model can screen out KV that meets the requirements.

[0104] The prior rules are generally rules set by humans based on experience, and errors in KV are prone to occur. For example, when the number of characters is obviously greater than the set value, it is generally impossible to take the value of the attribute.

[0105] Preferably, the prior rules can be further divided into general prior rules and industry prior rules.

[0106] Further, for the general prior rules, at least one of the number of characters included in the key field of the key-value pair, the number of symbols included in the key field of the key-value pair, and the number of numerical characters included in the value field of the key-value pair can be included.

[0107] Specifically, by further refining the key field and the value field in the key-value pair, the value field and the key field in the key-value pair that do not conform to the prior rules in form can be directly screened, which is efficient and stable. For example, in the power industry, the corresponding numerical value in the value field must have its corresponding physical unit, that is, the number of numerical characters in the value field is at least two, so the key-value pair with the number of value field characters less than two is directly screened and excluded.

[0108] Further, for the industry prior rules, the block characteristics of the key-value block to which the key-value pair belongs and the chapter characteristics of the key-value pair can be included; wherein the block characteristics include: the density of key-value pairs in the same key-value block, the density of key-value blocks under each parent chapter in the document, and the density of key-value pairs under each parent chapter.

[0109] The key-value block is formed by a paragraph in the document containing a number of key-value pairs exceeding a preset number threshold, and is a set containing all key-value pairs in the paragraph. The block characteristics are characteristics expressed by most key-value pairs in the key-value block.

[0110] Specifically, by acquiring the density of key-value pairs in the same key-value block, the density of key-value blocks under each parent chapter in the document, and the density of key-value pairs under each parent chapter, noise can be further filtered out. Specifically, the characteristics of the KV block represent the clustered KV. Statistically, if a certain KV appears alone, the probability of non-noise data is high; if multiple KV clusters appear, it is highly likely that these KV all represent "attribute: value". If the KV block characteristics are considered, it is equivalent to further considering the KV block characteristics on the basis of considering the text semantic characteristics, which increases the recognition effect of part of the visual characteristics. Generally, according to the structural characteristics of the document, similar format contents will be concentrated together, and the state of clustering is presented from the visual effect.

[0111] S430, acquiring document structure information to which the key-value pair belongs from the target document.

[0112] S440, acquiring an entity from the document structure information.

[0113] S450, establishing an association between the entity and the key-value pair to form a knowledge unit including the entity and the key-value pair.

[0114] The technical scheme of the embodiment of the present disclosure can effectively screen the parsed KV based on the general filtering strategy and the industry filtering strategy. The general filtering strategy can be applied to various situations and mainly screens based on the KV content. The industry filtering strategy can be set based on the extraction target of the industry knowledge unit, and the KV that does not meet the extraction target is pre-filtered out. When the knowledge unit extraction system is migrated in different industry extraction requirements, only the special industry strategy part needs to be changed, and the general strategy part can be retained, so it has a certain degree of universality and scalability.

[0115] Further, the classification model in the general filtering strategy can be obtained through the following training process:

[0116] According to the positive requirements of the semantic content of each slot in the key-value pair to be extracted, the structured key-value pairs meeting the positive requirements are acquired from the structured key-value pair database as positive example samples;

[0117] According to at least one type of exclusion requirement of the semantic content of each slot in the key-value pair to be extracted, the exclusion structured key-value pairs are extracted from a plurality of source documents according to a set identification strategy as at least one type of negative example sample; wherein the set identification strategy includes at least one of the following: setting a trigger, a key-value pair identification model, and a machine learning model;

[0118] The positive example samples and the negative example samples are input into a text classification model for training to obtain a semantic content classification model in the general filtering strategy.

[0119] Among them, the structured key-value pair database can be constructed by extracting infobox, core set attributes and other structured data sources, or adding PO of existing SPO data set / OpenIE data set, or combining structured data from various sources together as a structured key-value pair database. The authoritative structured data source such as infobox has high quality, which helps the model to learn the characteristics of key field and value field type, and the SPO data output by OpenIE can supplement the recall of training negative example samples. Different construction methods can be used according to the difference of slot meaning, and the flexibility is high. The positive example sample is the KV sample that should be retained by the model after filtering. The negative example sample is the KV sample that should be filtered out.

[0120] Specifically, the classification model is trained on the positive example sample and the negative example sample, the classification model is used as a language model for binary classification fine-tuning, and the generalization ability of the language model can automatically learn the significant features of the key-value pair and further distinguish whether the key-value pair is the target key-value pair. The efficiency is significantly improved, and less human intervention is required.

[0121] Further, the structured key-value pair slot semantic content corresponding to the positive requirement includes attributes and attribute values; and the structured key-value pair slot semantic content corresponding to the exclusion requirement can include at least one of the following: noun and noun explanation; general statement and sub-statement; annotation and content; person and speech content.

[0122] Specifically, when using a trigger symbol, especially a colon, as a trigger symbol to parse KV, there may be other associated KVs, such as noun and noun explanation, general statement and sub-statement, annotation and content, person and speech content, which often have similar forms in the document as the attribute-attribute value of the present disclosure embodiment, and it is difficult to effectively distinguish them. Therefore, in the present disclosure embodiment, the two are respectively set as positive example samples and negative example samples, and the positive and negative of the two are distinguished during the construction of the classification model, so that the classification model can be used to effectively filter the noun and noun explanation, general statement and sub-statement, annotation and content, person and speech content during the filtering process.

[0123] The negative example sample can be constructed in different ways according to the difference of slot meaning;

[0124] "noun-explanation" is represented: the key can take the title of the encyclopedia, and the value can take the summary sentence text;

[0125] "general statement-sub-statement" is represented: negative example samples can be constructed based on a specific trigger symbol and based on a list title identification method;

[0126] Indicates "note - content": negative example samples can be constructed based on a specific trigger mode;

[0127] Indicates "person - speaking content": negative example samples can be constructed based on a specific trigger mode;

[0128] Colon appears in special usage such as mathematical expressions: negative example samples are constructed based on a specific mode

[0129] Colon appears in nouns such as book titles / standard names: negative example samples are constructed based on a specific mode.

[0130] Further, the positive example samples and negative example samples are input into a text classification model for training to obtain a semantic content classification model in the general filtering strategy can include: inputting the positive example samples, each class of negative example samples and the class weight of the class of negative example samples into a text classification model for training to obtain a semantic content classification model in the general filtering strategy.

[0131] Specifically, since the number of positive example samples and negative example samples in the sample document can be completely different, i.e., the positive and negative example samples are unbalanced. Therefore, different weights are set for the negative example samples according to their categories, and then the negative example samples with weight information are input into the classification model together with the positive example samples for training, so as to ensure that the training of the classification model is more scientific and targeted.

[0132] Optionally, the priori rule and the classification model can be implemented by using a framework (Wide&Deep) of joint training of a shallow model and a deep model. Specifically, the classification model can be implemented by using a model as shown in Figure 4B The general KV filtering can be regarded as a classification problem, and a language model (such as BERT, ERNIE, etc.) pre-trained based on general Chinese corpus (People's Daily, Encyclopedia) is selected for binary classification fine-tuning. With the generalization ability of the language model, significant features can be automatically learned. The sample can be converted into the form of "[CLS]key[SEP]value" and input into the model, and the output is a 0 / 1 classification label. The model structure is shown in Figure 4B [CLS], [SEP] are format symbols of input data.

[0133] The priori rule and the classification model can be converted into a Wide&Deep model training, and the model structure is shown in Figure 4C The priori rule can influence the output result in parallel with the classification model to realize filtering.

[0134] In the technical solution, the KV identification link can include a KV meta information acquisition link, which is configured to acquire document structure information. Of course, the acquisition of the document structure information is not limited to the link, but can be extracted from the document when needed.

[0135] After the KV data is filtered based on the general filtering strategy, the KV data can be further filtered based on an industry filtering strategy. The industry filtering strategy can also include prior rules and a classification model, and the implementation manner is the same as that of the general filtering strategy. According to the distribution of KV on the industry document and the prior knowledge of the industry that affects the judgment of KV, the wide feature is added to the model. The classification model can be trained by pre-constructing samples, and the two are implemented in a wide&deep architecture.

[0136] Figure 5 A flowchart of a knowledge unit extraction method provided for another embodiment of the disclosure is provided based on the above-mentioned embodiments. The embodiment provides a specific implementation scheme of the S identification link, which refines the “identifying and acquiring entities from the document structure information” into “inputting sentences in the document structure information into a named entity recognition model to identify and determine candidate entity texts; wherein the candidate entity texts include basic entities and attributive phrases of the basic entities; performing slot parsing on the candidate entity texts based on existing slot rules of a to-be-extracted industry, and constructing entities according to the slot parsing results”.

[0137] Specifically, referring to Figure 5 The method can include:

[0138] S510, identifying and acquiring a plurality of key-value pairs from a target document.

[0139] The process of acquiring the key-value pairs can include a KV parsing and a KV filtering link.

[0140] S520, acquiring document structure information to which the key-value pairs belong from the target document.

[0141] S530, inputting sentences in the document structure information into a named entity recognition model to identify and determine candidate entity texts.

[0142] The candidate entity texts include basic entities and attributive phrases of the basic entities.

[0143] S540, performing slot parsing on the candidate entity texts based on existing slot rules of a to-be-extracted industry, and constructing entities according to the slot parsing results.

[0144] Among them, the named entity recognition model (NER) can be used to identify the named entity from the document structure information. The construction of the entity recognition model can be a supervised learning method, for example, commonly used models or methods include hidden Markov model, language model, maximum entropy model, support vector machine, decision tree and conditional random field; it can also be a semi-supervised learning method, which uses a small labeled data set to bootstrap learning; it can also be an unsupervised learning method, which uses lexical resources for context clustering; it can also be a hybrid method, combining several models or using statistical methods and manually summarized knowledge base.

[0145] The input of NER is a sentence, and the output is a list of entity mentions. In the embodiments of the present disclosure, after training the NER as needed, the identified basic entities and all attributes of the basic entities can be output. There are three problems with the output of NER, one is that when multiple entity mentions of the same type are identified in a specific document domain, the best one cannot be selected, two is that compound entities cannot be split or the attributes cannot be completed, and three is that the constraints of the entity can not be included in the same sentence.

[0146] Therefore, the embodiments of the present disclosure further optimize the entities extracted by NER using slot parsing.

[0147] The existing slot rules of the industry to be extracted are slot parsing rules set according to the general rules of the industry documents and the extraction requirements of the industry knowledge unit. For example, the entity attributes concerned by the electric power industry include rated voltage, number of phases, insulating medium, voltage regulation mode, number of windings, etc. These entity attributes to be parsed can be set as slots in advance, and the parsing method of each attribute can also be set correspondingly. Then, the corresponding slot content is parsed from the document structure information through slot parsing, and the name of the basic entity is optimized by semantic completion, screening or merging. The slot to be parsed can not be limited to attributes, but can also be other information that can optimize the entity name.

[0148] Through slot parsing, the extracted entity text is converted into a structured type, which can determine the hierarchical relationship of the same S type entity, split multiple entities, complete the missing attributes of compound entities, and complete the attribute constraints across sentences. Another function of slot parsing is to support entity splicing. In industry documents, different entities in different regions need to be spliced into complete entities to serve as related objects: for example, in electric power documents, “oil-immersed transformer” is extracted from the range chapter, and “sleeve” and “tap switch” are extracted from the title, and are spliced into “oil-immersed transformer sleeve” and “oil-immersed transformer tap switch”. Entity splicing relies on prior knowledge, and the S type connection rules are set according to the S system (existing slot entity relationship) in advance.

[0149] S550, establish an association between the entity and the key-value pair to form a knowledge unit including the entity and the key-value pair.

[0150] The technical solutions of the embodiments of the present disclosure can effectively filter the entities identified in the document structure information based on the slot parsing and entity understanding manner, and complete the entity content to become a candidate entity with higher accuracy, for association with the KV.

[0151] On the basis of the above-mentioned scheme, optionally, based on the existing slot rules of the to-be-extracted industry, the candidate entity text is parsed, and according to the slot parsing result, the entity is constructed to include:

[0152] Based on the existing slot rules of the to-be-extracted industry, the candidate entity text is parsed, and the basic entity and at least one entity attribute are obtained;

[0153] According to the title level of the document structure information to which each entity attribute belongs, each entity attribute is sorted;

[0154] According to the sorted entity attribute and the basic entity, at least one entity is constructed by combining.

[0155] In the above technical solution, the existing slot rules are parsed to obtain the basic entity and the entity attribute, and the process of optimizing the basic entity based on the entity attribute can be realized by means of the relationship of the entity attribute in the title level. For example, several entity attributes appear in different title levels, and then they can be sequentially combined to form a final entity name by adding the basic entity. Different entity attributes in the same title level can be combined with the basic entity to form a final entity name.

[0156] Further, the obtaining of the basic entity can further include:

[0157] If there are more than two basic entities in the same title level, one basic entity is reserved according to the number of attributes of the basic entity.

[0158] In the above-mentioned screening rule, if the basic entity has more attributes, it can be considered as a main entity and reserved, and another entity with fewer attributes can be discarded. Of course, the screening rule of the basic entity is not limited to this, and both can be reserved.

[0159] Further, the obtaining of the basic entity can further include:

[0160] If there are more than two basic entities in different title levels, the basic entities are combined into one basic entity according to the set entity relationship of the to-be-extracted industry.

[0161] When different base entities appear in different title levels, there may be a case of association between different base entities, typically as A entity is a component of B entity, and the assembly relationship is the association between the two. Based on the pre-set entity relationship in this industry, the base entities with association can be merged to form one base entity.

[0162] The above operation of establishing the association between different base entities is equivalent to the entity understanding link. The function of entity understanding is based on document structure information and multiple regional entity information to generate correct candidate entities (S) for the current region. Abstractly, the entity understanding link is a classifier of S type subordination relationship, which combines the current scene, that is, combines the document structure information to determine which entities have a subordinate relationship. In industry applications, the understanding of entities is usually based on the S system, and must rely on industry prior knowledge to pre-specify which entities can have a subordinate relationship; the entity understanding of the general strategy needs to combine the text information of multiple regions of the document, and combine the multi-dimensional features to judge the subordinate relationship suitable for the current scene, which is modeled as a relationship classification task.

[0163] The following is a specific example to illustrate the process of identifying and obtaining entities based on NER and slot parsing.

[0164] (I) The document structure information of a certain KV after NER identification outputs the following content:

[0165] Scope section: Single-phase and three-phase oil-immersed shunt reactors with rated frequency of 50 Hz, system nominal voltage of 110 kV and above; 110 kV and above oil-immersed shunt reactors with neutral grounding reactors.

[0166] Title level 1: 110 kV and above oil-immersed shunt reactors with neutral grounding reactors.

[0167] Title level 2: 110 kV, 220 kV, 330 kV, 500 kV level shunt reactors with neutral grounding reactors.

[0168] Title level 3-5: No entity.

[0169] In the above NER output content, the base entities include "shunt reactor" and "shunt reactor with neutral grounding reactor". The aforementioned text of the base entity is an attribute.

[0170] (ii) Based on the existing slot rules, the NER output content is parsed for base entities and attributes, and the parsing results are as follows:

[0171] Scope section includes:

[0172] Base entity: shunt reactor; shunt reactor matching neutral grounding reactor

[0173] Property:

[0174] Rated frequency: 50HZ

[0175] Rated voltage: 110KV and above

[0176] Number of phases: single-phase, three-phase

[0177] Insulating medium: oil-immersed

[0178] Title level 1 includes:

[0179] Base entity: shunt reactor; shunt reactor matching neutral grounding reactor

[0180] Property:

[0181] Rated voltage: 110KV

[0182] Insulating medium: oil-immersed

[0183] Title level 2 includes:

[0184] Base entity: shunt reactor; shunt reactor matching neutral grounding reactor

[0185] Property:

[0186] Rated voltage: 110kv, 220kv, 330kv, 500kv

[0187] Sort by title level from low to high. Relative to the properties of title level 2, if other properties appear in title level 1, they are retained, otherwise they are repeated properties, then skip. From title level 2 -> title level 1, output:

[0188] Base entity: shunt reactor; shunt reactor matching neutral grounding reactor

[0189] Property:

[0190] Insulating medium: oil-immersed

[0191] Rated voltage: 110kv, 220kv, 330kv, 500kv

[0192] Then process the range chapter again. From title level 1 -> range chapter, output:

[0193] Base entity: shunt reactor; shunt reactor matching neutral grounding reactor

[0194] Property:

[0195] Rated frequency: 50Hz

[0196] Insulating medium: oil-immersed

[0197] Number of phases: single-phase, three-phase

[0198] Rated voltage: 110 kv, 220 kv, 330 kv, 500 kv

[0199] Shunt reactors also appear in the range section, which can be discarded due to their fewer attributes.

[0200] In the slot parsing result as above, 1 basic entity and 10 attributes located in 3 title levels are included. Different title levels of attributes can be combined to obtain 10 attribute combinations, which are combined with the basic entity, and then 10 entities are constructed.

[0201] Figure 6 A flowchart of a knowledge unit extraction method provided for another embodiment of the disclosure. Based on the above embodiments, the implementation of the S and KV association link is provided, which refines the "establishing the association between the entity and the key-value pair" into "traversing the key-value pair in the document structure information to which it belongs in the hierarchical order from low to high, and establishing the association between the first traversed entity and the key-value pair", so that the key-value pair can be associated with the optimal expression entity in multiple entities.

[0202] Specifically, referring to Figure 6 The method can include:

[0203] S610, acquiring a plurality of key-value pairs from a target document.

[0204] S620, acquiring document structure information to which the key-value pairs belong from the target document.

[0205] S630, acquiring an entity from the document structure information.

[0206] S640, traversing the key-value pair in the document structure information to which it belongs in the hierarchical order from low to high, and establishing the association between the first traversed entity and the key-value pair.

[0207] Among them, the hierarchical order is the different hierarchical order of the sentence, the paragraph title, the chapter title, the civilization title, etc. From low to high is the order from the perspective of the document structure.

[0208] Specifically, if it is detected that the statement in which the current key value is located has an entity, it is determined that the entity is the first traversed entity, and the entity is associated with the current key value pair. If no entity is detected in the statement, it is detected whether there is an entity in the paragraph title, and if no entity is still detected, the chapter title, the civilization title, and the like are traversed one by one until the first traversed entity is associated with the current key value pair as the entity to which the key value pair is associated. Traversing the entity from low to high level can ensure that the key value pair can be preferably associated with the entity closest in semantics and structure.

[0209] Further, the first traversed entity associated with the key value pair can include:

[0210] If more than two entities belonging to the same level are first traversed, the entity of the lower level is filtered from the more than two first traversed entities, and the key value pair is associated.

[0211] Specifically, in the process of traversal, there can be a case where two entities appear in a level, for example, the title of the current chapter is "domestic ultra-high voltage power transmission specification", and the entities can be two, which are "domestic ultra-high voltage power transmission specification" and "ultra-high voltage power transmission specification". The more lower "domestic ultra-high voltage power transmission specification" is used as the key value pair for association. For example, the title of the current chapter is "existing transformer temperature control standard, taking China as an example", and the entities are two, which are "existing transformer temperature control standard" and "China existing transformer temperature control standard". The most lower "China existing transformer temperature control standard" is associated with the key value pair. That is, the key value pair is associated with the most lower entity in the multiple same levels by the embodiment of the disclosure, so as to ensure that the semantics of the knowledge unit formed based on the key value pair and the entity association is clear and definite.

[0212] S650, the key value pair and the entity associated are formed into a knowledge unit including the entity and the key value pair.

[0213] The technical scheme of the embodiment can preferentially associate the entity close in position and close in document structure level with the KV, and ensure that the association degree of the extracted SPO content is high.

[0214] The technical solutions of the embodiments of the present disclosure can provide an effective solution for knowledge unit extraction for industry documents, and actually provide a KV knowledge extraction framework, which aims to: automatically mine SPO triple knowledge in semi-structured text of industry documents without relying on pre-set entity and attribute category restrictions (schema), and should have flexible migration ability to quickly support extraction requirements of new industries. The SPO triples mined by the KV extraction framework can not only improve the connectivity of the knowledge graph and increase the richness of entities, but also assist in the cold start construction of the industry schema through data-driven assistance, and then assist in slot filling, relationship extraction and other extraction tasks that rely on the schema.

[0215] Compared with the prior art, the KV knowledge extraction solves the following problems:

[0216] Extraction target is ambiguous: there is no clear definition of the standard of KV and KV class SPO, the extraction range is not determined, which leads to multiple iterations during development.

[0217] High degree of human participation: the system cannot be automatically run, and each step needs the participation of developers for configuration and annotation, which consumes a lot of manpower, and the developers need to have industry knowledge.

[0218] In terms of industry migration, the KV knowledge extraction solves the following two problems:

[0219] Low cold start efficiency: when facing new industries, developers need to have sufficient professional knowledge to manually set rules for extraction (analysis and filtering).

[0220] Poor reusability: poor generalizability of strategies, when migrating to new industries, the analysis and filtering strategies need to be reconfigured according to industry knowledge.

[0221] To solve the above problems, the embodiments of the present disclosure first define the general standard of KV and KV class SPO, determine the system work category and extensibility. Secondly, according to the established standard, the KV extraction system for industry documents is proposed, which includes three modules: KV identification, KV and S association and KV completion. The advantages of the system architecture are: first, the automation degree is improved, the KV extraction needs to be automatically executed, and only one pass of the document can extract the desired KV (PO); second, it supports non-homogeneous corpus, and has strong generalizability and low migration cost; third, it supports fast adaptation of industries, and supports adjusting the strategies of some modules according to the characteristics of industry data.

[0222] Figure 7A device structure of a knowledge unit extraction device provided for another embodiment of the present disclosure, the embodiment can be applicable to the case of knowledge extraction on a document to obtain an effective knowledge unit, and the device can be implemented in a software and / or hardware manner. The device can be configured in an electronic device with corresponding processing capability, as shown in Figure 7 The device comprises:

[0223] A key-value pair acquisition module 701, configured to identify and acquire a plurality of key-value pairs from a target document;

[0224] A structure information acquisition module 702, configured to acquire document structure information to which the key-value pairs belong from the target document;

[0225] An entity identification module 703, configured to identify and acquire an entity from the document structure information;

[0226] A knowledge unit formation module 704, configured to establish an association between the entity and the key-value pairs to form a knowledge unit comprising the entity and the key-value pairs.

[0227] The device and the modules can perform the knowledge unit extraction method provided by any embodiment of the present disclosure, and have the corresponding function modules and beneficial effects of performing the method.

[0228] Optionally, the key field in the key-value pair is used to store an attribute, and the value field in the key-value pair is used to store a value of the attribute.

[0229] Optionally, the document structure information can comprise a structure chapter, a table title, a chapter title, and a document name to which the key-value pairs belong.

[0230] Optionally, the device further comprises a semantic completion module 705, configured to perform semantic understanding on the document structure information to perform semantic completion on the key-value pairs.

[0231] Optionally, the semantic completion module 705 is specifically configured to perform semantic understanding on the document structure information according to a document data priori rule of a to-be-extracted industry, and perform semantic completion on the key field in the key-value pairs according to a semantic understanding result; and / or perform abstract extraction from the document structure information, and perform semantic completion on the key field in the key-value pairs according to an abstract extraction result.

[0232] Optionally, the key-value pair acquisition module 701 is specifically configured to identify and acquire a plurality of associated text pairs from a sentence of the target document based on a set identification strategy, and fill the associated text pairs into corresponding key-value pair slots according to slots in the set identification strategy to form the key-value pairs; wherein the set identification strategy comprises at least one of the following: a set trigger, a key-value pair identification template, and a machine learning model.

[0233] Optionally, the apparatus further comprises a key-value pair filtering module 706 configured to filter each of the key-value pairs based on a filtering policy; wherein the filtering policy comprises a general filtering policy and / or an industry filtering policy.

[0234] Optionally, the filtering policy comprises a general filtering policy and / or an industry filtering policy.

[0235] Optionally, the general filtering policy and / or the industry filtering policy comprises a priori rule and / or a classification model.

[0236] Optionally, the a priori rule and the classification model are implemented by a framework of joint training of a shallow model and a deep model.

[0237] Optionally, the key-value pair filtering module 706 is further configured to: obtain, as positive example samples, structured key-value pairs that meet positive requirements of semantic content of each slot in a to-be-extracted key-value pair from a structured key-value pair database according to the positive requirements; extract, as at least one type of negative example samples, exclusion structured key-value pairs from a plurality of source documents according to at least one type of exclusion requirements of semantic content of each slot in the to-be-extracted key-value pair according to a set identification strategy; wherein the set identification strategy comprises at least one of the following: a set trigger, a key-value pair identification template, and a machine learning model; and input the positive example samples and the negative example samples into a text classification model for training to obtain a semantic content classification model in the general filtering policy.

[0238] Optionally, the structured key-value pair slot semantic content corresponding to the positive requirements comprises an attribute and an attribute value; and the structured key-value pair slot semantic content corresponding to the exclusion requirements comprises at least one of the following: a noun and a noun explanation; a general statement and a specific statement; an annotation and content; a person and speaking content.

[0239] Optionally, the key-value pair filtering module 706 is further configured to: input the positive example samples, each type of negative example samples, and a class weight of the type of negative example samples into a text classification model for training to obtain the semantic content classification model in the general filtering policy.

[0240] Optionally, the general a priori rule comprises at least one of the following: a number of characters included in a key field in the key-value pair; a number of symbols included in the key field in the key-value pair; and a number of numerical characters included in a value field in the key-value pair.

[0241] Optionally, the industry filtering strategy is configured to perform key-value pair filtering according to industry knowledge extraction targets, and industry prior rules in the industry filtering strategy include at least one of a block feature of a key-value block to which the key-value pair belongs and a chapter feature to which the key-value pair belongs; and the block feature includes density of key-value pairs in the same key-value block, density of key-value blocks under each parent chapter in the document, and density of key-value pairs under each parent chapter.

[0242] Optionally, the entity recognition module 703 includes:

[0243] An entity text recognition unit is configured to input a sentence in the document structure information into a named entity recognition model to identify a candidate entity text; and the candidate entity text includes a basic entity and attributive phrases of the basic entity.

[0244] A slot parsing unit is configured to perform slot parsing on the candidate entity text based on existing slot rules of the industry to be extracted, and construct an entity according to a slot parsing result.

[0245] Optionally, the slot parsing unit is specifically configured to perform slot parsing on the candidate entity text based on existing slot rules of the industry to be extracted to obtain a basic entity and at least one entity attribute; sort the entity attributes according to a title level of document structure information to which each entity attribute belongs; and combine the sorted entity attributes and the basic entity to construct at least one entity.

[0246] Optionally, the apparatus can further include a basic entity screening module configured to perform slot parsing on the candidate entity text based on existing slot rules of the industry to be extracted to obtain a basic entity, and if there are more than two basic entities in the same title level, select one basic entity to be retained according to a number of attributes of the basic entity.

[0247] Optionally, the apparatus can further include an entity merging module configured to perform slot parsing on the candidate entity text based on existing slot rules of the industry to be extracted to obtain a basic entity, and if there are more than two basic entities in different title levels, merge the basic entities into one basic entity according to a set entity relationship of the industry to be extracted.

[0248] Optionally, the knowledge unit forming module 704 is specifically configured to traverse the key-value pair in the document structure information according to a hierarchical order from low to high, and establish an association between a first-traversed entity and the key-value pair.

[0249] Optionally, the knowledge unit forming module 704 is specifically configured to, if two or more entities belonging to the same level are firstly traversed, filter entities of a lower level from the two or more entities firstly traversed, and establish an association with the key-value pair.

[0250] The apparatus and module after further illustration can execute the knowledge unit extraction method provided by any embodiment of the present disclosure, and have the corresponding function module and beneficial effects of executing the method

[0251] According to embodiments of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.

[0252] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0253] As shown in Figure 8 The device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 802 or loaded into a random access memory (RAM) 803 from a storage unit 808. Various programs and data required for operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0254] Various components in the device 800 are connected to the I / O interface 805, including an input unit 806 such as a keyboard, a mouse, etc., an output unit 807 such as various types of displays, a speaker, etc., a storage unit 808 such as a magnetic disk, an optical disk, etc., and a communication unit 809 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0255] The computing unit 801 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processors, controllers, microcontrollers, etc. The computing unit 801 performs various methods and processes described above, such as the knowledge unit extraction method. For example, in some embodiments, the knowledge unit extraction method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded onto the RAM 803 and executed by the computing unit 801, one or more steps of the knowledge unit extraction method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured as the knowledge unit extraction method by any other suitable means, such as by means of firmware.

[0256] The various implementations of the system and techniques described above herein can be realized in a digital electronic circuit system, an integrated circuit system, a logic field programmable gate array (FPGA), an application specific integrated circuit (ASIC), an application specific standard product (ASSP), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0257] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine or server, or entirely on a remote machine or server.

[0258] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include a wired or wireless electrical connection, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0259] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0260] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0261] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, and solves the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0262] It should be understood that the steps shown above in various forms of flow can be reordered, added, or deleted. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present disclosure can be achieved, and the present disclosure is not limited herein.

[0263] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A knowledge unit extraction method, comprising: identifying a plurality of key-value pairs from a target document; filtering each of the key-value pairs based on a filtering strategy, the filtering strategy comprising a general filtering strategy, the general filtering strategy comprising a classification model; obtaining document structure information to which the key-value pairs belong from the target document; identifying an entity from the document structure information; establishing an association between the entity and the key-value pairs to form a knowledge unit comprising the entity and the key-value pairs; wherein the classification model in the general filtering strategy is obtained through a training process comprising: obtaining structured key-value pairs that meet positive requirements of semantic content of each slot in a key-value pair to be extracted from a structured key-value pair database as positive example samples according to the positive requirements; extracting structured key-value pairs that meet at least one type of exclusion requirement of semantic content of each slot in the key-value pair to be extracted from a plurality of source documents as at least one type of negative example sample according to the at least one type of exclusion requirement and a set identification strategy, wherein the set identification strategy comprises at least one of the following: a set trigger, a key-value pair identification template, and a machine learning model; inputting the positive example samples and the negative example samples into a text classification model for training to obtain a semantic content classification model in the general filtering strategy.

2. The method of claim 1, wherein, The key field in the key-value pair is used to store an attribute, and the value field in the key-value pair is used to store a value of the attribute.

3. The method of claim 1, wherein, The document structure information comprises a structural chapter, a list title, a chapter title, and a document name to which the key-value pair belongs. 4.The method of claim 1, further comprising: performing semantic understanding on the document structure information to perform semantic completion on the key-value pairs.

5. The method of claim 4, wherein, The semantic understanding on the document structure information to perform semantic completion on the key-value pairs comprises: performing semantic understanding on the document structure information according to a document data prior rule of an industry to be extracted, and performing semantic completion on the key field in the key-value pair according to a semantic understanding result; and / or performing abstract extraction from the document structure information, and performing semantic completion on the key field in the key-value pair according to an abstract extraction result.

6. The method of claim 1, wherein, The identifying a plurality of key-value pairs from a target document comprises: identifying a plurality of associated text pairs from sentences of the target document based on a set identification strategy, and filling the associated text pairs into corresponding key-value pair slots according to slots in the set identification strategy to form key-value pairs; wherein the set identification strategy comprises at least one of the following: a set trigger, a key-value pair identification template, and a machine learning model. 7.The method of claim 1, wherein the filtering strategy further comprises an industry filtering strategy.

8. The method of claim 7, wherein, The industry filtering strategy comprises a prior rule and / or a classification model, and the general filtering strategy further comprises a prior rule.

9. The method of claim 8, wherein, The prior rule and the classification model are implemented using a framework of joint training of a shallow model and a deep model. 10.The method of claim 1, wherein: the structured key-value pair slot semantic content corresponding to the positive requirements comprises an attribute and a value of the attribute; the structured key-value pair slot semantic content corresponding to the exclusion requirements comprises at least one of the following: Nouns and noun explanations; general and specific; notes and content; characters and speaking content.

11. The method of claim 1, wherein, The positive example samples and the negative example samples are input into a text classification model for training to obtain a semantic content classification model in the general filtering strategy. The positive example samples, each type of negative example sample, and the class weight of the negative example sample are input into a text classification model for training to obtain a semantic content classification model in the general filtering strategy.

12. The method of claim 1, wherein, The general priori rule in the general filtering strategy includes at least one of the following: the number of characters included in the key field in the key-value pair; the number of symbols included in the key field in the key-value pair; and the number of numerical characters included in the value field in the key-value pair.

13. The method of claim 8, wherein, The industry filtering strategy is used to filter key-value pairs according to industry knowledge extraction targets, and an industry priori rule in the industry filtering strategy includes at least one of the following: a block feature of a key-value block to which the key-value pair belongs and a chapter feature to which the key-value pair belongs; wherein the block feature includes: the density of key-value pairs in the same key-value block, the density of key-value blocks under each parent chapter in the document, and the density of key-value pairs under each parent chapter.

14. The method of claim 1, wherein, The entity is identified from the document structure information. The sentences in the document structure information are input into a named entity recognition model to identify candidate entity texts; wherein the candidate entity texts include basic entities and attributive phrases of the basic entities. The candidate entity texts are slot parsed based on existing slot rules of the industry to be extracted, and an entity is constructed according to the slot parsing result.

15. The method of claim 14, wherein, The candidate entity texts are slot parsed based on existing slot rules of the industry to be extracted, and an entity is constructed according to the slot parsing result, which includes: The candidate entity texts are slot parsed based on existing slot rules of the industry to be extracted, and at least one entity attribute and a basic entity are obtained. The entity attributes are sorted according to the title levels of the document structure information to which the entity attributes belong. The sorted entity attributes and the basic entity are combined to construct at least one entity.

16. The method of claim 15, wherein the basic entity is further obtained by: If there are more than two basic entities in the same title level, one basic entity is selected according to the number of attributes of the basic entity.

17. The method of claim 15, wherein the basic entity is further obtained by: If there are more than two basic entities in different title levels, the basic entities are combined into one basic entity according to the set entity relationship of the industry to be extracted.

18. The method of claim 1, wherein, The association between the entity and the key-value pair is established by: The entity that is first traversed is associated with the key-value pair.

19. The method of claim 18, wherein, The entity that is first traversed is associated with the key-value pair, which includes: If there are more than two entities that are first traversed and belong to the same level, the entity of the lower level is selected from the more than two entities that are first traversed and is associated with the key-value pair.

20. A knowledge unit extraction apparatus characterized by comprising: The device includes: A key-value pair acquisition module configured to identify and obtain a plurality of key-value pairs from a target document; The filtering module is configured to filter each of the key-value pairs based on a filtering strategy, the filtering strategy comprising a general filtering strategy; the general filtering strategy comprises a classification model; The structural information obtaining module is configured to obtain document structural information to which the key-value pairs belong from the target document; The entity recognition module is configured to recognize and obtain an entity from the document structural information; The knowledge unit forming module is configured to establish an association between the entity and the key-value pairs to form a knowledge unit comprising the entity and the key-value pairs; The classification model in the general filtering strategy is obtained through the following training process: According to positive requirements of semantic content of each slot in the key-value pair to be extracted, structured key-value pairs meeting the positive requirements are obtained from a structured key-value pair database as positive example samples; According to at least one type of exclusion requirement of semantic content of each slot in the key-value pair to be extracted, exclusion structured key-value pairs are extracted from a plurality of source documents according to a set identification strategy as at least one type of negative example sample; the set identification strategy comprises at least one of the following: a set trigger, a key-value pair identification template and a machine learning model; The positive example samples and the negative example samples are input into a text classification model for training to obtain a semantic content classification model in the general filtering strategy.

21. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the knowledge unit extraction method of any one of claims 1-19.

22. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the knowledge unit extraction method according to any one of claims 1-19.

Citation Information

Patent Citations

  • Entity relationship data generating method, apparatus, equipment and storage medium

    CN109325201A

  • Knowledge graph processing method and device, apparatus and medium

    CN110263083A

  • Information interaction method and device

    CN113032661A