A traffic police situation handling method, device, electronic device and storage medium

By using BERT text pre-training model and multi-task processing model, the problem of insufficient portability and generalization capabilities of existing natural language models in traffic police data processing is solved, and the rapid and accurate processing of traffic police data is achieved.

CN114861626BActive Publication Date: 2025-08-01TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210249040.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2025-08-01
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

The existing natural language models have problems such as poor portability, weak generalization ability when processing traffic police data, and the single-task learning cannot meet the needs of multiple tasks.

Method used

The BERT text pre-trained model is used as the upstream shared parameter layer, and combined with the key information extraction sub-model, text classification sub-model and semantic recognition sub-model of the multi-task processing model, parallel learning is carried out through the parameter sharing mechanism to realize automatic processing of traffic police data.

Benefits of technology

The generalization ability and identification accuracy of the model are improved, and the key information, types and severity of the traffic police data can be quickly and accurately processed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114861626B_ABST
    Figure CN114861626B_ABST
Patent Text Reader

Abstract

The present invention discloses a traffic police situation processing method, apparatus, electronic device, and storage medium. The method includes: obtaining traffic police situation data to be processed; inputting the traffic police situation data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model; the text pre-training model simultaneously inputs the enhanced semantic vector into each sub-model of a multi-task processing model; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model; the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model analyze the enhanced semantic vector to respectively determine the police situation information, police situation type, and police situation severity in the traffic police situation data. Through the technical solution provided by the embodiments of the present invention, the automatic processing of traffic police situation data can be quickly and accurately realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic safety, and particularly to a traffic police situation processing method, device, electronic device and storage medium. Background Art

[0002] Existing natural language models have two deficiencies in processing traffic police situation data: on the one hand, the portability of language models is not high and the generalization ability is poor. These models require a large amount of manually labeled data during the training process, and the performance of the models is proportional to the quantity of labeled data. When the labeled data is too scarce in fields with scarce training data (for example, there is currently no large-scale Chinese traffic corpus annotation set), the model cannot fully learn the hidden features in the text, resulting in a significant reduction in prediction performance. At the same time, extracting key information in traffic police situations depends on the design of the language model and the formulation of rules. When the application scenario and data change (for example, there are differences in the alarm content and format in different cities), it takes a lot of time and effort to revise and improve the rules. On the other hand, existing language models focus on solving single problems and conduct separate training for specific tasks in the text. For example, extraction of key information in traffic accidents, causes of major and extremely serious traffic accidents, and identification of road safety risk sources. The single-task learning language model often pays more attention to local information in the text, while traffic police situation data needs to process multiple tasks (such as key information of police situations, police situation classification, and police situation semantic recognition) for the entire text content. Single-task learning obviously cannot meet the actual needs of police situation data processing. Summary of the Invention

[0003] The present invention provides a traffic police situation processing method, device, electronic device and storage medium, which can quickly and accurately realize automatic processing of traffic police situation data.

[0004] According to one aspect of the present invention, there is provided a traffic police situation processing method, including:

[0005] Obtaining traffic police situation data to be processed;

[0006] Inputting the traffic police situation data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model;

[0007] The text pre-training model inputs the enhanced semantic vector into each sub-model of a multi-task processing model at the same time; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model and a semantic recognition sub-model;

[0008] The key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model analyze the enhanced semantic vector to respectively determine the police situation information, the police situation type, and the severity of the police situation in the traffic police situation data.

[0009] According to another aspect of the present invention, there is provided a traffic police situation processing device, including:

[0010] A police situation data acquisition module for acquiring traffic police situation data to be processed;

[0011] An enhanced semantic vector acquisition module for inputting the traffic police situation data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model;

[0012] An enhanced semantic vector input module for the text pre-training model to simultaneously input the enhanced semantic vector into each sub-model of a multi-task processing model; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model;

[0013] A police situation data processing module for the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model to analyze the enhanced semantic vector to respectively determine the police situation information, the police situation type, and the severity of the police situation in the traffic police situation data.

[0014] According to another aspect of the present invention, there is provided an electronic device, the electronic device includes:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the traffic police situation processing method according to any embodiment of the present invention.

[0018] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to execute the traffic police situation processing method according to any embodiment of the present invention when executed.

[0019] The traffic police situation processing solution according to the embodiments of the present invention obtains traffic police situation data to be processed; inputs the traffic police situation data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model; the text pre-training model simultaneously inputs the enhanced semantic vector into each sub-model of a multi-task processing model; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model; the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model analyze the enhanced semantic vector to respectively determine the police situation information, police situation type, and police situation severity in the traffic police situation data. Through the technical solution provided by the embodiments of the present invention, using the BERT text pre-training model as the upstream shared parameter layer and the multi-task parallel learning method as the downstream automatic processing layer, not only realizes the automatic processing of the key police situation information, police situation type, and police situation severity in the traffic police situation data, but also reduces the training parameters of different sub-models by adopting a parameter sharing mechanism, learns more content with less prior knowledge, thereby improving the generalization ability and recognition accuracy of the model.

[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0022] Figure 1 is a flowchart of a traffic police situation processing method provided by Embodiment 1 of the present invention;

[0023] Figure 2 is a schematic diagram of the composition of the BERT model word vectors provided by the embodiments of the present invention;

[0024] Figure 3 is a schematic diagram of a traffic police situation processing process provided by the embodiments of the present invention;

[0025] Figure 4 is a schematic diagram of a police situation information determination process provided by the embodiments of the present invention;

[0026] Figure 5A schematic diagram of the process for determining the severity of a police situation provided by an embodiment of the present invention;

[0027] Figure 6 It is a schematic structural diagram of a traffic police situation processing device provided by Embodiment 2 of the present invention;

[0028] Figure 7 It is a schematic structural diagram of an electronic device for implementing the traffic police situation processing method of the embodiment of the present invention. Detailed implementation manners

[0029] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0031] Embodiment 1

[0032] Figure 1 A flowchart of a traffic police situation processing method is provided for Embodiment 1 of the present invention. This embodiment is applicable to the situation of processing traffic police situation data. This method can be executed by a traffic police situation processing device, which can be implemented in the form of hardware and / or software, and the traffic police situation processing device can be configured in an electronic device. As Figure 1 shown, the method includes:

[0033] S110. Obtain traffic police situation data to be processed.

[0034] Among them, the traffic police situation data to be processed can be one or multiple. In the embodiments of the present invention, the traffic police situation data to be processed can be obtained from the traffic command center, or the data reported by users in the form of telephone or text message can be used as the traffic police situation data to be processed. It should be noted that the embodiments of the present invention do not limit the acquisition method of the traffic police situation data.

[0035] In the embodiments of the present invention, a piece of traffic police situation data may include event time information, address information, license plate information, police situation type, and police situation severity. Exemplarily, in the traffic police situation data "At the intersection of Songling Youche Road and Songling Avenue, a school teacher was hit by a car on Youche Road at around 1 pm. The license plate is Su E2***. The injured person was not reported to the police at that time and is now being rescued in the First People's Hospital. The reporter is now at Songling Beimen Primary School", the address information is "At the intersection of Songling Youche Road and Songling Avenue", the time information is "around 1 pm", the license plate information is "Su E2***", the police situation type is "being hit by a car", and the police situation severity is "being rescued in the First People's Hospital".

[0036] Optionally, preprocessing operations can be performed on the traffic police situation data to be processed. Among them, there are some proper nouns with local characteristics used by the reporter during the oral description in the police situation data, such as road names, building names, and some referring nouns, etc. For example, the reporter usually uses the brand of a motor vehicle to replace the vehicle name. Therefore, in the preprocessing stage, a proper noun corpus can be established. By means of downloading electronic maps, web search, synonym search, etc., a road name corpus, a vehicle brand name corpus, a motor vehicle type corpus, a non-motor vehicle type corpus, a pedestrian referring noun corpus, a time type corpus (such as yesterday, a few days ago, week, etc.), a geographical location corpus (such as at the door, at the intersection, by the river, under the bridge, etc.), and a license plate information type corpus (such as Su E, Su U) within the research area can be established. In addition, since some irrelevant special punctuation characters, blank characters, and modal particles have no actual meaning themselves, these characters can be deleted during the data preprocessing stage.

[0037] S120. Input the traffic police situation data into the text pre-training model to obtain the enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model.

[0038] Among them, the BERT (Bidirectional Encoder Representations from Transformers) model is a dynamic natural language processing pre-training technology. In the embodiments of the present invention, the BERT model is used as a text pre-training model, and the traffic police situation data to be processed is input into the text pre-training model, so that the text pre-training model analyzes the traffic police situation data and outputs an enhanced semantic vector corresponding to the traffic police situation data.

[0039] Specifically, the BERT model includes a vector transformation layer and at least one Transformer encoder. Suppose the traffic police situation data sequence is X = {x1, x2, …, x N}, and N is the number of words in the traffic police situation data. The vector transformation layer of the BERT model converts the input traffic police situation data into the sum of three vectors as the input. The three vectors are word vector embedding, sentence embedding, and position embedding respectively. During the input process of the traffic police situation data sequence, [CLS] is the beginning of the sequence and [SEP] is the separator symbol. Figure 2 FIG. is a schematic diagram of the composition of word vectors of a BERT model provided by an embodiment of the present invention.

[0040] After the input traffic police situation data sequence is vector-transformed, the vector is passed into the Transformer encoder to extract vector features. The calculation formula for feature extraction is as follows:

[0041] R l = Transformer l (R l-1 ) (1)

[0042] In the formula, l represents the number of layers corresponding to the Transformer encoder (that is, the number of Transformer encoders), and R l is the feature of the data vector of each layer. Each Transformer encoder consists of a multi-head self-attention module composed of multiple self-attention mechanisms. The self-attention mechanism obtains three groups of vector sequences by linearly transforming the input data sequence, as shown in formula (2):

[0043]

[0044] In the formula, Q represents the output vector sequence, K represents the key vector sequence, and V represents the input vector sequence. W Q , W K , W V respectively represent learnable hyperparameter matrices. The Softmax function is used to normalize the weight matrix to obtain the feature function of the self-attention mechanism as follows:

[0045]

[0046] In the formula, represents the scaling factor. The calculation formula of the multi-head self-attention module is:

[0047] H i = Attention(Q, K, V) (4)

[0048] Muti-H i = concat[H1, H2,..., H h W O (5)

[0049] In the formula, h is the number of attention heads, and W O is a learnable hyperparameter matrix. The output of the multi-head self-attention module contains an enhanced semantic vector with context semantics; through steps such as residual connection, layer normalization, and feed-forward neural network, an enhanced semantic vector identical to the original word vector is finally obtained and used as the input of the next layer of the encoder; after repeating the same Transformer encoder multiple times, an output vector with the same length as the traffic police situation data is obtained, that is, the enhanced semantic vector.

[0050] S130. The text pre-training model inputs the enhanced semantic vector into each sub-model of the multi-task processing model simultaneously; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model.

[0051] In the embodiment of the present invention, the enhanced semantic vector output by the text pre-training model is applied to each sub-model of the multi-task processing model through a parameter sharing mechanism to reduce the training parameters of different sub-models, learn more content with less prior knowledge, and thus improve the generalization ability of the sub-models. Specifically, the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model. The text pre-training model inputs the enhanced semantic vector into the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model in the multi-task processing model simultaneously through the parameter sharing mechanism, so that the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model in the multi-task processing model perform parallel processing on the enhanced semantic vector to realize the automatic processing of traffic police situation data.

[0052] Figure 3 It is a schematic diagram of a traffic police situation processing process provided by an embodiment of the present invention.

[0053] S140, the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model analyze the enhanced semantic vector to respectively determine the police situation information, police situation type, and police situation severity in the traffic police situation data.

[0054] Among them, the key information extraction sub-model analyzes the enhanced semantic vector to determine the police situation information from the traffic police situation data. Among them, the police situation information may include time information, address information, and license plate information. The embodiment of the present invention does not limit the type of the key information extraction sub-model.

[0055] The text classification sub-model analyzes the enhanced semantic vector to determine the police situation type in the traffic police situation data. Among them, the text classification sub-model may be a linear classification model built in the BERT pre-trained model, or a fast text classification model FastText, or a convolutional network text classification model TextCNN. Of course, it may also be a recurrent neural network model TextRNN or a deep pyramid convolutional neural network model DPCNN. It should be noted that the embodiment of the present invention does not limit the type of the text classification sub-model. In the embodiment of the present invention, according to different causes of police situations, the police situation types may include motor vehicle and motor vehicle accidents, motor vehicle and non-motor vehicle accidents, motor vehicle and pedestrian accidents, non-motor vehicle and non-motor vehicle accidents, non-motor vehicle and pedestrian accidents, and single-vehicle accidents. In the embodiment of the present invention, accurately determining the police situation type in the traffic police situation data is of great significance for the traffic police to adopt fast and effective accident handling methods and subsequent accident cause analysis. Table 1 is a sample of six types of traffic police situation data provided by the embodiment of the present invention:

[0056] Table 1 Sample of Six Types of Traffic Police Situation Data

[0057]

[0058]

[0059] In the embodiment of the present invention, the semantic recognition sub-model analyzes the enhanced semantic vector to determine the police situation severity in the traffic police situation data. Among them, the police situation severity can be understood as the severity of a traffic accident and is used to determine whether rescue is needed. For example, for an accident with casualties, promptly dispatching medical or fire rescue forces to the accident scene can minimize casualties and health hazards. Therefore, accurately determining the police situation severity is crucial. In the embodiment of the present invention, the type of the semantic recognition sub-model is not limited.

[0060] The traffic police situation processing method according to an embodiment of the present invention obtains traffic police situation data to be processed; inputs the traffic police situation data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model; the text pre-training model simultaneously inputs the enhanced semantic vector into each sub-model of a multi-task processing model; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model; the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model analyze the enhanced semantic vector to respectively determine the police situation information, police situation type, and police situation severity in the traffic police situation data. Through the technical solution provided by the embodiment of the present invention, using the BERT text pre-training model as the upstream shared parameter layer and the multi-task parallel learning method as the downstream automatic processing layer, not only realizes the automatic processing of the key police situation information, police situation type, and police situation severity in the traffic police situation data, but also reduces the training parameters of different sub-models by adopting a parameter sharing mechanism, learns more content with less prior knowledge, thereby improving the generalization ability and recognition accuracy of the model.

[0061] In some embodiments, the key information extraction sub-model includes a conditional random field model; before the key information extraction sub-model analyzes the enhanced semantic vector to determine the police situation information in the traffic police situation data, it further includes: the text pre-training model performs sequence annotation on the traffic police situation data, and determines a state sequence corresponding to the traffic police situation data according to the annotation result; the text pre-training model inputs the state sequence into the key information extraction sub-model; the key information extraction sub-model analyzes the enhanced semantic vector to determine the police situation information in the traffic police situation data, including: the conditional random field model analyzes the enhanced semantic vector and the state sequence to determine the police situation information in the traffic police situation data. The advantage of such a setting is that the sequence annotation of the traffic police situation data is realized through the enhanced semantic vector output by the text pre-training model combined with the conditional random field model CRF, so as to accurately determine the police situation information in the traffic police situation data.

[0062] Specifically, the text pre-training model performs sequence labeling on traffic police situation data, and determines the state sequence corresponding to the traffic police situation data according to the labeling result. It can be understood that the process of sequence labeling is that the text pre-training model takes the enhanced semantic vector as the sequence to be observed, sets a state for each semantic vector, maximizes the weights of the observed sequence and the state sequence through the training set, finds the probability value that meets the conditions, and completes the sequence labeling process. Then the text pre-training model inputs the state sequence and the enhanced semantic vector into the conditional random field model (i.e., the key information extraction sub-model) at the same time. In the conditional random field model, the enhanced semantic vector is used as the observed sequence. Assuming that the observed sequence p = (p1, p2,..., p n ), and the state sequence q = (q1, q2,..., q n ), let P(q|p) be a linear chain random field, and the calculation formula of the conditional random field model is:

[0063]

[0064] where Z(p) is the normalization term, and the calculation formula is:

[0065]

[0066] In the formula, t k and s l represent the feature functions, and λ k and μ l represent the corresponding weights. It should be noted that the BIO labeling method can be used for sequence labeling, where "B" represents the start position of the word label, "I" represents the internal position of the word label, and "O" represents the external position that does not belong to the word label. The sequence labeling probability of each word vector can be obtained through the key information extraction sub-model. In the embodiments of the present invention, the time information (Time), location information (Address), and license plate information (Plate) in the traffic police situation data can be extracted in combination with the characteristics of the traffic police situation data and actual requirements. Figure 4 FIG. is a schematic diagram of a police situation information determination process provided by an embodiment of the present invention.

[0067] Optionally, the police situation information includes time information; after determining the police situation information in the traffic police situation data, it further includes: extracting the time information in the traffic police situation data; determining the type of the time information; wherein, the type of the time information includes the current occurrence time and the historical occurrence time. It can be understood that obtaining the time information in the traffic police situation data is very important for determining the occurrence time of the police situation and the rapid deployment of police force. The time information in the police situation can be divided into the current occurrence time and the historical occurrence time. The current occurrence time generally adopts the time when the alarm call is made. Some explicit times included in some police situations can further refine the occurrence time of the police situation, such as "5 minutes ago", "about 10 minutes"; the historical occurrence time is usually used to distinguish the historical police situations in the police situation information that "occurred in the past but do not require immediate police dispatch", such as "yesterday", "last Friday". This type of historical time can also be called relative time, and the time when the police situation event occurred can be calculated forward with the current alarm time as the reference point. By extracting the time information in the traffic police situation data and then judging the type of the time information, the number of mis-dispatched police by traffic police can be reduced.

[0068] Exemplarily, Table 2 shows the extraction results of the traffic police situation time information provided by the embodiments of the present invention:

[0069] Table 2 Extraction Results of Traffic Police Situation Time Information

[0070]

[0071]

[0072] In the embodiments of the present invention, the address information is the key information in the police situation data that describes the location where the police situation occurred. According to the granularity of the address location, it can be divided into four levels: city level, county level, street level, and local level. Among them, the local level refers to the detailed geographical location where the police situation occurred. It should be noted that there are a large number of address entity nesting phenomena in the process of extracting local level information. For example, there are two entity nestings of a place name (Zhongshan Road) and an institution name (New World) in "at the entrance of New World on Zhongshan Road". The traditional address information extraction method generally can only obtain the address information of "Zhongshan Road", but this information has a vague geographical scope and is not conducive to the traffic police arriving at the police situation site quickly. In the embodiments of the present invention, by observing the data format in the police situation, the address annotation "B-Address" can be selected as the starting position, and the [SEP] symbol can be used as the ending position. The address information is allocated in sequence according to the city level, county level, and street level, and the remaining characters are attributed to the local level to accurately determine the address information in the traffic police situation data.

[0073] Exemplarily, Table 3 shows the extraction results of the traffic police situation address information provided by the embodiments of the present invention:

[0074] Table 3 Traffic police address information extraction results

[0075]

[0076]

[0077] In this embodiment of the present invention, license plate information is also key information in police intelligence data, especially for fleeing vehicles. Obtaining license plate information facilitates traffic police's investigation and control, and helps them quickly capture the vehicle involved in the accident. License plate information is typically formatted in a standardized format, typically consisting of seven characters. Therefore, based on the data structure of the license plate information, the starting position (e.g., "苏") and internal positions (e.g., "E") of the license plate can be extracted, and the extraction process can continue until the end of the numeric or alphabetic characters.

[0078] In some embodiments, the traffic warning data is at least two; the semantic recognition sub-model includes a similarity calculation layer, a Bi-GRU unit layer and an attention mechanism layer; the semantic recognition sub-model analyzes the enhanced semantic vector to determine the severity of the warning in the traffic warning data, including: the similarity calculation layer in the semantic recognition sub-model respectively calculates the similarity between the enhanced semantic vectors corresponding to the at least two traffic warning data, and determines the target enhanced semantic vector whose similarity is greater than a preset similarity threshold; the similarity calculation layer inputs the target enhanced semantic vector into the Bi-GRU unit layer, the Bi-GRU unit layer determines the local feature enhancement vector corresponding to the target enhanced semantic vector, and inputs the local feature enhancement vector into the attention mechanism layer; the attention mechanism layer analyzes the local feature enhancement vector and respectively determines the severity of the warning in the traffic warning data corresponding to the target enhanced semantic vector. The advantage of this setting is that the severity of the warning in the traffic warning data can be accurately determined.

[0079] In an embodiment of the present invention, there are two difficulties in judging whether rescue is needed from a piece of traffic alarm data: on the one hand, the rescue-related word vectors appearing in the alarm have polysemy. For example, the "ambulance" in the alarm may refer to the type of accident ("a car and an ambulance collided"), or it may refer to an accident rescue request ("an ambulance is needed to arrive at the scene"). On the other hand, the sentence vectors for judging whether rescue is needed have a high similarity. For example, "someone is injured, notify an ambulance", "someone is injured, an ambulance has been notified", and "someone is injured, no ambulance is needed". Among the above three alarm data, only the first one needs to notify the rescue vehicle. Therefore, in an embodiment of the present invention, the severity of the alarm in the traffic alarm data can be accurately determined based on the traffic alarm semantic analysis method enhanced by local features.

[0080] Specifically, the semantic recognition sub-model includes a similarity calculation layer, a Bi-GRU cell layer, and an attention mechanism layer. When there are at least two traffic police situation data to be processed, the text pre-training model inputs the enhanced semantic vectors corresponding to each traffic police situation data into the similarity calculation layer in the semantic recognition sub-model respectively. The similarity calculation layer calculates the similarity between the enhanced semantic vectors corresponding to at least two traffic police situation data respectively, and determines the target enhanced semantic vectors whose similarity is greater than the preset similarity threshold. Then the similarity calculation layer inputs the target enhanced semantic vectors into the Bi-GRU cell layer. The Bi-GRU cell layer is used to extract the local feature enhanced vectors corresponding to the target enhanced vectors, that is, to determine the local deep features in the similar semantics, and inputs the local feature enhanced vectors into the attention mechanism layer (that is, the Attention mechanism layer). The Softmax function is used for normalization processing in the Attention mechanism layer, and finally the severity label of the traffic police situation is obtained, so as to determine the severity of the traffic police situation data.

[0081] Exemplarily, Figure 5 is a schematic diagram of a process for determining the severity of a police situation provided by an embodiment of the present invention. As Figure 5 shown, after the traffic police situation data sequence is pre-trained by BERT, an enhanced semantic vector sequence V = {v1, v2,..., v N} will be obtained, where N represents the length of the traffic police situation data sequence. Then the enhanced semantic vectors are input into the Bi-GRU hidden layer. The state of the hidden layer is jointly determined by the input v t at time t, the output of the hidden layer state forward at time t - 1 and the output of the hidden layer state in the reverse direction . The Bi-GRU model can be considered as the weighted sum of two unidirectional GRUs, as shown in formulas (8 - 10):

[0082]

[0083] In the formula, the GRU(·) function represents a non-linear transformation of the input word vector, encoding the word vector into the corresponding GRU hidden layer state. ω t and μ t are the weights corresponding to the forward hidden layer state and the reverse hidden layer state of the bidirectional GRU at time t respectively, and b t represents the bias corresponding to the hidden layer at time t. To further strengthen the word features with important parts of speech and reduce the word features with unimportant parts of speech, the fully connected layer of the Bi-GRU model is input into the Attention mechanism layer. The formula for calculating the cumulative sum of the products of the input hidden layer states and the weight coefficients is:

[0084]

[0085] Where,

[0086]

[0087] e i = μ i tanh(ω i h i + b i ) (13)

[0088] In the formula, e i represents the energy value determined by the hidden layer state vector h i at the i-th moment; μ i and ω i represent the weight coefficient matrix at the i-th moment; b i represents the corresponding offset at the i-th moment. Through formula (11), the local key feature sentence vector can be obtained. On this basis, the Softmax classifier is used to obtain the severity label of the police situation semantic, and the backpropagation mechanism is used to continuously adjust and update the weights and biases according to the error until the iteration times are reached or less than the fixed precision.

[0089] Embodiment 2

[0090] Figure 6 The following is a schematic structural diagram of a traffic police situation processing device provided in Embodiment 2 of the present invention. As Figure 6 shown, the device includes:

[0091] A police situation data acquisition module 610, configured to acquire traffic police situation data to be processed;

[0092] An enhanced semantic vector acquisition module 620, configured to input the traffic police situation data into a text pre-training model, and acquire an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model;

[0093] An enhanced semantic vector input module 630, configured to input the enhanced semantic vector into each sub-model of a multi-task processing model by the text pre-training model; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model;

[0094] A police situation data processing module 640, configured to analyze the enhanced semantic vector by the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model, and respectively determine the police situation information, police situation type, and police situation severity in the traffic police situation data.

[0095] Optionally, the key information extraction sub-model includes a conditional random field model;

[0096] The device further includes:

[0097] A status sequence determination module, configured to perform sequence annotation on the traffic police situation data by the text pre-training model before the key information extraction sub-model analyzes the enhanced semantic vector to determine the police situation information in the traffic police situation data, and determine a status sequence corresponding to the traffic police situation data according to the annotation result;

[0098] A status sequence input module, configured to input the status sequence into the key information extraction sub-model by the text pre-training model;

[0099] The police situation data processing module is configured to:

[0100] The conditional random field model analyzes the enhanced semantic vector and the status sequence to determine the police situation information in the traffic police situation data.

[0101] Optionally, there are at least two pieces of the traffic police situation data;

[0102] The semantic recognition sub-model includes a similarity calculation layer, a Bi-GRU cell layer, and an attention mechanism layer;

[0103] The police situation data processing module is configured to:

[0104] The similarity calculation layer in the semantic recognition sub-model calculates the similarity between the enhanced semantic vectors corresponding to the at least two pieces of traffic police situation data respectively, and determines a target enhanced semantic vector with a similarity greater than a preset similarity threshold;

[0105] The similarity calculation layer inputs the target enhanced semantic vector into the Bi-GRU cell layer, and the Bi-GRU cell layer determines a local feature enhanced vector corresponding to the target enhanced semantic vector and inputs the local feature enhanced vector into the attention mechanism layer;

[0106] The attention mechanism layer analyzes the local feature enhanced vector and determines the severity of the police situation in the traffic police situation data corresponding to the target enhanced semantic vector respectively.

[0107] Optionally, the police situation information includes time information, address information, and license plate information.

[0108] Optionally, the police situation information includes time information;

[0109] The device further includes:

[0110] A time information extraction module, configured to extract the time information in the traffic police situation data after determining the police situation information in the traffic police situation data;

[0111] A time type determination module for determining the type of the time information; wherein, the type of the time information includes the current occurrence time and the historical occurrence time.

[0112] Optionally, the text classification sub-model includes a recurrent neural network model.

[0113] Optionally, the types of police cases include motor vehicle and motor vehicle accidents, motor vehicle and non-motor vehicle accidents, motor vehicle and pedestrian accidents, non-motor vehicle and non-motor vehicle accidents, non-motor vehicle and pedestrian accidents, and single-vehicle accidents.

[0114] The traffic police case processing device provided by the embodiments of the present invention can execute the traffic police case processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0115] Embodiment III

[0116] Figure 7 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0117] As Figure 7 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0118] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0119] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the traffic police situation processing method.

[0120] In some embodiments, the traffic police situation processing method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the traffic police situation processing method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the traffic police situation processing method by any other suitable means (e.g., by means of firmware).

[0121] The various embodiments of the systems and technologies described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, executed partially on the machine as an independent software package and partially on a remote machine, or executed entirely on a remote machine or server.

[0123] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0124] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0125] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected with each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0126] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0127] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0128] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A traffic police situation handling method, characterized in that, Including: Obtain traffic police situation data to be processed; Input the traffic police situation data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police situation data output by the text pre-training model; wherein, the text pre-training model is a BERT model; The text pre-training model simultaneously inputs the enhanced semantic vector into each sub-model of a multi-task processing model; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model; The key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model analyze the enhanced semantic vector to respectively determine the situation information, situation type, and situation severity in the traffic police situation data.

2. The method according to claim 1, wherein The key information extraction sub-model includes a conditional random field model; Before the key information extraction sub-model analyzes the enhanced semantic vector to determine the situation information in the traffic police situation data, it further includes: The text pre-training model performs sequence annotation on the traffic police situation data and determines a state sequence corresponding to the traffic police situation data according to the annotation result; The text pre-training model inputs the state sequence into the key information extraction sub-model; The key information extraction sub-model analyzes the enhanced semantic vector to determine the situation information in the traffic police situation data, including: The conditional random field model analyzes the enhanced semantic vector and the state sequence to determine the situation information in the traffic police situation data.

3. The method according to claim 1, wherein There are at least two pieces of the traffic police situation data; The semantic recognition sub-model includes a similarity calculation layer, a Bi-GRU unit layer, and an attention mechanism layer; The semantic recognition sub-model analyzes the enhanced semantic vector to determine the situation severity in the traffic police situation data, including: The similarity calculation layer in the semantic recognition sub-model calculates the similarity between the enhanced semantic vectors corresponding to at least two pieces of traffic police situation data respectively, and determines a target enhanced semantic vector with a similarity greater than a preset similarity threshold; The similarity calculation layer inputs the target enhanced semantic vector into the Bi-GRU unit layer, and the Bi-GRU unit layer determines a local feature enhanced vector corresponding to the target enhanced semantic vector and inputs the local feature enhanced vector into the attention mechanism layer; The attention mechanism layer analyzes the local feature enhanced vector to respectively determine the situation severity in the traffic police situation data corresponding to the target enhanced semantic vector.

4. The method according to any one of claims 1 to 3, characterized in that The situation information includes time information, address information, and license plate information.

5. The method according to claim 4, characterized in that, The situation information includes time information; After determining the situation information in the traffic police situation data, it further includes: Extract the time information in the traffic police situation data; Determine the type of the time information; wherein, the type of the time information includes the current occurrence time and the historical occurrence time.

6. The method according to claim 1, characterized in that, The text classification sub-model includes a recurrent neural network model.

7. The method according to claim 1, characterized in that, The types of police cases include motor vehicle and motor vehicle accidents, motor vehicle and non-motor vehicle accidents, motor vehicle and pedestrian accidents, non-motor vehicle and non-motor vehicle accidents, non-motor vehicle and pedestrian accidents, and single-vehicle accidents.

8. A traffic police situation processing device, characterized in that, Including: A police case data acquisition module for acquiring traffic police case data to be processed; An enhanced semantic vector acquisition module for inputting the traffic police case data into a text pre-training model to obtain an enhanced semantic vector corresponding to the traffic police case data output by the text pre-training model; wherein, the text pre-training model is a BERT model; An enhanced semantic vector input module for the text pre-training model to input the enhanced semantic vector into each sub-model of a multi-task processing model simultaneously; wherein, each sub-model of the multi-task processing model includes a key information extraction sub-model, a text classification sub-model, and a semantic recognition sub-model; A police case data processing module for the key information extraction sub-model, the text classification sub-model, and the semantic recognition sub-model to analyze the enhanced semantic vector and respectively determine the police case information, police case type, and police case severity in the traffic police case data.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the traffic police case processing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the traffic police case processing method according to any one of claims 1-7 when executed.

Citation Information

Patent Citations

  • Multi-task classification model training method and device and multi-task classification method and device

    CN110728298A

  • Monitoring information processing method and system, terminal and readable storage medium

    CN111416841A