Rail transit event extraction method fusing semantic features and local dependence features
By integrating semantic features and locally dependent features in rail transit event extraction, the problems of poor adaptability and low accuracy of traditional models in rail transit field are solved, and higher event extraction accuracy is achieved.
Patent Information
- Application Number
- CN202411977413.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The accuracy of the traditional event extraction model in the application of rail transit is mainly due to the fact that it simply relies on semantic features or local features and fails to make full use of all event information, resulting in poor adaptability and low accuracy.
Using the method of fusing semantic features and local dependency features, the local dependency information and semantic information of the event text data set are enhanced, and the fused feature vector is generated, and the CRF model is input for prediction to improve the accuracy of event extraction.
By fusion of semantic features and local dependency features, making full use of all the event information, the accuracy of event extraction is significantly improved, and the problems of poor adaptability and low accuracy of traditional models in the rail transit field are solved.
Smart Images

Figure CN119862877A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of rail transit engineering big data processing, and specifically relates to a rail transit event extraction method that integrates semantic features and local dependency features. Background Art
[0002] As rail transit projects continue to grow in complexity and scale, the number of design specifications, construction records, and technical documents is also increasing rapidly. These documents contain a large amount of valuable event information about project progress, construction methods, and safety measures. Accurately extracting this information is of great significance for future compliance inspections, risk assessment and management, and the construction of a cause-and-effect map, which can effectively improve the overall management level and safety assurance of the project.
[0003] In the field of rail transit engineering, event extraction technology is often used for information extraction. Traditional event extraction models such as BERT+BiLSTM+CRF and BERT+CRF show high accuracy on public data sets, but their accuracy has declined in actual applications in the field of rail transit. The reason is that traditional event extraction models simply rely on the semantic features or local features of events and fail to fully utilize all event information, making the model poorly adaptable in the field of rail transit. In addition, due to the lack of domain knowledge, the accuracy of event extraction is low. Summary of the invention
[0004] The purpose of the present invention is to provide a rail transit event extraction method that integrates semantic features and local dependency features, so as to solve the problem of low accuracy of traditional event extraction models in the prior art.
[0005] The technical solution adopted by the present invention is a rail transit event extraction method integrating semantic features and local dependency features, comprising the following steps: Step 1: Obtain the original design specification text and perform preprocessing to obtain the event text dataset; Step 2: Enhance the local dependency information of the event text dataset in step 1, and then obtain the enhanced local dependency features; Step 3: Enhance the semantic information of the event text dataset in step 1, and then obtain the enhanced semantic features; Step 4: Fuse the local dependency features enhanced in step 2 and the semantic features enhanced in step 3 to generate a fused feature vector; Step 5: Input the fused feature vector in step 4 into the CRF model for prediction, and evaluate the model performance through various evaluation indicators.
[0006] The present invention is also characterized in that: The specific process of step 1 is as follows: Step 1.1, obtain the original design specification text, the data comes from TB10413-2018 "Railway Track Engineering Construction Quality Acceptance Standard"; Step 1.2: clean the original design specification text in step 1.1, and filter the cleaned text; The data cleaning methods in step 1.2 include: Remove special characters and symbols irrelevant to the subject of the original design specification text, delete extra spaces and garbled characters in the original design specification text, identify and delete repeated sentences, useless sentences and erroneous sentences in the original design specification text, replace English symbols in the original design specification text with Chinese symbols; correct typos in the original design specification text; The specific process of data filtering in step 1.2 is as follows: Obtain the original design specification text after data cleaning, count the characters of each sentence corresponding to each period in the text, delete the sentences with more than 80 characters, and obtain the text after data filtering; Step 1.3, obtain the text after data filtering in step 1.2, and perform period segmentation processing according to each period in the text to obtain several sentences, which together constitute the event text data set; Step 1.4: Identify trigger words on the event text dataset in step 1.3 and obtain a trigger word list; The specific process of step 1.4 is as follows: Step 1.4.1, select words related to the field of rail transit technology to construct a trigger word dictionary; Step 1.4.2, using regular expressions to match the words in the trigger word dictionary in step 1.4.1 above as trigger words; Step 1.4.3: Use the word segmentation tool to segment the event text dataset in step 1.3, and use the pre-trained language model (BERT) to generate the contextual embedding representation of each word in the event. The specific formula is as follows: (1); in, Indicates the first i words; Expressive words Contextual embedding representation of ; Step 1.4.4: Combine the contextual embedding representation of each word in the event in 1.4.3, and use the cosine similarity method to calculate the similarity between the contextual embedding representation of each word in the event and the embedding representation of each trigger word in the dictionary. If the similarity is higher than the predetermined threshold, it is marked as a potential trigger word, otherwise it is marked as a non-trigger word. The specific calculation formula for the similarity is as follows: (2); in, and Respectively represent the contextual embedding representation of the word in the event and the contextual embedding representation of the word in the dictionary; || || represents the Euclidean norm of the embedding representation, that is, the length or modulus of the embedding representation; Step 1.4.5: Use the conditional random field (CRF) model to predict the events that have been judged by similarity in step 1.4.3, and parse the label sequence generated by the CRF model to obtain the final trigger word list; Step 1.5: Combine the trigger word list in step 1.4 and segment each event into trigger words to ensure that each event has only one trigger word. The specific process of step 1.5 is as follows: Step 1.5.1, count the number of trigger words in each event list in step 1.4; Step 1.5.2: Determine whether the number of trigger words in each event exceeds 1. If the number of trigger words is only 1, mark the event as a simple event. If the number of trigger words is greater than 1, mark the event as a complex event. Step 1.5.3: Combine step 1.5.2 to identify the position of the trigger word in the complex event, then use the tree structure analysis method to identify the master-slave structure of the complex event, and use the syntax analysis tool spaCy to split the complex event into multiple separate events, return to step 1.5.2 to continue to judge each separate event until each event has only one trigger word, and then proceed to the next step; Step 1.6, perform BIO annotation on the events segmented by trigger words in step 1.5 to obtain a BIO-annotated event text dataset; The specific process of BIO annotation in step 1.6 is as follows: Get the events segmented by trigger words in step 1.5, mark the starting position of each trigger word and argument in the event as BX, the subsequent position of each trigger word and argument as IX, and other words that do not belong to trigger words and arguments as O; Among them, in the marking of trigger words and arguments, if it is a trigger word, X is represented by V, and if it is an argument, X is represented by the specific type of the argument. The specific types of arguments include: OBJ, ADJ, ATTR, COND.
[0007] The specific process of step 2 is as follows: Step 2.1, obtain the event text dataset annotated by BIO in step 1, and identify the trigger words and arguments in each event; Step 2.2, extract the dependency relationship between the arguments in step 2.1; The specific process of step 2.2 is as follows: Select a dependency syntax parsing tool to perform dependency syntax analysis to obtain the syntax dependency information of the event text; Step 2.3: Construct a dependency graph based on the syntactic dependency information of the event text in step 2.2, and use the relational graph attention network (RGAT) to train the generated dependency graph to obtain node features. , edge features ; The specific process of step 2.3 is as follows: Step 2.3.1, construct a dependency graph based on the event structure information and the basic dependency relationship of the arguments in step 2.2, where each node of the dependency graph represents an argument, and each edge represents the dependency relationship between the arguments; Step 2.3.2: Construct the node features and edge features in the dependency graph. Specifically, use Word2Vec to encode each node to construct the node features, expressed as: (3); in, represents a d-dimensional vector; Is a node The vector representation of ; i represents the node number; The edge features are constructed based on the dependencies between nodes, and the dependencies are expressed as: (4); Where i represents the starting node of the dependency relationship; j represents the target node of the dependency relationship; Step 2.4: Use the DGL graph network framework to define the graph structure, build the RGAT model, and input the node features trained in step 2.3 and edge features RGAT model aggregates the features of neighbor nodes through the self-attention mechanism, captures the dependencies in events, and outputs enhanced local dependency features. , the specific calculation formula is: (5); in, Is a node i Local dependency feature representation of ; Is a node i The set of neighbor nodes of j Representation Node i Neighbor nodes; w is a learnable linear transformation matrix; is the self-attention weight, calculated as: (6); Among them, LeakReLU is the activation function; Represents a parameter vector for calculating attention weights; W is a linear transformation matrix; and are the features of nodes i and j respectively; and are the edge features of node i, node j and node k respectively; || means concatenating the vectors.
[0008] The specific process of step 3 is as follows: Step 3.1, obtain the event text dataset annotated by BIO in step 1, and enhance the semantic information of the event by adding measurement words to each event and mining new trigger words; The specific process of step 3.1 is as follows: Step 3.1.1: Use the density-based clustering algorithm (DBSCAN) to identify the correspondence between the measurement words and measurement units in the event through cluster analysis, and construct a dictionary of measurement words and measurement units, as follows: Extract measurement words and measurement units from the event text annotated by BIO in step 1, and use the term frequency-inverse document frequency (TF-IDF) algorithm to represent the extracted measurement words and measurement units. The TF-IDF formula is as follows: (7); in, is the frequency of word y in the document; DF(y) represents the number of documents containing word y; N is the total number of documents; Then, the DBSCAN algorithm is used to cluster the feature vectors. Specifically, the distance from each feature vector to its Kth nearest neighbor is calculated by drawing a K-distance graph, and these distances are arranged in ascending order. The neighborhood parameters are selected. The inflection point of the corresponding distance curve is taken as the optimal At the same time, set the minimum number of points minPts required to form a cluster, at point p Number of points in the neighborhood , as follows: (8); Among them, q is a point in the set, which is a neighbor of point p; if , then p is marked as a core point, and all core points and points in their neighborhood are grouped into the same cluster, that is, words with similar semantics are clustered into the same cluster, where words with similar semantics include measurement words and measurement units. After clustering, the corresponding relationship between measurement words and measurement units can be identified through each cluster, and then a dictionary of measurement words and measurement units can be constructed; Step 3.1.2: Use the Latent Dirichlet Algorithm (LDA) to mine new trigger words in the event. If the event after mining contains more than one trigger word, use the trigger word segmentation method in step 1.5 to ensure that each event has only one trigger word. The specific process of using the LDA algorithm to mine new trigger words in events is as follows: Use the LDA algorithm to analyze the topics contained in each event text, mine the high-frequency words in each topic, calculate the weight of the high-frequency words, and compare them with the set threshold. If the weight of the high-frequency word is greater than the threshold, then the word is set as a potential trigger word. Otherwise, other high-frequency words are judged. Finally, the topic text with more than one trigger word is segmented by trigger words to ensure that each topic text contains only one trigger word. The likelihood function formula of the LDA algorithm is as follows: (9); Among them, α is the topic distribution hyperparameter; β is the word distribution hyperparameter; event set The topic distribution and each theme k Word distribution in All are generated from Dirichlet distribution; It is i The first j The label of the word; It is i of the documents j words; It is i The number of words in a document; is the total number of events; θ i It is i The topic distribution of events; The weights of high-frequency words are calculated using the TF-IDF algorithm in step 3.1.1 above. The specific method for setting the threshold is as follows: Calculate the total number of words in each topic TF-IDF value, based on Distribution of TF-IDF values. Sort all words by weight from small to large and find The weight value corresponding to the 90% quantile in the TF-IDF value distribution is set as the threshold. The calculation formula is as follows: (10); in, It represents the probability of word y being generated given the topic k.
[0009] Step 3.2: Use the SBERT+BiLSTM model to encode the events with enhanced semantic information in step 3.1 and extract the enhanced semantic features; The specific process of step 3.2 is as follows: Use SBERT to transform the events with enhanced semantic information in step 3.1 into contextual embedding representations , and then use BiLSTM to process , the contextual embedding of the input sequence , as follows: (11); in, T Indicates the length of the event; is the SBERT embedding representation vector of each word; BiLSTM calculates the hidden state through two LSTM units, forward and backward. The forward and backward hidden state formulas of BiLSTM embed the input context for further processing by dynamically modeling context dependencies and extracting enhanced semantic features, as follows: (12) (13); Where t is the time step; and are the t-th hidden state of the forward and backward LSTM respectively; and Represents the forward and backward propagation parts of LSTM, where the input sequence is processed from beginning to end and from end to beginning according to the time step respectively; is the input embedding at time step t; and are the hidden states of the previous time step and the next time step respectively.
[0010] Then, the forward and backward hidden states are concatenated to obtain enhanced semantic features. , as follows: (14); in, .
[0011] The specific process of step 4 is as follows: For the local dependence features in step 2 and the semantic features in step 3 Perform weighted averaging and define a learnable weight parameter , whose value range is [0, 1], and then the optimal weight is learned through the Adam optimization algorithm, that is, the fused feature It can be expressed as: (15); in, It is the enhanced local dependency feature; is the enhanced semantic feature.
[0012] The specific process of step 5 is as follows: Step 5.1: Use CRF as the prediction model and input the features fused in step 4 , trained to predict the label of each word; (16); Step 5.2: During the training process in step 5.1, the CRF model uses the sequence cross entropy loss function to optimize the weights so that the predicted label sequence is consistent with the actual label sequence. The sequence cross entropy loss function is used to measure the difference between the predicted value and the true label. The formula of the cross entropy loss function is: (17); in, is the predicted category probability distribution; is the true label; M is the number of events.
[0013] The beneficial effects of the present invention are: The rail transit event extraction method of the present invention integrates semantic features and local dependency features, enhances the semantic information of events by supplementing measurement words and mining new trigger words, and at the same time, fully utilizes the local dependency features of events by constructing a dependency graph and an RGAT model. The effective integration of the two makes full use of all event information and effectively improves the accuracy of event extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is an overall flow chart of the rail transit event extraction method integrating semantic features and local dependency features of the present invention; Figure 2 It is a flow chart of data preprocessing in the rail transit event extraction method integrating semantic features and local dependency features of the present invention; Figure 3 It is a schematic diagram of a BIO annotation in the rail transit event extraction method integrating semantic features and local dependency features of the present invention; Figure 4 This is an example of an output result of the rail transit event extraction method that integrates semantic features and local dependency features of the present invention. DETAILED DESCRIPTION
[0015] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] The rail transit event extraction method of the present invention integrates semantic features and local dependency features, such as Figure 1 As shown, the specific steps are as follows: Step 1: Get the original design specification text and preprocess it, such as Figure 2 As shown, obtain the event text dataset; Step 1.1, obtain the original design specification text, the data comes from TB10413-2018 "Railway Track Engineering Construction Quality Acceptance Standard"; Step 1.2: clean the original design specification text in step 1.1, and filter the cleaned text; The data cleaning methods in step 1.2 include: Remove special characters and symbols that are not related to the subject of the original design specification text, delete extra spaces and garbled characters in the original design specification text, identify and delete repeated sentences, useless sentences and erroneous sentences in the original design specification text, replace English symbols in the original design specification text with Chinese symbols; for example: colon, semicolon, comma, etc., and correct typos in the original design specification text; The specific process of data filtering in step 1.2 is as follows: The original design specification text after data cleaning is obtained, and the characters of the sentences corresponding to each period in the text are counted. The sentences with more than 80 characters are deleted to obtain the text after data filtering.
[0017] Step 1.3, obtain the text after data filtering in step 1.2, and perform period segmentation processing according to each period in the text to obtain several sentences, which together constitute the event text data set; For example: The sentence "The rail type of the main line turnout should be consistent with the rail type of the adjacent section, and shall not be lower than the strength grade and material requirements of the rails in the adjacent section. The subway main line, auxiliary line and test line should use all kinds of turnouts no less than No. 9, and the throat area of the yard line should use all kinds of turnouts no larger than No. 7, and AT point rails, high manganese steel switch and adjustable guardrails should be used" can be split into "The rail type of the main line turnout should be consistent with the rail type of the adjacent section, and shall not be lower than the strength grade and material requirements of the rails in the adjacent section" and "The subway main line, auxiliary line and test line should use all kinds of turnouts no less than No. 9, and the throat area of the yard line should use all kinds of turnouts no larger than No. 7, and AT point rails, high manganese steel switch and adjustable guardrails should be used".
[0018] Step 1.4: Identify trigger words on the event text dataset in step 1.3 and obtain a trigger word list; The specific process of step 1.4 is as follows: Step 1.4.1, select words related to the field of rail transit technology to construct a trigger word dictionary; for example: "sampling", "retain", "inspect", "sawing", "paving", "conduct" and other words.
[0019] Step 1.4.2, using regular expressions to match the words in the trigger word dictionary in step 1.4.1 above as trigger words; Step 1.4.3: Use the word segmentation tool to segment the event text dataset in step 1.3, and use the pre-trained language model (BERT) to generate the contextual embedding representation of each word in the event. The specific formula is as follows: (1); in, Indicates the first i words; Expressive words Contextual embedding representation of ; The word segmentation tool adopts a Chinese word segmentation tool based on a dictionary and a statistical method, such as the Jieba word segmentation tool.
[0020] Step 1.4.4: Combine the contextual embedding representation of each word in the event in 1.4.3, and use the cosine similarity method to calculate the similarity between the contextual embedding representation of each word in the event and the embedding representation of each trigger word in the dictionary. If the similarity is higher than the predetermined threshold, it is marked as a potential trigger word, otherwise it is marked as a non-trigger word. The specific calculation formula for the similarity is as follows: (2); in, and Respectively represent the contextual embedding representation of the word in the event and the contextual embedding representation of the word in the dictionary; || || represents the Euclidean norm of the embedding representation, that is, the length or modulus of the embedding representation; Step 1.4.5: Use the conditional random field (CRF) model to predict the events that have been judged by similarity in step 1.4.3, and parse the label sequence generated by the CRF model to obtain the final trigger word list; Step 1.5: Combine the trigger word list in step 1.4 and segment each event into trigger words to ensure that each event has only one trigger word. The specific process is as follows: Step 1.5.1, count the number of trigger words in each event list in step 1.4; Step 1.5.2: Determine whether the number of trigger words in each event exceeds 1. If the number of trigger words is only 1, mark the event as a simple event. If the number of trigger words is greater than 1, mark the event as a complex event. Step 1.5.3: Combine step 1.5.2 to identify the position of the trigger word in the complex event, then use the tree structure analysis method to identify the master-slave structure of the complex event, and use the syntax analysis tool spaCy to split the complex event into multiple separate events, return to step 1.5.2 to continue to judge each separate event until each event has only one trigger word, and then proceed to the next step; For example: the trigger word for the event "Construction units shall randomly check 10 welds per row or 10km" is "spot check"; the trigger word for the event "Truss reinforcement shall not be twisted, deformed, open or loose" is "shall not"; the trigger word for the event "Pre-laid ballast surface shall be 50mm higher than the abutment retaining wall" is "higher than"; the trigger word for the event "Concrete pouring construction and maintenance shall comply with the relevant provisions of Articles 6.4.2 to 6.4.8 of the "Railway Concrete Engineering Construction Quality Acceptance Standard" TB10424-2018" is "comply with".
[0021] Step 1.6, perform BIO annotation on the events segmented by trigger words in step 1.5 to obtain a BIO-annotated event text dataset; The specific process of BIO annotation in step 1.6 is as follows: Get the events segmented by trigger words in step 1.5, mark the starting position of each trigger word and argument in the event as BX, the subsequent position of each trigger word and argument as IX, and other words that do not belong to trigger words and arguments as O, for example: "The pre-ballasted surface should be 50mm higher than the abutment retaining wall". In this sentence, "pre-ballasted surface" is the subject, "pre" is the starting position, and "ballasted surface" is the subsequent position; Among them, after the event trigger word is identified, the vocabulary related to the trigger word is found out through dependency syntactic analysis, which is the argument; in the marking of the trigger word and the argument, if it is a trigger word, X is represented by V, and if it is an argument, X is represented by the specific type of the argument. The specific types of arguments include: subject (OBJ), adjective (ADJ), object (ATTR), and condition (COND).
[0022] like Figure 3 The figure shows an example of BIO annotation for the sentence "When the line is locked, the difference between the highest and lowest actual locked rail temperatures of the unit rail section in the same section shall not be greater than 10°C." The figure shows the annotation results of the trigger words, arguments, and other words that are not trigger words and arguments in this example.
[0023] Step 2: Enhance the local dependency information of the event text dataset in step 1, and then obtain the enhanced local dependency features; Step 2.1, obtain the event text dataset annotated by BIO in step 1, and identify the trigger words and arguments in each event; Step 2.2, extract the dependency relationship between the arguments in step 2.1; The specific process of step 2.2 is as follows: Select a dependency syntax parsing tool, perform dependency syntax analysis, and obtain syntax dependency information; for example: select the parsing tool Stanford Parser, then download the software Stanford CoreNLP and Java, install and start the StanfordCoreNLP server, submit the event text and send a request, perform dependency syntax analysis, and the parsing result of the Stanford CoreNLP server is returned in JSON format, where the parsing result includes the syntax dependency information of the event text; each dependency relationship indicates the dependency of a dependent word with another subject word, for example: for the event "The protection of track components should be strengthened during the construction of ballastless trackbed", "strengthen" depends on "ballastless trackbed", "during construction" depends on "ballastless trackbed", "track components" depends on "protection", and "protection" depends on "strengthen".
[0024] Step 2.3: Construct a dependency graph based on the syntactic dependency information of the event text in step 2.2, and use the relational graph attention network (RGAT) to train the generated dependency graph to obtain node features. , edge features ; The specific process of step 2.3 is as follows: Step 2.3.1, construct a dependency graph based on the event structure information and the basic dependency relationship of the arguments in step 2.2, where each node of the dependency graph represents an argument, and each edge represents the dependency relationship between the arguments; Step 2.3.2: Construct node features and edge features in the dependency graph. Specifically, use the context window-based distributed word embedding method (Word2Vec) to encode each node and construct node features, expressed as: (3) in, represents a d-dimensional vector; yes The vector representation of ; i represents the node number; The edge features are constructed based on the dependencies between nodes, and the dependencies are expressed as: (4); Where i represents the starting node of the dependency relationship; j represents the target node of the dependency relationship; Step 2.4: Use the DGL graph network framework to define the graph structure, build the RGAT model, and input the node features trained in step 2.3 and edge features The RGAT model aggregates the features of neighbor nodes through the self-attention mechanism. The features of neighbor nodes contain the dependency information that affects the target node in the event, captures the dependency relationship in the event, and outputs the enhanced local dependency features. , the specific calculation formula is: (5); in, Is a node i The set of neighbor nodes of node i; j represents the neighbor node of node i; W is a learnable linear transformation matrix; is the self-attention weight, calculated as: (6); Among them, LeakReLU is the activation function; Represents a parameter vector for calculating attention weights; W is a linear transformation matrix; and are the features of nodes i and j respectively; and are the edge features of node i, node j and node k respectively; || means concatenating the vectors.
[0025] Step 3: Enhance the semantic information of the event text dataset in step 1, and then obtain the enhanced semantic features; Step 3.1, obtain the event text dataset annotated by BIO in step 1, and enhance the semantic information of the event by adding measurement words to each event and mining new trigger words; The specific process of step 3.1 is as follows: Step 3.1.1: Use the density-based clustering algorithm (DBSCAN) to identify the correspondence between the measurement words and measurement units in the event through cluster analysis, and construct a dictionary of measurement words and measurement units, as follows: Extract measurement words and measurement units from the event text annotated by BIO in step 1, and use the term frequency-inverse document frequency (TF-IDF) algorithm to represent the extracted measurement words and measurement units. The TF-IDF formula is as follows: (7); Among them, TF(y) is the frequency of word y in the document; DF(y) represents the number of documents containing word y; N is the total number of documents; Then, the DBSCAN algorithm is used to cluster the feature vectors. Specifically, the distance from each feature vector to its Kth nearest neighbor is calculated by drawing a K-distance graph, and these distances are arranged in ascending order. The neighborhood parameters are selected. The inflection point of the corresponding distance curve is taken as the optimal At the same time, the minimum number of points minPts required to form a cluster is set. For example, the minimum number of points minPts required to form a cluster is set to 4 to ensure a reasonable cluster density and reduce the misjudgment of noise points. The number of points in the neighborhood of point p is , as follows: (8); Among them, q is a point in the set, which is a neighbor of point p; if , then p is marked as a core point, and all core points and points in their neighborhood are grouped into the same cluster, that is, words with similar semantics are grouped into the same cluster, where words with similar semantics include measurement words and measurement units; after clustering, the corresponding relationship between measurement words and measurement units is identified through each cluster, and then a dictionary of measurement words and measurement units is constructed; For example, a part of the dictionary may include: the measurement words "length", "height" and "distance" correspond to "meter", and the measurement word "temperature" corresponds to "℃". In addition, for events that only contain measurement units but lack clear measurement words, the corresponding measurement words are supplemented to the events in combination with the context and the dictionary of measurement words and measurement units, so as to more comprehensively express the quantitative information of the event. For example, in the event "For lines with a design speed of less than 120km / h, small-scale machinery can be used to lay ballasted and level the track to about 50mm below the rail surface, and large-scale maintenance machinery should be used for leveling operations", the missing measurement word should be "height". After supplementation, the sentence can be modified to: "For lines with a design speed of less than 120km / h, small-scale machinery can be used to lay ballasted and level the track to about 50mm below the rail surface, and large-scale maintenance machinery should be used for leveling operations".
[0026] Step 3.1.2: Use the Latent Dirichlet Algorithm (LDA) to mine new trigger words in the event. If the event after mining contains more than one trigger word, use the trigger word segmentation method in step 1.5 to ensure that all events have only one trigger word. The specific process of using the LDA algorithm to mine new trigger words in events is as follows: Use the LDA algorithm to analyze the topics contained in each event text, mine the high-frequency words in each topic, calculate the weight of the high-frequency words, and compare them with the set threshold. If the weight of the high-frequency word is greater than the threshold, then the word is set as a potential trigger word. Otherwise, other high-frequency words are judged. Finally, the topic text with more than one trigger word is segmented by trigger words to ensure that each topic text contains only one trigger word. Among them, using the likelihood function formula of LDA, the hidden semantic structure and vocabulary distribution in the text can be discovered by maximizing the probability distribution between documents and topics. By identifying the words with high frequencies within a topic, potential trigger words for event extraction can be provided. The likelihood function formula of the LDA algorithm is as follows: (9); Among them, α is the hyperparameter of the topic distribution; β is the hyperparameter of the word distribution; the topic distribution of the event set and the word distribution in each topic are both generated from the Dirichlet distribution; k is the label of the th word in the th event; i is the j th word in the th document; is the i number of words in the th document; N is the total number of events; θ i is the topic distribution of the th event;
[0027] For example, for the sentence: "For lines with a design speed of less than 120 km / h, when the ballast paving and track leveling are carried out manually in cooperation with small machinery to a height about 50 mm below the rail surface, large track maintenance machinery should be used for track leveling operations", the measurement words have been supplemented in step 3.1.1. Then, in step 3.1.2, by mining new trigger words, a new trigger word "for" is identified. After adding it, there are two trigger words in this event: "for" and "carry out". Therefore, it is necessary to use step 1.4 to divide it into multiple simple events, namely: "For lines with a design speed of less than 120 km / h, the ballast paving and track leveling can be carried out manually in cooperation with small machinery to a height of about 50 mm below the rail surface" and "When the ballast paving and track leveling are carried out to a height of about 50 mm below the rail surface by small machinery, large track maintenance machinery should be used for track leveling operations". The weights of high-frequency words are calculated by the TF-IDF algorithm in step 3.1.1 above. The specific method for setting the threshold is as follows: Calculate the ·TF-IDF values of all the words in each topic. According to the ·TF-IDF value distribution, sort the weight values of all the words from small to large, and find the weight value corresponding to the 90th percentile in the ·TF-IDF value distribution. Set the weight value corresponding to the 90th percentile as the threshold. The specific formula of (10); Among them, It represents the probability of word y being generated given the topic k.
[0028] Step 3.2: Use the SBERT+BiLSTM model to encode the events with enhanced semantic information in step 3.1 and extract the enhanced semantic features; The specific process of step 3.2 is as follows: Use SBERT to transform the events with enhanced semantic information in step 3.1 into contextual embedding representations , and then use BiLSTM to process , the contextual embedding of the input sequence , as follows: (11); in, T Indicates the length of the event; is the SBERT embedding representation vector of each word; BiLSTM calculates the hidden state through two LSTM units, forward and backward. The forward and backward hidden state formulas of BiLSTM embed the input context for further processing by dynamically modeling context dependencies and extracting enhanced semantic features, as follows: (12) (13); Where t is the time step; and are the t-th hidden state of the forward and backward LSTM respectively; and Represents the forward and backward propagation parts of LSTM, where the input sequence is processed from beginning to end and from end to beginning according to the time step respectively; is the input embedding at time step t; and are the hidden states of the previous time step and the next time step respectively.
[0029] Then, the forward and backward hidden states are concatenated to obtain enhanced semantic features. , as follows: (14); in, ; Step 4: Fuse the enhanced local dependency features in step 2 and the enhanced semantic features in step 3 to generate a fused feature vector. The semantic information of the event is enhanced by supplementing the measurement words and mining new trigger words. At the same time, the local dependency features of the event are fully utilized by constructing the dependency graph and the RGAT model. The effective fusion of the two makes full use of all the information of the event and effectively improves the accuracy of event extraction. The specific process of step 4 is as follows: For the local dependence features in step 2 and the semantic features in step 3 Perform weighted averaging and define a learnable weight parameter , whose value range is [0, 1], and then the optimal weight is learned through the Adam optimization algorithm, that is, the fused feature It can be expressed as: (15); in, It is the enhanced local dependency feature; is the enhanced semantic feature.
[0030] Step 5: Input the fused feature vector in step 4 into the CRF model for prediction, and evaluate the model performance through various evaluation indicators.
[0031] The specific process of step 5 is as follows: Step 5.1: Use CRF as the prediction model and input the features fused in step 4 , trained to predict the label of each word; (16); Step 5.2: During the training process in step 5.1, the CRF model uses the sequence cross entropy loss function to optimize the weights so that the predicted label sequence is consistent with the actual label sequence. The sequence cross entropy loss function is used to measure the difference between the predicted value and the true label. The formula of the cross entropy loss function is: (17); in, is the predicted category probability distribution; is the true label; M is the number of events.
[0032] For example: for the event "When the line is locked, the difference between the highest and lowest actual locked rail temperatures of the unit rail section in the same section shall not be greater than 10°C", such as Figure 4 The final output result is shown in Figure 2.
[0033] The specific embodiment of the rail transit event extraction method integrating semantic features and local dependency features of the present invention is as follows: Example 1 The rail transit event extraction method integrating semantic features and local dependency features includes the following steps: Step 1: Obtain the original design specification text and perform preprocessing to obtain the event text dataset; Step 2: Enhance the local dependency information of the event text dataset in step 1, and then obtain the enhanced local dependency features; Step 3: Enhance the semantic information of the event text dataset in step 1, and then obtain the enhanced semantic features; Step 4: Fuse the local dependency features enhanced in step 2 and the semantic features enhanced in step 3 to generate a fused feature vector; Step 5: Input the fused feature vector in step 4 into the CRF model for prediction, and evaluate the model performance through various evaluation indicators.
[0034] Example 2 Based on the above embodiment 1, this embodiment discloses the specific process of step 1, and the specific process of step 1 is as follows: Step 1.1, obtain the original design specification text, the data comes from TB10413-2018 "Railway Track Engineering Construction Quality Acceptance Standard"; Step 1.2: clean the original design specification text in step 1.1, and filter the cleaned text; The data cleaning methods in step 1.2 include: Remove special characters and symbols irrelevant to the subject of the original design specification text, delete extra spaces and garbled characters in the original design specification text, identify and delete repeated sentences, useless sentences and erroneous sentences in the original design specification text, replace English symbols in the original design specification text with Chinese symbols; correct typos in the original design specification text; The specific process of data filtering in step 1.2 is as follows: Obtain the original design specification text after data cleaning, count the characters of each sentence corresponding to each period in the text, delete the sentences with more than 80 characters, and obtain the text after data filtering; Step 1.3, obtain the text after data filtering in step 1.2, and perform period segmentation processing according to each period in the text to obtain several sentences, which together constitute the event text data set; Step 1.4: Identify trigger words on the event text dataset in step 1.3 and obtain a trigger word list; The specific process of step 1.4 is as follows: Step 1.4.1, select words related to the field of rail transit technology to construct a trigger word dictionary; Step 1.4.2, using regular expressions to match the words in the trigger word dictionary in step 1.4.1 above as trigger words; Step 1.4.3: Use the word segmentation tool to segment the event text dataset in step 1.3, and use BERT to generate the contextual embedding representation of each word in the event. The specific formula is as follows: (1); in, Indicates the first i words; Expressive words Contextual embedding representation of ; Step 1.4.4: Combine the contextual embedding representation of each word in the event in 1.4.3, and use the cosine similarity method to calculate the similarity between the contextual embedding representation of each word in the event and the embedding representation of each trigger word in the dictionary. If the similarity is higher than the predetermined threshold, it is marked as a potential trigger word, otherwise it is marked as a non-trigger word. The specific calculation formula for the similarity is as follows: (2); in, and Respectively represent the contextual embedding representation of the word in the event and the contextual embedding representation of the word in the dictionary; || || represents the Euclidean norm of the embedding representation, that is, the length or modulus of the embedding representation; Step 1.4.5: Use the CRF model to predict the events that have been judged by similarity in step 1.4.3, and parse the label sequence generated by the CRF model to obtain the final trigger word list; Step 1.5: Combine the trigger word list in step 1.4 and segment each event into trigger words to ensure that each event has only one trigger word. The specific process of step 1.5 is as follows: Step 1.5.1, count the number of trigger words in each event list in step 1.4; Step 1.5.2: Determine whether the number of trigger words in each event exceeds 1. If the number of trigger words is only 1, mark the event as a simple event. If the number of trigger words is greater than 1, mark the event as a complex event. Step 1.5.3: Combine step 1.5.2 to identify the position of the trigger word in the complex event, then use the tree structure analysis method to identify the master-slave structure of the complex event, and use the syntax analysis tool spaCy to split the complex event into multiple separate events, return to step 1.5.2 to continue to judge each separate event until each event has only one trigger word, and then proceed to the next step; Step 1.6, perform BIO annotation on the events segmented by trigger words in step 1.5 to obtain a BIO-annotated event text dataset; The specific process of BIO annotation in step 1.6 is as follows: Get the events segmented by trigger words in step 1.5, mark the starting position of each trigger word and argument in the event as BX, the subsequent position of each trigger word and argument as IX, and other words that do not belong to trigger words and arguments as O; Among them, in the marking of trigger words and arguments, if it is a trigger word, X is represented by V, and if it is an argument, X is represented by the specific type of the argument. The specific types of arguments include: OBJ, ADJ, ATTR, COND.
[0035] Example 3 Based on the above-mentioned embodiment 2, this embodiment discloses the specific process of step 2, and the specific process of step 2 is as follows: Step 2.1, obtain the event text dataset annotated by BIO in step 1, and identify the trigger words and arguments in each event; Step 2.2: Extract the dependency relationship between the arguments in step 2.1 through the parsing tool Stanford Parser; The specific process of step 2.2 is as follows: Download the software Stanford CoreNLP and Java, install and start the Stanford CoreNLP server, submit the event text and send a request to perform dependency syntactic analysis. The Stanford CoreNLP server returns the parsing results in JSON format, including the syntactic dependency information of the event text. Step 2.3: Construct a dependency graph based on the syntactic dependency information of the event text in step 2.2, and use RGAT to train the generated dependency graph to obtain node features. , edge features ; The specific process of step 2.3 is as follows: Step 2.3.1, construct a dependency graph based on the event structure information and the basic dependency relationship of the arguments in step 2.2, where each node of the dependency graph represents an argument, and each edge represents the dependency relationship between the arguments; Step 2.3.2: Construct the node features and edge features in the dependency graph. Specifically, use Word2Vec to encode each node to construct the node features, expressed as: (3); in, represents a d-dimensional vector; Is a node The vector representation of ; i represents the node number; The edge features are constructed based on the dependencies between nodes, and the dependencies are expressed as: (4); Where i represents the starting node of the dependency relationship; j represents the target node of the dependency relationship; Step 2.4: Use the DGL graph network framework to define the graph structure, build the RGAT model, and input the node features trained in step 2.3 and edge features RGAT model aggregates the features of neighbor nodes through the self-attention mechanism, captures the dependencies in events, and outputs enhanced local dependency features. , the specific calculation formula is: (5); in, Is a node i The set of neighbor nodes of node i; j represents the neighbor node of node i; w is a learnable linear transformation matrix; is the self-attention weight, calculated as: (6); Among them, LeakReLU is the activation function; Represents a parameter vector for calculating attention weights; W is a linear transformation matrix; and are the features of nodes i and j respectively; and are the edge features of node i, node j and node k respectively; || means concatenating the vectors.
[0036] Example 4 Based on the above embodiment 3, this embodiment discloses the specific process of step 3, which is as follows: Step 3.1, obtain the event text dataset annotated by BIO in step 1, and enhance the semantic information of the event by adding measurement words to each event and mining new trigger words; The specific process of step 3.1 is as follows: Step 3.1.1: Use the DBSCAN clustering algorithm to identify the correspondence between the measurement words and measurement units in the event through cluster analysis, and construct a dictionary of measurement words and measurement units, as follows: In step 1, extract the measurement words and measurement units from the event text annotated by BIO, and use the TF-IDF algorithm to represent the extracted measurement words and measurement units. The TF-IDF formula is as follows: (7); in, is the frequency of word y in the document; DF(y) represents the number of documents containing word y; N is the total number of documents; Then, the DBSCAN algorithm is used to cluster the feature vectors. Specifically, the distance from each feature vector to its Kth nearest neighbor is calculated by drawing a K-distance graph, and these distances are arranged in ascending order. The neighborhood parameters are selected. The inflection point of the corresponding distance curve is taken as the optimal At the same time, the minimum number of points required to form a cluster, minPts, is set to 4 to ensure a reasonable cluster density and reduce the misjudgment of noise points. Number of points in the neighborhood , as follows: (8); Among them, q is a point in the set, which is a neighbor of point p; if , then p is marked as a core point, and all core points and points in their neighborhood are grouped into the same cluster, that is, words with similar semantics are clustered into the same cluster, where words with similar semantics include measurement words and measurement units. After clustering, the corresponding relationship between measurement words and measurement units can be identified through each cluster, and then a dictionary of measurement words and measurement units can be constructed; Step 3.1.2: Use the LDA algorithm to mine new trigger words in the event. If the mined event contains more than one trigger word, use the trigger word segmentation method in step 1.5 to ensure that all events have only one trigger word. The specific process of using the LDA algorithm to mine new trigger words in events is as follows: Use the LDA algorithm to analyze the topics contained in each event text, mine the high-frequency words in each topic, calculate the weight of the high-frequency words, and compare them with the set threshold. If the weight of the high-frequency word is greater than the threshold, then the word is set as a potential trigger word. Otherwise, other high-frequency words are judged. Finally, the topic text with more than one trigger word is segmented by trigger words to ensure that each topic text contains only one trigger word. The likelihood function formula of the LDA algorithm is as follows: (9); Among them, α is the topic distribution hyperparameter; β is the word distribution hyperparameter; event set The topic distribution and each theme k Word distribution in All are generated from Dirichlet distribution; It is i The first j The label of the word; It is i of the documents j words; It is i The number of words in a document; is the total number of events; θ i is the topic distribution of the i-th event; The weights of high-frequency words are calculated using the TF-IDF algorithm in step 3.1.1 above. The specific method for setting the threshold is as follows: Calculate the total number of words in each topic TF-IDF value, based on Distribution of TF-IDF values. Sort all words by weight from small to large and find The weight value corresponding to the 90% quantile in the TF-IDF value distribution is set as the threshold. The calculation formula is as follows: (10); in, It represents the probability of word y being generated given the topic k.
[0037] Step 3.2: Use the SBERT+BiLSTM model to encode the events with enhanced semantic information in step 3.1 and extract the enhanced semantic features; The specific process of step 3.2 is as follows: Use SBERT to transform the events with enhanced semantic information in step 3.1 into contextual embedding representations , and then use BiLSTM to process , the contextual embedding of the input sequence , as follows: (11); in, T Indicates the length of the event; is the SBERT embedding representation vector of each word; BiLSTM calculates the hidden state through two LSTM units, forward and backward. The forward and backward hidden state formulas of BiLSTM embed the input context for further processing by dynamically modeling context dependencies, and extract enhanced semantic features. This feature can better capture the context information of the event and provide higher quality semantic input for subsequent event extraction, as follows: (12) (13); Where t is the time step; and are the t-th hidden state of the forward and backward LSTM respectively; and Represents the forward and backward propagation parts of LSTM, where the input sequence is processed from beginning to end and from end to beginning according to the time step respectively; is the input embedding at time step t; and are the hidden states of the previous time step and the next time step respectively.
[0038] Then, the forward and backward hidden states are concatenated to obtain enhanced semantic features. , as follows: (14); in, .
[0039] Example 5 Based on the above-mentioned embodiment 4, this embodiment further discloses the specific process of step 4, and the specific process of step 4 is as follows: For the local dependence features in step 2 and the semantic features in step 3 Perform weighted averaging and define a learnable weight parameter , whose value range is [0, 1], and then the optimal weight is learned through the Adam optimization algorithm, that is, the fused feature It can be expressed as: (15); in, It is the enhanced local dependency feature; is the enhanced semantic feature.
[0040] Example 6 Based on the above embodiment 5, this embodiment further discloses the specific process of step 5, and the specific process of step 5 is as follows: The specific process of step 5 is as follows: Step 5.1: Use CRF as the prediction model and input the features fused in step 4 , trained to predict the label of each word; (16); Step 5.2: During the training process in step 5.1, the CRF model uses the sequence cross entropy loss function to optimize the weights so that the predicted label sequence is consistent with the actual label sequence. The sequence cross entropy loss function is used to measure the difference between the predicted value and the true label. The formula of the cross entropy loss function is: (17); in, is the predicted category probability distribution; is the true label; M is the number of events.
Claims
1. A rail transit event extraction method integrating semantic features and local dependency features, characterized in that: The following steps are involved: Step 1: Obtain the original design specification text and perform preprocessing to obtain the event text dataset; Step 2: Enhance the local dependency information of the event text dataset in step 1, and then obtain the enhanced local dependency features; Step 3: Enhance the semantic information of the event text dataset in step 1, and then obtain the enhanced semantic features; Step 4: Fuse the local dependency features enhanced in step 2 and the semantic features enhanced in step 3 to generate a fused feature vector; Step 5: Input the fused feature vector in step 4 into the CRF model for prediction, and evaluate the model performance through various evaluation indicators.
2. The rail transit event extraction method integrating semantic features and local dependency features according to claim 1 is characterized in that: The specific process of step 1 is as follows: Step 1.1, obtain the original design specification text, the data comes from TB10413-2018 "Railway Track Engineering Construction Quality Acceptance Standard"; Step 1.2: clean the original design specification text in step 1.1, and filter the cleaned text; The data cleaning methods described in step 1.2 include: Remove special characters and symbols irrelevant to the subject of the original design specification text, delete extra spaces and garbled characters in the original design specification text, identify and delete repeated sentences, useless sentences and erroneous sentences in the original design specification text, replace English symbols in the original design specification text with Chinese symbols; correct typos in the original design specification text; The specific process of data filtering described in step 1.2 is as follows: Obtain the original design specification text after data cleaning, count the characters of each sentence corresponding to each period in the text, delete the sentences with more than 80 characters, and obtain the text after data filtering; Step 1.3, obtain the text after data filtering in step 1.2, and perform period segmentation processing according to each period in the text to obtain several sentences, which together constitute the event text data set; Step 1.4: Identify trigger words on the event text dataset in step 1.3 and obtain a trigger word list; Step 1.5: Combine the trigger word list in step 1.4 and segment each event into trigger words to ensure that each event has only one trigger word. Step 1.6, perform BIO annotation on the events segmented by trigger words in step 1.5 to obtain a BIO-annotated event text dataset; The specific process of BIO annotation described in step 1.6 is as follows: Get the events segmented by trigger words in step 1.5, mark the starting position of each trigger word and argument in the event as BX, the subsequent position of each trigger word and argument as IX, and other words that do not belong to trigger words and arguments as O; Among them, in the marking of trigger words and arguments, if it is a trigger word, X is represented by V, and if it is an argument, X is represented by the specific type of the argument, and the specific types of the argument include: OBJ, ADJ, ATTR, COND.
3. The rail transit event extraction method integrating semantic features and local dependency features according to claim 2 is characterized in that: The specific process of step 1.4 is as follows: Step 1.4.1, select words related to the field of rail transit technology to construct a trigger word dictionary; Step 1.4.2, using regular expressions to match the words in the trigger word dictionary in step 1.4.1 above as trigger words; Step 1.4.3: Use the word segmentation tool to segment the event text dataset in step 1.3, and use the pre-trained language model (BERT) to generate the contextual embedding representation of each word in the event. The specific formula is as follows: (1) in, Indicates the first i words; Expressive words Contextual embedding representation of ; Step 1.4.4: Combine the contextual embedding representation of each word in the event in 1.4.3, and use the cosine similarity method to calculate the similarity between the contextual embedding representation of each word in the event and the embedding representation of each trigger word in the dictionary. If the similarity is higher than the predetermined threshold, it is marked as a potential trigger word, otherwise it is marked as a non-trigger word. The specific calculation formula for the similarity is as follows: (2) in, and Respectively represent the contextual embedding representation of the word in the event and the contextual embedding representation of the word in the dictionary; || || represents the Euclidean norm of the embedding representation, that is, the length or modulus of the embedding representation; Step 1.4.5: Use the CRF model to predict the events that have been judged by similarity in step 1.4.3, and parse the label sequence generated by the CRF model to obtain the final trigger word list.
4. The rail transit event extraction method integrating semantic features and local dependency features according to claim 2 is characterized in that: The specific process of step 1.5 is as follows: Step 1.5.1, count the number of trigger words in each event list in step 1.4; Step 1.5.2: Determine whether the number of trigger words in each event exceeds 1. If the number of trigger words is only 1, mark the event as a simple event. If the number of trigger words is greater than 1, mark the event as a complex event. Step 1.5.3: Combine step 1.5.2 to identify the position of the trigger word in the complex event, then use the tree structure analysis method to identify the master-slave structure of the complex event, and use the syntactic analysis tool spaCy to split the complex event into multiple separate events, return to step 1.5.2 to continue judging each separate event until each event has only one trigger word, and then proceed to the next step.
5. The rail transit event extraction method integrating semantic features and local dependency features according to claim 1 is characterized in that: The specific process of step 2 is as follows: Step 2.1, obtain the event text dataset annotated by BIO in step 1, and identify the trigger words and arguments in each event; Step 2.2, extract the dependency relationship between the arguments in step 2.1; The specific process of step 2.2 is as follows: Select a dependency syntax parsing tool to perform dependency syntax analysis to obtain the syntactic dependency information of the event text; Step 2.3: Construct a dependency graph based on the syntactic dependency information of the event text in step 2.2, and use RGAT to train the generated dependency graph to obtain node features. , edge features ; The specific process of step 2.3 is as follows: Step 2.3.1, construct a dependency graph based on the event structure information and the basic dependency relationship of the arguments in step 2.2, where each node of the dependency graph represents an argument, and each edge represents the dependency relationship between the arguments; Step 2.3.2: Construct the node features and edge features in the dependency graph. Specifically, use Word2Vec to encode each node to construct the node features, expressed as: (3) in; represents a d-dimensional vector; Is a node The vector representation of ; i represents the node number; The edge feature is constructed according to the dependency relationship between nodes, and the dependency relationship is expressed as: (4) Where i represents the starting node of the dependency relationship; j represents the target node of the dependency relationship; Step 2.4: Use the DGL graph network framework to define the graph structure, build the RGAT model, and input the node features trained in step 2.3 and edge features RGAT model aggregates the features of neighbor nodes through the self-attention mechanism, captures the dependencies in events, and outputs enhanced local dependency features. , the specific calculation formula is: (5) in, Is a node i The set of neighbor nodes of node i; j represents the neighbor node of node i; w is a learnable linear transformation matrix; is the self-attention weight, calculated as: (6) Among them, LeakReLU is the activation function; Represents a parameter vector for calculating attention weights; W is a linear transformation matrix; and are the features of nodes i and j respectively; and are the edge features of node i, node j and node k respectively; || means concatenating the vectors.
6. The rail transit event extraction method integrating semantic features and local dependency features according to claim 1 is characterized in that: The specific process of step 3 is as follows: Step 3.1: Obtain the event text dataset annotated by BIO in step 1, and enhance the semantic information of the event by adding measurement words to each event and mining new trigger words. The specific process is as follows: Step 3.1.1: Use the DBSCAN clustering algorithm to identify the correspondence between the measurement words and measurement units in the event through cluster analysis, and construct a dictionary of measurement words and measurement units, as follows: In step 1, extract the measurement words and measurement units from the event text annotated by BIO, and use the TF-IDF algorithm to represent the extracted measurement words and measurement units. The TF-IDF formula is as follows: (7) in, is the frequency of word y in the document; DF(y) represents the number of documents containing word y, and N is the total number of documents; Then, the DBSCAN algorithm is used to cluster the feature vectors. Specifically, the distance from each feature vector to its Kth nearest neighbor is calculated by drawing a K-distance graph, and these distances are arranged in ascending order. The neighborhood parameters are selected. The inflection point of the corresponding distance curve is taken as the optimal At the same time, set the minimum number of points minPts required to form a cluster, at point p Number of points in the neighborhood , as follows: (8) Among them, q is a point in the set, which is a neighbor of point p; if , then p is marked as a core point, and all core points and points in their neighborhood are grouped into the same cluster, that is, words with similar semantics are grouped into the same cluster, where words with similar semantics include measurement words and measurement units. After clustering is completed, the corresponding relationship between measurement words and measurement units is identified through each cluster, and then a dictionary of measurement words and measurement units is constructed; Step 3.1.2: Use the LDA algorithm to mine new trigger words in the event. If the event after mining contains more than one trigger word, use the trigger word segmentation method in step 1.5 to ensure that each event has only one trigger word. The specific process of using the LDA algorithm to mine new trigger words in an event is as follows: Use the LDA algorithm to analyze the topics contained in each event text, mine the high-frequency words in each topic, calculate the weight of the high-frequency words, and compare them with the set threshold. If the weight of the high-frequency word is greater than the threshold, then the word is set as a potential trigger word. Otherwise, other high-frequency words are judged. Finally, the topic text with more than one trigger word is segmented by trigger words to ensure that each topic text contains only one trigger word. The likelihood function formula of the LDA algorithm is as follows: (9) Among them, α is the topic distribution hyperparameter; β is the word distribution hyperparameter; event set The topic distribution and each theme k Word distribution in All are generated from Dirichlet distribution; It is i The first j The label of the word; It is i of the documents j words; It is i The number of words in a document; is the total number of events; θ i is the topic distribution of the i-th event; The weight of the high-frequency words is calculated by the TF-IDF algorithm in step 3.1.1 above, and the specific method for setting the threshold is as follows: Calculate the total number of words in each topic TF-IDF value, based on Distribution of TF-IDF values. Sort all words by weight from small to large and find The weight value corresponding to the 90% quantile in the TF-IDF value distribution is set as the threshold. The calculation formula is as follows: (10) in, represents the probability of word y being generated given the topic k; Step 3.2: Use the SBERT+BiLSTM model to encode the events with enhanced semantic information in step 3.1 and extract the enhanced semantic features; The specific process of step 3.2 is as follows: Use SBERT to transform the events with enhanced semantic information in step 3.1 into contextual embedding representations , and then use BiLSTM to process , the contextual embedding of the input sequence , as follows: (11) in, T Indicates the length of the event; is the SBERT embedding representation vector of each word; BiLSTM calculates the hidden state through two LSTM units, forward and backward. The forward and backward hidden state formulas of BiLSTM dynamically model the context dependency, embed the input context for further processing, and extract the enhanced semantic features, as follows: (12) (13) Where t is the time step; and are the t-th hidden state of the forward and backward LSTM respectively; and Represents the forward and backward propagation parts of LSTM, where the input sequence is processed from beginning to end and from end to beginning according to the time step respectively; is the input embedding at time step t; and are the hidden states of the previous time step and the next time step respectively; Then, the forward and backward hidden states are concatenated to obtain enhanced semantic features. , as follows: (14) in, .
7. The rail transit event extraction method integrating semantic features and local dependency features according to claim 1 is characterized in that: The specific process of step 4 is as follows: For the local dependence features in step 2 and the semantic features in step 3 Perform weighted averaging and define a learnable weight parameter , whose value range is [0, 1], and then the optimal weight is learned through the Adam optimization algorithm, that is, the fused feature It can be expressed as: (15) in, It is the enhanced local dependency feature; is the enhanced semantic feature.
8. The rail transit event extraction method integrating semantic features and local dependency features according to claim 1 is characterized in that: The specific process of step 5 is as follows: Step 5.1: Use CRF as the prediction model and input the features fused in step 4 , trained to predict the label of each word; (16) Step 5.2: During the training process in step 5.1, the CRF model uses the sequence cross entropy loss function to optimize the weights so that the predicted label sequence is consistent with the actual label sequence. The sequence cross entropy loss function is used to measure the difference between the predicted value and the true label. The formula of the cross entropy loss function is: (17) in, is the predicted category probability distribution; is the true label; M is the number of events.
Citation Information
Patent Citations
Event extraction method fusing graph attention mechanism and dependency syntactic analysis
CN118862874A
Method For Extracting Dam Emergency Event Based On Dual Attention Mechanism
US20230119211A1