Knowledge graph construction method, device, electronic device and storage medium

By using the joint extraction model of global interactive flexible graph convolution in the field of welding quality, the problems of low accuracy and low efficiency of the general triple extraction model are solved, and efficient fusion of human-machine material data and welding are achieved. Accurate decision-making in quality control.

CN117633245BActive Publication Date: 2024-12-06CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311585876.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2024-12-06
Estimated Expiration
2043-11-24

AI Technical Summary

Technical Problem

When using a general triple extraction model in welding quality data to build a knowledge graph, the accuracy is low and the efficiency is low, and it is difficult to achieve efficient fusion of human-machine-material data, resulting in low decision-making accuracy.

Method used

A joint extraction model based on global interactive flexible graph convolution is adopted. By obtaining the marked triple information of the target field for training, a knowledge graph for specific fields is constructed, the problem of overlapping subjects and objects is avoided, and the accuracy and efficiency of triple information is improved.

Benefits of technology

It improves the construction accuracy and efficiency of the knowledge graph, realizes the efficient integration of human-machine material data, and enhances the decision-making accuracy of welding quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117633245B_ABST
    Figure CN117633245B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and provides a method, device, electronic device and storage medium for constructing a knowledge graph. The method obtains a target domain training corpus that has been pre-labeled with triples, uses the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution, and uses the trained joint extraction model to extract triple information from the target domain corpus, and then constructs a knowledge graph of the target domain based on the extracted triple information. Compared with using a general triple extraction model to obtain triple information and then construct a knowledge graph, this method can improve the extraction accuracy and efficiency of triple information, so that the constructed knowledge graph can better guide the production of the target domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a knowledge graph construction method, device, electronic device and storage medium. Background Art

[0002] In the problem of body-in-white welding quality control, some researchers have used machine learning, signal analysis and other methods to detect the welding quality of the body-in-white, and then deal with quality abnormalities based on the experience of technicians. In this way, although the body-in-white welding quality can be detected more accurately, due to the limited level of technicians, the efficiency of management and control decisions is low and the quality is unstable. At the same time, the welding manufacturing system is a "man-machine-object" ternary system, involving many types of equipment, complex production processes, and large amounts of data. The knowledge base and expert system commonly used in the management and control decision-making in the manufacturing field have low efficiency and high cost in extracting knowledge manually, and cannot complete the fusion of man-machine-object data, so the decision accuracy is not high. Therefore, it is very necessary to propose a decision-making method that can efficiently extract knowledge from massive welding quality data, realize the fusion of man-machine-object data, and assist technicians in intelligent control of welding quality.

[0003] Since welding quality data is domain-specific data, extracting triples from the knowledge graph requires the design of a human-machine-object ontology, and it is difficult to ensure the accuracy and efficiency of extraction using a general triple extraction model. If entity recognition and relationship extraction are used to extract triples, the Subject Object Overlap (SOO) problem will occur. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a knowledge graph construction method, device, electronic device and storage medium to solve the problem of low accuracy and low efficiency in constructing knowledge graphs for specific fields using a general triple extraction model in the prior art.

[0005] A first aspect of an embodiment of the present application provides a method for constructing a knowledge graph, including:

[0006] Obtaining target domain training corpus, where the target domain training corpus includes labeled triple information;

[0007] Use the target domain training corpus to train the joint extraction model based on global interactive flexible graph convolution to obtain a trained joint extraction model;

[0008] Obtain the corpus of the target domain, input the corpus of the target domain into the trained joint extraction model, and obtain the triple information of the target domain;

[0009] Input the triple information into the graph database to obtain the knowledge graph of the target field.

[0010] A second aspect of the embodiment of the present application provides a knowledge graph construction device, including:

[0011] An acquisition module is configured to acquire a target domain training corpus, wherein the target domain training corpus includes labeled triple information;

[0012] A training module is configured to train a joint extraction model based on global interactive flexible graph convolution using target domain training corpus to obtain a trained joint extraction model;

[0013] An extraction module is configured to obtain corpus in a target domain, input the corpus in the target domain into a trained joint extraction model, and obtain triple information in the target domain;

[0014] The building module is configured to input triple information into the graph database to obtain the knowledge graph of the target domain.

[0015] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0017] The beneficial effect of the embodiments of the present application compared with the prior art is as follows: the embodiments of the present application obtain a target domain training corpus that has been pre-labeled with triples, use the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution, and use the trained joint extraction model to extract triple information from the corpus of the target domain, and then construct a knowledge graph of the target domain based on the extracted triple information. Compared with using a general triple extraction model to obtain triple information and then construct a knowledge graph, this method can improve the extraction accuracy and efficiency of triple information, so that the constructed knowledge graph can better guide production in the target domain. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 It is a flow chart of the method for constructing a body-in-white welding quality control knowledge graph ontology model provided in an embodiment of the present application.

[0020] Figure 2 It is a flow chart of a knowledge graph construction method provided in an embodiment of the present application.

[0021] Figure 3 It is a flowchart of a method for training a joint extraction model based on global interactive flexible graph convolution using target domain training corpus provided in an embodiment of the present application.

[0022] Figure 4 It is a flowchart of a method for encoding target domain training corpus using an encoding module provided in an embodiment of the present application.

[0023] Figure 5 It is a flowchart of a method for annotating entity head and tail links, relationship entity head links, and relationship entity tail links on a coding vector at a handshake annotation layer provided by an embodiment of the present application.

[0024] FIG6(A) is a schematic diagram of a method for labeling relationship entity header links provided in an embodiment of the present application.

[0025] FIG6(B) is a schematic diagram of a method for marking tail links of relationship entities provided in an embodiment of the present application.

[0026] Figure 7 It is a flowchart of a method provided in an embodiment of the present application for transposing an initial label matrix to obtain a label matrix of a target domain training corpus.

[0027] Figure 8 It is a flowchart of a method for decoding feature vectors of target domain training corpus using a decoding module provided in an embodiment of the present application.

[0028] Fig. 9 It is a flowchart of a method for using a potential relationship extraction layer to predict a potential relationship subset in a feature vector of a target domain training corpus provided in an embodiment of the present application.

[0029] Fig.10 It is a flowchart of a method provided in an embodiment of the present application for using a global interactive flexible graph convolution module to predict entity pair information in a feature vector of a target domain training corpus that can constitute a prediction triple.

[0030] Fig.11 It is a flowchart of a method for updating the confidence of a global interaction matrix using a multi-head attention mechanism algorithm provided in an embodiment of the present application.

[0031] Fig.12 It is a flowchart of a method for extracting predicted triple information of a target domain training corpus from a feature vector of a target domain training corpus provided in an embodiment of the present application.

[0032] Fig.13 It is a flow chart of another knowledge graph construction method provided in an embodiment of the present application.

[0033] Fig.14 It is a structural diagram of a joint extraction model based on global interactive flexible graph convolution provided in an embodiment of the present application.

[0034] Fig.15 It is a schematic diagram of a knowledge graph construction device provided in an embodiment of the present application.

[0035] Fig.16 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0037] A knowledge graph construction method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0038] As mentioned above, since welding quality data is domain-specific data, extracting triples from the knowledge graph requires the design of a human-machine-object ontology, and it is difficult to ensure the accuracy and efficiency of extraction using a general triple extraction model. If entity recognition and relationship extraction are used to extract triples, the SOO problem will occur.

[0039] In view of this, the embodiment of the present application provides a method for constructing a knowledge graph, defines the human-machine-object ontology structure based on relevant literature and engineer experience, and designs a joint extraction model based on global interactive flexible graph convolution, thereby avoiding the problem of subject-object entity overlap and realizing efficient extraction of human-machine-object ternary knowledge. Through entity alignment operations, redundant triples are eliminated, the final knowledge graph is generated, and the fusion of human-machine-object data is realized.

[0040] Furthermore, an embodiment of the present application also provides a method for constructing a knowledge graph, by obtaining a target domain training corpus that has been pre-labeled with triples, using the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution, and using the trained joint extraction model to extract triple information from the corpus of the target domain, and then constructing a knowledge graph of the target domain based on the extracted triple information. Compared with using a general triple extraction model to obtain triple information and then construct a knowledge graph, this method can improve the extraction accuracy and efficiency of triple information, thereby enabling the constructed knowledge graph to better guide production in the target domain.

[0041] To build a knowledge graph, you need to first build an ontology model. The ontology model is equivalent to the backbone and framework of a knowledge graph. It defines the logical structure of the conceptual hierarchy of the knowledge graph. The ontology model directly affects the quality of knowledge graph construction. In order to make the knowledge graph have a strong expressive ability, so that the decision model can make good use of the relationship between entities and better explore the hidden features of entities in the knowledge graph, it is necessary to reasonably define the structure of the ontology model. The ontology construction method is divided into two methods: bottom-up and top-down. The bottom-up method is to abstract the logical structure of the ontology from the original data through relevant methods. This method is often applicable to knowledge graphs in the public domain. Since the knowledge graph construction method provided in the embodiment of the present application is mainly used in knowledge graphs involving three parties such as welding quality control, that is, the method is used to construct a knowledge graph in a specific field, so the knowledge graph involves related concepts that are controllable and fixed, so a top-down method is used to construct the ontology, and the ontology structure of the knowledge graph is refined through expert experience and relevant literature. The steps for constructing an ontology model generally adopt the seven-step method proposed by the Stanford University School of Medicine: determine the domain and scope of the ontology, consider reusing existing ontologies, list important terms in the ontology, define classes and their hierarchical structures, define class attributes, define attribute restrictions, and create instances. This method first considers whether a reusable ontology model can be found in the field, and then defines the concepts in the ontology based on the organized domain knowledge to achieve the initial construction of the ontology. Then the concepts are divided into levels, the relationships between different concepts are clarified, and the attributes of the entity and the relationships between attributes are defined.

[0042] Figure 1 Schematic diagram of the process of constructing a body-in-white welding quality control knowledge graph ontology model provided in the embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0043] 1) Determine the purpose and scope of the construction.

[0044] 2) Use word frequency analysis to collect and organize welding quality data: First, design the quality control knowledge graph ontology from the accumulated data resources and expert knowledge. In an example, the jieba tool of the crawler (python) can be used to perform word frequency analysis on the collected data such as quality inspection reports, quality reports, engineer experience and related literature, and the words with high word frequency are counted and the words with low word frequency are filtered out. Some statistical results are shown in Table 1:

[0045] Table 1: Statistical results of word frequency of some data

[0046]

[0047] 3) Define concept classes and confirm hierarchical relationships: Use word frequency analysis to filter out low-frequency words, and use the remaining words as candidate words for ontology induction. Combined with relevant industry standards and expert experience in the field of welding quality control as a guide, summarize the candidate words, and gradually refine them from top to bottom to build a conceptual framework for the manufacturing quality control system of the welding production line. The ontology structure can be developed around the center, and its ontology types are divided into three categories: man, machine, and object. The entire quality control system is divided into seven top-level categories: influencing factors, control methods, defect location, defect analysis, defect handling, defect causes, and quality problems. The top-level categories are divided into several layers of subcategories according to the situation until they are decomposed to the bottom. The entire system reflects the entire process of handling quality problems in the man-machine-object ternary welding system from the perspectives of defect location, causes and influencing factors to personnel and measures for handling defects.

[0048] 4) Define the relationship between concept classes: In the previous process of defining concept classes, the upper and lower layers and the same layer relationships of concept classes were visualized through a tree structure, but what this relationship is was not specifically specified. Therefore, the following top-down order is adopted, starting from the top layer until the bottom layer is defined, and the relationship between the adjacent upper and lower layers and the nodes within each layer is defined. Since English words are shorter than Chinese words, the relationships between different concept classes in the field of welding quality control are more numerous and complex. In order to more intuitively represent the relationship between entities in the knowledge graph, the relationship between entities can all be expressed in English. For example, the cause of the defect in the top-level class can provide the correct guidance for defect handling, so the relationship between the cause of the defect and the defect handling is defined as guide; quality problems can be observed through the defect location, so the relationship between the defect location and the defect problem is observe; in the subclass, the production line contains workstations, and the workstations contain workpieces. The relationship between them can be defined as including. Table 2 shows some concept class relationships:

[0049] Table 2 Relationships between some concept classes

[0050]

[0051] 5) Define concept class attributes: Concept class attributes refer to the description of the defined concept class attributes, such as the processing date, processing time, and probability ratio of quality problems of the workpiece. Define the concept class attributes in a top-down order. The top-down process is a process from general to specific. First define the general attributes of the parent class, and then define the special attributes of the child class. There is also a transfer relationship between attributes, that is, some attributes of the parent class can be passed to the child class, and the same attributes may exist between different classes at the same level, so the attributes need to be merged. For example, "probability ratio" can describe defect problems, as well as other concepts such as defect causes. Table 3 shows the attributes of some concept classes:

[0052] Table 3 Attributes of some concept classes

[0053]

[0054] 6) Expert ontology verification: The constructed ontology structure is handed over to technical personnel for evaluation and corresponding adjustments, and then the ontology is visualized and managed to facilitate modification or expansion of the ontology library. In one example, the protege software developed by Stanford University can be used to visualize and manage the ontology.

[0055] Figure 2 Schematic diagram of a knowledge graph construction method provided in an embodiment of the present application. Figure 2 As shown, the knowledge graph construction method includes the following steps:

[0056] In step S201, target domain training corpus is obtained.

[0057] The target domain training corpus includes labeled triple information.

[0058] In step S202, the target domain training corpus is used to train a joint extraction model based on global interactive flexible graph convolution to obtain a trained joint extraction model.

[0059] In step S203, the corpus of the target domain is obtained, and the corpus of the target domain is input into the trained joint extraction model to obtain triple information of the target domain.

[0060] In step S204, the triple information is input into the graph database to obtain the knowledge graph of the target domain.

[0061] In an embodiment of the present application, the method can be used to construct a knowledge graph in a specific field. The specific field can be a field involving multiple subjects such as people, machines, and objects. In one example, the specific field can be the field of body-in-white welding quality control. Furthermore, the method can be executed by a terminal with certain data processing and computing capabilities.

[0062] In the embodiment of the present application, the target field training material can be first obtained, wherein the target field training corpus includes the marked triple information. Taking the target field as the white body welding quality control field as an example, the quality inspection report and record in the white body welding quality control process can be obtained first, and the experience of the on-site technicians and the relevant literature can be obtained. These contents are usually recorded in the format of documents, texts and pictures. The above content can be first converted into a text format, and then the word segmentation tool, such as Jieba word segmentation, can be used to segment the text. Specifically, the input sentence can be first scanned and segmented based on the statistical dictionary in the Jieba word segmentation library to obtain all segmentation possibilities. Then, according to the segmentation position, a directed acyclic graph is constructed, such as the sentence "the current is too small, the resistance heat is too small, and the weld nugget is too small". After the word segmentation, the words "current", "too small", "lead", "resistance heat", "too small", "weld nugget" and "too small" can be obtained. Finally, according to the dynamic programming algorithm, the maximum probability path is calculated, and the segmentation method corresponding to the maximum probability path is used as the output result.

[0063] Furthermore, since unstructured data such as quality inspection reports and documents may contain some invalid, interfering or redundant information, referring to the experience of engineers and combining the ontology model described above, the technical solution of the embodiment of the present application can also establish a stop word list for welding quality control to remove some useless symbols and words, so as to facilitate the marking of triples in sentences. Furthermore, since the jieba word segmentation result cannot fully guarantee the readiness of the word segmentation, the technical solution of the embodiment of the present application can also use manual verification and adjustment of the word segmentation result, and specially mark the "entity pair" and "relationship" to obtain the marked triple information.

[0064] In one example, if the input sentence is "The current is too small, which leads to the resistance being too hot", the sentence can be marked as subject: current is too small; object: resistance being too hot; relation: leading to. Furthermore, the text can be converted into a vector form that can be processed by a computer. For example, the Word2Vec method can be used to convert each sentence into a word vector, thereby obtaining the training corpus for the target domain.

[0065] In the embodiment of the present application, the target domain training corpus can be used to train a joint extraction model based on global interactive flexible graph convolution to obtain a trained joint extraction model. Specifically, since the original welding quality data contains three types of knowledge: human, machine, and object, and the three types of knowledge come from different sources and are domain-specific knowledge, it is difficult for a general triple extraction model to effectively extract triples from them. Considering that the accuracy of extracting triples after separating entity recognition and relationship extraction is not as high as the joint extraction model, and that entity overlap problems will occur, the embodiment of the present application sets a joint extraction model based on global interactive flexible graph convolution to extract triples based on the characteristics of welding quality data, thereby improving the accuracy and efficiency of triple information extraction, and thereby improving the accuracy and efficiency of knowledge graph construction.

[0066] In an embodiment of the present application, after completing the training of the joint extraction model based on the global interactive flexible graph convolution, the corpus of the target field can be further obtained. The corpus of the target field can be all the original corpus of the target field, and the newly generated corpus of the target field can be continuously added over time to improve the constructed knowledge graph. Among them, the corpus of the target field is also the corpus that has been preprocessed by word segmentation and word vector conversion. The corpus of the target field is input into the trained joint extraction model to obtain the triple information of the target field. Finally, all the triple information extracted is input into the graph database to obtain the knowledge graph of the target field.

[0067] According to the technical solution provided in the embodiment of the present application, by obtaining a target domain training corpus that has been pre-labeled with triples, using the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution, and using the trained joint extraction model to extract triple information from the corpus of the target domain, and then constructing a knowledge graph of the target domain based on the extracted triple information, this method can improve the extraction accuracy and efficiency of triple information compared to using a general triple extraction model to obtain triple information and then construct a knowledge graph, so that the constructed knowledge graph can better guide the production in the target domain.

[0068] In an embodiment of the present application, a joint extraction model based on global interactive flexible graph convolution may include an encoding module, a handshake annotation layer and a decoding module.

[0069] Figure 3 1 is a flow chart of a method for training a joint extraction model based on global interactive flexible graph convolution using target domain training corpus provided in an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:

[0070] In step S301, the target domain training corpus is encoded using an encoding module to obtain an encoding vector of the target domain training corpus.

[0071] In step S302, entity head and tail link annotations, relationship entity head link annotations and relationship entity tail link annotations are performed on the encoding vector at the handshake annotation layer to obtain an initial label matrix of the target domain training corpus.

[0072] In step S303, the initial label matrix is ​​transposed to obtain the label matrix of the target domain training corpus.

[0073] In step S304, the encoding vector of the target domain training corpus is labeled using the label matrix to obtain the feature vector of the target domain training corpus.

[0074] In step S305, a decoding module is used to decode the feature vector of the target domain training corpus to extract the predicted triple information of the target domain training corpus.

[0075] In step S306, in response to the difference between the predicted triple information and the labeled triple information being greater than a preset loss threshold, the decoding module is updated, and the updated decoding module is used to re-extract the predicted triple information from the label matrix of the target domain training corpus.

[0076] In step S307, the step of determining whether the difference between the predicted triple information and the marked triple information is greater than a preset loss threshold is repeated. If so, the decoding module is updated, and the updated decoding module is used to re-extract the predicted triple information until the difference between the predicted triple information and the marked triple information is less than or equal to the preset loss threshold.

[0077] In step S308, it is determined that the joint extraction model composed of the encoding module, the handshake annotation layer, and the decoding module when the difference between the predicted triplet information and the marked triplet information is less than or equal to the preset loss threshold is a trained joint extraction model.

[0078] In an embodiment of the present application, the target domain training corpus can be first encoded using an encoding module to obtain an encoding vector of the target domain training corpus. Then, the encoding vector is annotated with entity head and tail links, relationship entity head links, and relationship entity tail links in the handshake annotation layer to obtain an initial label matrix of the target domain training corpus. Next, the initial label matrix is ​​transposed to obtain a label matrix of the target domain training corpus, and the encoding vector of the target domain training corpus is annotated using the label matrix to obtain a feature vector of the target domain training corpus.

[0079] Then, the decoding module is used to decode the feature vector of the target domain training corpus to extract the predicted triple information of the target domain training corpus. The predicted triple information is compared with the marked triple information. When the difference between the predicted triple information and the marked triple information is greater than the preset loss threshold, the decoding module is updated, and the updated decoding module is used to re-extract the predicted triple information from the label matrix of the target domain training corpus. Repeat the above-mentioned steps of judging whether the difference between the predicted triple information and the marked triple information is greater than the preset loss threshold. If so, the decoding module is updated, and the updated decoding module is used to re-extract the predicted triple information until the difference between the predicted triple information and the marked triple information is less than or equal to the preset loss threshold. At this time, the joint extraction model composed of the encoding module, the handshake annotation layer, and the decoding module when the difference between the predicted triple information and the marked triple information is less than or equal to the preset loss threshold is the trained joint extraction model.

[0080] That is to say, for the input sentence, the encoding module is first imported. This module can be a bidirectional encoder representation method (Bidirectional Encoder Representations from Transformer, BERT) pre-trained model, which can obtain the linear weighted vector of the word vector, sentence vector and position vector of the sentence, and then obtain the vector representation of the sentence through average pooling, which helps the model to better learn the relationship between word meanings and sentence structure relationships, and improve the accuracy of joint extraction. Then it is labeled through the handshake annotation layer. This labeling method can identify the relationship of sharing one or more entities in the triple, thereby alleviating the problem of exposure bias. Then the vector representation of the labeled sentence sequence is imported into the decoding module, which mainly consists of three parts: global interactive flexible graph convolution, potential relationship prediction layer and triple extraction layer. Global interactive graph convolution can mine the interactive features between entities. It learns the different weights of each adjacent node through multi-head attention, treats them differently, and thus adaptively changes the value in the global interaction matrix to improve the accuracy of matching two entities in the triple. The potential relationship extraction layer can eliminate the relationship that does not exist in the knowledge graph through the feature vector, reducing the computational complexity of the model. The specific relation sequence labeling layer can identify entities in sentences and solve the SOO problem, and output triples in sentences by combining the relations extracted by the potential relation extraction layer.

[0081] Figure 4 1 is a flow chart of a method for encoding a target domain training corpus using an encoding module provided in an embodiment of the present application. Figure 4 As shown, the method comprises the following steps:

[0082] In step S401, the target domain training corpus is encoded using a token embedding layer to obtain a first vector representation.

[0083] Among them, the first vector representation is the overall vector representation of the training corpus.

[0084] In step S402, the target domain training corpus is encoded using a position embedding layer to obtain a second vector representation.

[0085] The second vector representation is a vector representation of the position information of each word in the training corpus.

[0086] In step S403, the target domain training corpus is encoded using the segment embedding layer to obtain a third vector representation.

[0087] Among them, the third vector representation is the vector representation of different sentences in the training corpus.

[0088] In step S404, the first vector representation, the second vector representation and the third vector representation are concatenated using a fully connected layer, and the concatenated vector representation is encoded using a sequence model based on an attention mechanism to obtain an encoding vector of the target domain training corpus.

[0089] In an embodiment of the present application, a Token embedding layer can be used to encode the target domain training corpus to obtain a first vector representation. The first vector representation is the overall vector representation of the training corpus. At the same time, the position Position embedding layer is used to encode the target domain training corpus to obtain a second vector representation. The second vector representation is a vector representation of the position information of each word in the training corpus. At the same time, the segment Segment embedding layer is used to encode the target domain training corpus to obtain a third vector representation. The third vector representation is a vector representation of different sentences in the training corpus. Then, a fully connected layer is used to concatenate the first vector representation, the second vector representation, and the third vector representation, and the concatenated vector representation is encoded using a sequence model based on an attention mechanism to obtain the encoded vector of the target domain training corpus.

[0090] That is to say, the encoding module can adopt the BERT pre-trained model, which contains a total of 12 layers of attention-based sequence model Transformer. Furthermore, the BERT model also includes a Token embedding layer, a Position embedding layer, and a Segment embedding layer. The Token embedding layer outputs a vector representation of the entire sentence. In the embodiment of the present application, the Word2Vec model can be used to generate feature vectors. The Position embedding layer generates a vector representation representing the position information of words in the sentence. The Segment embedding layer generates a vector representation that distinguishes different sentences. The three vector representations are spliced ​​through the fully connected layer and then input into the above-mentioned 12-layer Transformer to generate the encoding vector of the sentence.

[0091] Figure 5 1 is a flow chart of a method for marking entity head and tail links, relationship entity head links, and relationship entity tail links on a coding vector at a handshake annotation layer provided by an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:

[0092] In step S501, entity information in the encoding vector is obtained, and a subject-guest entity relationship between any two entities in the encoding vector is determined.

[0093] In step S502, entity head and tail links are annotated on the encoding vector to obtain a first initial label matrix.

[0094] Among them, in the first initial label matrix, the value of the matrix element marked with entity head and tail link is 1, and the value of other matrix elements is 0. The matrix elements marked with entity head and tail link are the matrix elements where the row corresponding to the serial number of the first sequence element and the column corresponding to the serial number of the last sequence element in each entity are located.

[0095] In step S503, the relationship entity head links are annotated on the encoded vector to obtain a second initial label matrix.

[0096] Among them, in the second initial label matrix, the value of the matrix element marked with the head link of the relationship entity is 1, and the value of other matrix elements is 0. The matrix element marked with the head link of the relationship entity is the matrix element where the row corresponding to the serial number of the first sequence element in the entity as the subject and the column corresponding to the serial number of the first sequence element in the entity as the object of any two entities are located.

[0097] In step S504, the relationship entity tail link is annotated on the encoding vector to obtain a second initial label matrix.

[0098] Among them, in the second initial label matrix, the value of the matrix element marked with the tail link of the relationship entity is 1, and the value of other matrix elements is 0. The matrix element marked with the tail link of the relationship entity is the matrix element where the row corresponding to the serial number of the last sequence element in the entity as the subject and the column corresponding to the serial number of the last sequence element in the entity as the object of any two entities are located.

[0099] In an embodiment of the present application, entity information in the encoding vector can be obtained, and the subject-object entity relationship between any two entities in the encoding vector can be determined. In an example, if the encoding vector is X = [x1, x2, x3, x4, x5, x6, x7], where [x1, x2] constitutes the first entity, [x4, x5] constitutes the second entity, and [x6, x7] constitutes the third entity, then the encoding vector can be labeled with entity head and tail links, relationship entity head links, and relationship entity tail links, respectively, to obtain the first, second, and third initial label matrices.

[0100] Among them, the method of annotating the entity head and tail links of the coding vector is: construct an initialization label matrix, the number of rows and columns of which are equal to the number of elements in the coding vector. The initialization label matrix is ​​made red, and the values ​​of the matrix elements corresponding to the row of the first sequence element and the column of the last sequence element in each entity are set to 1, and the values ​​of the remaining matrix elements are set to 0, and the first initial label matrix can be obtained. Taking the above-mentioned coding vector X=[x1,x2,x3,x4,x5,x6,x7] as an example, the entity head and tail links are annotated to obtain the first initial label matrix:

[0101]

[0102]

[0103] Furthermore, the method for labeling the head link of the relationship entity of the encoding vector is as follows: constructing an initialization label matrix, the number of rows and the number of columns of the initialization label matrix are equal to the number of elements in the encoding vector. In the initialization label matrix, the values ​​of the matrix elements corresponding to the row of the first sequence element in the subject entity and the column of the first sequence element in the object entity of any two entities are set to 1, and the values ​​of the remaining matrix elements are set to 0, so as to obtain a second initial label matrix. Taking the above encoding vector X=[x1,x2,x3,x4,x5,x6,x7] as an example, if in the entity pairs [x1,x2] and [x4,x5], [x1,x2] is the subject and [x4,x5] is the object, in the entity pairs [x1,x2] and [x6,x7], [x1,x2] is the subject and [x6,x7] is the object, in the entity pairs [x4,x5] and [x6,x7], [x6,x7] is the subject and [x4,x5] is the object, then the relationship entity head link annotation can be performed in the manner shown in FIG6(A), and the second initial label matrix is ​​obtained as follows:

[0104]

[0105] Furthermore, the method for labeling the tail link of the relationship entity of the encoding vector is as follows: construct an initialization label matrix, the number of rows and the number of columns of the initialization label matrix are equal to the number of elements in the encoding vector. In the initialization label matrix, the values ​​of the matrix elements corresponding to the row of the last sequence element in the subject entity and the column of the last sequence element in the object entity of any two entities are set to 1, and the values ​​of the remaining matrix elements are set to 0, so as to obtain a third initial label matrix. Taking the above encoding vector X=[x1,x2,x3,x4,x5,x6,x7] as an example, if in the entity pairs [x1,x2] and [x4,x5], [x1,x2] is the subject and [x4,x5] is the object, in the entity pairs [x1,x2] and [x6,x7], [x1,x2] is the subject and [x6,x7] is the object, in the entity pairs [x4,x5] and [x6,x7], [x6,x7] is the subject and [x4,x5] is the object, then the tail link of the relationship entity can be annotated in the manner shown in FIG6(B), and the third initial label matrix is ​​obtained as follows:

[0106]

[0107] According to the above three annotations, triple extraction can be completed. The possible subject and object in the triple can be found through the head link, and the entity nesting problem can be solved through the tail link constraint to completely determine the triple. In the above example, according to the head link (x1, x4), the entity [x1, x2] that may be the subject of the triple and the entity [x4, x5] that is the object are found. Because the tail link (x2, x5) exists, the triple (entity [x1, x2], rel, entity [x4, x5]) is obtained, where rel is the annotation relationship between entity [x1, x2] and entity [x4, x5]. That is to say, the above-mentioned encoding vector X is annotated using the method of the embodiment of the present application, and the obtained triplets include three pairs: ([x1,x2],rel,[x4,x5]), ([x1,x2],rel,[x6,x7]) and ([x6,x7],rel,[x4,x5]), where [x1,x2], [x4,x5] and [x6,x7] are respectively three entities of length 2.

[0108] In an embodiment of the present application, considering that using a complete matrix will cause a waste of resources and reduce the accuracy due to matrix sparsity, only the upper triangular part of the label matrix can be retained, that is, the initial label matrix can be transposed to obtain the label matrix of the target domain training corpus.

[0109] Figure 7 1 is a flow chart of a method for transposing an initial label matrix to obtain a label matrix of a target domain training corpus provided in an embodiment of the present application. Figure 7 As shown, the method comprises the following steps:

[0110] In step S701 , the upper triangles of the first, second and third initial label matrices are retained.

[0111] In step S702, the lower triangles of the first, second and third initial label matrices are transposed to the upper triangles respectively, and the values ​​of the transposed lower triangular matrix elements are multiplied by the coefficient k to obtain the first, second and third label matrices of the target domain training corpus.

[0112] Wherein, k is a positive integer greater than 1.

[0113] In an embodiment of the present application, when the initial label matrix is ​​transposed, the upper triangles of the first, second and third initial label matrices can be retained, and then the lower triangles of the first, second and third initial label matrices can be transposed to the upper triangles, respectively, and the values ​​of the transposed lower triangular matrix elements are multiplied by the coefficient k to obtain the first, second and third label matrices of the target domain training corpus.

[0114] That is to say, since the head of the same entity is labeled before the tail by default, the "1" label of the entity link annotation only exists in the upper triangular part of the original label matrix, and the information contained in the simplified label matrix will not be reduced. If there is a relational entity link in the original label matrix, the label element is "1", otherwise it is "0". After the matrix is ​​simplified, the label matrix of the two relational entity link annotations needs to match the non-zero elements of the lower triangular part to the upper triangular part, so the label "k" is added. If the relational entity link of the original label matrix exists in the lower triangular part, it is "transposed" to the upper triangular part and labeled as "k".

[0115] Taking k=2 as an example, the first, second and third label matrices obtained by transposing the first, second and third initial label matrices are shown as follows:

[0116]

[0117]

[0118] By adopting the technical solution of the embodiment of the present application, the label matrix of the target domain training corpus is obtained by transposing the initial label matrix, which can identify the relationship of sharing one or more entities in the triples, thereby alleviating the problem of exposure bias.

[0119] Figure 8 1 is a flow chart of a method for decoding a feature vector of a target domain training corpus using a decoding module provided in an embodiment of the present application. Figure 8 As shown, the method comprises the following steps:

[0120] In step S801, a latent relation extraction layer is used to predict a subset of latent relations in a feature vector of a target domain training corpus.

[0121] The potential relationship subset is used to indicate the potential relationship information of each entity in the feature vector.

[0122] In step S802, a global interactive flexible graph convolution module is used to predict entity pair information that can constitute a prediction triple in the feature vector of the target domain training corpus.

[0123] In step S803, using a specific relation sequence labeling layer, based on entity pair information and potential relation subsets that can constitute prediction triples, prediction triple information of the target domain training corpus is extracted from feature vectors of the target domain training corpus.

[0124] In an embodiment of the present application, when a decoding module is used to decode the feature vector of the target domain training corpus, the potential relationship extraction layer can be used to first predict the potential relationship subset in the feature vector of the target domain training corpus, wherein the potential relationship subset is used to indicate the potential relationship information of each entity in the feature vector. At the same time, a global interactive flexible graph convolution module is used to predict the entity pair information that can constitute the predicted triple in the feature vector of the target domain training corpus. Finally, a specific relationship sequence labeling layer is used to extract the predicted triple information of the target domain training corpus from the feature vector of the target domain training corpus based on the entity pair information and the potential relationship subset that can constitute the predicted triple.

[0125] That is to say, the decoding module is mainly composed of a global interactive flexible graph convolution, a latent relationship extraction layer, and a specific relationship sequence labeling layer. The global interactive flexible graph convolution is used to mine the interactive information of different entity feature vectors, the latent relationship labeling layer is used to remove redundant relationships for the knowledge graph and reduce the computational complexity of the model. The specific relationship sequence labeling layer is used to generate the final triples.

[0126] Fig. 9 1 is a flow chart of a method for using a potential relationship extraction layer to predict a potential relationship subset in a feature vector of a target domain training corpus provided in an embodiment of the present application. Fig. 9 As shown, the method comprises the following steps:

[0127] In step S901, a global average pooling operation is performed on the feature vectors of the target domain training corpus.

[0128] In step S902, a multi-label binary classification task model is used to predict the feature vector after global average pooling to obtain a potential relation subset in the feature vector of the target domain training corpus.

[0129] In an embodiment of the present application, when using the latent relationship extraction layer to predict the latent relationship subset in the feature vector of the target domain training corpus, the feature vector of the target domain training corpus can be firstly subjected to a global average pooling operation, and then the feature vector after the global average pooling can be predicted using a multi-label binary classification task model to obtain the latent relationship subset in the feature vector of the target domain training corpus.

[0130] In other words, the feature vector of a text annotated by the handshake annotation layer can be imported into the decoding module. The potential relationship extraction layer first predicts the subset that may contain potential relationships, and then uses the feature vector of the relationship to determine whether it is the relationship required by the knowledge graph. The process can be expressed as:

[0131] h avg =Avgpool(h)

[0132] P rel =σ(W r h avg +b r )

[0133] Among them, h is the feature vector, h avg is the average feature vector, Avgpool is the global average pooling operation, P rel is the probability that the relation rel is the relation required by the knowledge graph, P rel is greater than or equal to 0 and less than or equal to 1, σ is the sigmoid activation function of the S-type growth curve, b r is the linear layer bias, b r The prediction process is a multi-label binary classification task. If P rel If the value of exceeds a specific threshold, the relationship is marked as 1, otherwise it is marked as 0, thereby clearing a large number of redundant relationships that are not included in the knowledge graph and improving the computational efficiency of the specific relationship sequence marking layer.

[0134] Fig.10 1 is a flow chart of a method for predicting entity pair information that can constitute a prediction triple in a feature vector of a target domain training corpus using a global interactive flexible graph convolution module provided by an embodiment of the present application. Fig.10 As shown, the method comprises the following steps:

[0135] In step S1001, all entity pairs in the feature vector are obtained, and the global interaction matrix confidence of all entity pairs is calculated.

[0136] In step S1002, the global interaction matrix confidence is updated using a multi-head attention mechanism algorithm.

[0137] In step S1003, entity pair information that can constitute a prediction triplet is predicted in the feature vector of the target domain training corpus based on the updated global interaction matrix confidence.

[0138] In an embodiment of the present application, when using the global interactive flexible graph convolution module to predict the entity pair information that can constitute the predicted triple in the feature vector of the target domain training corpus, all entity pairs in the feature vector can be obtained first, and the global interaction matrix confidence of all entity pairs can be calculated. Then the global interaction matrix confidence is updated using the multi-head attention mechanism algorithm. Finally, based on the updated global interaction matrix confidence, the entity pair information that can constitute the predicted triple in the feature vector of the target domain training corpus is predicted.

[0139] That is to say, the feature vector of the text annotated by the handshake annotation layer can also be sent to the global interaction flexible graph convolution module to calculate whether two entities have a relationship, that is, whether the two entities belong to the same triplet by constructing a global interaction matrix. Specifically, all entity pairs in the feature vector can be listed first, and the confidence of each entity pair belonging to the same triplet can be calculated. The confidence calculation formula in the global interaction matrix is ​​as follows:

[0140]

[0141] in, For entity pairs The confidence that the two entities belong to the same triplet. is the encoding representation of the i-th entity in the input sentence, i.e., the input feature vector, is the encoding representation of the jth entity in the input sentence, i.e., the input feature vector, W g is the training weight, b g is the bias parameter and σ is the sigmoid activation function.

[0142] Next, the confidence in the global interaction matrix can be adaptively changed during the training process through the multi-head attention mechanism to improve the accuracy of determining whether an entity group belongs to a triple. The method of updating the confidence of the global interaction matrix using the multi-head attention mechanism algorithm is described in detail below. Finally, based on the updated global interaction matrix confidence, the entity pair information that can constitute the predicted triple is predicted in the feature vector of the target domain training corpus.

[0143] Fig.11 is a flow chart of a method for updating the confidence of a global interaction matrix using a multi-head attention mechanism algorithm provided in an embodiment of the present application. Fig.11 As shown, the method comprises the following steps:

[0144] In step S1101, N learning probability global interaction matrices are determined based on the global interaction matrix, and a subgraph space is formed based on each learning probability global interaction matrix.

[0145] Wherein, N is a positive integer;

[0146] In step S1102, N graph neural network models are used to mine the features of each subgraph space respectively to obtain N mined features.

[0147] In step S1103, N pooling layers are used to perform pooling compression processing on the N mined features respectively.

[0148] In step S1104, a linear layer is used to perform linear transformation on the N mining features after pooling and compression processing to obtain an intermediate linear feature matrix.

[0149] In step S1105, the steps of determining N learning probability global interaction matrices based on the intermediate linear feature matrix, forming a subgraph space based on each learning probability global interaction matrix, using N graph neural network models to respectively mine the features of each subgraph space to obtain N mined features, using N pooling layers to respectively perform pooling compression processing on the N mined features, and using a linear layer to perform linear transformation processing on the N pooled and compressed mined features are repeated M times to obtain an output linear feature matrix.

[0150] Wherein, M is a positive integer.

[0151] In step S1106, an updated global interaction matrix confidence is determined based on the output linear feature matrix.

[0152] In the embodiment of the present application, when using the multi-head attention mechanism algorithm to update the global interaction matrix confidence, you can first

[0153] In an embodiment of the present application, N learning probability global interaction matrices are determined based on the global interaction matrix, and a subgraph space is formed based on each learning probability global interaction matrix. Then, N graph convolutional neural network (GCN) models are used to mine the features of each subgraph space respectively to obtain N mining features. Then, N pooling layers are used to perform pooling compression processing on the N mining features respectively, and a linear layer is used to perform linear transformation processing on the mining features after the N pooling compression processing to obtain an intermediate linear feature matrix. Next, the above steps are repeated M times to obtain the output linear feature matrix. Finally, the updated global interaction matrix confidence is determined based on the output linear feature matrix.

[0154] That is to say, we can first calculate the N learning probability global interaction matrices using the multi-head attention mechanism algorithm by the following formula:

[0155]

[0156] Among them, A is the global interaction matrix, A (t) is the t-th learning probability global interaction matrix learned using the multi-head attention mechanism algorithm, W i Q ∈R d×d And W i K ∈R d×d Respectively reflect the linear transformation matrix of the attention mechanism, R d×d is the vector space, d is the dimension of the vector space, Q and K represent the feature vectors of the previous layer.

[0157] Then, N GCN models are used to mine the features of each subgraph space respectively, and N mining features are obtained. Among them, the input of GCN is the global interaction matrix after multi-head attention optimization and the word vector generated by the embedding expression (Embedding) layer. Since the multi-head attention mechanism will generate N learning probability global interaction matrices, forming N different subgraph spaces, N is the number of attention heads, so N parallel GCNs are needed to mine the features of different subgraph spaces. The process of GCN learning the features of the t-th subgraph space can be described as follows:

[0158] The following formula is used from A (t) Get the symmetric normalized Laplacian matrix

[0159]

[0160] in, I N is the identity matrix, L is the Laplace matrix of the knowledge graph regularization, and L can be obtained from the global interaction matrix A (t) Find:

[0161]

[0162] Where D is A (t) The degree matrix of .

[0163] Then Perform eigendecomposition, i.e. spectral decomposition:

[0164]

[0165] in, is a column vector belonging to the node vector space, that is is the eigenvalue matrix of L. Assume that the input feature of the i-th layer GCN is n is the number of graph nodes, k is the dimension of point-wise space vector, and the output feature is At the same time, design a filter for the graph structure And linearly transform each channel of the node in the graph to get the output of GCN

[0166]

[0167] Among them, W i ∈R k×k is the linear transformation matrix, and h is the filter function. In order to reduce the amount of calculation, the Chebyshev inequality can be used to approximate the estimate get:

[0168]

[0169] Then, N parallel pooling layers are used to remove redundant information, compress features, simplify network complexity, and reduce computational complexity. The pooling process can be described as follows:

[0170]

[0171] Among them, W is the linear transformation matrix of the pooling process, and bias is the bias of the pooling process. Finally, the linear layer is used to fuse the features mined by N parallel pooling layers. The process of linear transformation can be described as follows:

[0172] Z comb =W comb Z out +b comb

[0173] Among them, Z comb is the output of the linear transformation, Z out =[Z (1) ,...,Z (N) ] is the output of N parallel pooling layers, b comb is the bias vector of the linear transformation. Furthermore, N parallel global interaction matrices generate a new global interaction matrix by averaging and transmit it to the next layer of parallel GCN. The process can be described as:

[0174]

[0175] In other words, the global interaction matrix can be processed using M layers of N parallel GCNs to optimize the confidence of the global interaction matrix. In this way, the calculation accuracy of the probability of whether an entity pair can form a triple can be improved when extracting triple information, thereby improving the confidence of the entity pair in the extracted triple information.

[0176] Fig.12 1 is a flow chart of a method for extracting predicted triple information of target domain training corpus from feature vectors of target domain training corpus provided in an embodiment of the present application. Fig.12 As shown, the method comprises the following steps:

[0177] In step S1201 , based on entity pair information and potential relationship subsets that can constitute predicted triples, a first probability and a second probability of each entity in each predicted triple is calculated.

[0178] In step S1202, in response to the first probability of the first entity in the target triple being greater than the first preset probability threshold and the first probability of the first entity being greater than the first probability of the second entity, the first entity is determined to be the main entity in the triple.

[0179] In step S1203, in response to the second probability of the second entity in the target triple being greater than the second preset probability threshold and the second probability of the second entity being greater than the second probability of the first entity, the second entity is determined to be the object entity in the triple.

[0180] In an embodiment of the present application, when extracting the predicted triple information of the target domain training corpus from the feature vector of the target domain training corpus, firstly, based on the entity pair information and the potential relationship subset that can constitute the predicted triple, the first probability and the second probability of each entity in each predicted triple are calculated. If the first probability of the first entity in the target triple is greater than the first preset probability threshold, and the first probability of the first entity is greater than the first probability of the second entity, then the first entity is determined to be the subject entity in the triple. If the second probability of the second entity in the target triple is greater than the second preset probability threshold, and the second probability of the second entity is greater than the second probability of the first entity, then the second entity is determined to be the object entity in the triple.

[0181] That is to say, in order to avoid the SOO problem, the embodiment of the present application can use a relationship annotation layer composed of several fully connected layers to form a specific relationship sequence marking layer, which can independently extract the subject and object entities in the triple, thereby avoiding the SOO problem.

[0182] Specifically, each predicted triple includes a pair of entities, and the first probability and second probability of each entity in the entity pair can be calculated, where the first probability is the probability that the entity is a subject entity, and the second probability is the probability that the entity is an object entity. It can be calculated by the following formula:

[0183]

[0184] Second probability It can be calculated by the following formula:

[0185]

[0186] Among them, W sub and W obj is the weight matrix, h i is the feature vector of the ith Token sequence, u j is the training weight of the jth relation in the relation subset after being filtered by the potential relation extraction layer, b sub and b obj is the bias parameter.

[0187] When the first entity in the pair When the probability of the second entity in the entity pair is greater than the first preset probability threshold, usually, will be a smaller value, in which case the first entity can be directly determined as the main entity in the triple. is also greater than the first preset probability threshold, then it can be further determined that the first entity Is it greater than the second entity? If so, the first entity is determined to be the main entity in the triple, otherwise, the second entity is determined to be the main entity in the triple.

[0188] In a similar manner, the object entity in the entity pair can be determined, which will not be described in detail here.

[0189] Since the descriptions of the same entity in different paragraphs may be different, but the meanings expressed are the same, the entities with the same meanings must be aligned after the triples are extracted to eliminate redundant information. Welding quality data comes from different production cases, which come from different factories, so there may be different descriptions of the same problem, cause, equipment, etc. For example, the entities of "robot" and "welding robot", "spot welding nugget defect" and "nugget quality problem" are essentially the same, but the specific descriptions are different, so entity alignment is required after triple extraction.

[0190] Fig.13 It is a flow chart of another knowledge graph construction method provided in the embodiment of the present application. Fig.13 Steps S1301 to S1303 in the embodiment shown are Figure 2 Steps S201 to S203 in the illustrated embodiment are substantially the same and will not be described in detail herein. Fig.13 As shown, the method also includes the following steps:

[0191] In step S1304, the similarity between any two entities in the triple information is calculated.

[0192] In step S1305, entities with similarities greater than a preset similarity threshold are aligned to obtain aligned triplet information.

[0193] The alignment is to name all entities whose similarity is greater than a preset similarity threshold with the same name.

[0194] In step S1306, the aligned triple information is input into the graph database to obtain the knowledge graph of the target domain.

[0195] In an embodiment of the present application, the similarity between any two entities in the triple information extracted by the joint extraction model can be calculated first. Among them, the similarity between entities can be based on the edit distance Levenshtein similarity, Jaccard similarity, Token similarity or cosine similarity. In one embodiment of the present application, the similarity between two entities can be determined by calculating the cosine similarity between the two entities. The calculation formula of cosine similarity is:

[0196]

[0197] Among them, A i and B i Two entities respectively.

[0198] In an embodiment of the present application, after calculating the similarity between entities, entities with similarity greater than a preset similarity threshold can be aligned to obtain aligned triplet information, wherein the alignment is to name all entities with similarity greater than the preset similarity threshold with the same name. In other words, a similarity threshold can be preset, and an entity can be selected as a named entity from entity pairs that exceed the preset similarity threshold, and the names of similar entities in the triplet can also be replaced with the names of command entities, thereby achieving entity alignment. Furthermore, after the entity alignment, the accuracy of the entity can also be ensured through manual verification and validation.

[0199] In the embodiment of the present application, the aligned triple information is input into the graph database to obtain the knowledge graph of the target field. The knowledge graph mainly includes two storage methods: RDF and graph database. Compared with the RDF storage mode, the graph database has stronger data processing capabilities and faster traversal speed. In addition, the nodes and relationships have attributes and strong expansion capabilities, and can be combined with the development platform. Therefore, the embodiment of the present application uses the Neo4j graph database to store the knowledge graph. Neo4j stores entities and relationships in the database through a dedicated Cypher graph query language and completes the corresponding query operations.

[0200] Taking the target field of body-in-white welding quality control as an example, the extracted named entities such as workpieces, equipment, quality problems, cause of problems, control methods, and triples composed of entities are converted into comma-separated values ​​(csv) format and stored in the graph database through Cypher syntax. Some of the imported situations are shown in Table 4:

[0201] Table 4 Entity data import

[0202]

[0203]

[0204] After importing all triple information into Neo4j graph data, we can obtain a knowledge graph that can visually represent the relationships between entities.

[0205] Fig.14 Schematic diagram of the structure of the joint extraction model based on global interactive flexible graph convolution provided in the embodiment of the present application. Fig.14 As shown in the figure, the corpus of the target domain is input from the encoding module of the joint extraction model. The Bert pre-training model in the encoding module pre-trains the input corpus and then performs vector representation. The vector is then annotated by the handshake annotation layer. The annotated vector is input to the decoding module. On the one hand, the global interactive flexible graph convolution layer is combined with the multi-head attention mechanism to extract entity pairs. On the other hand, the potential relationship extraction layer extracts the relationship between entities. Finally, the specific relationship sequence labeling layer determines the prediction triple information based on the extracted entity pairs and relationships.

[0206] In order to verify that the joint extraction model based on global interactive flexible graph convolution proposed in the embodiment of the present application has a good triple extraction effect in the field of body-in-white welding quality control, the present application compares the three indicators of Precision, Recall, and F1 of the joint extraction model with GraphRel, CopyRE, OrderCopyRE, and TPLinker, and repeats the experiment 4 times, records the experimental results, and statistically averages the average value to eliminate random errors. As shown in Table 2.5, GCFGC has improved the best effect of the other four models in terms of precision, recall, and F1 score by 9.2%, 4.1%, 6.6%, and 3.1%, respectively, which proves that the joint extraction model proposed in the embodiment of the present application has excellent performance. In addition, the standard deviation of the joint extraction model proposed in the embodiment of the present application is small in the above three indicators, which further proves that the model has good stability. The data of the comparative experiment are shown in Table 5:

[0207] Table 5 Performance comparison between this application model and existing joint extraction models

[0208]

[0209] In order to further verify the role of each module in the joint extraction model provided in the embodiment of the present application, this paper conducts an ablation experiment, and the results are shown in Table 6:

[0210] Table 6 Ablation experiments of various parts of the model in this application

[0211]

[0212] When conducting ablation experiments, BiLSTM is first used instead of GCN to mine the hidden features of the semantic space. Compared with the joint extraction model provided in the embodiment of the present application, the precision, recall rate and F1 score are all reduced, which shows that GCN is more capable and has stronger generalization ability when capturing non-Euclidean data features and their hidden information. In addition, the multi-head attention layer is directly removed to compare with the original model. The corresponding indicators are all reduced compared with the joint extraction model provided in the embodiment of the present application, and are higher than the model without GCN. This shows that the multi-head attention mechanism adaptively changes the confidence in the global interaction matrix during the training process, and improves the accuracy of distinguishing whether the entity group belongs to a triple. Next, the potential relationship sequence extraction layer is also removed, and all relationships are directly passed to the relationship sequence labeling layer. Compared with the original model, the performance decline is relatively large. This is because the amount of data in all relationships is relatively large, resulting in a large amount of model calculation, and the training time is also longer. At the same time, it is also difficult to distinguish relationships that meet triples from a large number of relationships. In order to verify the role of the relational sequence annotation layer, the layer was replaced with a conditional random field (CRF) for comparative experiments. The experimental results show that each indicator has also dropped significantly compared to the original model, and it can be observed from the results that the CRF predicts the entities in the triples with high accuracy, but the accuracy of predicting the relationship between them is low. This is because the CRF model is easier to remember the location of the entity, but it is difficult to understand the potential semantics between sentences, and it is easy to cause entity overlap. At the same time, this also proves that the relational sequence annotation layer proposed in the embodiment of the present application has better robustness and generalization.

[0213] The technical solution of the embodiment of the present application first designs the ontology structure, analyzes the welding quality data source and type, then preprocesses the data source, and then constructs a joint extraction model based on global interactive flexible graph convolution. Experiments show that the accuracy of extracting triples reaches 88.2%, which is much better than other existing models. Then the acquired triples are aligned using cosine similarity calculation and manual detection methods, and finally the sorted triples are stored in the graph database to complete the construction of the entire welding quality control human-machine-object ternary knowledge graph.

[0214] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0215] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0216] Fig.15 Schematic diagram of a knowledge graph construction device provided in an embodiment of the present application. Fig.15 As shown, the knowledge graph construction device includes:

[0217] An acquisition module 1501 is configured to acquire a target domain training corpus, where the target domain training corpus includes labeled triple information;

[0218] The training module 1502 is configured to train the joint extraction model based on global interactive flexible graph convolution using the target domain training corpus to obtain a trained joint extraction model;

[0219] The extraction module 1503 is configured to obtain the corpus of the target domain, input the corpus of the target domain into the trained joint extraction model, and obtain triple information of the target domain;

[0220] The construction module 1504 is configured to input the triple information into the graph database to obtain the knowledge graph of the target domain.

[0221] According to the technical solution provided in the embodiment of the present application, by obtaining a target domain training corpus that has been pre-labeled with triples, using the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution, and using the trained joint extraction model to extract triple information from the corpus of the target domain, and then constructing a knowledge graph of the target domain based on the extracted triple information, this method can improve the extraction accuracy and efficiency of triple information compared to using a general triple extraction model to obtain triple information and then construct a knowledge graph, so that the constructed knowledge graph can better guide the production in the target domain.

[0222] In an embodiment of the present application, a joint extraction model based on global interactive flexible graph convolution includes an encoding module, a handshake annotation layer and a decoding module; the joint extraction model based on global interactive flexible graph convolution is trained using the target domain training corpus to obtain a trained joint extraction model, including: using the encoding module to encode the target domain training corpus to obtain an encoding vector of the target domain training corpus; annotating the encoding vector with entity head and tail links, relationship entity head links and relationship entity tail links in the handshake annotation layer to obtain an initial label matrix of the target domain training corpus; transposing the initial label matrix to obtain a label matrix of the target domain training corpus; annotating the encoding vector of the target domain training corpus using the label matrix to obtain a feature vector of the target domain training corpus; and using the decoding module to decode the feature vector of the target domain training corpus. The method comprises the steps of decoding the predicted triple information of the target domain training corpus and extracting the predicted triple information of the target domain training corpus; in response to the difference between the predicted triple information and the marked triple information being greater than a preset loss threshold, updating the decoding module, and using the updated decoding module to re-extract the predicted triple information from the label matrix of the target domain training corpus; repeatedly executing the step of judging whether the difference between the predicted triple information and the marked triple information is greater than the preset loss threshold, and if so, updating the decoding module, and using the updated decoding module to re-extract the predicted triple information, until the difference between the predicted triple information and the marked triple information is less than or equal to the preset loss threshold; determining that the joint extraction model composed of the encoding module, the handshake annotation layer, and the decoding module when the difference between the predicted triple information and the marked triple information is less than or equal to the preset loss threshold is the trained joint extraction model.

[0223] In an embodiment of the present application, an encoding module is used to encode the target domain training corpus to obtain an encoding vector of the target domain training corpus, including: using a Token embedding layer to encode the target domain training corpus to obtain a first vector representation, which is the overall vector representation of the training corpus; using a Position embedding layer to encode the target domain training corpus to obtain a second vector representation, which is a vector representation of the position information of each word in the training corpus; using a Segment embedding layer to encode the target domain training corpus to obtain a third vector representation, which is a vector representation of different sentences in the training corpus; using a fully connected layer to concatenate the first vector representation, the second vector representation, and the third vector representation, and encoding the concatenated vector representation using a sequence model based on an attention mechanism to obtain an encoding vector of the target domain training corpus.

[0224] In an embodiment of the present application, entity head and tail link annotation, relationship entity head link annotation and relationship entity tail link annotation are performed on the coding vector in the handshake annotation layer to obtain an initial label matrix of the target domain training corpus, including: obtaining entity information in the coding vector, and determining the subject and object entity relationship between any two entities in the coding vector; performing entity head and tail link annotation on the coding vector to obtain a first initial label matrix, in which the values ​​of the matrix elements marked with entity head and tail links are 1, and the values ​​of other matrix elements are 0, and the matrix elements marked with entity head and tail links are the matrix elements where the row corresponding to the serial number of the first sequence element in each entity and the column corresponding to the serial number of the last sequence element are located; performing relationship entity head link annotation on the coding vector to obtain a second initial label matrix, and the second initial label matrix In the signature matrix, the values ​​of the matrix elements marked with the head link of the relationship entity are 1, and the values ​​of the other matrix elements are 0. The matrix elements marked with the head link of the relationship entity are the row corresponding to the serial number of the first sequence element in the entity as the subject of any two entities and the column corresponding to the serial number of the first sequence element in the entity as the object; the encoding vector is marked with the tail link of the relationship entity to obtain the second initial label matrix. In the second initial label matrix, the values ​​of the matrix elements marked with the tail link of the relationship entity are 1, and the values ​​of the other matrix elements are 0. The matrix elements marked with the tail link of the relationship entity are the row corresponding to the serial number of the last sequence element in the entity as the subject of any two entities and the column corresponding to the serial number of the last sequence element in the entity as the object.

[0225] In an embodiment of the present application, the initial label matrix is ​​transposed to obtain the label matrix of the target domain training corpus, including: retaining the upper triangle of the first, second and third initial label matrices; transposing the lower triangles of the first, second and third initial label matrices to the upper triangle, respectively, and multiplying the values ​​of the transposed lower triangular matrix elements by a coefficient k to obtain the first, second and third label matrices of the target domain training corpus, wherein k is a positive integer greater than 1.

[0226] In an embodiment of the present application, a decoding module is used to decode the feature vector of the target domain training corpus to extract the predicted triple information of the target domain training corpus, including: using a potential relationship extraction layer to predict a potential relationship subset in the feature vector of the target domain training corpus, the potential relationship subset is used to indicate the potential relationship information of each entity in the feature vector; using a global interactive flexible graph convolution module to predict the entity pair information that can constitute the predicted triple in the feature vector of the target domain training corpus; using a specific relationship sequence labeling layer, based on the entity pair information and the potential relationship subset that can constitute the predicted triple, the predicted triple information of the target domain training corpus is extracted from the feature vector of the target domain training corpus.

[0227] In an embodiment of the present application, a potential relationship extraction layer is used to predict a subset of potential relationships in a feature vector of a target domain training corpus, including: performing a global average pooling operation on the feature vector of the target domain training corpus; and using a multi-label binary classification task model to predict the feature vector after global average pooling to obtain a subset of potential relationships in the feature vector of the target domain training corpus.

[0228] In an embodiment of the present application, a global interactive flexible graph convolution module is used to predict entity pair information that can constitute a predicted triple in the feature vector of the target domain training corpus, including: obtaining all entity pairs in the feature vector, calculating the global interaction matrix confidence of all entity pairs; using a multi-head attention mechanism algorithm to update the global interaction matrix confidence; and predicting entity pair information that can constitute a predicted triple in the feature vector of the target domain training corpus based on the updated global interaction matrix confidence.

[0229] In an embodiment of the present application, a multi-head attention mechanism algorithm is used to update the global interaction matrix confidence, including: determining N learning probability global interaction matrices based on the global interaction matrix, forming a subgraph space based on each learning probability global interaction matrix, N is a positive integer; using N graph neural network models to respectively mine the features of each subgraph space to obtain N mined features; using N pooling layers to respectively perform pooling compression processing on the N mined features; using a linear layer to linearly transform the N mined features after the pooling compression processing to obtain an intermediate linear feature matrix; repeating M times the steps of determining N learning probability global interaction matrices based on the intermediate linear feature matrix, forming a subgraph space based on each learning probability global interaction matrix, using N graph neural network models to respectively mine the features of each subgraph space to obtain N mined features, using N pooling layers to respectively perform pooling compression processing on the N mined features, and using a linear layer to linearly transform the N mined features after the pooling compression processing to obtain an output linear feature matrix, M is a positive integer; determining the updated global interaction matrix confidence based on the output linear feature matrix.

[0230] In an embodiment of the present application, a specific relationship sequence labeling layer is used, and based on the entity pair information and potential relationship subsets that can constitute the predicted triples, the predicted triple information of the target domain training corpus is extracted from the feature vector of the target domain training corpus, including: based on the entity pair information and potential relationship subsets that can constitute the predicted triples, calculating the first probability and the second probability of each entity in each predicted triple; in response to the first probability of the first entity in the target triple being greater than a first preset probability threshold, and the first probability of the first entity being greater than the first probability of the second entity, determining that the first entity is the subject entity in the triple; in response to the second probability of the second entity in the target triple being greater than a second preset probability threshold, and the second probability of the second entity being greater than the second probability of the first entity, determining that the second entity is the object entity in the triple.

[0231] In an embodiment of the present application, it also includes: calculating the similarity between any two entities in the triple information; aligning the entities whose similarity is greater than a preset similarity threshold to obtain aligned triple information, wherein the alignment is to name all entities whose similarity is greater than a preset similarity threshold with the same name; inputting the aligned triple information into a graph database to obtain a knowledge graph of the target domain.

[0232] In an embodiment of the present application, the similarity between any two entities includes any one of the following: the similarity between any two entities based on the edit distance Levenshtein, the similarity between any two entities based on Jaccard, the similarity between any two entities based on the token, and the similarity between any two entities based on the cosine similarity; the graph database includes the Neo4j graph database.

[0233] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0234] Fig.16 Schematic diagram of an electronic device provided in an embodiment of the present application. Fig.16 As shown, the electronic device 16 of this embodiment includes: a processor 1601, a memory 1602, and a computer program 1603 stored in the memory 1602 and executable on the processor 1601. When the processor 1601 executes the computer program 1603, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1601 executes the computer program 1603, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0235] The electronic device 16 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 16 may include, but is not limited to, a processor 1601 and a memory 1602. Those skilled in the art will appreciate that Fig.16 The electronic device 16 is merely an example and does not limit the electronic device 16 , and may include more or less components than those shown in the figure, or different components.

[0236] Processor 1601 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0237] The memory 1602 may be an internal storage unit of the electronic device 16, for example, a hard disk or memory of the electronic device 16. The memory 1602 may also be an external storage device of the electronic device 16, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the electronic device 16. The memory 1602 may also include both an internal storage unit of the electronic device 16 and an external storage device. The memory 1602 is used to store computer programs and other programs and data required by the electronic device.

[0238] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0239] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0240] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A knowledge graph construction method, characterized in that: include: Acquire target domain training corpus, wherein the target domain training corpus includes labeled triple information; Using the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution to obtain a trained joint extraction model; Acquire the corpus of the target domain, input the corpus of the target domain into the trained joint extraction model, and obtain triple information of the target domain; Inputting the triple information into a graph database to obtain a knowledge graph of the target domain; The joint extraction model based on global interactive flexible graph convolution includes an encoding module, a handshake annotation layer and a decoding module; The encoding module is used to generate an encoding vector of the corpus of the target domain, and the handshake annotation layer is used to annotate the encoding vector to obtain a feature vector of the corpus of the target domain; The decoding module includes a potential relationship extraction layer, a global interactive flexible graph convolution and a specific relationship sequence labeling layer. The potential relationship extraction layer is used to predict a potential relationship subset in the feature vector of the corpus of the target domain to remove redundant relationships for the knowledge graph. The global interactive flexible graph convolution is used to predict entity pair information that can constitute prediction triples in the feature vector of the corpus of the target domain. The specific relationship sequence labeling layer is used to extract the prediction triple information of the corpus of the target domain from the feature vector of the corpus of the target domain based on the entity pair information that can constitute the prediction triples and the potential relationship subset in the feature vector of the corpus of the target domain.

2. The method according to claim 1, characterized in that The method of using the target domain training corpus to train a joint extraction model based on global interactive flexible graph convolution to obtain a trained joint extraction model includes: Encode the target domain training corpus using the encoding module to obtain an encoding vector of the target domain training corpus; Perform entity head and tail link annotation, relationship entity head link annotation and relationship entity tail link annotation on the encoding vector at the handshake annotation layer to obtain an initial label matrix of the target domain training corpus; Transpose the initial label matrix to obtain a label matrix of the target domain training corpus; Using the label matrix to label the encoding vector of the target domain training corpus, to obtain a feature vector of the target domain training corpus; Decoding the feature vector of the target domain training corpus using the decoding module to extract predicted triplet information of the target domain training corpus; In response to a difference between the predicted triple information and the labeled triple information being greater than a preset loss threshold, updating the decoding module, and using the updated decoding module to re-extract the predicted triple information from the label matrix of the target domain training corpus; Repeat the step of determining whether the difference between the predicted triple information and the marked triple information is greater than a preset loss threshold, and if so, updating the decoding module, and re-extracting the predicted triple information using the updated decoding module, until the difference between the predicted triple information and the marked triple information is less than or equal to the preset loss threshold; Determine the joint extraction model composed of the encoding module, the handshake annotation layer, and the decoding module when the difference between the predicted triplet information and the marked triplet information is less than or equal to the preset loss threshold, which is the trained joint extraction model.

3. The method according to claim 2, characterized in that The using the encoding module to encode the target domain training corpus to obtain an encoding vector of the target domain training corpus includes: Encode the target domain training corpus using a token embedding layer to obtain a first vector representation, where the first vector representation is the overall vector representation of the training corpus; Using a position embedding layer to encode the target domain training corpus to obtain a second vector representation, where the second vector representation is a vector representation of position information of each word in the training corpus; Encode the target domain training corpus using a segment embedding layer to obtain a third vector representation, where the third vector representation is a vector representation of different sentences in the training corpus; The first vector representation, the second vector representation and the third vector representation are concatenated using a fully connected layer, and the concatenated vector representation is encoded using a sequence model based on an attention mechanism to obtain an encoding vector of the target domain training corpus.

4. The method according to claim 2, characterized in that: The step of performing entity head and tail link annotation, relationship entity head link annotation and relationship entity tail link annotation on the encoding vector at the handshake annotation layer to obtain an initial label matrix of the target domain training corpus includes: Acquire entity information in the encoding vector, and determine a subject-guest entity relationship between any two entities in the encoding vector; Perform entity head-tail link marking on the encoding vector to obtain a first initial label matrix, in which the values ​​of the matrix elements marked with entity head-tail link are 1, and the values ​​of other matrix elements are 0, and the matrix elements marked with entity head-tail link are the matrix elements of the row corresponding to the serial number of the first sequence element and the column corresponding to the serial number of the last sequence element in each entity; Performing relationship entity head link labeling on the encoding vector to obtain a second initial label matrix, in which the values ​​of the matrix elements labeled with relationship entity head links are 1, and the values ​​of other matrix elements are 0, and the matrix elements labeled with relationship entity head links are the matrix elements where the row corresponding to the serial number of the first sequence element in the entity as the subject and the column corresponding to the serial number of the first sequence element in the entity as the object of any two entities are located; The encoding vector is annotated with relational entity tail links to obtain a third initial label matrix, in which the values ​​of the matrix elements annotated with relational entity tail links are 1, and the values ​​of other matrix elements are 0. The matrix elements annotated with relational entity tail links are the matrix elements where the row corresponding to the serial number of the last sequence element in the entity as the subject and the column corresponding to the serial number of the last sequence element in the entity as the object of any two entities are located.

5. The method according to claim 4, characterized in that The transposing process of the initial label matrix to obtain the label matrix of the target domain training corpus includes: Retaining the upper triangles of the first initial label matrix, the second initial label matrix, and the third initial label matrix; The lower triangles of the first initial label matrix, the second initial label matrix, and the third initial label matrix are transposed to the upper triangle respectively, and the values ​​of the transposed lower triangular matrix elements are multiplied by the coefficient k to obtain the first initial label matrix, the second initial label matrix, and the third initial label matrix of the target domain training corpus, where k is a positive integer greater than 1.

6. The method according to claim 2, characterized in that The step of using the decoding module to decode the feature vector of the target domain training corpus and extracting the predicted triplet information of the target domain training corpus includes: Predicting a potential relationship subset in the feature vector of the target domain training corpus using a potential relationship extraction layer, wherein the potential relationship subset is used to indicate potential relationship information of each entity in the feature vector; Using a global interactive flexible graph convolution module to predict entity pair information that can constitute a prediction triple in the feature vector of the target domain training corpus; Using a specific relation sequence labeling layer, based on the entity pair information that can constitute the predicted triple and the potential relation subset, the predicted triple information of the target domain training corpus is extracted from the feature vector of the target domain training corpus.

7. The method according to claim 6, characterized in that The method of using the potential relation extraction layer to predict the potential relation subset in the feature vector of the target domain training corpus includes: Performing a global average pooling operation on the feature vectors of the target domain training corpus; A multi-label binary classification task model is used to predict the feature vector after global average pooling to obtain a potential relation subset in the feature vector of the target domain training corpus.

8. The method according to claim 6, characterized in that The method of using the global interactive flexible graph convolution module to predict the entity pair information that can constitute the prediction triple in the feature vector of the target domain training corpus includes: Obtaining all entity pairs in the feature vector, and calculating global interaction matrix confidences of all entity pairs; Using a multi-head attention mechanism algorithm to update the global interaction matrix confidence; Based on the updated global interaction matrix confidence, the entity pair information that can constitute the prediction triplet is predicted in the feature vector of the target domain training corpus.

9. The method according to claim 8, characterized in that The method of updating the global interaction matrix confidence using a multi-head attention mechanism algorithm includes: Determine N learning probability global interaction matrices based on the global interaction matrix, and form a subgraph space based on each learning probability global interaction matrix, where N is a positive integer; Use N graph neural network models to mine the features of each subgraph space respectively, and obtain N mining features; Use N pooling layers to perform pooling compression processing on the N mined features respectively; Use the linear layer to perform linear transformation on the N mining features after pooling and compression to obtain an intermediate linear feature matrix; Repeat M times the steps of determining N learning probability global interaction matrices based on the intermediate linear feature matrix, forming a subgraph space based on each learning probability global interaction matrix, using N graph neural network models to respectively mine the features of each subgraph space to obtain N mining features, using N pooling layers to respectively perform pooling compression processing on the N mining features, and using a linear layer to perform linear transformation processing on the mining features after the N pooling compression processing, to obtain an output linear feature matrix, where M is a positive integer; An updated global interaction matrix confidence is determined based on the output linear feature matrix.

10. The method according to claim 6, characterized in that The method of using a specific relation sequence labeling layer to extract the predicted triple information of the target domain training corpus from the feature vector of the target domain training corpus based on the entity pair information capable of constituting the predicted triple and the potential relation subset includes: Based on the entity pair information capable of constituting a predicted triple and the potential relationship subset, calculating a first probability and a second probability of each entity in each predicted triple; In response to a first probability of a first entity in the target triple being greater than a first preset probability threshold, and the first probability of the first entity being greater than a first probability of a second entity, determining that the first entity is a subject entity in the triple; In response to a second probability of a second entity in the target triple being greater than a second preset probability threshold and the second probability of the second entity being greater than the second probability of the first entity, the second entity is determined to be an object entity in the triple.

11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: Calculating the similarity between any two entities in the triple information; Aligning entities whose similarity is greater than a preset similarity threshold to obtain aligned triplet information, wherein the alignment is to name all entities whose similarity is greater than the preset similarity threshold with the same name; The aligned triplet information is input into a graph database to obtain a knowledge graph of the target domain.

12. The method according to claim 11, characterized in that The similarity between any two entities includes any of the following: The similarity between any two entities based on Levenshtein's edit distance, the similarity between any two entities based on Jaccard's similarity, the similarity between any two entities based on Token's similarity, and the similarity between any two entities based on cosine similarity; The graph database includes a Neo4j graph database.

13. A knowledge graph construction device, characterized in that: include: An acquisition module is configured to acquire a target domain training corpus, wherein the target domain training corpus includes labeled triple information; A training module is configured to train a joint extraction model based on global interactive flexible graph convolution using the target domain training corpus to obtain a trained joint extraction model; An extraction module is configured to obtain the corpus of the target domain, input the corpus of the target domain into the trained joint extraction model, and obtain triple information of the target domain; A construction module is configured to input the triple information into a graph database to obtain a knowledge graph of the target domain; The joint extraction model based on global interactive flexible graph convolution includes an encoding module, a handshake annotation layer and a decoding module; The encoding module is used to generate an encoding vector of the corpus of the target domain, and the handshake annotation layer is used to annotate the encoding vector to obtain a feature vector of the corpus of the target domain; The decoding module includes a potential relationship extraction layer, a global interactive flexible graph convolution and a specific relationship sequence labeling layer. The potential relationship extraction layer is used to predict a potential relationship subset in the feature vector of the corpus of the target domain to remove redundant relationships for the knowledge graph. The global interactive flexible graph convolution is used to predict entity pair information that can constitute prediction triples in the feature vector of the corpus of the target domain. The specific relationship sequence labeling layer is used to extract the prediction triple information of the corpus of the target domain from the feature vector of the corpus of the target domain based on the entity pair information that can constitute the prediction triples and the potential relationship subset in the feature vector of the corpus of the target domain.

14. An electronic device 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 12 are implemented.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.