Method and system for automatically constructing knowledge graph by using unstructured text for inspection

By classifying and marking unstructured texts, combining the output of the extraction model, the knowledge graph is constructed, and the problems of high cost of manual participation and insufficient data preprocessing in the existing technology are solved, and efficient and accurate knowledge graph construction and data utilization are achieved.

CN119721213APending Publication Date: 2025-03-28NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411905151.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, the cost of manual participation when constructing knowledge graphs in unstructured text is high, and the lack of pre-processing and identification of data is caused by a large amount of unrelated data being misidentified as knowledge, which increases the pressure of model processing and manual review costs.

Method used

By obtaining the relevant text of the business data uploaded by the device or user, segmenting and classifying text data, using the trained classification model to mark the results, and input the marking results to extract the model, extract the values ​​and relationships of the output indicators of the model, perform benchmark comparisons, and generate marking results. Build a knowledge graph based on the defined schema and iterate through user review and modification results.

Benefits of technology

It realizes automatic construction of knowledge graphs of unstructured text, reduces the cost of manual participation, improves the accuracy and efficiency of data processing, avoids misidentification of irrelevant data, and enhances the data quality and application efficiency of knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721213A_ABST
    Figure CN119721213A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for automatically constructing a knowledge graph by an unstructured text for inspection. The method comprises the following steps: acquiring a related text of business data uploaded by equipment or a user; all the unstructured texts are converted into text data; segmenting the paragraph into uniform paragraph fragments; inputting the segmented paragraph segments into a trained classification model to obtain paragraph segments and corresponding labels; taking the paragraph segment and the corresponding label as input, inputting an extraction model, outputting a numerical value of an index corresponding to the label extracted from the paragraph segment and a relationship between the numerical value and other indexes, and comparing the numerical value and the relationship with a reference of the corresponding index to obtain a marking result; and the mapping knowledge domain is constructed according to the defined schema according to the marking result. According to the method, knowledge management of private data or products and entity equipment information in a certain industry field can be realized, and the utilization rate of document data and the efficiency of users to reach knowledge are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing and knowledge graph construction, and in particular to a method and system for automatically constructing a knowledge graph from unstructured text for equipment or device inspection. Background Art

[0002] The design and production of equipment or devices usually go through the stages of project establishment, research and development, production, testing, prototype, improvement, inspection and finalization. Since each stage spans a long time, there are many design parameters and indicators, and the file formats generated in different stages are diverse, and the indicator values ​​are also different, which may lead to the need to manually compare various indicators during the prototype or finalization. When the structure of the equipment or device is complex and involves more than one department or manufacturer, it is difficult to determine whether it meets the design goals or inspection requirements. Therefore, it is necessary to process these unstructured text business data into graphs to facilitate the inspection of whether the equipment or device can meet the predetermined requirements.

[0003] In order to ensure the accuracy of the constructed knowledge graph data, the common knowledge graph construction method usually uses structured data as input, associates the data content with the entity categories and relationship categories in the knowledge graph, and realizes rapid data structure transformation and knowledge graph construction. However, the proportion of structured data in any scenario is relatively low, and a large number of knowledge value points are hidden in unstructured data, and the value of unstructured data is difficult to reflect.

[0004] Extracting knowledge elements from massive unstructured text data and realizing knowledge management of a certain industry field, private data, or product and physical equipment information (such as equipment inspection and acceptance) can effectively improve the utilization rate of document data and the efficiency of users' access to knowledge. However, in the existing technologies for constructing knowledge graphs from unstructured text, most of them emphasize the ability of the model itself. The model is trained through text annotation, and then the formed model is used to process subsequent texts. In this process, the value of human participation is weakened. In scenarios with extremely high requirements for data quality, human participation verification is an indispensable link. How to minimize the cost of human participation and improve the efficient use of human feedback data is the weakness of current existing technologies.

[0005] Existing technologies lack prior identification and screening of data for building knowledge graphs. The extraction models receive and process data indiscriminately. Faced with massive amounts of data, if there is no prior data preprocessing solution, a large amount of irrelevant data will be mistakenly identified as knowledge, increasing the processing pressure of the extraction model and the cost of manual review. Once mistakenly entered into the knowledge graph, it will also mislead subsequent knowledge applications. Summary of the invention

[0006] The purpose of the present invention is to provide a method for automatically constructing a knowledge graph from unstructured text for verification, so as to solve the technical problem in the prior art that the cost of manual participation is high when constructing a knowledge graph using business data of unstructured text.

[0007] To achieve the above object, the present invention provides a method for automatically constructing a knowledge graph from unstructured text for verification, comprising: Get the relevant text of business data uploaded by the device or user; Convert all unstructured texts into text data; and divide the text data into even paragraph segments according to chapters, paragraphs and punctuation marks; Input the sliced ​​paragraph fragments into the trained classification model to obtain the paragraph fragments and corresponding labels; The classification model is trained through the following steps: label each paragraph segment after slicing; use the labeled paragraph segments as the data set, the paragraph segments as the input, and the paragraph segments and their corresponding labels as the output to train the classification model; the labels and the indicators involved in the paragraph segments are mapped one by one to the elements in the defined schema; The paragraph fragment and the corresponding label are used as input to the extraction model, and the numerical value of the indicator corresponding to the label extracted from the paragraph fragment and the relationship between it and other indicators are output, and compared with the benchmark of the corresponding indicator to obtain the labeling result; The labeling results are used to construct a knowledge graph according to the defined schema.

[0008] As a further improvement of the method of the present invention: Business data includes data on indicators of components and the relationships between indicators recorded during the research and development, production, testing, prototyping, improvement, inspection and finalization of equipment or devices.

[0009] After obtaining the marking result, the method further includes: When the value of the tag index in the paragraph segment and the relationship with other indexes meet the benchmark, the tagging result is qualified; otherwise, it is unqualified; The marking results are returned to the user for review and modification, and the marking results reviewed and modified by the user are returned to the extraction model for the corresponding extraction model to iterate.

[0010] The labeling results reviewed and modified by the user are pushed to the knowledge graph, and the content of the corresponding nodes of the knowledge graph is constructed and filled according to the defined schema. The defined schema is the core skeleton structure of the knowledge graph.

[0011] The knowledge graph includes nodes and edges. Nodes are indicators, and edges are the relationships between indicators and other indicators.

[0012] The extraction model is extracted according to the following rules: The indicator corresponding to the label is defined as the entity, and the relationship between the indicator and other indicators is defined as the relationship. The numerical value of the indicator is used as the text extraction content of the entity definition, and the relationship type between the indicator and other indicators is used as the text extraction content of the relationship definition.

[0013] The number of extraction models corresponds to the number of categories in the classification model.

[0014] After obtaining the paragraph fragments and the corresponding labels, the paragraph fragments and the corresponding labels are returned to the user for review and modification, and the review and modification results are returned to the classification model for iteration.

[0015] The extraction model is a large model with understanding and generalization capabilities used to perform extraction tasks.

[0016] On the other hand, the present invention also provides a system for automatically constructing a knowledge graph from verified unstructured text, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of any of the above methods are implemented when the processor executes the computer program.

[0017] The present invention has the following beneficial effects: 1. The method of automatically constructing a knowledge graph from unstructured text for verification of the present invention uses a one-time definition and multiple-use approach, which simplifies the complexity of users using the system, applies the defined schema information to data labeling, extraction model training and knowledge graph definition at the same time, aligns information from multiple data processing links, and facilitates the system to automatically realize data flow, so that knowledge graphs can be automatically constructed in the process of manually reviewing data.

[0018] 2. In the preferred embodiment, the method of automatically constructing a knowledge graph for unstructured text for verification of the present invention labels all the data introduced into the system by introducing text classification, and directs the data to different processing flows through the labels, thereby reducing the pressure of machine calculations. Compared with full data processing, the accuracy of the results of each calculation task can be improved by accurately distributing tasks, filtering out unnecessary calculations and saving the investment in personnel review.

[0019] 3. In the preferred embodiment, the method for automatically constructing a knowledge graph for unstructured text for verification of the present invention also makes full use of manually operated data, establishes a data reflux mechanism, and merges manual annotation and review into the same step. The manually processed data will automatically flow back to the model side to iterate the model. The system selects the best model to replace the online service, gradually improves the accuracy of machine calculation results, and also gradually saves labor costs.

[0020] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 It is a flowchart of a method for automatically constructing a knowledge graph from unstructured text for verification according to a preferred embodiment of the present invention; Figure 2 It is a schematic diagram of the schema process of defining a graph in the preferred embodiment 2 of the present invention; Figure 3 It is a schematic diagram of the marking result of the preferred embodiment 2 of the present invention for the user to review and modify; Figure 4 It is a flow chart of iterative training of the classification model according to the preferred embodiment 2 of the present invention; Figure 5 It is a flowchart of the knowledge annotation and extraction model iteration of the preferred embodiment 2 of the present invention. DETAILED DESCRIPTION

[0022] The embodiments of the present invention are described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.

[0023] Figure 1 It is a flow chart of the method for automatically constructing a knowledge graph from unstructured text for verification as referred to in this embodiment. The present invention is mainly applied to unstructured data mapping. Structured data mapping can no longer meet the market demand for data applications, and most of the data still exists in an unstructured form. The present invention focuses on unstructured data mapping. Combining the construction of a knowledge graph with the extraction model can realize the integration of the two processes into one. To construct a knowledge graph, it is necessary to set the schema of the graph. The schema can also be applied to the definition of the model. The entity definition and relationship definition of the extraction model are mapped with the schema in the knowledge graph. The results of the model extraction can be directly applied to the knowledge graph to realize automatic construction of the graph.

[0024] Example 1 See also Figure 1 The method for automatically constructing a knowledge graph from unstructured text for verification in this embodiment includes the following steps: Obtain relevant text of business data uploaded by the device or user; in this embodiment, the business data includes data on indicators related to components and the relationship between the indicators recorded during the research and development, production, testing, prototyping, improvement, inspection and finalization of the equipment or device.

[0025] Convert all unstructured texts into text data; and divide the text data into even paragraph segments according to chapters, paragraphs and punctuation marks; The sliced ​​paragraph fragments are input into the trained classification model to obtain the paragraph fragments and corresponding labels. During implementation, after obtaining the paragraph fragments and corresponding labels, the paragraph fragments and corresponding labels are returned to the user for review and modification, and the review and modification results are returned to the classification model for iteration.

[0026] The classification model is trained through the following steps: label each paragraph segment after slicing; use the labeled paragraph segments as the data set, the paragraph segments as the input, and the paragraph segments and their corresponding labels as the output to train the classification model; the labels and the indicators involved in the paragraph segments are mapped one by one to the elements in the defined schema; The paragraph fragment and the corresponding label are used as input to the extraction model, and the output is the numerical value and relationship between the indicator corresponding to the label extracted from the paragraph fragment and other indicators, and compared with the benchmark of the corresponding indicator to obtain the labeling result; when implemented, when the numerical value and relationship between the label indicator in the paragraph fragment and other indicators meet the benchmark, the labeling result is qualified; otherwise, it is unqualified. When implemented, the labeling result can also be returned to the user for review and modification, and the labeling result reviewed and modified by the user is returned to the extraction model for the corresponding extraction model to iterate. Among them, when implemented, the extraction model can be extracted according to the following rules: the indicator corresponding to the label is used as the entity definition, and the relationship between the indicator and other indicators is used as the relationship definition; the numerical value of the indicator is used as the text extraction content of the entity definition, and the relationship type between the indicator and other indicators is used as the text extraction content of the relationship definition.

[0027] The number of extraction models corresponds to the number of categories in the classification model.

[0028] The labeling results are used to build a knowledge graph according to the defined schema. During implementation, the labeling results reviewed and modified by the user are pushed to the knowledge graph, and the content of the corresponding nodes that fill the knowledge graph is built according to the defined schema. The defined schema is the core skeleton structure of the knowledge graph. The knowledge graph skeleton structure includes: nodes and edges. Nodes are indicators, and edges are the relationship between indicators and other indicators.

[0029] The above steps include text conversion and label classification. The main purpose of this data preprocessing process is to add a data screening process. In massive data, the target data is only contained in a very small part of the document text. Model extraction has a certain error rate. If all data is extracted by the model, a large part of the documents and extraction results that are not related to the target data will be recalled. All documents or text data need to be extracted by the model and manually reviewed, which greatly increases the labor cost and machine calculation cost. Adding data screening can quickly locate the text paragraph where the target data is located, and label all the texts accordingly. The text segment where the target data is located can be quickly obtained through the label information, and irrelevant information can be filtered out, which can not only improve the accuracy of model extraction, but also reduce the time of manual verification.

[0030] When the present invention is implemented, the above method can be refined into definition and cold start phase, data preprocessing, knowledge extraction and graph construction.

[0031] Among them, the definition and cold start phase are as follows: Graph model schema definition: The schema defines the core skeleton structure of the knowledge graph, mainly including entities and relationships; Cold start data upload and processing: In the initial stage, there is no model to assist in completing the entire data processing process, so a small amount of business data needs to be uploaded as the cold start data of the system. For documents such as word and pdf (non-txt text), they need to be converted into text data (txt text), and the text data needs to be sliced ​​and processed. The complete text data should be divided into uniform paragraph segments as much as possible according to chapters, punctuation, etc.

[0032] Manual labeling and classification training: Label each segment according to the processed segment, and the label comes from the defined schema. In actual implementation, each segment can also be marked with multiple labels. The labeled content will be collected in the system background, and the classification model training will be automatically started.

[0033] Knowledge annotation: According to the annotated labels, paragraph fragments will be assigned to the corresponding model. Only the corresponding knowledge information needs to be annotated manually. Paragraphs without labels will be automatically ignored by the system. The annotated information will be collected by the background into the corresponding model to start the extraction model training. The present invention labels all the data introduced into the system by introducing text classification, and guides the data to different processing flows through labels, which reduces the pressure of machine calculation. At the same time, compared with the full data processing, the accuracy of the results of each calculation task can be improved by accurately distributing tasks, filtering out unnecessary calculations, and saving the investment of personnel review.

[0034] After completing the above steps, the system already has basic classification models and extraction models to provide acceleration services for subsequent data processing.

[0035] The data preprocessing stages are as follows: Document data upload: Users upload all business data. TXT text data directly extracts the internal text content. Word, PDF and other document data are parsed and rearranged through document elements to obtain the internal text content.

[0036] Data slicing and fragment classification: The operation of this part is basically the same as the cold start stage. The cold start data will train a preliminary classification model. After the model training is completed, the system automatically launches the model, and the segmented fragments are processed by the model respectively to give the classification results of each fragment. From the user's perspective, the labeling results will be directly obtained at this stage, and the user only needs to review whether the labeling results are accurate. The present invention simplifies the complexity of users using the system by defining it once and using it multiple times. The defined schema information is simultaneously applied to data labeling, extraction model training and knowledge graph definition, and the information of multiple data processing links is aligned to facilitate the system to automatically realize the flow of data, so that the knowledge graph can be automatically constructed in the process of manually reviewing the data.

[0037] Audit result return and model retraining: This stage is independently implemented in the background. The results after manual review will continue to flow back to the model. The model will gradually iterate to improve the classification effect, with the aim of gradually reducing the time for manual review and labeling. The present invention makes full use of manually operated data, establishes a data return mechanism, and merges manual labeling and review into the same step. The manually processed data will automatically flow back to the model side to iterate the model. The system selects the best model to replace the online service, gradually improves the accuracy of the results calculated by the machine, and also gradually saves labor costs.

[0038] In scenarios with extremely high requirements for data quality, it is necessary to utilize the data from manual feedback as much as possible. The model can reduce manual operations through its own automation capabilities, and the data from manual operations can also be fed back to the model to gradually iterate and improve the model's effectiveness. The two links complement each other.

[0039] The knowledge extraction phase is as follows: Knowledge extraction, review and reflow: The operation of this step is basically the same as the cold start stage. The cold start data will train a series of extraction models and automatically go online. The paragraph fragments with labels will call the corresponding extraction model service to obtain the extraction results. From the user's perspective, this stage will directly obtain the extraction results. The user only needs to modify the incorrect part. The results after review and modification will continue to flow back to the corresponding model. The background automatically iterates the model. The purpose is to gradually reduce the user's labeling and review investment without changing the user's operation.

[0040] In scenarios with extremely high requirements for data quality, it is necessary to utilize the data from manual feedback as much as possible. The model can reduce manual operations through its own automation capabilities, and the data from manual operations can also be fed back to the model to gradually iterate and improve the model's effectiveness. The two links complement each other.

[0041] The stages of building the graph are as follows: In addition to flowing back to the corresponding model for iteration, the modified and reviewed compliance result data can also be pushed to the knowledge graph to build a graph. When defining the knowledge graph and the model schema, the definitions of the two have been mapped one by one. Therefore, the extracted result data can quickly find its position in the graph and can be automatically entered into the graph through the system. At this stage, the user does not need to perform any operation. The constructed knowledge graph can visualize query information and export graph results to provide support for subsequent applications.

[0042] Embodiment 2: This embodiment is used for the inspection of an equipment vehicle and the automatic construction of a knowledge graph from unstructured text. The method for automatically constructing a knowledge graph from unstructured text for inspection in this embodiment includes the following steps: First upload the document and configure the graph: The user uploads the business data, which includes the data of the indicators of the components involved in the equipment vehicle during the research and development, inspection and finalization process, as well as the relationship between the indicators. The document can be uploaded in the form of pdf, word, txt and various pictures, etc. The text content is extracted in the reading order through document parsing, and stored in the system in the form of text as the data basis for subsequent processing.

[0043] Define the schema of the graph. The schema mainly includes three types: entity type, relationship type and event type. Figure 2 In this way, after the schema in each type is defined, the configuration will serve as the knowledge definition for the entire system.

[0044] In this embodiment, the entity type can be the corresponding indicators of the components of the equipment vehicle, such as the chassis (departure angle, wading depth, etc.), the body (size, weight, thickness, spraying, three-proof, etc.), the communication components (frequency bands of each communication component, antenna form, deployment conditions, etc.) and the XX components (such as energy storage or power generation components, protection components, field survival or portable equipment, etc.); the relationship type can be the center of gravity of each component, various interferences between XX components and YY components, connections between different communication components, etc.; the event type can be different working modes, fault scenarios, test scenarios and extreme scenarios, etc.

[0045] Then perform text segmentation and segment labeling: Document data has the concept of chapters, and the same type of content will be concentrated in the same chapter for presentation. Therefore, the chapter information and chapter levels in the text are identified first, and the text content is divided into multiple paragraphs according to the chapters. If a chapter has a large number of words, the text is divided again around 500 words with punctuation marks such as "." and "!" to end the text.

[0046] After segmentation, each fragment text is treated as an independent piece of data. Each piece of data needs to call the classification model to confirm the classification label of the current fragment. If it is a cold start stage without a classification model, the system will assign the "other" label to the current fragment by default. The text labeled "other" will stop at the current process and will not be subjected to subsequent extraction processing. Because most texts do not contain the user's target knowledge, the default "other" label can reduce the user's labeling operations.

[0047] The labeling results are displayed to the user in a visual way, with the document fragment on the left and the identified label information on the right. If the labeling result is incorrect, the user can modify the labeling result, and the candidate label is consistent with the schema defined in the first step. The labeling result modified by the user can be returned to the model for iteration.

[0048] The iterative training steps of the classification model can be found in Figure 4 The training of the model mainly relies on manual information feedback. When the system obtains the feedback results after manual review, the text data with labels will be concentrated in the corpus. The background will trigger the training of the model regularly. When the number of newly added corpora exceeds 20 and there is no model being trained, the training will start formally. If there are no more than 20 or there is a model being trained, the current task will be jumped out and wait for the corpus to continue to accumulate. The output of model training includes the trained model, the number of training data, and the results of model evaluation F1, R, and P. Combined with the number of training data and F1, the model evaluation score is recalculated (the continuous increase in data volume may lead to a decrease in F1, but the information content of the model obtained by training with a large data volume is higher than that of the model obtained with a small data volume, so the quality of the model cannot be judged by F1 alone). The evaluation score is calculated as follows: (w1 * F1_score) + (w2 * log1p(data_volume)), w1 and w2 are the weights of the data volume and F1 score, and w1+w2=1. The specific value can be adjusted according to the actual situation.

[0049] The system obtains the model with the highest evaluation score from all trained classification models and puts it online to provide model support for subsequent automatic labeling of data.

[0050] Then extract the task diversion: Since the definitions of classification labels and extraction models are common, the text extraction task can call the corresponding extraction model according to the labeling results, or filter out the knowledge content with the corresponding label from the extraction results. Text with the "other" label can be directly ignored and skipped.

[0051] The specific steps of knowledge annotation and extraction model iteration in this embodiment are as follows: Figure 5 : (1) Triggering the task: After the user submits the result, the platform will automatically trigger the information extraction process; (2) Information extraction corpus preparation: Based on the label information identified in the previous step, remove the corpus in the "other" category, retain the remaining paragraphs, and segment the corpus required for information extraction according to the chapter level used in the topic classification; (3) Extraction task assignment: Obtain the mapping information between the user-configured "classification label" and "extraction model", and assign paragraphs with different labels to the corresponding extraction model for prediction. If the same paragraph is marked with multiple labels, the current paragraph needs to be extracted multiple times. There is no model service in the cold start phase, so this step will be skipped directly in the cold start phase. (4) Model extraction: The way to process a paragraph is to push all the text information involved in the paragraph to the model side for estimation, and save the obtained estimation result in the form of "original text + label + extraction result + coordinates of the current paragraph where the extraction result is located"; (5) Manual review: Manual review also has the function of text annotation in this system. Through the information of the extraction results, the system can restore the content of the knowledge and its position in the original text segment. If the result is incorrect, the user can use the operation of swiping in the original text to re-mark the knowledge and its location. The system can also record "original text + label + extraction result + coordinates of the current paragraph where the extraction result is located" and return it to the model side to wait for model iteration; (6) Submit the review results: Use the paragraph tag to push the corresponding text content, extraction results, and review results back to the ontology model corresponding to the tag to accumulate data for incremental model updates; (7) Model self-learning: A scheduled task is started in the background. The data accumulation status is checked on a daily basis. Model training is started when the data increment exceeds 10 items. The system automatically plans the resources required for training. After the training is completed, the model will be saved to the model warehouse according to the training time. The output of the model training includes the trained model, the number of training data items, and the results of the model evaluation F1, R, and P. The model evaluation score is recalculated based on the number of training data items and F1 (the F1 score may decrease if the data volume continues to increase, but the information content of the model obtained by training with a large data volume is higher than that of the model obtained with a small data volume. Therefore, the quality of the model cannot be judged solely by F1). The evaluation score is calculated as follows: (w1 * F1_score) +(w2 * log1p(data_volume)), where w1 and w2 are the weights of the data volume and F1 score, and w1+w2=1. The specific value can be adjusted according to the actual situation.

[0052] The system obtains the model with the highest evaluation score from all trained models and puts it online to provide model support for subsequent automatic data extraction.

[0053] Then the knowledge is automatically constructed into a knowledge graph Obtain the graph schema definition configuration information, confirm the mapping relationship between the model results and the knowledge information in the graph, and place the manually verified knowledge in the corresponding slot in the graph. This stage can be directly and automatically implemented without additional user operation.

[0054] Through the above steps, the massive amount of unstructured data such as reliability testing, multiple modifications, and scheme changes of the equipment vehicle can be automatically extracted and a knowledge graph can be established. The index data of the process can be clearly displayed and compared and summarized in the inspection stage, and the index items that do not meet the equipment design requirements at each stage can be optimized or marked. This greatly saves manpower and is more accurate.

[0055] Embodiment 3: The steps of this embodiment are basically the same as those of Embodiment 2, except that the extraction model of this embodiment adopts a large model for performing the extraction task, and the extraction process utilizes the understanding and generalization capabilities of the large language model for extraction.

[0056] The extraction algorithm of the large model of this embodiment is as follows: For entity relationship extraction tasks using prompt words, we first need to construct effective prompt words. In order to enhance the performance of large models in specific fields, different role types can be preset according to different tasks and fields. For example, in the financial field, it can be set as "financial field entity recognition expert", and in the equipment development field, it can be set as "equipment development field relationship extraction expert". This role setting can help the model better understand the professional background and extraction goals of different fields.

[0057] When constructing a prompt, first add the input text and the schema to be extracted (i.e., the structure that defines entities and relationships) to the instruction. The schema should contain the entity types to be identified (such as "device name", "product type", "device indicator information", indicator content, etc.) and possible relationship types (such as "device attributes", "required content", "measured content", etc.).

[0058] Addition of examples: In order to make the large model better understand the extraction task, 1-10 examples should be added to the prompt word. The selection of examples should follow the following principles: Diversity: Examples should cover all types of samples that may appear in the dataset, including but not limited to samples with clear labels, samples with empty labels (i.e., the model fails to extract valid entity relationships), and samples with complex structures. For example, the original text mentions that "the wading depth of the transport vehicle is required to be no less than 1 meter, and the actual wading depth is 1.2 meters." For this sample, the following tips are given to the large model: "You are an expert in equipment development and production information extraction. Please complete the subsequent extraction work according to the following examples. The examples are as follows:" Input: "The wading depth of the transport vehicle is required to be no less than 1 meter, and the actual wading depth is 1.2 meters"; Output: Equipment name: transport vehicle; Equipment index: wading depth; Equipment requirements: not less than 1 meter; Equipment measured content: 1.2 meters; Comprehensiveness: Examples should cover all possible entity types and relationships. Even if some entities or relationships appear less frequently in the data, they should be considered in the examples to ensure that the large model can accurately extract these rare cases.

[0059] Edge cases: Add examples that include special cases, such as ambiguous or ambiguous examples, or complex examples with multiple relationships, to help the model identify potential difficulties and edge cases.

[0060] Label consistency: The labels in the example should be highly consistent with the schema to be extracted, ensuring that the format, entity, and relationship labels of the example are consistent with the actual task.

[0061] In this way, the model can not only obtain rich domain background information, but also learn how to handle different entity and relationship extraction tasks through examples, thereby improving the accuracy and generalization ability of extraction.

[0062] Embodiment 4: An embodiment of the present invention also provides a system for automatically constructing a knowledge graph from unstructured text for verification, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of any of the above embodiments are implemented when the processor executes the computer program.

[0063] In summary, the present invention mainly solves three problems. The first is to solve the problem of missing data preprocessing process. The second is to combine the extraction model with the knowledge graph construction to the greatest extent, speed up the output rate of the knowledge graph, and the third is to make the best use of the role of human in the entire knowledge output process. By adding the data preprocessing process of text classification, the diversion of data tasks is realized; one definition is used multiple times, and the information of multiple data processing processes is aligned, which can simplify the data operation steps and realize the automatic construction of knowledge graphs as a result of data extraction; make full use of artificial feedback data, establish a data reflux mechanism, and gradually iterate the model to support the improvement of the automation level of the system. Based on natural language processing technology and knowledge graph construction technology, the present invention realizes the extraction of knowledge elements from massive unstructured text data, realizes the knowledge management of a certain industry field, privatized data or product and physical equipment information, and effectively improves the utilization rate of document data and the efficiency of users accessing knowledge.

[0064] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for automatically constructing a knowledge graph from unstructured text for verification, characterized in that: include: Get the relevant text of business data uploaded by the device or user; Convert all unstructured texts into text data; And divide the text data into even paragraph segments according to chapters, paragraphs and punctuation; Input the sliced ​​paragraph fragments into the trained classification model to obtain the paragraph fragments and corresponding labels; The classification model is trained by the following steps: each paragraph segment after slicing is labeled with a corresponding label; the labeled paragraph segments are used as data sets, the paragraph segments are used as input, and the paragraph segments and their corresponding labels are used as output to train the classification model; the labels are mapped one by one to the elements in the defined schema corresponding to the indicators involved in the paragraph segments; The paragraph fragment and the corresponding label are used as input to the extraction model, and the numerical value and relationship between the index corresponding to the label extracted from the paragraph fragment and other indexes are output, and compared with the benchmark of the corresponding index to obtain the labeling result; The labeling results are used to construct a knowledge graph according to the defined schema.

2. The method for automatically constructing a knowledge graph from unstructured text for verification according to claim 1, characterized in that: The business data includes data on indicators related to components and the relationships between indicators recorded during the research and development, production, testing, prototyping, improvement, inspection and finalization of equipment or devices.

3. The method for automatically constructing a knowledge graph from unstructured text for verification according to claim 1, characterized in that: After obtaining the marking result, the method further includes: When the value of the tag index in the paragraph segment and the relationship between the value and other indexes meet the benchmark, the tagging result is qualified; otherwise, it is unqualified; The marking result is returned to the user for review and modification, and the marking result reviewed and modified by the user is returned to the extraction model for the corresponding extraction model to iterate.

4. The method for automatically constructing a knowledge graph from unstructured text for verification according to claim 3, characterized in that: The marking results reviewed and modified by the user are pushed to the knowledge graph, and the content of the corresponding nodes of the knowledge graph is constructed and filled according to the defined schema. The defined schema is the core skeleton structure of the knowledge graph.

5. The method for automatically constructing a knowledge graph from unstructured text for verification according to claim 4, characterized in that: The knowledge graph includes: nodes and edges, the nodes are the indicators, and the edges are the relationships between indicators and other indicators.

6. The method for automatically constructing a knowledge graph from unstructured text for verification according to any one of claims 1 to 5, characterized in that: The extraction model is extracted according to the following rules: The indicator corresponding to the label is defined as the entity, and the relationship between the indicator and other indicators is defined as the relationship. The numerical value of the indicator is used as the text extraction content of the entity definition, and the relationship type between the indicator and other indicators is used as the text extraction content of the relationship definition.

7. The method for automatically constructing a knowledge graph from unstructured text for verification according to claim 6, characterized in that: The number of the extraction models corresponds to the number of categories of the classification model.

8. The method for automatically constructing a knowledge graph from unstructured text for verification according to any one of claims 1 to 4, characterized in that: After obtaining the paragraph fragments and the corresponding labels, the paragraph fragments and the corresponding labels are returned to the user for review and modification, and the review and modification results are returned to the classification model for iteration.

9. The method for automatically constructing a knowledge graph from unstructured text for verification according to claim 1, characterized in that: The extraction model is a large model with understanding and generalization capabilities used to perform extraction tasks.

10. A system for automatically constructing a knowledge graph from unstructured text for verification, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.