Database operation and maintenance text relation extraction method and system based on double attention mechanism

By adopting a dual attention mechanism and remote supervision entity alignment method in database operation and maintenance text relationship extraction, combined with a multi-layer neural network model, the problem of poor interpretability of labeled data requirements and model in the existing technology is solved, and a higher level of data is achieved the accuracy and robustness of relationship extraction.

CN119294391APending Publication Date: 2025-01-10BEIJING XINSHU TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411440643.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing database operation and maintenance text entity relationship extraction methods have problems such as labeling data requirements, domain expertise dependence, poor model interpretability, and inability to process diversified data.

Method used

Using a dual attention mechanism method, remote supervision entity alignment is used to automatically generate training data, combined with the relationship extraction model of XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer, and through word and sentence attention The mechanism more accurately allocates weights, eliminates noise interference, and improves the accuracy of relationship extraction.

Benefits of technology

It has achieved the reduction of manual annotation work, improved the accuracy of entity recognition and relationship extraction, enhanced the performance of the model in processing complex database operation and maintenance texts, and improved the robustness and extraction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119294391A_ABST
    Figure CN119294391A_ABST
Patent Text Reader

Abstract

According to the database operation and maintenance text entity relationship extraction method and system based on the double attention mechanism, entity alignment with an external open source database is carried out by utilizing a remote supervision entity extraction method, and training data is automatically obtained; secondly, transmitting database data as input to a pre-trained XLNet model, wherein the XLNet model generates a vector for capturing sentence feature information for each word in the sentence; the BiLSTM model learns context feature information of a target entity from the output of the XLNet model, and captures a long-distance dependency relationship in a sentence; then in combination with a character and sentence attention mechanism, information is captured from different levels, and specific entity words (character levels) and sentences (sentence levels) containing key information are concerned; and finally, sending to a CRF output layer, and outputting the output of the attention mechanism layer in a sequence tag form.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and system for extracting entity relations from database operation and maintenance text based on a dual attention mechanism, and belongs to the field of database operation and maintenance. Background Art

[0002] Database operation and maintenance text entity relationship extraction refers to the technology of automatically identifying and extracting the relationship between entities from text data related to database operation and maintenance. These text data include database logs, fault reports, maintenance records, user feedback, etc. Through database operation and maintenance text entity relationship extraction, real-time monitoring of database operation status can be achieved, the cause of faults can be quickly located, and potential risks can be predicted, thereby improving the stability and availability of the database. In addition, automatic relationship extraction can reduce the manual work of database administrators.

[0003] Relation extraction is usually performed by converting binary relations into relation triplets, such as<Entity1,Relation,Entity2> , where Entity1 and Entity2 represent two entities, and Relation represents the relationship between the two entities.

[0004] In the current database field, in order to improve the efficiency and intelligence level of operation and maintenance management, there are many relationship extraction methods, which can be mainly divided into the following categories:

[0005] (1) Rule-based approach: Relies on pre-defined rules to identify and extract operational knowledge. These rules are usually designed by database experts based on experience and domain knowledge, including regular expressions, keyword matching, etc. The rule-based approach is simple and easy to implement, but has poor flexibility and generalization ability, and requires continuous updating and maintenance of rules to adapt to new situations.

[0006] (2) Methods based on statistical machine learning: Use machine learning algorithms to train models and automatically learn and identify operation and maintenance knowledge from text. However, this method requires manual extraction of text features and requires a large amount of labeled data for training, and the model generalization ability is poor.

[0007] (3) Remote supervised learning method: Use the information in the knowledge base to automatically annotate a large amount of text data to build a training set and solve the problem of data scarcity. Although remote supervised learning provides an effective solution for the relationship extraction task, its accuracy is affected by noisy labels. Noisy labels may come from errors or incompleteness in the knowledge base itself, causing the model trained by the remote supervised learning method to be affected by these inaccurate labels, reducing the model performance.

[0008] In summary, although the methods of relational entity extraction from database operation and maintenance texts have made significant progress in this field, they still have some shortcomings when facing real scenarios, mainly including the need for labeled data, reliance on domain expertise, poor model interpretability, and inability to handle diverse data. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 It is the system flow chart.

[0010] Figure 2 To automatically generate a flow chart for training data.

[0011] Figure 3 A distantly supervised relation extraction model. Summary of the invention

[0012] In order to solve the technical problems existing in the prior art, the present invention proposes a database operation and maintenance text relationship extraction method based on a dual attention mechanism. The method performs entity alignment with a remote knowledge base and automatically generates training data. The relationship extraction model used is XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom, which can effectively allocate weights and eliminate noise interference.

[0013] The specific steps are:

[0014] (1) Collect text data from database operation and maintenance related text data and store it locally to form original data;

[0015] (2) Extracting plain text information from raw data through data cleaning and storing it in a unified text format;

[0016] (3) Use external open source databases for entity pair matching, match text with entities in the open source database, assign remote supervision labels to text, and automatically obtain training data;

[0017] (4) Extracting remote supervision relations: The training data obtained in step (3) is fed into the remote supervision relation extraction model to obtain the globally optimal label sequence.

[0018] (5) Database operation and maintenance text data generates triples based on entity relationships.

[0019] Furthermore, in step (4), the remote supervision relation extraction model consists of XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom; in the sentence attention layer, where r i Nr is for each sentence r iThe accuracy of the relationship with the input sentence r, N is the diagonal matrix of the weight matrix α, T is the matrix composed of all relationship vectors, b is the bias matrix, O is the neural network output, i is the position index of the specific word in the sentence, and n is the number of characters in the sentence.

[0020] The CRF output layer takes the context feature vector extracted by the word attention layer and the sentence attention layer as input, and the objective function Where A is the transfer matrix, is the yth character of the ith word in the sentence i The probability of labels; the input sequence is X; the output sequence is y, is the combined feature weight, label-feature function f k (y i ,y i+1 ,X) is used to capture the label y at position i i and the label y at position i+1 i+1 Relationship with the input sequence X, α k is the attention weight of the feature function, k is the identifier of different feature functions, k∈[1,m], and m is the total number of feature functions.

[0021] Based on the above method, the present invention proposes a database operation and maintenance text relation extraction system based on a dual attention mechanism. The relation extraction model used in the system is XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom, specifically including:

[0022] (1) Raw data collection module: This module collects text data from database operation and maintenance related text data and stores it locally to form raw data;

[0023] (2) Plain text information extraction module: This module extracts plain text information from the original data through data cleaning and stores it in a unified text format;

[0024] (3) Training data acquisition module: This module uses an external open source database to perform entity pair matching, matches the text with entities in the open source database, assigns remote supervision labels to the text, and automatically obtains training data;

[0025] (4) Remote supervision relationship extraction module: This module feeds the training data obtained in module (3) into the remote supervision relationship extraction model to obtain the globally optimal label sequence.

[0026] (5) Triple generation module: Database operation and maintenance text data generates triples based on entity relationships.

[0027] Furthermore, in the remote supervision relation extraction module, the remote supervision relation extraction model is XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom; in the sentence attention layer, where r i Nr is for each sentence r i The accuracy of the relationship with the input sentence r, N is the diagonal matrix of the weight matrix α, T is the matrix composed of all relationship vectors, b is the bias matrix, O is the neural network output, i is the position index of the specific word in the sentence, and n is the number of characters in the sentence.

[0028] The CRF output layer takes the context feature vector extracted by the word attention layer and the sentence attention layer as input, and the objective function Where A is the transfer matrix, is the yth character of the ith word in the sentence i The probability of labels; the input sequence is X; the output sequence is y, is the combined feature weight, label-feature function f k (y i ,y i+1 ,X) is used to capture the label y at position i i and the label y at position i+1 i+1 Relationship with the input sequence X, α k is the attention weight of the feature function, k is the identifier of different feature functions, k∈[1,m], and m is the total number of feature functions.

[0029] The present invention designs a database operation and maintenance text entity relationship extraction method based on a dual attention mechanism. The method uses a remote supervised entity extraction method to perform entity alignment with an external open source database to automatically obtain training data; then the database data is passed as input to a pre-trained XLNet model, and the XLNet model generates a vector that captures sentence feature information for each word in a sentence; the BiLSTM model learns the context feature information of the target entity from the output of the XLNet model to capture the long-distance dependency in the sentence; then the word and sentence attention mechanisms are combined to capture information from different levels, focusing on specific entity words (word level) and sentences containing key information (sentence level); finally, it is sent to a CRF output layer, and the output of the attention mechanism layer is output in the form of sequence labels. DETAILED DESCRIPTION

[0030] The present invention proposes a method for extracting entity relationships from database maintenance text based on a dual attention mechanism. In this method, the dual attention mechanism of the word attention layer and the sentence attention layer is used to more accurately allocate weights and improve the accuracy of extracted relationships. The system flow chart of this application is as follows: Figure 1 shown.

[0031] Embodiment 1:

[0032] (1) Open source information acquisition: Collect text in semi-structured or unstructured form from text data related to database operation and maintenance to form raw data. Such data are usually loosely organized and do not follow a unified data model.

[0033] (2) Text preprocessing: Extracting pure text information from the raw data through data cleaning and storing it in a unified text format for subsequent text analysis tasks.

[0034] (3) Automatically generate training data

[0035] Entity pairs are extracted from the annotated text, and sentences containing the same entity pairs are classified into the same sentence bag. The sentence bag is matched with the open source database to obtain the relationship labels of the entity pairs, which are used as the remote supervision labels of the sentence bag. The process is as follows: Figure 2 shown.

[0036] Finally, the text data is divided into a test set and training data for the relation extraction model.

[0037] (4) Extracting remote supervision relations: The training corpus obtained in step (3) is fed into the remote supervision relation extraction model to obtain the globally optimal label sequence. The model consists of XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom. The remote supervision relation extraction model is as follows: Figure 3 shown.

[0038] Specifically:

[0039] a. The XLNet model automatically learns the feature information of sentences through its two-layer bidirectional conversion decoding feature, thereby obtaining a vector representation of the full text semantic information that combines word vectors, segment vectors, and position vectors;

[0040] b. The BiLSTM model learns the contextual feature information of the target entity from the XLNet output, and extracts the contextual feature vector based on the long-distance dependency relationship of the input vector to obtain more comprehensive semantic information;

[0041] c. Multiply the feature vector obtained by the BiLSTM layer with the character weight parameter obtained by the character attention layer and the sentence weight parameter obtained by the sentence attention layer to obtain the output of the model neural network.

[0042] The further word attention layer design is as follows:

[0043] By calculating the matching degree between each character and the predicted target entity, constructing a word-level weight matrix, and combining word vectors into sentence vectors, we can get the distributed expression of each sentence. The specific process is as follows:

[0044] M=tanh(H)

[0045] α=Softmax(β T M)

[0046] r′=Hα T

[0047] r = tanh(r′)

[0048] Among them, H is the output set of the previous BiLSTM layer; M is the fully connected hidden representation; α is the weight matrix; β is the trained parameter; β T and α T is the transposition of α and β, r′ is the sentence distribution expression; r is the output of the word attention layer.

[0049] The sentence attention layer is further designed as follows:

[0050] The output of the word attention layer is used as input. By calculating the matching degree between each entity pair sentence and the predicted relationship class, a sentence-level weight matrix is ​​constructed, and finally the vector representation of the sentence is obtained. The specific algorithm flow is as follows:

[0051]

[0052]

[0053] Among them, r i Nr is for each sentence r i The accuracy of the relationship with the input sentence r, N is the diagonal matrix of the weight matrix α; T is the matrix composed of all relationship vectors; α i is the vector r i The weight matrix of , b is the bias matrix; O is the output of the neural network, i is the position index of the specific word in the sentence, and n is the number of characters in the sentence.

[0054] The CRF output layer outputs the globally optimal label sequence by adding constraints. After the features are obtained through the XLnet layer and the BiLSTM layer to the output of the neural network, each character x is obtained. i Corresponding labels, we get the predicted label sequence y = (y1, y2, y3, ..., y n ), the CRF output layer is used to constrain and adjust the predicted label sequence y to obtain the optimal label sequence of the target sentence X. The specific algorithm flow of the CRF output layer is as follows

[0055]

[0056] Where A is the transfer matrix, P i,yi Represents the yth word of the i-th word in the sentence i The probability of labels; the input sequence is X; the output sequence is y, Expressed as the combined feature weight, f k (y i ,y i+1 ,X) is used to capture the label y at position i i and the label y at position i+1 i+1 Relationship with the input sequence X, α k is the attention weight of the feature function, k is the identifier of different feature functions, k∈[1,m], m is the total number of feature functions, f k (y i ,y i+1 ,X) is the label pair feature function, which can be selected as needed.

[0057] (5) Database operation and maintenance text data generates triples based on entity relationships

[0058] The label sequence obtained after the remote supervision relation model extracts the entity relations is further processed and parsed to generate data in the form of triples.

[0059] The remote supervision relationship extraction model constructed by the above structure will be trained on the collected data set. The model will continuously optimize parameters through an iterative learning process and finally be applied to the database operation and maintenance text relationship extraction task. The database operation and maintenance text entity relationship extraction method based on the dual attention mechanism automatically generates labeled data and gradually adjusts parameters through iterative learning to adapt to specific fields or tasks, and finally realizes the extraction of entity relationships in text.

[0060] After adopting the present invention, the following technical effects can be achieved:

[0061] 1. Traditional relationship extraction methods usually require a lot of manual annotation work, that is, to create training data by manually reading the text and annotating the entities and the relationships between them. This method is labor-intensive and time-consuming. The present invention uses external open source databases, resources containing a large amount of structured information, to perform entity pair matching. It also tries to match entities in the text with entities in the open source database, thereby giving remote supervision labels to the text, and the system can automatically obtain training data.

[0062] 2. Dual attention mechanism: This mechanism enables the model to pay more attention to the structured information in the text, and constructs a weight matrix by calculating the degree of match between each character and the predicted target entity. By paying attention to the character level, the model can analyze the structure and organization of the text more carefully, thereby improving the recognition accuracy of the entity. This attention can effectively capture the characteristics and contextual information of the entity in the text, which helps to more accurately locate and identify the target entity, thereby enhancing the performance of the relationship extraction model in processing structured information.

[0063] 3. In the task of text relationship extraction of database operation and maintenance, the knowledge structure of database operation and maintenance is relatively complex, and most of them are composed of multiple letters and words. The present invention proposes a text processing framework for remote relationship extraction with a dual attention mechanism, which automatically generates training data by aligning entities with a remote knowledge base, and then uses a dual attention mechanism to better allocate weights to eliminate noise interference. The character attention layer can accurately capture the structured information in the text and more accurately identify entities and relationships. The sentence attention layer helps to identify and emphasize key sentences, thereby better understanding the contextual relationship. By integrating the attention mechanisms at these two levels, weights can be allocated more accurately and the accuracy of relationship extraction can be improved.

[0064] Embodiment 2:

[0065] The specific contents of each step in the method are:

[0066] (1) Open source information acquisition: Use tools such as web crawlers to automatically access web pages, extract data, and store it locally.

[0067] (2) The specific operations of text preprocessing are as follows:

[0068] Data filtering: Filter the acquired text for special characters based on the characteristics of the information source, delete invalid characters, and remove text tags, such as HTML tags in web page text information, multimedia object information in social platform text information, etc.

[0069] Data screening: Delete files with a capacity of less than 20 bytes after data cleaning, as well as invalid files with unknown formats that cannot be opened normally.

[0070] Text segmentation: Use natural language processing tools or simple sentence segmentation based on punctuation marks. Use regular expressions and other methods to remove spaces and special characters in sentences.

[0071] (3) Automatically generate training data

[0072] Assume that there is an annotated text dataset containing multiple entity types, such as person names (PER), places (LOC), organizations (ORG), etc. The goal of this paper is to extract entity pairs and build a bag-of-sentences dataset, which is then matched with an open source database to obtain remote supervision labels for entity pairs. Finally, the dataset is split into a test set and a training corpus for training a relation extraction model.

[0073] Entity pair extraction: For example, in the sentence "Alice was the director of the zoo.", the model will mark "Alice" as a PER (person name) entity and "zoo" as a LOC (location) entity. Entity pairs are pairs between these entities, such as "Alice" and "zoo".

[0074] Bag-of-sentence construction: Sentences containing the same entity pairs are grouped into the same bag-of-sentences. For example, if another sentence "Bobsucceeded Alice as the director of the zoo." also contains the two entities "Alice" and "zoo", then this sentence will be grouped into the same bag-of-sentences.

[0075] Open source database matching: Match the sentence bag with open source databases (such as Wikidata, AllenNLP's Entity Linking API, etc.). For example, if "Alice" is the director of "zoo" in the open source database, then this relationship label can be used as the remote supervision label of the sentence bag.

[0076] Training corpus and test set split: Split the text data into a test set and a training corpus.

[0077] (4) Given a knowledge sentence about database operation and maintenance as the corpus: "Because the database table space is full, the operation and maintenance engineer Xiao Li expanded the table space and cleaned up useless data to free up space."

[0078] Through the XLNet model, we can get the following vectors to represent the semantic information of the sentence:

[0079]

[0080] Next, the vector is input into the BiLSTM model, which learns the contextual feature information of the target entity. As shown in the above corpus, the model focuses on the words before and after "tablespace", such as "conduct" and "capacity expansion operation" to extract contextual feature information. The feature vector of the target entity is obtained:

[0081]

[0082] Next, the feature vector obtained by the BiLSTM layer is multiplied by the character weight parameter obtained by the character attention layer and the sentence weight parameter obtained by the sentence attention layer to obtain the output of the model neural network.

[0083] The matching degree between each character and the target entity is calculated through the character attention layer to obtain the character weight parameter. The calculation process is as follows:

[0084]

[0085] Setting β = [0.1, -0.2, 0.3], then α = [0.4290, 0.2559, 0.1549, 0.0787, 0.0815] r′ = [0.2041, -0.0271, -0.1543].

[0086] The final word weight parameter is r = [0.2006, -0.0270, -0.1522].

[0087] Taking the output of the word attention mechanism layer as input, the sentence attention layer constructs a sentence-level weight matrix to obtain the vector representation of the final sentence:

[0088]

[0089] Assumptions b=[0.2,0.3,0.1], then the final output of the neural network is O=[1.73821,1.88905,2.08599].

[0090] Now use the CRF output layer algorithm to calculate the optimal label sequence: Assuming the sentence length is 4, the number of labels is 3, the transfer matrix Label Probability Assuming that the entity relationship is "PER" (person) and the index of the best label sequence is [2,1,0,2], the corresponding label sequence is ['E','M','B','E'].

[0091] (5) Parse the tag sequence and map it to the corresponding entity relationship. Assuming that the sequence represents the personal entity "PER", the triple obtained by parsing is:

[0092] Entity 1: "B-PER"->"E-PER", the corresponding text is "BE"

[0093] Entity 2: "M-PER", the corresponding text is "M"

[0094] Entity 3: "E-PER", the corresponding text is "E"

[0095] Therefore, the generated triple is ("BE", "M", "E"). This triple can be further used to describe entity relationships, where "BE" and "E" represent the beginning and end of a person entity, and "M" represents the middle part of the person entity.

[0096] Compared with the existing technology, the database operation and maintenance text entity relationship extraction method based on the dual attention mechanism has the following advantages:

[0097] (1) Deeper semantic understanding: The dual attention mechanism can better understand the deep semantic content in the text, especially in highly professional and technical texts such as database operation and maintenance texts, and can more accurately identify the relationship between entities.

[0098] (2) Higher extraction accuracy: The distant supervision relationship extraction model can take into account the entities and their contextual environment, thereby improving the accuracy of entity relationship extraction and reducing misjudgment.

[0099] (3) Better robustness: When processing complex and professional texts such as database operation and maintenance texts, the present invention has better robustness against noise and outliers.

[0100] The units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this application, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0101] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.

[0102] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0103] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0104] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0105] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A database operation and maintenance text relation extraction method based on a dual attention mechanism, which performs entity alignment with a remote knowledge base and automatically generates training data. The relation extraction model used is XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom, characterized in that: The specific steps are: (1) Collect text data from database operation and maintenance related text data and store it locally to form original data; (2) Extracting plain text information from raw data through data cleaning and storing it in a unified text format; (3) Use external open source databases for entity pair matching, match text with entities in the open source database, assign remote supervision labels to text, and automatically obtain training data; (4) Extracting remote supervision relations: The training data obtained in step (3) is fed into the remote supervision relation extraction model to obtain the globally optimal label sequence. (5) Database operation and maintenance text data generates triples based on entity relationships.

2. The method for extracting database operation and maintenance text relations based on a dual attention mechanism as claimed in claim 1, characterized in that: In step (4), the remote supervision relation extraction model consists of XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom; in the sentence attention layer, where r i Nr is for each sentence r i The accuracy of the relationship with the input sentence r, N is the diagonal matrix of the weight matrix α, T is the matrix composed of all relationship vectors, b is the bias matrix, O is the neural network output, i is the position index of the specific word in the sentence, and n is the number of characters in the sentence.

3. The method for extracting database operation and maintenance text relations based on a dual attention mechanism as claimed in claim 1, characterized in that: The CRF output layer takes the context feature vector extracted by the word attention layer and the sentence attention layer as input, and the objective function Where A is the transfer matrix, P i,yi is the yth character of the ith word in the sentence i The probability of a label; the input sequence is X; The output sequence is y, is the combined feature weight, label-feature function f k (y i ,y i+1 ,X) is used to capture the label y at position i i and the label y at position i+1 i+1 Relationship with the input sequence X, α k is the attention weight of the feature function, k is the identifier of different feature functions, k∈[1,m], and m is the total number of feature functions.

4. A database operation and maintenance text relation extraction system based on a dual attention mechanism, wherein the relation extraction model used in the system is XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom, and is characterized by: Specifically include: (1) Raw data collection module: This module collects text data from database operation and maintenance related text data and stores it locally to form raw data; (2) Plain text information extraction module: This module extracts plain text information from the original data through data cleaning and stores it in a unified text format; (3) Training data acquisition module: This module uses an external open source database to perform entity pair matching, matches the text with entities in the open source database, assigns remote supervision labels to the text, and automatically obtains training data; (4) Remote supervision relationship extraction module: This module feeds the training data obtained in module (3) into the remote supervision relationship extraction model to obtain the globally optimal label sequence. (5) Triple generation module: Database operation and maintenance text data generates triples based on entity relationships.

5. A database operation and maintenance text relationship extraction system based on a dual attention mechanism as claimed in claim 4, characterized in that: In the remote supervision relation extraction module, the remote supervision relation extraction model is composed of XLNet layer, BiLSTM layer, word attention layer, sentence attention layer and CRF output layer from top to bottom; in the sentence attention layer, where r i Nr is for each sentence r i The accuracy of the relationship with the input sentence r, N is the diagonal matrix of the weight matrix α, T is the matrix composed of all relationship vectors, b is the bias matrix, O is the neural network output, i is the position index of the specific word in the sentence, and n is the number of characters in the sentence.

6. A database operation and maintenance text relationship extraction system based on a dual attention mechanism as claimed in claim 4, characterized in that: The CRF output layer takes the context feature vector extracted by the word attention layer and the sentence attention layer as input, and the objective function Where A is the transfer matrix, is the yth character of the ith word in the sentence i The probability of a label; the input sequence is X; The output sequence is y, is the combined feature weight, label-feature function f k (y i ,y i+1 ,X) is used to capture the label y at position i i and the label y at position i+1 i+1 Relationship with the input sequence X, α k is the attention weight of the feature function, k is the identifier of different feature functions, k∈[1,m], and m is the total number of feature functions.

Citation Information

Patent Citations

  • Remotely-supervised Dual-Attention relation classification method and system

    CN108829722A

  • Multi-person relationship extraction method based on multi-level attention mechanism

    CN111125367A

  • Entity relationship extraction method and device based on fusion relationship and two-dimensional attention

    CN118536505A