Knowledge extraction method, device and equipment based on attention adaptive vocabulary enhancement

Through the method of advancing attention vocabulary enhancement, the entity identification problem of metallurgical equipment maintenance records in the Chinese context is solved, efficient and accurate triple generation is achieved, and the intelligent operation and maintenance of equipment and economic benefits are promoted.

CN120470124APending Publication Date: 2025-08-12UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510656032.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In the knowledge extraction of metallurgical equipment maintenance records in the prior art, there are problems such as difficult entity recognition, traditional methods being affected by the output order and error accumulation in the prior art, resulting in poor extraction effect.

Method used

Using an attention-adaptive vocabulary enhancement method, the positions of head and tail entities are predicted through attention weight scores, combined with bidirectional long and short-term memory network and non-time sequence feature decoding, triplets are constructed and differential comparisons are performed to reduce error accumulation.

Benefits of technology

It improves the efficiency and accuracy of knowledge extraction in the Chinese context, generates triples that are consistent with historical maintenance, promotes the intelligence of equipment operation and maintenance, and improves economic benefits and equipment quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120470124A_ABST
    Figure CN120470124A_ABST
Patent Text Reader

Abstract

The invention relates to a knowledge extraction method, device and equipment based on attention adaptive vocabulary enhancement, and the method comprises the following steps: processing an input text, and obtaining an attention weight score; performing prediction processing on the embedded matrix processed by the input text by adopting the attention weight score to obtain a starting position and an ending position of a head entity and a starting position and an ending position of a tail entity; determining a triple in the input text according to the predicted starting and ending positions of the head entity and the predicted starting and ending positions of the tail entity; and carrying out difference comparison on the determined triad and a triad calibrated in advance so as to check the determined triad. According to the method, the equipment fault knowledge extraction efficiency and precision under the Chinese context can be effectively improved, the limitation of a traditional method in the face of complex texts is solved, and the method has remarkable advantages especially under the situation that the number of triples is large or data is complex.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of metallurgical technology, and specifically relates to a knowledge extraction method, device and equipment based on attention-adaptive vocabulary enhancement. Background Art

[0002] As the metallurgical industry continues to expand, the operating pressure on metallurgical equipment is also increasing. Therefore, efficient maintenance strategies have become crucial for the daily operations and maintenance of metallurgical enterprises. Early information extraction methods primarily relied on feature engineering, extracting specific features to improve model performance. Joint extraction methods based on feature engineering require significant manpower and expertise in the feature acquisition process and are subject to error propagation issues, which can affect extraction results. Existing research in the field of information extraction is primarily based on English contexts, while feature extraction from specialized domain texts in the Chinese context presents challenges. Compared to English, Chinese sentences are not naturally segmented, making entity recognition more challenging in information extraction in this context. Current algorithms for extracting knowledge from Chinese contexts suffer from the following issues: when segmenting Chinese samples using vocabulary as the smallest unit, only a portion of the vocabulary can have a positive impact in subsequent steps, making direct use of the entire vocabulary information ineffective for the task. Traditional methods are also affected by the output order when generating triples, which can affect training effectiveness. Summary of the Invention

[0003] In order to overcome the above-mentioned problems existing in the prior art, the present invention provides a knowledge extraction method, device and equipment based on attention-adaptive vocabulary enhancement, which are used to solve the above-mentioned problems existing in the prior art.

[0004] A knowledge extraction method based on attention-adaptive vocabulary enhancement, comprising the following steps: S1. Process the input text and obtain the attention weight score; S2. Use the attention weight scores to predict the embedding matrix after the input text processing to obtain the start and end positions of the head entity and the start and end positions of the tail entity; S3. Determine the triples in the input text based on the predicted start and end positions of the head entity and the start and end positions of the tail entity; S4. Compare the determined triplet with the pre-calibrated triplet to verify the determined triplet.

[0005] According to the above aspects and any possible implementation, an implementation is further provided, wherein the input file is a maintenance record of metallurgical equipment, which is recorded in Chinese text in segments.

[0006] According to the above aspects and any possible implementation, an implementation is further provided, wherein S1 includes: S11) After the input text is segmented into words or subwords, it is converted into a word embedding vector and an embedding matrix; S12) Perform a nonlinear transformation on each word embedding vector and map it to a high-dimensional feature space to obtain a vocabulary encoding vector; S13) Flattening the entire embedding matrix into a vector and performing dimensionality reduction to obtain a compressed vector representing the semantics of the text, i.e., the text encoding vector; S14) Perform a dot product calculation on the vocabulary encoding vector and the text encoding vector to obtain the attention weight score of each word in the overall context.

[0007] According to the above aspects and any possible implementation, there is further provided an implementation, wherein the S11 includes: S111) dividing the input text into a continuous string sequence, screening the string sequence to obtain a dictionary set V; S112) Convert the text sequence S and vocabulary set V into word vector outputs respectively and ; in, represents the embedding matrix of the vocabulary set V, , m represents the capacity of the vocabulary set V, represents the embedding direction of each word in the vocabulary, Embedding vectors for the vocabulary.

[0008] In the above aspects and any possible implementation, an implementation is further provided, S12) specifically includes: using a feed-forward neural network FFN to embed the vocabulary set vector Perform nonlinear transformation and map it to high-dimensional feature space to obtain the vocabulary set encoding vector , the process can be expressed as: in, represents the encoding vector of the vocabulary set V, Represents the encoded vector representation of each word in the vocabulary.

[0009] According to the above aspects and any possible implementation, a further implementation is provided, S13) specifically includes: embedding the matrix After flattening to a vector, dimensionality reduction is performed to obtain a compressed vector representing the semantics of the text, namely the text encoding vector , the process is expressed as: in, and Represent the weight matrix and bias coefficient respectively, n represents the sequence length, and d represents the embedding matrix Dimensions, Function represents a flattening operation.

[0010] According to the above aspects and any possible implementation, a further implementation is provided, wherein S14) specifically includes: encoding the vocabulary vectors With text encoding vector Perform dot product calculation to obtain the attention weight score of each word , the process is expressed as: Among them, the score is a scalar.

[0011] According to the above aspects and any possible implementation, an implementation is further provided, wherein S2 includes: S21) processing the embedding matrix using a feedforward neural network to obtain non-temporal features; S22) decoding the non-temporal feature and predicting all relationship types contained in the current text; S23) Processing the embedding matrix using a bidirectional long short-term memory network to obtain enhanced temporal features; S24) Using the attention weight coefficient to construct the influence factor of the head entity and the influence factor of the tail entity; S25) predicting the start and end positions of the head entity and the start and end positions of the tail entity according to the temporal features and the influence factor of the head entity and the influence factor of the tail entity.

[0012] The present invention also provides a knowledge extraction device based on attention-adaptive vocabulary enhancement, which is used to implement the method described above, including: a processing module, used to process the input text to obtain an attention weight score; The prediction module is used to predict the embedding matrix after the input text is processed using the attention weight score to obtain the start and end positions of the head entity and the start and end positions of the tail entity; A determination module, which determines triples in the input text according to the predicted start and end positions of the head entity and the start and end positions of the tail entity; The verification module compares the determined triplet with the pre-calibrated triplet to verify the determined triplet.

[0013] The present invention further provides an electronic device, comprising: a memory storing executable instructions; A processor is configured to execute the executable instructions in the memory to implement the method.

[0014] Beneficial effects of the present invention The method of the present invention uses vocabulary as a unit to perform semantic segmentation on the text sequence, adopts an attention adaptive mechanism, and uses the calculated weight score to focus on the vocabulary information that is closer to the sentence meaning during the feature extraction process. This improvement can not only selectively utilize vocabulary features, but also effectively learn the features of professional vocabulary; the present invention formulates the joint entity and relationship extraction task as a set prediction problem, combines non-autoregressive parallel decoding with a bipartite matching loss function, and in this way avoids the cumulative error problem existing in the autoregressive decoder method used in the prior art, and eliminates the verification of the output sequence order during the training process, thereby reducing the impact of the increase in the number of triples on the extraction effect; the present invention is applied to the construction task of professional knowledge graphs. Through the existing operation and maintenance data information, triples that are consistent with historical maintenance can be directly generated as equipment fault operation and maintenance knowledge graphs, which helps enterprises improve the efficiency of equipment operation and maintenance processes, realize intelligent maintenance, and significantly promote the improvement of economic benefits and equipment product quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flow chart of the method of the present invention; Figure 2 is the true value of the knowledge triples contained in the embodiment sample; Figure 3 It is an effect diagram of the atlas constructed by the extraction results of the method of the present invention; Figure 4 It is a performance index result diagram using the method of the present invention. DETAILED DESCRIPTION

[0016] To better understand the technical solutions of the present invention, the present invention includes but is not limited to the specific embodiments described below. Similar technologies and methods should be considered within the scope of protection of the present invention. To further clarify the technical problems, technical solutions, and advantages to be solved by the present invention, the following detailed description is provided in conjunction with the accompanying drawings and specific embodiments.

[0017] It should be understood that the embodiments described herein are only a portion of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0018] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "an", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

[0019] like Figure 1 As shown, the present invention provides a knowledge extraction method based on attention-adaptive vocabulary enhancement, which is characterized by comprising the following steps: S1. Process the input text and obtain the attention weight score; S2. Use the attention weight scores to predict the embedding matrix after the input text processing to obtain the start and end positions of the head entity and the start and end positions of the tail entity; S3. Determine the triples in the input text based on the predicted start and end positions of the head entity and the start and end positions of the tail entity; S4. Compare the determined triplet with the pre-calibrated triplet to verify the determined triplet.

[0020] Furthermore, the input file is a maintenance record of metallurgical equipment, which is recorded in Chinese text in sections.

[0021] Furthermore, the S1 includes: S11) After the input text is segmented into words or subwords, it is converted into a word embedding vector and an embedding matrix; S12) Perform a nonlinear transformation on each word embedding vector and map it to a high-dimensional feature space to obtain a vocabulary encoding vector; S13) Flattening the entire embedding matrix into a vector and performing dimensionality reduction to obtain a compressed vector representing the semantics of the text, i.e., the text encoding vector; S14) Perform a dot product calculation on the vocabulary encoding vector and the text encoding vector to obtain the attention weight score of each word in the overall context.

[0022] Furthermore, the S11 includes: S111) dividing the input text into a continuous string sequence, screening the string sequence to obtain a dictionary set V; S112) Convert the text sequence S and vocabulary set V into word vector outputs respectively and ; in, represents the embedding matrix of the vocabulary set V, , m represents the capacity of the vocabulary set V, represents the embedding direction of each word in the vocabulary, Embedding vectors for the vocabulary.

[0023] Furthermore, S12) specifically includes: using a feed-forward neural network FFN to embed the vocabulary set vector Perform nonlinear transformation and map it to high-dimensional feature space to obtain the vocabulary set encoding vector , the process can be expressed as: in, represents the encoding vector of the vocabulary set V, Represents the encoded vector representation of each word in the vocabulary.

[0024] Furthermore, S13) specifically includes: embedding the matrix After flattening to a vector, dimensionality reduction is performed to obtain a compressed vector representing the semantics of the text, namely the text encoding vector , the process is expressed as: in, and Represent the weight matrix and bias coefficient respectively, n represents the sequence length of the input text, and d represents the embedding matrix Dimensions, Function represents a flattening operation.

[0025] Furthermore, the S14) specifically includes: respectively encoding the vocabulary vector With text encoding vector Perform dot product calculation to obtain the attention weight score of each word , the process is expressed as: Among them, the score is a scalar.

[0026] Furthermore, the S2 includes: S21) processing the embedding matrix using a feedforward neural network to obtain non-time series features; S22) decoding the non-temporal feature and predicting all relationship types contained in the current text; S23) Processing the embedding matrix using a bidirectional long short-term memory network to obtain enhanced temporal features; S24) Using the attention weight coefficient to construct the influence factor of the head entity and the influence factor of the tail entity; S25) predicting the start and end positions of the head entity and the start and end positions of the tail entity according to the temporal features and the influence factor of the head entity and the influence factor of the tail entity.

[0027] Specifically, the steps of S1) are as follows: S11) Use the N-gram segmentation method to divide the input text into a continuous string sequence. Use statistical indicators such as word frequency-inverse document frequency, mutual information, and context entropy to filter out valid strings and form a dictionary set V. Use the pre-trained language model Bert to convert the input text sequence S and the vocabulary set V into embedding matrices respectively and embedding vector , respectively expressed as: (1) in, represents the embedding matrix of the vocabulary set V, , m represents the capacity of the vocabulary set V, represents the embedding vector of each word in the vocabulary, R is the vector space; n represents the sequence length of the input text, and d represents the embedding matrix Bert is a pre-trained language model, a large model method that converts input text into vectors or matrices that can be recognized and calculated by computer language.

[0028] S12) Use feed-forward neural network FFN to embed the vocabulary set vector Perform nonlinear transformation and map it to high-dimensional feature space to obtain the vocabulary set encoding vector , the process can be expressed as: (2) in, represents the encoding vector of the vocabulary set V, Represents the encoding vector representation of each word in the vocabulary. FFN is a feedforward neural network that achieves feature enhancement through two layers of linear transformation and nonlinear activation function. The mathematical expression is: in, and is the trainable weight matrix, and is the bias term, ReLU is the rectified linear activation function, and the expression is: S13) Embed text into matrix After flattening to a vector, dimensionality reduction is performed to obtain a compressed vector representing the semantics of the text, namely the text encoding vector , the process can be expressed as: (3) in, and Represent the weight matrix and bias coefficient respectively, which are known quantities, n represents the sequence length, d represents the dimension of the embedding vector, Function represents a flattening operation.

[0029] S14) Encode the vocabulary vectors With text encoding vector Perform dot product calculation to obtain the attention weight score of each word , the process can be expressed as: (4) Among them, the score It is a scalar. The higher the value, the more important the corresponding vocabulary is, and the greater the result on the final output in the subsequent steps. T represents transposition.

[0030] The present invention performs weighted adjustment on the original word embedding vector according to the attention weight score, thereby enhancing the representation capability of semantically important words and reducing the semantic interference caused by word segmentation errors.

[0031] The specific steps of S2) are as follows: S21) embeds the matrix Input the feedforward neural network FFN to obtain the non-time series feature matrix. The process can be expressed as: (5) in, It is the non-time series feature matrix obtained after dimension conversion using FFN2.

[0032] S22) uses linear transformation to decode the non-temporal feature matrix and predict all possible relation types in the input text. By combining contextual information and inter-entity association features, it can effectively capture the potential semantic connections in the sentence, thereby assigning an accurate relation label to each triple determined subsequently. The process can be expressed as: (6) in, , t is the number of all relations in the preset triple type to be determined (including the special relation type Ø indicating the absence of triples). Here, the value of parameter s is set to be significantly larger than the average number of triples in sentences in the input text paragraph, effectively avoiding missed triples due to insufficient output length. This strategy not only improves the robustness of the method but also ensures that all potential triples in the sentence are included in the actual prediction. represents the weight matrix, is the decoded relation label. r stands for "relation," indicating that this label is a relation label. This step is used to decode the relation. The softmax function is a vector normalization operation that maps each element of the input vector to a non-negative value through an exponential function and converts the output into a probability distribution by dividing it by the sum of all element exponentials. Its general mathematical expression is: in, Represents exponential operation.

[0033] The tanh function is a nonlinear activation function that maps any real input to the continuous interval [-1, 1] by calculating the ratio of hyperbolic sine to hyperbolic cosine. Its general mathematical expression is: S23) embedding matrix BiLSTM is used for processing to extract context-dependent temporal features. BiLSTM can effectively combine global contextual information through forward and backward propagation mechanisms, thereby enhancing the ability to understand sequence data: (7) in, It is the enhanced time series feature matrix output obtained by using BiLSTM to process sequence features.

[0034] S24) Use the attention weight coefficient to construct the head entity influence factor and the tail entity influence factor, and construct the indicator function as follows: (8) in, represents the index of the word in the input text, represents the index of the character in Hs, Indicates that the probability that the jth character is the starting position of the entity is affected by the influence factor of the i-th word, Indicates that the probability that the jth character is the end position of the entity is affected by the influence factor of the i-th word, represents the Kronecker function, which is defined as: (9) Among them, k is constructed When is the position of the starting character of the word in the sentence, When is the position of the last character of the word in the sentence, By accumulating the impact factors of each word, the overall impact factor of the entire vocabulary set V is calculated and , thereby more comprehensively characterizing the comprehensive role of the vocabulary set V in entity boundary prediction, the process can be expressed as: (10) S25) respectively for time series characteristics and overall impact factors and Decode and predict the start and end positions of the head entity and the start and end positions of the tail entity. The process is expressed as follows: (11) in , and All are known parameters and are known quantities; 、 are the start and end positions of the head entity respectively; 、 They are the start and end positions of the tail entity respectively.

[0035] S3. Knowledge triples are the most basic knowledge representation units in the knowledge graph, used to describe the relationship between entities. They are stored in a structure of head entity, relationship, and tail entity. The head entity is connected to the tail entity through the relationship. Therefore, this step can determine several triples in the paragraph in the input text based on the start and end positions of the head entity and the start and end positions of the tail entity predicted by S2.

[0036] S4. Compare the determined triples with the pre-calibrated triples to verify the determined triples and prove the effectiveness of the method.

[0037] The present invention uses a bipartite matching loss constructed based on the matching loss to perform the test. By performing negative logarithm operation on the probability value, the first The matching cost of a triplet in different matching situations guides the model to learn a more accurate triplet output, which is expressed as: (12) in, Indicates the predicted value The matching results of triples, Indicates the corresponding probability value, Indicates the difference between the extracted triples and the true triples; ln is the natural logarithm function, which is a logarithmic operation with the mathematical constant e as the base. represents the relationship among the real triples, Represents the starting position index of the head entity in the real triple, Represents the end position index of the head entity in the real triple, Represents the starting position index of the tail entity in the real triple, Represents the end position index of the tail entity in the real triple.

[0038] The bipartite matching loss By minimizing the optimal matching cost, the triples calculated or predicted by the method of the present invention and the annotated real triples are matched at the ideal position, thereby reducing the difference between the two. The expression is: (13) Where M represents the total number of all triples, Represents the difference between the output set and the labeled true value set. Represents the relationship among the prediction result triples, Represents the starting position index of the head entity in the prediction result triple, Represents the end position index of the head entity in the prediction result triple, Represents the starting position index of the tail entity in the prediction result triple, Represents the end position index of the tail entity in the prediction result triple.

[0039] The present invention adopts the optimal matching , whose value satisfies the matching loss The triple set under the minimization condition is expressed as: (14) in, Indicates the matching of all index pairs and relation types. To meet the matching loss The optimal matching situation when minimizing the conditions. When it is 0, it indicates the best match, indicating that the predicted result is completely consistent with the true value.

[0040] The present invention is described in detail with reference to the following embodiments: First, we constructed a dataset using "Equipment Failure Report Forms" for bucket-wheel stacker reclaimers in a specific region from 2018 to 2023, collected by a metallurgical equipment operation and maintenance research institute. This dataset includes structured data such as steel mill name, production line, region, line type, individual equipment, equipment specialty, production impact, and maintenance team; and unstructured data such as the failure symptoms, cause descriptions, and treatment, analysis, and improvement methods. After data preprocessing, we generated a training set containing 2,756 samples and a test set containing 689 samples.

[0041] Then, the text samples constructed from the unstructured data are trained using the method of the present invention. After the training is completed, the knowledge triples contained in the data and the parameter weights obtained by the model training are output.

[0042] Next, we use the following three key performance metrics: Precision, Recall, and F1. Precision refers to the proportion of samples predicted as positive by the model that are actually positive. It measures the proportion of true positive examples among all samples predicted as positive by the model. A higher value indicates a more reliable positive prediction. It can be expressed as: (15) Among them, TP is the number of samples correctly predicted by the model as positive examples, and FP is the number of samples incorrectly predicted by the model as positive examples.

[0043] Recall refers to the proportion of all actual positive examples that are correctly predicted as positive by the model. It is used to measure the model's ability to identify all positive examples. A higher value indicates a stronger ability of the model to identify positive examples. It can be expressed as: (16) Where FN is the number of samples that the model incorrectly predicts as negative examples.

[0044] The F1 index takes into account both precision and recall and is their harmonic mean. When the model achieves a balance between precision and recall, the F1 index will be higher. It can be expressed as: (17) Finally, new sample data information of operation and maintenance fault records is obtained and input into the trained model to obtain the triple knowledge contained in the new sample.

[0045] Technical effect: Take the sample "the belt cannot start and the belt brake cannot be opened. The intermediate belt brake limit is damaged. On-site inspection confirms that the brake joint is flexible. Manually open the brake to confirm the signal. There is no feedback signal. Replace the brake limit and adjust the spacing. The signal appears and normal function is restored." as the data to be extracted. This sentence contains a description of the fault phenomenon, fault cause and treatment method. The triple truth value contained in it is as follows Figure 2 As shown in the figure, the triples listed are all the triples contained in the text. This is a formal transformation of the sentences in the input text that describe the fault phenomenon, fault cause, and fault handling method, expressing the sentences with the "subject-verb-object" structure in the form of triples. The extraction results of the method described in this invention contain a total of 5 groups of triples. These extracted triples are used to construct graph structure data, and the fault node is associated with the "component" type entity. This can form a tree-like knowledge graph subgraph with the fault node as the root, as shown in the figure. Figure 3As shown. Among them, the triplet "adjustment - measure - brake" is different from the true value "adjustment - measure - brake gap". Because the innovation of this chapter focuses on the recognition of entity boundaries, the overlap of spans is used as the standard when calculating indicators. The total number of characters contained in the triplet in the true value is 37, and the recognition result is 35 characters. There is no false detection, but two characters are missed. The various indicators of the extraction results are as follows Figure 4 shown.

[0046] As an embodiment disclosed by the present invention, the present invention further provides a knowledge extraction device based on attention adaptive vocabulary enhancement, which is used to implement the method, including: a processing module, used to process the input text to obtain an attention weight score; The prediction module is used to predict the embedding matrix after the input text is processed using the attention weight score to obtain the start and end positions of the head entity and the start and end positions of the tail entity; A determination module, which determines triples in the input text according to the predicted start and end positions of the head entity and the start and end positions of the tail entity; The verification module compares the determined triplet with the pre-calibrated triplet to verify the determined triplet.

[0047] As an embodiment disclosed in the present invention, the present invention further provides an electronic device, the electronic device comprising: a memory storing executable instructions; A processor is configured to execute the executable instructions in the memory to implement the method.

[0048] The foregoing description shows and describes several preferred embodiments of the present invention. However, as previously stated, it should be understood that the present invention is not limited to the form disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention can be used in various other combinations, modifications, and environments and can be modified within the scope of the application concept described herein by the teachings above or by techniques or knowledge in the relevant field. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention are intended to be protected by the appended claims.

Claims

1. A knowledge extraction method based on attention-adaptive vocabulary enhancement, characterized in that: The following steps are involved: S1. Process the input text and obtain the attention weight score; S2. Use the attention weight scores to predict the embedding matrix after the input text processing to obtain the start and end positions of the head entity and the start and end positions of the tail entity; S3. Determine the triples in the input text based on the predicted start and end positions of the head entity and the start and end positions of the tail entity; S4. Compare the determined triplet with the pre-calibrated triplet to verify the determined triplet.

2. The method according to claim 1, characterized in that The input file is a maintenance record of metallurgical equipment, which is recorded in Chinese text in sections.

3. The method according to claim 1, characterized in that The S1 includes: S11) After the input text is segmented into words or subwords, it is converted into a word embedding vector and an embedding matrix; S12) Perform a nonlinear transformation on each word embedding vector and map it to a high-dimensional feature space to obtain a vocabulary encoding vector; S13) Flattening the entire embedding matrix into a vector and performing dimensionality reduction to obtain a compressed vector representing the semantics of the text, i.e., the text encoding vector; S14) Perform a dot product calculation on the vocabulary encoding vector and the text encoding vector to obtain the attention weight score of each word in the overall context.

4. The method according to claim 3, characterized in that The S11 includes: S111) dividing the input text into a continuous string sequence, screening the string sequence to obtain a dictionary set V; S112) Convert the text sequence S and vocabulary set V into word vector outputs respectively and ; in, represents the embedding matrix of the vocabulary set V, , m represents the capacity of the vocabulary set V, represents the embedding direction of each word in the vocabulary, Embedding vectors for the vocabulary.

5. The method according to claim 4, characterized in that S12) specifically includes: using a feed-forward neural network FFN to embed the vocabulary set into a vector Perform nonlinear transformation and map it to high-dimensional feature space to obtain the vocabulary set encoding vector , the process can be expressed as: in, represents the encoding vector of the vocabulary set V, Represents the encoded vector representation of each word in the vocabulary.

6. The method according to claim 5, characterized in that S13) specifically includes: embedding the matrix After flattening to a vector, dimensionality reduction is performed to obtain a compressed vector representing the semantics of the text, namely the text encoding vector , the process is expressed as: in, and Represent the weight matrix and bias coefficient respectively, n represents the sequence length, and d represents the embedding matrix Dimensions, Function represents a flattening operation.

7. The method according to claim 6, characterized in that Said S14) specifically comprises: respectively encoding the vocabulary vectors With text encoding vector Perform dot product calculation to obtain the attention weight score of each word , the process is expressed as: Among them, the score is a scalar.

8. The method according to claim 1, characterized in that The S2 includes: S21) processing the embedding matrix using a feedforward neural network to obtain non-temporal features; S22) decoding the non-temporal feature and predicting all relationship types contained in the current text; S23) Processing the embedding matrix using a bidirectional long short-term memory network to obtain enhanced temporal features; S24) Using the attention weight coefficient to construct the influence factor of the head entity and the influence factor of the tail entity; S25) predicting the start and end positions of the head entity and the start and end positions of the tail entity according to the temporal features and the influence factor of the head entity and the influence factor of the tail entity.

9. A knowledge extraction device based on attention-adaptive vocabulary enhancement, characterized in that: The device is used to implement the method according to any one of claims 1 to 8, comprising: a processing module, used to process the input text to obtain an attention weight score; The prediction module is used to predict the embedding matrix after the input text is processed using the attention weight score to obtain the start and end positions of the head entity and the start and end positions of the tail entity; A determination module, which determines triples in the input text according to the predicted start and end positions of the head entity and the start and end positions of the tail entity; The verification module compares the determined triplet with the pre-calibrated triplet to verify the determined triplet.

10. An electronic device, characterized in that: The electronic device comprises: a memory storing executable instructions; A processor, wherein the processor runs the executable instructions in the memory to implement the method according to any one of claims 1 to 8.