Entity relation extraction method and system for constructing knowledge graph of helicopter assembly field
Patent Information
- Application Number
- CN202311548209.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-11-20
AI Technical Summary
然而,这些方法存在一些问题,限制了知识抽取的效果和应用:首先,规则和模板需要人工编写,对于复杂和多样化的文本数据覆盖不足,无法处理新的或未知的情况
[0065] Compared with the prior art, due to the adoption of the above technical solution, the entity relationship extraction method, system and readable storage medium of the present invention for knowledge graph construction in the field of helicopter assembly have the following beneficial and significant technical effects:
Smart Images

Figure CN117520561B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and to a method for extracting entity and relation information from text data. Specifically, it relates to an entity and relation extraction method, system, and readable storage medium for knowledge graph construction in the field of helicopter assembly. This method can automatically extract entity and relation information from text data in the field of helicopter assembly, thereby providing effective support for the intelligentization and automation of the helicopter assembly process. Background Technology
[0002] A knowledge graph is a structured data model used to represent and store knowledge, consisting of entities, attributes, and relationships. In the construction of a knowledge graph in the helicopter assembly field, knowledge extraction is a crucial process. Knowledge extraction can extract entity, attribute, and relationship information related to helicopter assembly from large amounts of unstructured data such as relevant documents, technical manuals, and professional papers. This helps to build a rich and comprehensive knowledge graph covering all aspects of the industry, such as helicopter structure, function, performance, processes, standards, specifications, faults, maintenance, and improvements. This facilitates the effective organization, management, and utilization of knowledge in the helicopter assembly field, improving its accessibility, shareability, and reusability. Secondly, knowledge extraction can automate the processing of text data, improving efficiency and accuracy. Compared to traditional manual sorting and summarizing methods, knowledge extraction can process large-scale data more quickly and extract useful knowledge. Furthermore, knowledge extraction can leverage advanced natural language processing and machine learning technologies to perform in-depth analysis and understanding of text data, improving the quality and accuracy of knowledge. Furthermore, knowledge extraction can help uncover hidden patterns and trends within text, providing insights and analysis into the helicopter assembly field. Through knowledge extraction, key technologies, hot topics, innovation directions, and competitive advantages in helicopter assembly can be extracted from textual data, which is of great significance for decision-making, technological innovation, and business optimization.
[0003] Current knowledge extraction methods primarily employ rule-based and template-matching approaches. These methods rely on pre-defined rules and templates to extract entity, attribute, and relational information by matching specific patterns in text. However, these methods suffer from several limitations, restricting the effectiveness and application of knowledge extraction: First, rules and templates require manual writing, resulting in insufficient coverage of complex and diverse text data and an inability to handle new or unknown situations. Since knowledge in the helicopter assembly field is dynamic and constantly updated, manually written rules and templates struggle to adapt to these changes. Second, these methods are mainly based on superficial pattern matching, lacking a deep understanding of the textual context. This limits the accuracy and generalization ability of the extraction algorithms, making them susceptible to noise and ambiguity, and prone to errors and omissions in extraction results. For example, the word "helicopter" in text might refer to the entire helicopter or a specific component; failure to distinguish this semantic difference can lead to incorrect entity identification. Furthermore, traditional methods are inefficient when processing large-scale data because they require sequential data processing and cannot be well parallelized or scaled. Furthermore, traditional methods rely heavily on domain experts, requiring them to manually define extraction rules, which limits the methods' generality and scalability. Finally, these methods are primarily designed for extracting structured entity, attribute, and relational information from structured text, and struggle to handle unstructured and semi-structured data.
[0004] In view of the above, developing knowledge extraction technology that can effectively process large amounts of unstructured and semi-structured data in the field of helicopter assembly, while reducing manpower input and dependence on domain experts, is an urgent technical problem to be solved. Summary of the Invention
[0005] (I) Purpose of the Invention
[0006] To address the shortcomings and deficiencies of existing technologies in entity relation extraction during knowledge graph construction in the helicopter assembly field, particularly the high dependence on automated annotation and human input, and the excessive reliance on domain experts, this invention aims to provide an entity relation extraction method, system, and readable storage medium for knowledge graph construction in the helicopter assembly field. By employing a pre-trained model for entity relation extraction, it not only improves the efficiency and speed of extraction but also enables the processing of large amounts of text data in a short time, achieving highly efficient entity relation extraction. Furthermore, it significantly reduces the degree of human intervention, lowers the reliance on domain experts, and enhances the adaptability and universality of the extraction method.
[0007] (II) Technical Solution
[0008] To achieve the objective of this invention, the technical solution adopted by this invention is as follows:
[0009] The first objective of this invention is to provide an entity relation extraction method for knowledge graph construction in the field of helicopter assembly, characterized in that the method includes at least the following steps when implemented:
[0010] SS1. Acquire text data in the helicopter assembly field to be processed, wherein the text data includes at least structured data, semi-structured data, and / or unstructured data;
[0011] SS2. Clean the text data to be processed, and delete or rewrite the garbled characters, unreasonable symbols and illogical statements in the data collected in step SS1;
[0012] SS3. Segment the text data cleaned and processed in step SS2 into sentences. The segmented sentences are coherent and of appropriate length.
[0013] SS4. Input the text segments obtained in step SS3 into the entity relation extraction model step by step. After processing, output the helicopter assembly domain entities and relations contained in the text segments. The entity relation extraction model is a pre-trained language model trained on entity relation extraction. The pre-trained language model is trained based on manually verified triplet data and includes at least the following training steps:
[0014] SS41. Collect and organize labeled datasets in the field of helicopter assembly to provide preparation data for training entity relation extraction models;
[0015] SS42. Based on the labeled dataset provided in sub-step SS41, perform feature extraction and representation learning to capture semantic and contextual information in text fragments;
[0016] SS43. Based on the labeled dataset provided in sub-step SS41 and the features extracted in sub-step SS42, the GLM language model is used as the pre-trained language model, and an entity relation extraction model is built on this basis, specifically as follows:
[0017] SS431. Pre-training is performed using an autoregressive whitespace-filling method. For each original input text segment x = [x1,...,x...], ... n Perform the following operations:
[0018] First, for multiple text spans {s1,…,s…} m Sampling is performed, where each text span si represents a continuous sequence of tokens.
[0019] Then, each text span is replaced with a single [MASK] tag, resulting in the corrupted text x. corrupt ;
[0020] Next, the corrupted text x corrupt Using the previously predicted text span as input, a pre-trained language model is used to predict the missing tokens in the text span;
[0021] Meanwhile, in order to more fully capture the interdependencies between different text spans, multiple text spans are randomly selected for masking, and the masked text spans are predicted in a random order, thereby learning entity and relation information in the text fragments;
[0022] SS432. On the output layer of the pre-trained language model, several task layers are added to extract and represent task-related features to complete the entity relation extraction task. The several task layers include at least an entity classification layer and a relation classification layer. Through these task layers, the output of the pre-trained language model is transformed into the output of the entity relation extraction task, so as to achieve the purpose of extracting entity and relation information from text data.
[0023] Preferably, in step SS1 above, acquiring the text data in the helicopter assembly field to be processed specifically includes:
[0024] By scanning helicopter assembly manuals, the paper texts are converted into digital images, and then optical character recognition (OCR) technology is used to convert them into editable text content to obtain the knowledge and information in the manuals.
[0025] We acquire structured and semi-structured data from relevant databases, literature, and papers in the field of helicopter assembly, including organized and compiled professional documents, technical materials, and research results in related fields, to gain rich domain knowledge and practical experience.
[0026] Preferably, in step SS2 above, the acquired data is cleaned, specifically including:
[0027] Remove garbled characters and illegal characters by detecting and filtering garbled characters and illegal characters in text data to eliminate noise and interference in the data;
[0028] Deduplication involves detecting and removing duplicate content from text data to ensure data uniqueness and prevent duplicate information from interfering with entity relation extraction.
[0029] Repairing grammatical errors and illogical statements: Using syntax analysis and semantic analysis techniques, we correct and optimize grammatical errors and illogical statements in text data to improve the readability and comprehensibility of the text.
[0030] Standardized text formatting involves standardizing text data, including unifying punctuation marks and case conversion, to ensure that text data has a consistent expression style.
[0031] Stop words are removed by filtering and deleting common words such as articles and prepositions from the text data based on a predefined stop word list, in order to reduce the impact on entity relation extraction.
[0032] Preferably, in step SS3 above, the cleaned data is split into sentences, which includes the following steps:
[0033] Sentence delimiter recognition utilizes natural language processing techniques, including punctuation analysis and grammatical analysis, to process cleaned text data in order to identify and locate sentence delimiters, such as periods, question marks, and exclamation marks.
[0034] Sentence segmentation involves segmenting the cleaned text data based on the positional information of sentence delimiters.
[0035] Sentence filtering involves filtering and selecting the segmented sentences to remove irrelevant information and meaningless sentences.
[0036] Preferably, step SS4 above further includes a sub-step SS44 for evaluation and optimization, which evaluates the model trained in sub-step SS432, performs performance testing and metric evaluation using an independent test dataset, such as accuracy and recall, and optimizes and improves the model based on the evaluation results to improve the accuracy and effectiveness of entity relation extraction.
[0037] Preferably, in step SS4 above, the workflow of the entity relationship extraction model specifically includes:
[0038] SS4A. Constructing Input Samples: Based on task requirements, transform text data into samples suitable for model input;
[0039] SS4B. Sequence Encoding: Uses word embedding techniques to convert text sequences into vector representations. Uses the GLM model for word embedding and obtains the vector representations of words. For long texts, truncation or padding strategies are used to ensure consistent sequence length.
[0040] SS4C. Entity Extraction: The encoded text sequence is input into a pre-trained language model. The model captures the contextual information of entities through a self-attention mechanism and a feedforward neural network layer, classifies each position, determines whether the position belongs to an entity, and completes the entity extraction task.
[0041] SS4D Relation Extraction: For the extracted entities, further relation extraction is performed in the model. The model utilizes a self-attention mechanism and a feedforward neural network layer to learn the relationships between entities and complete the relation extraction task.
[0042] By following the steps above, entity and relation information can be automatically extracted from text data, providing a foundation for subsequent tasks such as knowledge graph construction, information extraction, and natural language understanding.
[0043] Preferably, in the above sub-step SS431, z is defined m Let m be the set of all possible permutations of the index sequence [1,2,…,m] of length m, and Represents an index sequence The training objective function of the model is to maximize the expected log-likelihood under parameter θ:
[0044]
[0045] in, Indicates that in a given corrupted text x corrupt and the previous text span Under the condition, generate text span The probability of and the joint probability of all missing tokens:
[0046]
[0047] Among them, s i,j Indicates text span s i The j-th token in the array, s i,<j Indicates text span s i The first j-1 tokens in the array, l i Indicates text span s i The length, thus in predicting the text span For each token in the process, the corrupted text x must be considered. corrupt And the previously predicted text span and text span s i The preceding information s i,<j This makes predictions more accurate and consistent.
[0048] The above training objective function means that, given corrupted text x, ... corrupt And the previously predicted text span Under the condition of predicting the i-th text span s zi The maximum likelihood is obtained. This training method can make full use of entity and relation information in text fragments, while avoiding the limitations of traditional masked language models, such as fixed mask ratios and inability to handle long texts. At the same time, this training method can also enhance the model's generalization ability, enabling it to adapt to different text spans and orders.
[0049] Preferably, in the above sub-step SS431, each text span is divided into two parts, Part A and Part B, where Part A represents x.corrupt Part B represents the text span that is masked by the [MASK] tag. During the prediction process, all tokens in Part A can follow each other, but cannot follow Part B. However, Part B can follow all Part A and the Part B that has already been predicted, thus ensuring the accuracy and consistency of the prediction.
[0050] Furthermore, in the above sub-step SS431, each text span is filled with special markers [START] and during the autoregressive blank filling process. Each text span takes [START] as input and adds as output to ensure that the model can identify the start and end of the text span.
[0051] Furthermore, in the above sub-step SS431, two-dimensional positional encoding is used to represent the position of each token between and within spans, in order to enhance the model's understanding of the text structure.
[0052] Preferably, in the above sub-step SS432, the entity classification layer is a multi-label classifier used to determine the entity and its type for each token, and to determine whether it belongs to the helicopter assembly field and which entity category it belongs to, such as parts, tools, operations, etc.; the relationship classification layer is a multi-classifier used to determine the relationship type for each pair of entities, and to determine whether there is a relationship in the helicopter assembly field and which relationship category it belongs to, such as composition, connection, installation, etc.
[0053] The second objective of this invention is to provide an entity relation extraction system for knowledge graph construction in the helicopter assembly field, including a text acquisition module, a text cleaning module, a sentence segmentation module, and an entity relation extraction module, and correspondingly implementing the relevant steps of the entity relation extraction method for knowledge graph construction in the helicopter assembly field provided in the first objective of this invention, wherein...
[0054] The text acquisition module is used to acquire text data in the field of helicopter assembly, including structured data, semi-structured data, and unstructured data.
[0055] The cleaning and processing module deletes or rewrites garbled characters, unreasonable symbols, and illogical statements in the collected data.
[0056] The sentence segmentation module segments the processed text into sentences, resulting in sentences that are fluent and of appropriate length.
[0057] The entity relation extraction module inputs the data processed in the above process into the pre-trained model after entity relation extraction training. The data result is the entities and relations contained in the text.
[0058] A third object of the present invention is to provide an electronic device comprising: a memory and a processor;
[0059] The memory is used to store computer-readable instructions non-temporarily, and the processor is used to execute the computer-readable instructions;
[0060] When the computer-readable instructions are executed by the processor, the entity relationship extraction method for constructing a knowledge graph in the field of helicopter assembly, as described in the first objective of the invention, is performed.
[0061] A fourth objective of the present invention is to provide a non-transitory storage medium for storing computer-readable instructions, the computer-readable instructions including instructions for performing the method described in the first objective, wherein when the computer-readable instructions in the non-transitory storage medium are executed by a computer, the method described in the first objective is realized.
[0062] The non-transitory storage medium can be any suitable medium, such as a hard disk drive, solid-state drive, flash memory, optical disk, or any other form of storage device. The storage medium non-transitoryly retains computer-readable instructions so that they can be accessed and executed by the computer when needed.
[0063] Through the computer-readable instructions stored in the storage medium, the computer can perform corresponding operations according to the steps of the method described in the first objective, thereby realizing entity relation extraction for knowledge graph construction in the field of helicopter assembly.
[0064] (III) Technical Effects
[0065] Compared with the prior art, due to the adoption of the above technical solution, the entity relationship extraction method, system and readable storage medium of the present invention for knowledge graph construction in the field of helicopter assembly have the following beneficial and significant technical effects:
[0066] (1) This invention uses a pre-trained model for entity relation extraction, which improves the efficiency and speed of extraction. By applying the pre-trained model, a large amount of text data can be processed in a short time, achieving efficient entity relation extraction.
[0067] (2) The method of this invention automates the entity relation extraction process. The application of the pre-trained model reduces the degree of human intervention, making the entity relation extraction process more automated. This feature reduces labor costs and improves work efficiency.
[0068] (3) This invention significantly improves the model's ability to capture textual data structures and semantic relationships in the helicopter assembly domain by using the GLM language model as a pre-trained language model and employing an autoregressive blank-filling method for training. Traditional methods rely heavily on manually defined rules and templates in entity relationship extraction, which not only limits the accuracy and generalization ability of the extraction algorithm but also increases the complexity of model training and data processing. In contrast, the training method of this invention automatically learns the inherent features and patterns of textual data through autoregression, thereby accurately extracting entity and relationship information even without explicit rules and templates, greatly improving the efficiency and accuracy of extraction. Attached Figure Description
[0069] The accompanying drawings are provided to further illustrate the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0070] Figure 1 This is a flowchart of the knowledge graph construction process in the field of helicopter assembly according to Embodiment 1 of the present invention;
[0071] Figure 2 This is a training flowchart of the entity relationship extraction method in the helicopter assembly field according to Embodiment 1 of the present invention. Detailed Implementation
[0072] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Based on the embodiments in this application, other similar embodiments obtained by those skilled in the art without creative effort should all fall within the scope of protection of this application.
[0073] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. Furthermore, it should be understood that the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. Without conflict, embodiments and features in the embodiments of the present invention can be combined with each other.
[0074] Example 1
[0075] like Figure 1 , 2As shown, this example provides a method for entity relation extraction in the construction of knowledge graphs for the helicopter assembly domain, including the following steps:
[0076] Step SS1: Data acquisition in the helicopter assembly field;
[0077] Step SS2: Clean the acquired text data;
[0078] Step SS3: Segment the cleaned text data into sentences;
[0079] Step SS4: Input the segmented text fragments into the pre-trained model trained by entity relation extraction step by step, and output the helicopter assembly domain entities and relations contained in the text fragments; wherein, the pre-trained model trained by entity relation extraction is trained using manually verified triple data.
[0080] In a preferred embodiment of the present invention, step SS1, the acquisition of helicopter assembly data, includes:
[0081] Step SS1-1. Obtain structured and semi-structured data from relevant databases, literature, papers, and other data sources in the helicopter assembly field. Structured and semi-structured data include organized and processed professional documents, technical materials, and research findings in related fields. By accessing and querying these data sources, rich domain knowledge and practical experience can be obtained, providing a valuable information foundation for entity relation extraction.
[0082] Steps SS1-2: By scanning helicopter assembly manuals, unstructured data such as paper text is converted into digital images. Optical Character Recognition (OCR) technology is then used to process these images, converting them into editable text content. This allows access to the knowledge and information within the manuals, providing a crucial data source for subsequent entity relation extraction.
[0083] In a preferred embodiment of the present invention, step SS2 involves data cleaning of the acquired text data, specifically including:
[0084] Step SS2-1. Remove garbled characters and illegal characters: By detecting and filtering the text data, garbled characters and illegal characters are eliminated to reduce noise and interference in the data;
[0085] Step SS2-2. Deduplication: By detecting and deleting duplicate content in the text data, the uniqueness of the data is ensured, and the interference of duplicate information on entity relation extraction is avoided.
[0086] Step SS2-3. Repair grammatical errors and logically incoherent sentences: Use syntax analysis and semantic analysis techniques to correct and optimize grammatical errors and logically incoherent sentences in the text data, thereby improving the readability and comprehensibility of the text;
[0087] Step SS2-4. Standardize text format: Standardize the format of text data, including uniform punctuation, case conversion, etc., so that the text data has a consistent expression style;
[0088] Step SS2-5. Remove stop words: Based on a predefined list of stop words, filter and remove common words in the text data, such as articles and prepositions, to reduce the impact on entity relation extraction.
[0089] In a preferred embodiment of the present invention, step SS3, which involves sentence segmentation of the cleaned text data, specifically includes:
[0090] Step SS3-1. Sentence Boundary Marker Recognition: Advanced natural language processing techniques, including punctuation analysis and grammatical analysis, are used to process the cleaned text data to identify and locate sentence boundary markers, such as periods, question marks, and exclamation marks. This accurately determines the boundary positions of sentences, providing a basis for subsequent sentence segmentation.
[0091] Step SS3-2. Sentence Segmentation: Based on the positional information of sentence delimiters, the cleaned text data is segmented. Continuous text segments are cut into independent sentences, ensuring that the segmented sentences are semantically coherent and of appropriate length. This contributes to the accuracy and efficiency of subsequent entity relation extraction.
[0092] Step SS3-3. Sentence Filtering: The segmented sentences are filtered and selected to remove irrelevant information and meaningless sentences. By applying semantic analysis and domain-related filtering rules, it is ensured that the extracted sentences contain entities and relationships relevant to the helicopter assembly domain. This improves the accuracy and reliability of entity and relation extraction.
[0093] In a preferred embodiment of the present invention, in step SS4, the segmented text fragments are progressively input into a pre-trained model trained on entity relation extraction, and the helicopter assembly domain entities and relations contained in the text fragments are output. The training process of the pre-trained model trained on entity relation extraction specifically includes the following training steps:
[0094] Step SS4-1. Data Preparation: To train the entity-relation extraction model, a labeled dataset in the helicopter assembly domain is collected and organized. This dataset includes text fragments related to helicopter assembly and their corresponding entity and relation annotations. Entities and relations in each text fragment are accurately labeled using manual or semi-automatic annotation methods.
[0095] Step SS4-2. Feature Extraction and Representation Learning: Feature extraction and representation learning are performed on the labeled dataset to capture semantic and contextual information in text fragments. Feature extraction is a crucial step in text processing using the Transformer model. First, the original sequence data is converted into vector representations using word embedding techniques, such as obtaining the vector representation of each word using a pre-trained word embedding model. To preserve the positional information of the sequence, positional encoding is also added. Next, the encoded input sequence is fed into the Transformer model for feature extraction. The Transformer model consists of multiple encoder layers, each containing a self-attention mechanism and a feedforward neural network layer. The self-attention mechanism captures the internal relationships and dependencies in the sequence, while the feedforward neural network layer performs non-linear transformations. Finally, the output of the Transformer model can be either the encoded input sequence or the output of a specific layer; these outputs are high-dimensional vectors containing feature information at each position in the sequence.
[0096] Step SS4-3. Model Training and Optimization: Based on the extracted features and labeled dataset, an entity relation extraction model is constructed using the GLM language model open-sourced by Tsinghua University. GLM is trained using autoregressive blank infilling. The original input to GLM is a text segment x = [x_1,…,x_n], followed by training multiple text spans {s1,…,s_n}. m Sampling is performed, where each text span s_i represents a continuous sequence of tokens. Each text span is replaced by a single [Mask] tag, forming the corrupted text x. corrupt The GLM model accesses corrupted text x corrupt It uses the previously predicted text span to predict missing tokens within the text span. Simultaneously, GLM captures the interdependencies between different text spans more completely by randomly permuting the predicted text spans.
[0097] Step SS4-4: Evaluation and Tuning: Evaluate the trained model using an independent test dataset for performance testing and metric evaluation, such as accuracy and recall. Based on the evaluation results, tune and improve the model to enhance the accuracy and effectiveness of entity relation extraction.
[0098] In a preferred embodiment of the present invention, formally, let z m Let m be the set of all possible permutations of the index sequence [1,2,…,m] of length m, and Represents an index sequence In summary, the objective function for pre-training is defined as follows:
[0099]
[0100] Within each text span, each missing token is always generated in a left-to-right order, so generating each text span s... i The probability is:
[0101]
[0102] In each text span, Part A represents x. corrupt Part B represents the masked text span, which is the [MASK] token in Part A. During the prediction process, all tokens in Part A can follow each other, but cannot follow Part B. Part B, on the other hand, can follow all Part A and all predicted Part B, thus ensuring the accuracy and consistency of the prediction.
[0103] In a preferred embodiment of this invention, during the autoregressive blank-filling process, each text span is filled with special markers [START] and . Each text span takes [S] as input and adds [E] as output to ensure that the model can identify the start and end of the text span. Simultaneously, two-dimensional positional encoding is used to represent the position of each token between spans (Position 1) and within spans (Position 2) to enhance the model's understanding of the text structure.
[0104] In a preferred embodiment of this invention, after the model training process is completed, fine-tuning of the model is performed in subsequent processes to better adapt to the entity relation extraction task. To adapt to the specific task of entity relation extraction, a specific task layer is added to the expected output layer of the model. This layer is used to extract and represent task-related features. Considering the characteristics and purpose of the task, the already labeled entity and relation information is used to train and evaluate the fine-tuned model.
[0105] In a preferred embodiment of the present invention, the pre-trained model after entity relation extraction training specifically includes the following workflow:
[0106] Step SS4A. Constructing Input Samples: Based on task requirements, transform the text data into samples suitable for model input.
[0107] Step SS4B. Sequence Encoding: Convert the text sequence into a vector representation using word embedding techniques. Use a GLM model for word embedding to obtain the vector representation of each word. For long texts, truncation or padding strategies can be used to ensure consistent sequence length.
[0108] Step SS4C. Entity Extraction: The encoded text sequence is input into a pre-trained language model. The model captures the contextual information of entities through a self-attention mechanism and a feedforward neural network layer, classifies each position, determines whether the position belongs to an entity, and completes the entity extraction task.
[0109] Step SS4D. Relation Extraction: For the extracted entities, further relation extraction is performed in the model. The model utilizes a self-attention mechanism and a feedforward neural network layer to learn the relationships between entities and complete the relation extraction task.
[0110] By following the steps above, entity and relation information can be automatically extracted from text data, providing a foundation for subsequent tasks such as knowledge graph construction, information extraction, and natural language understanding.
[0111] Example 2
[0112] This example provides an entity relation extraction system for knowledge graph construction in the helicopter assembly field, including: a text acquisition module, a text cleaning module, a sentence segmentation module, and an entity relation extraction module.
[0113] The text acquisition module is responsible for acquiring text data related to helicopter assembly from multiple data sources. These data sources may include helicopter assembly manuals, academic paper databases, patent databases, and online technical forums and blogs. By using technologies such as scanning and optical character recognition (OCR), the paper text is converted into processable text data.
[0114] The text cleaning module cleans and preprocesses the acquired text data. This includes removing noise, unstructured information, and irrelevant content, such as HTML tags and special characters. Simultaneously, it normalizes, standardizes, and deduplicates the text to improve the effectiveness and accuracy of subsequent processing.
[0115] The sentence segmentation module segmentes the cleaned text data into individual sentences. It utilizes natural language processing techniques to identify sentence delimiters, such as periods, question marks, and exclamation marks, to determine sentence boundaries. This ensures that the segmented sentences are semantically coherent and of appropriate length, facilitating subsequent entity relation extraction.
[0116] The entity relation extraction module is the core component of the system. It utilizes a pre-trained model trained on entity relation extraction to progressively input segmented text fragments in order to identify and extract entities and relations in the helicopter assembly domain.
[0117] Example 3
[0118] This example provides an electronic device including a memory and a processor. The memory stores programs or instructions that can be executed by the processor. When the processor executes these programs or instructions, it can implement the steps of any of the helicopter assembly knowledge graph entity relation extraction methods in the first embodiment. Therefore, this electronic device has the technical effects described in the first aspect embodiment above.
[0119] Example 4
[0120] This example provides a readable storage medium storing a program or instructions. When a processor executes these programs or instructions, it can implement the steps of any of the helicopter assembly knowledge graph entity relation extraction methods in the first aspect embodiment. Therefore, this readable storage medium has the technical effects described in the first embodiment above.
[0121] The objectives of this invention have been fully and effectively achieved through the above embodiments. Those skilled in the art will understand that this invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments described above. Although the invention has been described with reference to what is currently considered the most practical and preferred embodiments, it should be understood that the invention is not limited to the disclosed embodiments, and any modifications that do not depart from the functional and structural principles of the invention will be included within the scope of the claims.
Claims
1. A method for entity relation extraction for knowledge graph construction in the helicopter assembly field, characterized in that, The method, when implemented, includes at least the following steps: SS1. Acquire text data in the helicopter assembly field to be processed, wherein the text data includes at least structured data, semi-structured data, and / or unstructured data; SS2. Clean the text data to be processed, and delete or rewrite the garbled characters, unreasonable symbols and illogical statements in the data collected in step SS1; SS3. Segment the text data cleaned in step SS2 into sentences. The segmented sentences should be fluent and of appropriate length. SS4. Input the text segments obtained in step SS3 into the entity relation extraction model step by step. After processing, output the helicopter assembly domain entities and relations contained in the text segments. The entity relation extraction model is a pre-trained language model trained on entity relation extraction. The pre-trained language model is trained based on manually verified triplet data and includes at least the following training steps: SS41. Collect and organize labeled datasets in the field of helicopter assembly to provide preparatory data for training entity relation extraction models; SS42. Perform feature extraction and representation learning based on the labeled dataset provided in sub-step SS41 to capture semantic and contextual information in text fragments; SS43. Based on the labeled dataset provided in sub-step SS41 and the features extracted in sub-step SS42, the GLM language model is used as the pre-trained language model, and an entity relation extraction model is built on this basis, specifically as follows: SS431. Pre-training is performed using an autoregressive whitespace imputation method for each original input text segment. Perform the following operations: First, for multiple text spans Sampling is performed, where each text span s i Both represent a continuous sequence of tokens. ; Then, each text span is replaced with a single [MASK] tag, resulting in the corrupted text x. corrupt ; Next, the corrupted text x corrupt Using the previously predicted text span as input, a pre-trained language model is used to predict the missing tokens in the text span; Meanwhile, in order to more fully capture the interdependencies between different text spans, multiple text spans are randomly selected for masking, and the masked text spans are predicted in a random order, thereby learning entity and relation information in the text fragments; Where z is defined m Let m be the set of all possible permutations of the index sequence [1,2,…,m] of length m, and Represents an index sequence The training objective function of the model is to maximize the expected log-likelihood under parameter θ: in, Indicates that in a given corrupted text x corrupt and the previous text span Under the condition, generate text span The probability of and the joint probability of all missing tokens: in, Indicates text span The j-th token in the data, Indicates text span The first j-1 tokens in the array, Indicates text span The length, thus in predicting the text span For each token in the process, corrupted text must be considered. And the previously predicted text span and text span The preceding information ; Furthermore, each text span is divided into two parts: Part A and Part B. Part A represents... Part B represents the text span that is masked by the [MASK] tag. During the prediction process, all tokens in Part A follow each other but cannot follow Part B, while Part B can follow all Part A and the Part B that has already been predicted. SS432. On the output layer of the pre-trained language model, several task layers are added to extract and represent task-related features to complete the entity relation extraction task. The several task layers include at least an entity classification layer and a relation classification layer. Through these task layers, the output of the pre-trained language model is transformed into the output of the entity relation extraction task, so as to achieve the purpose of extracting entity and relation information from text data.
2. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, In step SS1 above, acquiring data related to helicopter assembly includes: By scanning helicopter assembly manuals, paper texts are converted into digital images, and optical character recognition technology is used to convert them into editable text content to obtain the knowledge and information in the manuals. We acquire structured and semi-structured data from relevant databases, literature, and papers in the field of helicopter assembly, including organized and compiled professional documents, technical materials, and research results in related fields, to gain rich domain knowledge and practical experience.
3. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, In step SS2 above, cleaning the acquired data includes: Remove garbled characters and illegal characters by detecting and filtering garbled characters and illegal characters in text data to eliminate noise and interference in the data; Deduplication involves detecting and removing duplicate content from text data to ensure data uniqueness and prevent duplicate information from interfering with entity relation extraction. Repairing grammatical errors and illogical statements: Using syntax analysis and semantic analysis techniques, we correct and optimize grammatical errors and illogical statements in text data to improve the readability and comprehensibility of the text. Standardized text formatting involves standardizing text data, including unifying punctuation and case conversion, to ensure that text data has a consistent expression style. Stop words are removed by filtering and deleting common words from text data based on a predefined stop word list to reduce the impact on entity relation extraction.
4. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, In step SS3, sentence splitting of the cleaned data includes: Sentence delimiter recognition utilizes natural language processing techniques to process cleaned text data in order to identify and locate sentence delimiters. Sentence segmentation involves segmenting the cleaned text data based on the location information of sentence delimiters. Sentence filtering involves filtering and selecting the segmented sentences to remove irrelevant information and meaningless sentences.
5. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, In step SS4, the workflow of the entity relation extraction model is as follows: SS4A. Constructing Input Samples: Based on task requirements, transform text data into samples suitable for model input; SS4B. Sequence Encoding: Uses word embedding techniques to convert text sequences into vector representations. Uses the GLM language model to perform word embedding and obtain vector representations of words. For long texts, truncation or padding strategies are used to ensure consistent sequence length. SS4C. Entity Extraction: The encoded text sequence is input into a pre-trained language model. The model captures the contextual information of entities through a self-attention mechanism and a feedforward neural network layer, classifies each position, determines whether the position belongs to an entity, and completes the entity extraction task. SS4D. Relation Extraction: For the extracted entities, further relation extraction is performed in the model; the model uses a self-attention mechanism and a feedforward neural network layer to learn the relationships between entities and complete the relation extraction task.
6. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, In the above sub-step SS431, each text span is filled with special markers [START] and 7. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, during the autoregressive blank filling process. Each text span takes [START] as input and 8. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, as output to ensure that the model can recognize the start and end of the text span. In the sub-step SS431 above, two-dimensional positional encoding is used to represent the position of each token between and within spans, in order to enhance the model’s understanding of the text structure. In the above sub-step SS432, the entity classification layer is a multi-label classifier used to determine the entity and its type for each token, and to determine whether it belongs to the helicopter assembly domain and which entity category it belongs to. The relationship classification layer is a multi-classifier used to determine the relationship type for each pair of entities, and to determine whether there is a relationship in the helicopter assembly domain and which relationship category it belongs to.
9. The entity relation extraction method for knowledge graph construction in the helicopter assembly field as described in claim 1, characterized in that, The above step SS4 also includes a sub-step SS44 for evaluation and tuning, which evaluates the model trained in sub-step SS432, performs performance testing and metric evaluation using an independent test dataset, and tunes and improves the model based on the evaluation results to improve the accuracy and effectiveness of entity relation extraction.
10. An entity relationship extraction system for knowledge graph construction in the helicopter assembly field, characterized in that, It includes a text acquisition module, a text cleaning and processing module, a sentence segmentation module, and an entity relation extraction module, and performs the relevant steps of the entity relation extraction method for constructing a knowledge graph for the helicopter assembly domain as described in any one of claims 1-9, wherein... The text acquisition module is used to acquire text data in the field of helicopter assembly, including structured data, semi-structured data, and unstructured data. The cleaning module deletes or rewrites garbled characters, unreasonable symbols, and illogical statements in the collected data. The sentence segmentation module segments the processed text into sentences, and the segmented sentences are fluent and of appropriate length. The entity relation extraction module inputs the processed data into the pre-trained language model after entity relation extraction training, and the data result is the entities and relations contained in the text.
11. An electronic device comprising a memory and a processor, the memory for non-transitory storage of computer-readable instructions, the processor for executing the computer-readable instructions, characterized in that, When the computer-readable instructions are executed by the processor, they perform the entity relation extraction method for constructing a knowledge graph in the helicopter assembly field as described in any one of claims 1-9.
12. A readable storage medium, characterized in that, The readable storage medium stores a set of programs or instructions, which, when executed by the processor, enable the entity relation extraction method for constructing a knowledge graph in the helicopter assembly field as described in any one of claims 1-9.
Citation Information
Patent Citations
Power field knowledge graph relationship discovery method based on deep learning
CN116775905A
Knowledge graph automatic construction method and system for massive unstructured text
WO2020000848A1