Multitask learning method and system based on knowledge enhancement
By constructing a knowledge graph in the transportation domain and combining it with a multi-task learning method, the problem of insufficient integration of geographical knowledge in existing technologies is solved, achieving high accuracy and completeness in the extraction of traffic event information, and enhancing the robustness and adaptability of the model.
Patent Information
- Application Number
- CN202511068917.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-18
AI Technical Summary
Existing traffic event extraction technologies struggle to effectively integrate geographic knowledge and identify and understand geographic entities, leading to inaccurate location identification of traffic events, a lack of coordination between sub-tasks, and mismatched feature dimensions, all of which affect the accuracy and completeness of extraction.
A knowledge-enhanced multi-task learning approach is adopted. By constructing a knowledge graph in the transportation domain, geographic entities in the text are identified and linked with the knowledge graph. The multi-task learning module coordinates entity recognition, relation extraction, and event type classification to achieve deep integration of geographic knowledge and text information.
It improves the accuracy of traffic event extraction, enhances the understanding of geographic information, achieves collaborative enhancement between tasks, solves the problem of feature dimension mismatch, and improves the robustness and generalization ability of the model.
Smart Images

Figure CN120975265A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of traffic information processing, in particular to a multi-task learning method and system based on knowledge enhancement. BACKGROUND
[0002] Real-time acquisition and analysis of traffic event information is of great significance for the construction of intelligent transportation systems and traffic management. At present, a large amount of traffic event information exists in the form of unstructured text information in traffic reports, news reports and social media platforms. Automatically extracting structured traffic event information from these texts is a key link to realize traffic situation awareness and early warning.
[0003] Existing traffic event extraction technologies mainly fall into the following categories:
[0004] (1) Rule-based method: extracting event information through pre-defined syntax rules and pattern matching. This method relies on artificial rules, has poor scalability and is difficult to adapt to complex and variable text expressions.
[0005] (2) Statistical machine learning-based method: using feature engineering and statistical models for event extraction, such as Conditional Random Fields (CRF), Support Vector Machines (SVM), etc. This method requires a large amount of manual feature design and has limited generalization ability.
[0006] (3) Deep learning-based method: using deep neural networks such as Recurrent Neural Networks (RNN), Convolutional Neural Networks (CNN) and Transformers for event extraction. This method has stronger feature learning ability, but still has the following problems for traffic event extraction containing geographic information:
[0007] 1) Insufficient recognition and understanding of geographic entities, making it difficult to accurately associate the locations mentioned in the text with the actual geographic positions;
[0008] 2) Lack of integration and utilization of geographic knowledge, which cannot fully understand the spatial context of the event;
[0009] 3) Lack of effective coordination between sub-tasks (such as entity recognition, relation extraction, event classification), resulting in insufficient information transmission;
[0010] 4) Inconsistent feature representation dimensions, causing dimension mismatch when integrating information from different sources.
[0011] Therefore, there is an urgent need for a traffic event information recognition and extraction system that can integrate geographic knowledge, coordinate multi-task learning and solve the problem of inconsistent feature dimensions, in order to improve the accuracy and completeness of traffic event information extraction. SUMMARY
[0012] The present application aims to provide a knowledge-enhanced multi-task learning method and system to solve the problems in the background art.
[0013] To achieve the above-mentioned purpose, the present application provides the following technical solutions:
[0014] A knowledge-enhanced multi-task learning system, comprising: a basic encoding module for encoding traffic event text information into a text encoding representation as shared features for subsequent tasks;
[0015] A knowledge graph construction module for constructing a traffic domain knowledge graph as a knowledge base for a knowledge enhancement module;
[0016] A knowledge enhancement module for identifying geographic entities in the text encoding representation and linking them to the traffic domain knowledge graph, and deeply fusing the geographic knowledge of the filtered knowledge base entities in the traffic domain knowledge graph with the text encoding representation;
[0017] An event extraction module for extracting relevant elements (such as event trigger words, participants, and time and location, etc.) from the deeply fused text encoding representation and preliminarily constructing an event framework;
[0018] A multi-task learning module for coordinating joint learning and reasoning of tasks related to entity recognition, relation extraction, event type classification, and knowledge fusion, and identifying and extracting traffic event text information to output a final prediction result.
[0019] As a further specific solution of the present application, the basic encoding module comprises:
[0020] A pre-trained language model using a BERT model as a basic encoder to encode traffic event text information into a basic text encoding representation (H), using the bidirectional attention mechanism of the basic encoder to capture the deep semantics of the traffic event text information, given an input text sequence X = [x1, x2, …, x n ], the output of the basic encoder is the basic text encoding representation (H), and its expression is:
[0021] H = BERT(X) ∈ R n×dh ,
[0022] where n represents the length of the encoding sequence, d h represents the hidden layer dimension, specifically d h = 768;
[0023] A context-enhanced encoder to enhance the model's understanding of traffic event text information by adding traffic domain-specific pre-training tasks such as masked traffic entity prediction and road segment relationship prediction, and the calculation expression of the context-enhanced encoder is:
[0024] H ctx = LayerNorm(H + Dropout(FFN(H))),
[0025] where H ctx represents the context processed text encoding representation, FFN represents the feed-forward neural network, Dropout represents the random dropout operation, and LayerNorm represents the layer normalization operation.
[0026] The position-aware attention layer introduces a position-aware attention mechanism to capture the relative position relationship between geographical entities in the traffic event text information. The general calculation expression of the position-aware attention layer is:
[0027]
[0028]
[0029] where H i is the text encoding representation of geographical entity e i , H j is the text encoding representation of geographical entity e j , W Q is a learnable query matrix, W K is a learnable key matrix, d k is the vector dimension of the query matrix, is a position bias term used to encode the relative dependency information between geographical entity e i and geographical entity e j , e ij is the attention score of geographical entity e i to geographical entity e j , and A ij is the normalized attention score of geographical entity e i to geographical entity e j .
[0030] The sequence representation enhancement layer enhances the representation ability of the text encoding representation through residual connection and layer normalization operation. The calculation expression of the sequence representation enhancement layer is:
[0031] H en = LayerNorm(H ctx + Attention(H ctx )),
[0032] where Attention represents the position-aware attention operation used to capture the dependency relationship between two long-distance geographical entities in the traffic event text information, and H enThe text encoding representation after the enhancement of the representation by the Attention operation, the residual connection and the layer normalization operation is represented.
[0033] As a further specific scheme of the present application, the knowledge graph construction module comprises:
[0034] The data acquisition and integration component is configured to collect traffic field data from various sources.
[0035] The knowledge extraction and normalization component is configured to extract structured knowledge from the original traffic field data and perform normalization processing.
[0036] The knowledge graph construction component is configured to construct a traffic field knowledge graph based on the normalized structured knowledge.
[0037] The knowledge embedding learning component is configured to encode entities and relationships in the knowledge graph into low-dimensional dense vectors.
[0038] As a further specific scheme of the present application, the knowledge enhancement module comprises:
[0039] The geographic entity recognition and linking component is configured to recognize geographic entity mentions in the traffic event text (string) and link them with knowledge base entities (string) in the traffic field knowledge graph.
[0040] The knowledge fusion network component is configured to perform deep fusion of the geographic knowledge of the filtered entity and the text encoding representation (H en ) after the enhancement, so that the model enhances the event extraction capability by using geographic knowledge.
[0041] As a further specific scheme of the present application, the geographic entity recognition and linking component comprises:
[0042] The basic geographic entity linker is configured to extract geographic entity mentions, i.e., text mentions (m), from the traffic event text (string) by string matching, fuzzy matching (traditional) methods, to perform preliminary recognition and matching of the text mentions (m) with the knowledge base entities (e) in the traffic field knowledge graph, and to filter out text mentions (m) and knowledge base entities (e) with fuzzy matching similarity lower than a set threshold.
[0043]
[0044] Wherein, char(·) represents a character set, ∩ represents a set intersection operation, and ∪ represents a set union operation.
[0045] The neural geographic entity linker is based on a neural network advanced linker, and combines context information and geographic knowledge to perform entity linking on filtered text mentions (m) and knowledge base entities (e), wherein the filtered text mentions (m) are processed by a mention encoder to obtain an encoded representation h of the text mentions m , and the expression is
[0046]
[0047] The filtered knowledge base entities (e) are processed by an entity encoder to obtain an encoded representation h of the knowledge base entities e , and the expression is
[0048]
[0049] The similarity between the encoded representation of the text mention and the encoded representation of the knowledge base entity is calculated, and the calculation expression is
[0050]
[0051] Wherein, W is a learnable weight matrix, and b is a learnable bias term.
[0052] The context-aware link enhancement unit combines the context information to enhance the link accuracy of entity linking, retains the knowledge base entity encoded representation (h e ) with a matching similarity higher than a set threshold, and the similarity calculation expression after enhancing the link accuracy is
[0053] score enhanced (m,e)=score(m,e)+α·sim(h ctx ,h e ),
[0054] Wherein, α is a proportionality coefficient, sim is a cosine similarity, and h ctx is the encoded representation of the text mention containing the context information.
[0055] As a further specific scheme of the present application, the knowledge fusion network component comprises:
[0056] The knowledge gating unit is used to control the degree of the filtered knowledge encoded representation being integrated into the enhanced text encoded representation (H en ), and the expression of the knowledge gating function G is
[0057]
[0058] Wherein, [H en ; k] represents the splicing of the enhanced text encoded representation H en and the knowledge encoded representation K, and Wg represents a learnable weight matrix, b g represents a learnable bias term, and σ represents a Sigmoid activation function.
[0059] a knowledge conversion network for converting the knowledge encoding representation K into an enhanced text encoding representation H en a feature representation of the same dimension, i.e., a knowledge conversion representation K', whose expression is:
[0060]
[0061] where ReLU is an activation function, W t is a learnable weight matrix, and b t is a learnable bias term.
[0062] a multi-level knowledge attention layer that uses a multi-head attention mechanism to capture the interaction between the text and the knowledge at different levels, and its general expression is:
[0063] MultiHead(Q, K, V) = Concat(head1, …, head i )W O ,
[0064] where Q is a query matrix, K is a key matrix, V is a value matrix, Concat is a concatenation operation, head is a split attention head, i represents the number of attention head splits, different attention heads independently calculate attention, W O is a projection matrix.
[0065] a hierarchical fusion layer that gradually integrates the knowledge encoding representation K into the enhanced text encoding representation H en through a multi-level fusion strategy, and the specific steps include:
[0066] a shallow-level knowledge fusion that is performed through a gating unit, and its fusion expression is:
[0067] H shallow = H en + G o K',
[0068] where H shallow is the text encoding representation after shallow-level knowledge fusion through the gating unit, o is an element-wise multiplication,
[0069] a deep-level knowledge fusion that is performed through a multi-head attention operation and a residual connection, and its fusion expression is:
[0070] H deep = LayerNorm(H shallow + MultiHead(H shallowK', K'),
[0071] wherein the shallow-level knowledge fusion text encoding representation H shallow is calculated with the multi-head attention of the knowledge conversion representation K', and then is connected with itself in residual connection, and the layer normalization operation is performed to obtain the deep-level knowledge fusion text encoding representation H deep ;
[0072] The deep fusion text encoding representation H deep is fused with the enhanced text encoding representation H en , and the layer normalization operation is performed to obtain the final knowledge fusion text encoding representation H', and the expression is as follows:
[0073] H' = LayerNorm (H deep + H en ),
[0074] The contrastive learning loss calculation unit promotes the alignment of the enhanced text encoding representation H en and the knowledge encoding representation K by minimizing the contrastive learning loss, and the expression is as follows:
[0075]
[0076] wherein, is the contrastive learning loss function, and the smaller the value is, the higher the alignment degree is, is the transpose of a certain text encoding representation in H', h k is a certain knowledge encoding representation in K, j represents the index value range of geographical knowledge in the knowledge base, and the specific value is 1~the total number of knowledge, and τ is a temperature coefficient.
[0077] As a further specific scheme of the present application, the event extraction module comprises:
[0078] The event trigger word recognition component is used to recognize the event trigger word in the text encoding representation, determine the core action or state of the event, and specifically comprises the following steps:
[0079] Trigger word candidate generation: generate potential trigger word candidates based on part-of-speech and semantic information, and the expression is as follows:
[0080] P (y i |X) = softmax (W t h i +b t ),
[0081] wherein, i represents the index of the text sequence, and the maximum value is the length of the text sequence minus one, h i is the encoding representation of the i-th word in H', W t is a learnable weight parameter, and bt is a learnable bias parameter, y i is the i-th trigger word label, P(y i |X) represents the probability distribution of the i-th word belonging to each label category.
[0082] Trigger word screening and classification: screening and classifying event trigger words, determining event types, whose expression is:
[0083]
[0084] where t is the trigger word, c is the event type set, P(c|t) is the probability of the trigger word t belonging to the type c, represents the index of obtaining the maximum probability of the trigger word t belonging to the type c in the event type set c, determining the event type EventType(t);
[0085] Event element extraction component, used for extracting event-related participants, time, place and / or impact-related elements, specifically including the following steps:
[0086] Element role identification: identify the semantic roles of event elements, such as agent, patient, time, place, etc., and the probability distribution expression is:
[0087] P(r s |X,t)=softmax(W r [h s ;h t ;h s,t ]+b r ),
[0088] where X is the input text sequence, h s is the encoding representation of the candidate element, h t is the encoding representation of the trigger word, h s,t is the interaction feature between the candidate element and the trigger word, r s is the role label, W r is a learnable weight, b r is a corresponding bias, P(r s |X,t) represents the probability distribution of the event element belonging to each role label r s ;
[0089] Element boundary detection: detect the exact boundary of the event element, and the probability distribution expression is:
[0090] P(y m,n |X)=softmax(W b [h m ;h n ;h m:n ]+bb ),
[0091] where X is the input text sequence, m is the start position of the text sequence segment, n is the end position of the text sequence segment, h m:n is the span representation from the m-th word to the n-th word, y m,n is the boundary label, W b is the learnable weight, b b is the corresponding learnable bias, P(y m,n |X) represents the probability distribution of the event argument, i.e., the text segment m:n, belonging to each boundary label y m,n ;
[0092] Event framework construction component, based on the identified trigger words and elements to build a complete event framework, specifically including the following steps:
[0093] Element association: associate the extracted event elements with the corresponding event trigger words, and the association expression is:
[0094]
[0095] where t is the trigger word, s is the event element, h s is the encoding representation of the event element, is the transpose of the trigger word encoding representation, W a is the learnable association weight;
[0096] Framework integrity check: check the integrity of the event framework to ensure that all necessary elements have been extracted, and the expression is:
[0097]
[0098] where E is the extracted element set, RequiredRoles is the set of necessary roles required by the event type;
[0099] Event spatio-temporal relationship reasoning component, based on the extracted event elements, inferring the time and space relationship of the event, specifically including the following steps:
[0100] Temporal relationship reasoning: reasoning the time of event occurrence and the time sequence relationship with other events, and the expression is:
[0101]
[0102] where R temp is the set of time relationships (such as "before", "after", "at the same time", etc.), s1 represents the first event element, s2 represents the second event element, represents the encoding representation of the first event element, The encoding representation representing the second event element, TemporalRel(s1, s2) represents the most probable temporal relationship (r m ) in the probability distribution of the temporal relationship of the two event elements s1 and s2.
[0103] Spatial relationship reasoning: reasoning the specific location where the event occurs and the spatial relationship with other places, which is expressed as:
[0104]
[0105] Where R spat is a set of spatial relationships (such as "contains", "adjacent", "intersects", etc.), s1 represents the first event element, s2 represents the second event element, represents the first event element representation, represents the second event element representation, SpatialRel(s1, s2) represents the most probable spatial relationship (r n ) in the probability distribution of the spatial relationship of the two event elements s1 and s2.
[0106] As a further specific scheme of the present application, the multi-task learning module comprises:
[0107] The feature adaptation and sharing mechanism layer is used to adjust the dimension of the feature representation of each task, so that it can interact and share in the same feature space, and through a learnable transformation, the various source feature representations after dimension adaptation are mapped to the corresponding task feature space, while the attention mechanism is used to dynamically adjust the importance of the feature representation to adapt to the needs of the corresponding task.
[0108] The multi-task collaborative learning component is used to perform entity recognition tasks, relationship extraction tasks, event type classification tasks, and knowledge learning fusion tasks.
[0109] The inter-task information interaction component uses an information exchange mechanism to share adaptive features between tasks and promote the execution of each task.
[0110] The dynamic task balancing component is used to dynamically adjust the weights and learning strategies of each task according to the task difficulty and learning progress.
[0111] The joint training and inference component is used to coordinate the training and inference process of the system.
[0112] As a further specific scheme of the present application, the entity recognition task: identifies various entities in the text, including locations, times, event types, etc., which is expressed as:
[0113]
[0114] Where H′ Y is the sequence of entity labels, Y ′ is the input H ′ , l is the index of the entity label sequence, taking 1, 2, … n, φ is a feature function, which measures the compatibility of the previous label y l , the previous label y l-1 and the input text encoding representation H ′ , P(Y|H') is the probability that the entity label sequence Y is correct for the input text encoding representation H';
[0115] Relation extraction task: extract the semantic relationship between entities and construct the structured representation of the event, whose expression is:
[0116]
[0117] where r is a predefined relationship, e1 represents entity 1, e2 represents entity 2, represents the joint representation of the entity pair, W r represents the weight matrix (learnable parameter) corresponding to the predefined relationship r, b r represents the bias term (learnable parameter) corresponding to the predefined relationship r, P(r|e1, e2) represents the probability distribution of all possible relationships r;
[0118] Event type classification task: determine the specific type of the event, such as traffic congestion, traffic accident, road construction, etc., whose expression is:
[0119] P(c|X)=softmax(W c h doc +b c ),
[0120] where c represents the set of event types, h doc represents the encoding information representation of the input text sequence X, W c represents the weight matrix of the type set c, b c represents the corresponding bias term, P(c|X) is the probability that the input text sequence X is the event category c;
[0121] Knowledge learning fusion task: by minimizing the corresponding contrastive learning loss, promote the alignment of text encoding representation and knowledge encoding representation, enhance the understanding ability of the model to geographical knowledge.
[0122] A knowledge-enhanced multi-task learning method based on the knowledge-enhanced multi-task learning system, the following steps are performed:
[0123] S1, encode the traffic event text information into a text encoding representation through a basic encoding module;
[0124] S2, access a pre-constructed traffic domain knowledge graph to obtain structured knowledge of knowledge base entities;
[0125] S3, identify geographic entities in the traffic event text information through a knowledge enhancement module, and link them with the traffic domain knowledge graph, and deeply integrate related geographic knowledge with the text encoding representation;
[0126] S4, identify and extract event trigger words and related event elements through an event extraction module to build a preliminary event framework;
[0127] S5, coordinate entity recognition, relation extraction, event type classification, and knowledge learning through a multi-task learning module to jointly learn and reason related tasks, and output the final predicted structured event representation.
[0128] The application introduces a knowledge graph in the field of traffic to enhance the knowledge of the event extraction process, and matches the geographic information entities in the knowledge graph with the traffic event location entities in the text data to improve the accuracy of the incident location recognition. In addition, by adding entity recognition tasks, relation extraction tasks, event type classification tasks, and knowledge learning fusion tasks, knowledge sharing and migration of multiple tasks can be realized to alleviate the problem of data sparsity and improve the generalization ability of the model, thereby helping the model to comprehensively understand the input text from multiple angles. In the future, with the continuous development and improvement of the field of intelligent transportation, the model can be further optimized by integrating more comprehensive multi-source data to achieve more intelligent and accurate traffic event information recognition and improve the intelligence and safety level of the intelligent transportation system.
[0129] Compared with the prior art, the application has the following advantages:
[0130] 1. Improved accuracy of traffic event extraction: by integrating geographic knowledge and text information, the location, time, type, and other key information of traffic events can be more accurately identified;
[0131] 2. Enhanced understanding of geographic information: through geographic entity linking and knowledge fusion, the model can understand the geographic environment and spatial relationship of the event;
[0132] 3. Realize the collaborative enhancement between tasks: the multi-task learning framework enables each sub-task to share information and features, promoting each other and improving the overall performance;
[0133] 4. Solve the problem of feature dimension mismatch: through the feature adaptation layer, the feature representations of different sources are effectively aligned, making knowledge fusion more smooth;
[0134] 5. Improved robustness and generalization of the model: Through techniques such as adversarial training, noise injection, etc., the model's resistance to noise and variations is enhanced. BRIEF DESCRIPTION OF DRAWINGS
[0135] Figure 1 is a schematic diagram of a knowledge-enhanced multi-task learning system;
[0136] Figure 2 is a schematic diagram of a basic encoding module in a knowledge-enhanced multi-task learning system;
[0137] Figure 3 is a schematic diagram of a knowledge-enhanced module in a knowledge-enhanced multi-task learning system;
[0138] Figure 4 is a schematic diagram of an event extraction module in a knowledge-enhanced multi-task learning system;
[0139] Figure 5 is a schematic diagram of a multi-task learning module in a knowledge-enhanced multi-task learning system;
[0140] Figure 6 is a schematic diagram of a knowledge-enhanced multi-task learning method. DETAILED DESCRIPTION
[0141] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0142] The core challenge of extracting traffic events from social media platform data is how to accurately identify dynamic traffic conditions from massive unstructured information, which is crucial for improving urban traffic management efficiency and emergency response capability. Traffic event extraction technology (TET) as a key module of intelligent transportation system needs to balance between real-time, accuracy and scene adaptability. Current mainstream methods rely on traditional natural language processing (NLP) and machine learning models to identify accidents, congestion and other events in text through keyword matching or classifier, but there are significant limitations.
[0143] Please refer to Figures 1-5This invention proposes a knowledge-enhanced multi-task learning system, comprising: a basic encoding module, a knowledge graph construction module, a knowledge enhancement module, an event extraction module, and a multi-task learning module. The basic encoding module encodes traffic event text information into a text encoding representation, serving as a shared feature for subsequent tasks. The knowledge graph construction module constructs a traffic domain knowledge graph (which may contain information such as geographic entities, road networks, and traffic event types), serving as the knowledge base for the knowledge enhancement module. The knowledge enhancement module identifies geographic entities in the text encoding representation and links them to the traffic domain knowledge graph, deeply fusing the geographic knowledge of the selected entities in the knowledge base with the text encoding representation. The event extraction module extracts relevant elements (such as event trigger words, participants, and time and location) from the deeply fused text encoding representation, initially constructing an event framework. The multi-task learning module coordinates the joint learning and reasoning of entity recognition, relation extraction, event type classification, and knowledge fusion tasks, identifying and extracting the traffic event text information to be processed, and outputting the final prediction result.
[0144] As a specific solution, in this invention, the basic encoding module is the foundation of the system, responsible for encoding the input traffic event text information into a high-dimensional vector representation, providing shared features for subsequent tasks. The basic encoding module may specifically include: a pre-trained language model, which uses the BERT (Bidirectional Encoder Representations from Transformers) model as the basic encoder to encode the traffic event text information into a basic text encoding representation (H). It utilizes the bidirectional attention mechanism of the basic encoder to capture the deep semantics of the traffic event text information. Given an input text sequence X = [x1, x2, ..., x...], ... n The output of the basic encoder is the basic text-encoded representation (H), which is expressed as:
[0145] H = BERT(X) ∈ R n×dh
[0146] Where n represents the length of the encoded sequence, d h This represents the hidden layer dimension, specifically, d. h =768;
[0147] The context-enhanced encoder enhances the model's ability to understand textual information about traffic events by adding traffic domain-specific pre-training tasks, such as masked traffic entity prediction and road segment relationship prediction. The computational expression for the context-enhanced encoder is as follows:
[0148] H ctx =LayerNorm(H+Dropout(FFN(H)))
[0149] wherein H ctx represents the text encoding representation after context processing, FFN represents a feed-forward neural network, Dropout represents a random inactivation operation, and LayerNorm represents a layer normalization operation;
[0150] The position-aware attention layer considers the importance of geographical positions in traffic events, and introduces a position-aware attention mechanism to capture the relative position relationship between geographical entities in the traffic event text information.
[0151]
[0152]
[0153] wherein H i is the text encoding representation of the geographical entity e i , H j is the text encoding representation of the geographical entity e j , W Q is a learnable query matrix, W K is a learnable key matrix, d k is the vector dimension of the query matrix, is a position bias term, used to encode the relative dependency information between the geographical entity e i and the geographical entity e j , e ij is the attention score of the geographical entity e i to the geographical entity e j , and A ij is the normalized attention score of the geographical entity e i to the geographical entity e j .
[0154] The sequence representation enhancement layer enhances the representation ability of the text encoding representation through residual connection and layer normalization operation.
[0155] H en =LayerNorm(H ctx +Attention(H ctx ))
[0156] wherein Attention represents a position-aware attention operation, used to capture the dependency relationship between two long-distance geographical entities in the traffic event text information, and H en represents the text encoding representation after the Attention operation, residual connection and layer normalization operation.
[0157] As a body solution, in the present application, the knowledge graph construction module is the basic support of the present application, responsible for constructing the traffic field knowledge graph containing information such as geographic entities, traffic facilities and event types, and the knowledge graph construction module includes:
[0158] The data acquisition and integration component is used to collect traffic field data from multiple sources, and the specific content of the traffic field data can include: (1) urban geographic information data: road network, intersection, administrative region and other spatial data; (2) traffic facility data: traffic infrastructure information such as signal lights, monitoring equipment, toll stations; (3) historical traffic event data: accident, congestion, construction, regulation and other historical event records; (4) public transportation data: public transportation information such as bus routes, subway stations.
[0159] The knowledge extraction and normalization component is used to extract structured knowledge from original traffic field data and perform normalization processing, which can include: (1) entity extraction: identifying and extracting geographic entities, traffic facility entities and event type entities; (2) relationship extraction: extracting relationships between entities, such as spatial relationships (adjacent, containing), functional relationships (connected, belonging) and the like; (3) attribute extraction: extracting attribute information of entities, such as road length, speed limit, number of lanes and the like; (4) normalization processing: unifying naming rules, eliminating outliers, and completing missing information.
[0160] The knowledge graph construction component constructs a traffic field knowledge graph based on the normalized structured knowledge, which can specifically include: (1) graph pattern design: defining the pattern of entity type, relationship type and attribute type; (2) entity linking: linking different expressions of the same entity to solve the problem of homonym and synonym; (3) relationship reasoning: inferring implicit relationships based on existing relationships to enrich the knowledge graph; (4) graph storage: using an efficient graph database to store the knowledge graph to support fast retrieval and update.
[0161] The knowledge embedding learning component is used to encode entities and relationships in the knowledge graph into low-dimensional dense vectors, which can specifically include: (1) entity embedding: using TransE, RotatE and other methods to learn entity embedding representation; (2) relationship embedding: learning vector representation of relationships to capture semantic characteristics of relationships; (3) attribute embedding: integrating entity attributes into entity representation to enhance expression ability; (4) spatial embedding: introducing geographical spatial characteristics to make entity embedding maintain spatial continuity and relative position relationship.
[0162] The traffic knowledge graph constructed based on the above components will serve as the knowledge base of the knowledge enhancement module, providing structured background knowledge for event extraction.
[0163] As a specific solution, the knowledge enhancement module is a key innovative part of the application, mainly including two functions of geographic entity linking and knowledge fusion, the knowledge enhancement module comprises: a geographic entity recognition and linking component, used for recognizing geographic entity mentions in traffic event text (string) and linking and screening the geographic entity mentions with knowledge base entities (string) in a traffic domain knowledge graph;
[0164] a knowledge fusion network component, used for deeply fusing geographic knowledge of the screened entities with text encoding representation (H en ) after enhancement representation, so that the model enhances event extraction capability by using geographic knowledge.
[0165] Specifically, the geographic entity recognition and linking component comprises:
[0166] a basic geographic entity linker, which extracts geographic entity mentions, i.e., text mentions (m), from the traffic event text (string) by string matching, fuzzy matching (traditional) method, preliminarily recognizes and matches the text mentions (m) with knowledge base entities (e) in the traffic domain knowledge graph, and filters out text mentions (m) and knowledge base entities (e) with fuzzy matching similarity lower than a set threshold, the calculation expression of the fuzzy matching similarity is:
[0167]
[0168] wherein char(·) represents a character set, and represents a set intersection operation, and represents a set union operation;
[0169] a neural geographic entity linker, which is a neural network advanced linker, combines context information and geographic knowledge, and links the filtered text mentions (m) and knowledge base entities (e), wherein the filtered text mentions (m) are processed by a mention encoder to obtain an encoding representation h m of the text mentions, and the expression is:
[0170]
[0171] the filtered knowledge base entities (e) are processed by an entity encoder to obtain an encoding representation h e of the knowledge base entities, and the expression is:
[0172]
[0173] the similarity between the encoding representation of the text mentions and the encoding representation of the knowledge base entities is calculated, and the calculation expression is:
[0174]
[0175] where W is a learnable weight matrix and b is a learnable bias term.
[0176] The context-aware link enhancement unit enhances the link precision of entity linking in combination with the context information, retains the knowledge base entity code representation (h e ) with a matching similarity higher than a set threshold, and enhances the link precision.
[0177] score enhanced (m, e) = score(m, e) + a sim(h ctx , h e )
[0178] where a is a proportionality coefficient, sim is a cosine similarity, h ctx is a text mention code representation containing context information.
[0179] Through spatial consistency checking, it is ensured that all linked geographic entities are consistent in space, avoiding geographically impossible situations.
[0180] As a specific solution, the knowledge fusion network component includes a knowledge gating unit for controlling the degree of filtered knowledge code representation being integrated into the enhanced text code representation (H en ), allowing the model to dynamically determine how much external knowledge it should accept, and the expression of the knowledge gating function G is:
[0181]
[0182] where [H en ; K] represents the concatenation of the enhanced text code representation H en and the knowledge code representation K, W g represents a learnable weight matrix, b g represents a learnable bias term, and sigma represents a Sigmoid activation function.
[0183] The knowledge conversion network is used to convert the knowledge code representation K into a feature representation of the same dimension as the enhanced text code representation H en , i.e., the knowledge conversion representation K', and its expression is:
[0184]
[0185] where ReLU is an activation function, W t is a learnable weight matrix, and b t is a learnable bias term.
[0186] The multi-level knowledge attention layer uses a multi-head attention mechanism to capture the interaction between text and knowledge at different levels, and its general expression is:
[0187] MultiHead(Q,K,V)=Concat(head1,…,head i )W O
[0188] where Q is a query matrix, K is a key matrix, V is a value matrix, Concat is a concatenation operation, head is a split attention head, i represents the number of attention head splitting, different attention heads independently calculate attention, W O is a projection matrix;
[0189] The hierarchical fusion layer gradually integrates the knowledge encoding representation K into the enhanced text encoding representation H en through a multi-level fusion strategy, and the specific steps include:
[0190] The shallow-level knowledge fusion is performed through a gating unit, and the fusion expression is:
[0191] H shallow =H en +G⊙K'
[0192] where H shallow is the text encoding representation after shallow-level knowledge fusion obtained through the gating unit, and is an element-wise multiplication;
[0193] The deep-level knowledge fusion is performed through a multi-head attention operation and a residual connection, and the fusion expression is:
[0194] H deep =LayerNorm(H shallow +MultiHead(H shallow ,K′,K′))
[0195] where the text encoding representation H shallow after shallow-level knowledge fusion and the knowledge conversion representation K' are calculated for multi-head attention, and then are connected with themselves through a residual connection to obtain the text encoding representation H deep after deep-level knowledge fusion through a layer normalization operation;
[0196] The text encoding representation H deep after deep-level fusion is fused with the enhanced text encoding representation H en , and the final knowledge fused text encoding representation H' is obtained through a layer normalization operation, and the expression is:
[0197] H′=LayerNorm(H deep +H en )
[0198] The contrastive learning loss calculation unit promotes the enhanced text encoding representation H by minimizing the contrastive learning loss en and the alignment of the knowledge encoding representation K, expressed as:
[0199]
[0200] wherein, is a contrastive learning loss function, and the smaller the value is, the higher the alignment degree is, is the transpose of a certain text encoding representation in H', h k is a certain knowledge encoding representation in K, j represents the index value range of geographical knowledge in the knowledge base, specifically 1- the total number of knowledge, and τ is a temperature coefficient.
[0201] As a specific scheme of the application, the event extraction module is an important module of the application, responsible for extracting key elements of events from text and constructing structured event representations. The event extraction module specifically includes:
[0202] The event trigger word recognition component is used to identify event trigger words in the text encoding representation and determine the core action or state of the event, and specifically includes the following steps:
[0203] Trigger word candidate generation: based on part-of-speech and semantic information, potential trigger word candidates are generated, expressed as:
[0204] P(y i |X)=softmax(W t h i +b t )
[0205] wherein i represents the index of the text sequence, with a maximum of text sequence length minus one, h i is the encoding representation of the i-th word in H', W t is a learnable weight parameter, b t is a learnable bias parameter, y i is the i-th trigger word label, and P(y i |X) represents the probability distribution of the i-th word belonging to each label category.
[0206] Trigger word screening and classification: screening and classifying event trigger words to determine the event type, expressed as:
[0207]
[0208] wherein t is the trigger word, c is the event type set, P(c|t) is the probability of the trigger word t belonging to the type c, represents the index of the trigger word t belonging to the type c in the event type set c with the maximum probability, and determines the event type EventType(t).
[0209] The event element extraction component is used to extract elements related to an event, such as participants, time, location, and / or degree of impact. Specifically, it includes the following steps:
[0210] Element Role Recognition: Identifying the semantic roles of event elements, such as agent, victim, time, and location. The probability distribution expression is as follows:
[0211] P(r s |X,t)=softmax(W r [h s h t h s,t ]+b r )
[0212] Where X is the input text sequence, h s It is the coded representation of candidate elements, h t It is the encoded representation of the trigger word, h s,t It is the interaction feature between candidate elements and trigger words, r s It's a character tag, W r It is a learnable weight, b r It is the corresponding bias, P(r) s |X,t) represents the event element belonging to each role tag r s The probability distribution;
[0213] Feature boundary detection: Detects the exact boundaries of event features; the probability distribution expression is:
[0214] P(y m,n |X)=softmax(W b [h m h n h m:n ]+b b )
[0215] Where X is the input text sequence, m is the start position of the text sequence segment, n is the end position of the text sequence segment, and h is the input text sequence. m:n It represents the span from the m-th word to the n-th word, y m,n It's a boundary label, W b It is a learnable weight, b b It corresponds to the learnable bias, P(y) m,n |X) represents the event element, i.e., the text fragment m:n, which belongs to each boundary label y. m,n The probability distribution;
[0216] The event framework building component constructs a complete event framework based on the identified trigger words and elements, specifically including the following steps:
[0217] Element association: associate the extracted event elements with the corresponding event trigger, whose association expression is:
[0218]
[0219] where t is the trigger, s is the event element, h s is the encoding representation of the event element, is the transpose of the trigger encoding representation, W a is the learnable association weight;
[0220] Framework integrity check: check the integrity of the event framework to ensure that all necessary elements have been extracted, whose expression is:
[0221]
[0222] where E is the extracted element set, RequiredRoles is the set of necessary roles required by the event type;
[0223] Event spatio-temporal relationship reasoning component, based on the extracted event elements, infers the time and space relationship of the event, which includes the following steps:
[0224] Temporal relationship reasoning: reason the time of event occurrence and the time sequence relationship with other events, whose expression is:
[0225]
[0226] where R temp is the set of time relationships (such as "before", "after", "at the same time", etc.), s1 represents the first event element, s2 represents the second event element, represents the encoding representation of the first event element, represents the encoding representation of the second event element, TemporalRel(s1,s2) represents the most probable time sequence relationship (r m ) in the probability distribution of the time sequence relationship of s1,s2 two event elements;
[0227] Spatial relationship reasoning: reason the specific location of the event occurrence and the spatial relationship with other places, whose expression is:
[0228]
[0229] where R spat is the set of spatial relationships (such as "contains", "adjacent", "intersect", etc.), s1 represents the first event element, s2 represents the second event element, represents the first event element representation, SpatialRel(s1,s2) represents the probability distribution of the spatial relationship between s1 and s2, and r is the maximum probability in the probability distribution. n )。
[0230] Through the event extraction module, the system can extract structured event information from the text, providing a basis for subsequent multi-task learning.
[0231] As a specific scheme, in the present application, the multi-task learning module integrates the functions of the feature adaptation layer, the multi-task learning framework and the joint training inference module, is responsible for coordinating the joint learning and inference of multiple parallel tasks, improving the overall performance of the system, and the multi-task learning module includes:
[0232] The feature adaptation and sharing mechanism layer is used to adjust the dimension of the feature representation of each task, so that it can interact and share in the same feature space, and through a learnable transformation, the various source feature representations after dimension adaptation are mapped to the corresponding task feature space, while the attention mechanism is used to dynamically adjust the importance of the feature representation to adapt to the needs of the corresponding task, and the specific package can include:
[0233] Dimension adaptation: adjusting the dimensions of different source (output by each task) features so that they can interact and share in the same feature space, and the calculation expression of dimension adaptation is:
[0234]
[0235] Where F represents different source features, d t represents the unified feature dimension, d f represents the feature dimension of different source features, W p represents the weight, and b p represents the bias, and F' represents the different source features after adjusting the dimension.
[0236] Feature transformation network: through a learnable transformation, the original features of different sources after dimension adaptation are mapped to a feature space more suitable for different tasks (specific task feature space), and the expression of feature transformation is:
[0237] F task =ReLU(F'W task +b task )
[0238] Where W task is a task-specific learnable weight, b task is a task-specific bias, ReLU is an activation function, and F task is a task-specific feature representation.
[0239] Attention adaptation: dynamically adjust the importance of features using attention mechanisms to adapt to the needs of different tasks, its general expression is:
[0240]
[0241] Where Q is the query vector, K is the key vector, V is the value vector, d k is the dimension of the key vector, Attention(Q,K,V) is the attention weight;
[0242] Multi-task cooperative learning component, used to perform entity recognition task, relation extraction task, event type classification task and knowledge learning fusion task, which specifically includes:
[0243] Entity recognition task: identify various entities in the text, including location, time, event type, etc., its expression is:
[0244]
[0245] Where H' is the fused text encoding representation, Y is the entity label sequence, Y' is the set of all possible label sequences corresponding to the input H', l is the index of the entity label sequence, taking 1, 2,...n, φ is a feature function, which measures the compatibility of label y l , the previous label y l-1 and the input text encoding representation H' at position l, P(Y|H') is the probability that the entity label sequence Y is correct for the input text encoding representation H';
[0246] Relation extraction task: extract semantic relationships between entities to construct structured representations of events, its expression is:
[0247]
[0248] Where r is a predefined relationship, e1 represents entity 1, e2 represents entity 2, represents the joint representation of the entity pair, W r represents the weight matrix corresponding to the predefined relationship r (learnable parameter), b r represents the bias term corresponding to the predefined relationship r (learnable parameter), P(r|e1,e2) represents the probability distribution of all possible relationships r;
[0249] Event type classification task: determine the specific type of event, such as traffic congestion, traffic accident, road construction, etc., its expression is:
[0250] P(c|X)=softmax(W c h doc +b c )
[0251] where c represents a set of event types, h doc represents the encoding information representation of the input text sequence X, W c represents the weight matrix of the type set c, b c represents the corresponding bias term, P(c|X) is the probability that the input text sequence X is of event category c;
[0252] Knowledge learning fusion task: by minimizing the corresponding contrastive learning loss, promoting the alignment of text encoding representation and knowledge encoding representation, enhancing the model's understanding ability of geographical knowledge;
[0253] Inter-task information interaction component, using information exchange mechanism, sharing adaptive features among each task, promoting the execution of each task, which specifically includes:
[0254] Task gating layer: control the information flow of different task features, realize the adaptive feature sharing among tasks, its expression is:
[0255]
[0256] where i represents the i-th task, h represents the input text sequence encoding representation, represents the gating weight of the i-th task, represents the gating bias of the i-th task, represents the text sequence encoding representation of the i-th task;
[0257] Cross-task attention layer: let one task selectively focus on the feature representation of other tasks, its expression is:
[0258]
[0259] where α ij is the attention weight of task i to task j feature, is the information representation of task j, is the cross-task information representation of task i to task j;
[0260] Hierarchical sharing strategy layer: design different levels of feature sharing strategy, bottom layer shares general features, high layer maintains task specificity;
[0261] Dynamic task balancing component, used for dynamically adjusting the weight and learning strategy of each task according to the task difficulty and learning progress, which specifically includes:
[0262] Dynamic task weight adjustment: dynamically adjust the task weight according to the learning difficulty and progress of each task, its expression is:
[0263]
[0264] where i and j are task indices, taking 1,2,...,m, T is the temperature coefficient, w i is the weight of the i-th task, w j is the weight of the j-th task, λ i denotes the normalized weight of task i in each task;
[0265] Gradient normalization: balances the contribution of different tasks to parameter updates, preventing certain tasks from dominating the training process, expressed as:
[0266]
[0267] where i refers to different tasks, denotes the normalized gradient of task i, g i denotes the gradient of task i, ||g i ||2 denotes the L2 norm of the original gradient, g ref denotes the reference gradient, c i denotes the scaling factor of task i;
[0268] Task scheduling strategy: dynamically adjusts the training frequency of each task according to task priority and learning state;
[0269] Joint training and inference component, used to coordinate the training and inference process of the system to ensure efficient multi-task cooperation, which specifically includes: joint optimizer: uses adaptive optimization algorithms such as Adam optimizer to coordinate the gradient update of multiple tasks, expressed as:
[0270]
[0271] where θ t is the model parameter of the current step, θ t-1 is the model parameter of the previous step, α is the learning rate, is the first moment estimate of the gradient, is the second moment estimate of the gradient, ∈ is the minimum value to prevent the denominator from being 0;
[0272] Joint inference mechanism layer: in the inference stage, the outputs of each sub-task may have dependency relationships that need to be coordinated through joint inference mechanisms, expressed as:
[0273] P(r|e h ,e t )=P(r|e h ,e t ,e h ∈E,e t ∈E)
[0274] where E represents the legal entity type, r represents the dependency relationship type, P(r|eh ,e t ) represents the entity e h and the entity e t belongs to the dependency relationship r;
[0275] Result integration and verification layer: integrate the prediction results of multiple models and multiple tasks, improve the robustness and accuracy of the system, and verify the consistency and reasonableness of the results, which is expressed as:
[0276]
[0277] where X is the input text sequence, K is the total number of models, w k is the weight of the kth model, satisfying y is the class label, P ensemble (y|X) is the final probability prediction of the integrated model for the class label y;
[0278]
[0279] where event represents the event instance to be verified, structure represents the structured extraction operation, ValidStructures represents the set of predefined legal event structures, and valid(event) represents the validity of the event, which is a binary result 1 or 0.
[0280] Through the coordination of the multi-task learning module, each sub-task can fully share information and features, promote each other, and improve the performance and generalization ability of the entire system.
[0281] Please refer to Figure 6 , the present application also proposes a multi-task learning method based on knowledge enhancement, based on the multi-task learning system based on knowledge enhancement, the following steps are executed:
[0282] S1, encode the traffic event text information into a text code representation through a basic encoding module;
[0283] S2, access the pre-constructed traffic domain knowledge graph to obtain the structured knowledge of the knowledge base entity;
[0284] S3, identify the geographic entity in the traffic event text information through a knowledge enhancement module, and link it with the traffic domain knowledge graph, and deeply integrate the related geographic knowledge with the text code representation;
[0285] S4, identify and extract the event trigger word and related event elements through an event extraction module to construct a preliminary event framework;
[0286] S5, coordinating entity recognition, relation extraction, event type classification and knowledge learning through a multi-task learning module to fuse the joint learning and reasoning of related tasks, and outputting a final predicted structured event representation.
[0287] It will be obvious to a person skilled in the art that the application is not limited to the details of the foregoing exemplary embodiments and can be implemented in other concrete forms without departing from the spirit or essential characteristics of the application. Accordingly, the embodiments are to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. No reference signs in the claims should be considered as limiting the scope of the claims.
Claims
1. A knowledge-enhanced multi-task learning system, characterized in that, include: The basic encoding module is used to encode traffic incident text information into a text-encoded representation, which serves as a shared feature for subsequent tasks. The knowledge graph construction module is used to build a knowledge graph in the transportation field, which serves as the knowledge base for the knowledge enhancement module. The knowledge enhancement module is used to identify geographic entities in the text-encoded representation and link them to the transportation domain knowledge graph, and to deeply integrate the geographic knowledge of the selected knowledge base entities in the transportation domain knowledge graph with the text-encoded representation. The event extraction module extracts relevant elements from the deeply fused text encoding representation to initially construct the event framework; The multi-task learning module is used to coordinate the joint learning and reasoning of related tasks such as entity recognition, relation extraction, event type classification, and knowledge fusion. It identifies and extracts the text information of traffic events to be processed and outputs the final prediction results.
2. The knowledge-enhanced multi-task learning system according to claim 1, characterized in that, The basic encoding module includes: The pre-trained language model uses the BERT model as the basic encoder to encode traffic event text information into a basic text encoding representation, given a text sequence X = [x1, x2, ..., x...]. n The output of the basic encoder is the basic text encoding representation, which is expressed as: H=BERT(X)∈R n×dh , Where n represents the length of the encoded sequence, d h Indicates the dimension of the hidden layer; The context-enhanced encoder enhances the model's ability to understand textual information about traffic events by adding traffic-domain-specific pre-training tasks. The computational expression for the context-enhanced encoder is as follows: H ctx =LayerNorm(H+Dropout(FFN(H))), Among them, H ctx This represents the text encoding representation after context processing; FFN represents the feedforward neural network; Dropout represents the random deactivation operation; LayerNorm represents the layer normalization operation. The location-aware attention layer introduces a location-aware attention mechanism to capture the relative positional relationships between geographic entities in traffic event text information. The general calculation expression for the location-aware attention layer is: Among them, H i It is a geographical entity e i The text encoding representation of H j It is a geographical entity e j The text encoding representation, W Q It is a learnable query matrix, W K It is a learnable key matrix, d k It is the vector dimension of the query matrix. It is a location offset term used to encode geographic entity e. i and geographic entity e j Relative dependency information between locations, e ij It is a geographical entity e i For geographic entity e j Attention score, A ij It is the normalized geographic entity e i For geographic entity e j Attention score; The sequence representation enhancement layer enhances the expressive power of text encoding representation through residual connections and layer normalization operations. The computational expression for the sequence representation enhancement layer is as follows: H en =LayerNorm(H ctx +Attention(H ctx )), Here, Attention represents a location-aware attention operation used to capture the dependencies between two long-distance geographic entities in traffic event text information, H en This represents the text encoding representation after Attention operation, residual connection, and layer normalization operation to enhance the representation.
3. The knowledge-enhanced multi-task learning system according to claim 1, characterized in that, The knowledge graph construction module includes: Data acquisition and integration components are used to collect transportation data from multiple sources; The knowledge extraction and normalization component is used to extract structured knowledge from raw transportation domain data and perform normalization processing. A knowledge graph construction component that builds a knowledge graph for the transportation domain based on standardized structured knowledge. Knowledge embedding learning components are used to encode entities and relations in knowledge graphs into low-dimensional dense vectors.
4. A knowledge-enhanced multi-task learning system according to claim 2, characterized in that, The knowledge enhancement module includes: The geographic entity recognition and linking component is used to identify geographic entity mentions in traffic event texts and link them to knowledge base entities in the traffic domain knowledge graph. The knowledge fusion network component is used to deeply fuse the geographic knowledge of filtered entities with the enhanced text-encoded representation, enabling the model to enhance its event extraction capabilities using geographic knowledge.
5. A knowledge-enhanced multi-task learning system according to claim 4, characterized in that, The geographic entity recognition and linking components include: The basic geographic entity linker extracts geographic entity mentions (i.e., text mentions) from traffic event texts using string matching and fuzzy matching methods. It then performs preliminary identification and matching between these text mentions and knowledge base entities in the traffic domain knowledge graph. Text mentions and knowledge base entities with fuzzy matching similarity scores below a set threshold are filtered out. The expression for calculating fuzzy matching similarity is as follows: Where char(·) represents a character set, ∩ represents the intersection operation of sets, and ∪ represents the union operation of sets; The Neural Geographic Entity Linker, based on a high-level neural network linker, combines contextual information and geographic knowledge to link filtered and retained text mentions with knowledge base entities. Specifically, the filtered text mentions are processed by a mention encoder to obtain an encoded representation h of the text mentions. m Its expression is: The filtered knowledge base entities are processed by an entity encoder to obtain the encoded representation h of the knowledge base entities. e Its expression is: The similarity between the encoded representation of a text mention and the encoded representation of a knowledge base entity is calculated using the following expression: Where W is a learnable weight matrix and b is a learnable bias term; The context-aware link enhancement unit, by combining contextual information, enhances the link accuracy of entity links, retaining the knowledge base entity encoding representations with matching similarity higher than a set threshold. The similarity calculation expression after enhancing link accuracy is: score enhanced (m,e)=score(m,e)+α·sim(h ctx ,h e ), Where α is the proportionality coefficient, sim is the cosine similarity, and h ctx Encode a text reference that includes contextual information.
6. A knowledge-enhanced multi-task learning system according to claim 5, characterized in that, The knowledge fusion network components include: The knowledge gating unit controls the degree to which the filtered knowledge encoding representation is integrated into the enhanced text encoding representation. The expression for the knowledge gating function G is: Among them, [H en ;K] represents the enhanced text encoding representation H en And the concatenation of knowledge encoding representation K, W g Let b represent the learnable weight matrix. g σ represents the learnable bias term, and σ represents the Sigmoid activation function. Knowledge transformation networks are used to convert knowledge encoded representation K into an enhanced text encoded representation H. en The feature representation of the same dimension, i.e., the knowledge transformation representation K', is expressed as: Where ReLU is the activation function, W t b is a learnable weight matrix. t For learnable bias terms; The multi-layered knowledge attention layer uses a multi-head attention mechanism to capture the interaction between text and knowledge at different levels. Its general expression is: MultiHead(Q,K,V)=Concat(head1,…,head i )W O , Where Q is the query matrix, K is the key matrix, V is the value matrix, Concat is the concatenation operation, head is the split attention head, i represents the number of attention head splits, and attention is calculated independently for different attention heads, W O The projection matrix; The hierarchical fusion layer, through a multi-layered fusion strategy, gradually integrates the knowledge encoding representation K into the enhanced text encoding representation H. en The specific steps include: Shallow knowledge fusion is performed through gating units, and its fusion expression is as follows: H shallow =H en +G⊙K', Among them, H shallow This represents the text encoding after shallow knowledge fusion obtained through the gating unit, where ⊙ represents element-wise multiplication. Deep knowledge fusion is achieved through multi-head attention operations and residual connections, and its fusion expression is as follows: H deep =LayerNorm(H shallow +MultiHead(H shallow ,K,K′)), Among them, the text encoding representation after shallow knowledge fusion is H shallow Multi-head attention is computed with the knowledge transformation representation K', and then residual connections are made with it. After layer normalization, the text encoding representation H after deep knowledge fusion is obtained. deep ; Deeply fused text encoding representation H deep Compared with the enhanced text encoding representation H en After fusion and layer normalization, the final text encoding representation H' of the knowledge fusion is obtained, and its expression is: H'=LayerNorm(H deep +H en ), The contrastive learning loss computation unit improves the enhanced text encoding representation H by minimizing the contrastive learning loss. en The alignment with the knowledge encoding representation K is expressed as: in, To compare the learning loss function, a smaller value indicates a higher degree of alignment. h is the transpose of a text encoding representation in H'. k Let j represent the index value range of geographical knowledge in the knowledge base, specifically from 1 to the total number of knowledge points, and τ is the temperature coefficient.
7. A knowledge-enhanced multi-task learning system according to claim 6, characterized in that, The event extraction module includes: The event trigger word recognition component is used to identify event trigger words in text encoding representations and determine the core action or state of an event. Specifically, it includes the following steps: Trigger word candidate generation: Potential trigger word candidates are generated based on part-of-speech and semantic information. The expression is as follows: P(y i |X)=softmax(W t h i +b t ), Where i represents the index of the text sequence, with a maximum value of the text sequence length minus one, and h i W is the encoded representation of the i-th word in H'. t It is a learnable weight parameter, b t It is a learnable bias parameter, y i It is the i-th trigger word label, P(y i |X) represents the probability distribution of the i-th word belonging to each tag category; Trigger word filtering and classification: Filter and classify event trigger words to determine the event type. The expression is: Where t is the trigger word, c is the set of event types, and P(c|t) is the probability that trigger word t belongs to type c. This represents the index of the event type EventType(t) that has the highest probability of the trigger word t belonging to type c in the set of event types c; The event element extraction component is used to extract elements related to an event, such as participants, time, location, and / or degree of impact. Specifically, it includes the following steps: Element Role Recognition: Identifying the semantic roles of event elements, with the probability distribution expression as follows: P(r s |X,t)=softmax(W r [h s ;h t ;h s,t ]+b r ), Where X is the input text sequence, h s It is the coded representation of candidate elements, h t It is the encoded representation of the trigger word, h s,t It is the interaction feature between candidate elements and trigger words, r s It's a character tag, W r It is a learnable weight, b r It is the corresponding bias, P(r) s |X,t) represents the event element belonging to each role tag r s The probability distribution; Feature boundary detection: Detects the exact boundaries of event features; the probability distribution expression is: P(y m,n |X)=softmax(W b [h m ;h n ;h m:n ]+b b ), Where X is the input text sequence, m is the start position of the text sequence segment, n is the end position of the text sequence segment, and h is the input text sequence. m:n It represents the span from the m-th word to the n-th word, y m,n It's a boundary label, W b It is a learnable weight, b b It corresponds to the learnable bias, P(y) m,n |X) represents the event element, i.e., the text fragment m:n, which belongs to each boundary label y. m,n The probability distribution; The event framework building component constructs a complete event framework based on the identified trigger words and elements, specifically including the following steps: Element association: Associate the extracted event elements with the corresponding event trigger words. The association expression is as follows: Where t is the trigger word, s is the event element, and h is the event element. s It is the coded representation of event elements. It is the transpose of the trigger word encoding representation, W a These are learnable association weights; Frame integrity check: Checks the integrity of the event frame to ensure that all necessary elements have been extracted. Its expression is: Where E is the set of extracted elements, and RequiredRoles is the set of necessary roles required by the event type; The event spatiotemporal relationship reasoning component, based on extracted event elements, infers the temporal and spatial relationships of events, specifically including the following steps: Temporal Relationship Reasoning: Reasoning about the time of an event and its temporal relationship with other events; its expression is: Among them, R temp It is a set of time relationships, where s1 represents the first event element and s2 represents the second event element. The encoded representation of the first event element. The encoding representation of the second event element, TemporalRel(s1,s2), represents the temporal relationship with the highest probability in the probability distribution of the temporal relationship between the two event elements s1 and s2. Spatial relationship reasoning: Reasoning about the specific location where an event occurs and its spatial relationship with other locations, expressed as: Among them, R spat It is a set of spatial relationships, where s1 represents the first event element and s2 represents the second event element. The first event element represents, The second event element is represented by SpatialRel(s1,s2), which represents the spatial relationship with the highest probability in the probability distribution of the spatial relationship between the two event elements s1 and s2.
8. A knowledge-enhanced multi-task learning system according to claim 7, characterized in that, The multi-task learning module includes: The feature adaptation and sharing mechanism layer is used to adjust the dimension of the feature representations of various tasks so that they can interact and share in the same feature space. Through learnable transformations, the feature representations from various sources after dimension adaptation are mapped to the feature space of the corresponding task. At the same time, an attention mechanism is used to dynamically adjust the importance of the feature representations to adapt to the needs of the corresponding task. A multi-task collaborative learning component is used to perform entity recognition tasks, relation extraction tasks, event type classification tasks, and knowledge learning and fusion tasks. The inter-task information interaction component adopts an information exchange mechanism to share the adaptive features between various tasks and promote the execution of each task. The dynamic task balancing component is used to dynamically adjust the weight and learning strategy of each task based on the task difficulty and learning progress. A joint training and inference component is used to coordinate the training and inference processes of the system.
9. A knowledge-enhanced multi-task learning system according to claim 8, characterized in that, Entity recognition task: Identify various entities in text, whose expressions are: Where H' is the fused text encoding representation, Y is the entity label sequence, Y' is the set of all possible label sequences corresponding to the input H', l is the index of the entity label sequence, taking values from 1, 2, ..., n, and φ is the feature function used to measure the label y at position l. l The previous tag y l-1 The compatibility with the input text encoding representation H', P(Y|H') is the probability that the entity label sequence Y is correct for the input text encoding representation H'; Relation extraction task: Extract semantic relationships between entities and construct a structured representation of events, the expression of which is: Where r is a predefined relation, e1 represents entity 1, and e2 represents entity 2. W represents the joint representation of entity pairs. r b represents the weight matrix corresponding to the predefined relation r. r Let P(r|e1,e2) represent the bias term corresponding to the predefined relation r, and let P(r|e1,e2) represent the probability distribution of all possible relations r. Event type classification task: Determine the specific type of an event; the expression is: P(c|X)=softmax(W c h doc +b c ), Where c represents the set of event types, h doc W represents the encoded information of the input text sequence X. c Let b represent the weight matrix of the type set c. c Let P(c|X) represent the corresponding bias term, where P(c|X) is the probability that the input text sequence X is event category c. Knowledge learning fusion task: By minimizing the corresponding contrastive learning loss, we promote the alignment between text encoding representation and knowledge encoding representation, thereby enhancing the model's ability to understand geographical knowledge.
10. A multi-task learning method based on knowledge enhancement, characterized in that, Based on the knowledge-enhanced multi-task learning system according to any one of claims 1-9, the following steps are performed: S1. Encode the traffic incident text information into a text encoding representation using the basic encoding module; S2. Access the pre-built knowledge graph of the transportation domain to obtain the structured knowledge of the knowledge base entities; S3. Identify geographic entities in traffic incident text information through the knowledge enhancement module and link them with the traffic domain knowledge graph to deeply integrate relevant geographic knowledge with text encoding representation; S4. Identify and extract event trigger words and related event elements through the event extraction module to construct a preliminary event framework; S5. Through the multi-task learning module, entity recognition, relation extraction, event type classification and knowledge learning are coordinated to integrate the joint learning and reasoning of related tasks, and the final predicted structured event representation is output.
Citation Information
Cited By
Traffic accident knowledge graph construction method
CN121835861A