Traffic accident disability grade identification method based on mixed prompt learning
By applying a mixed prompt learning method in the identification of traffic accident disability grades and combining the pre-trained model of Transformer architecture for transfer learning, the problems of low efficiency and low accuracy in the existing technology are solved, and efficient and accurate automated identification is achieved.
Patent Information
- Application Number
- CN202411827496.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art has problems such as low work efficiency, low accuracy and large data volume in the identification of traffic accident disability grades, which are greatly affected by individual subjectivity.
A method based on mixed prompt learning is adopted, by screening and text processing the input traffic accident disability identification text, a supervised data set of traffic accident disability levels is generated, and the input characterization of the text is combined with the mixed prompt template through a gated mechanism, and a pre-trained model based on Transformer architecture is used for transfer learning to achieve the prediction of disability levels.
It significantly improves the work efficiency and accuracy of traffic accident judicial appraisal, reduces the amount of traffic accident data required for training models, and realizes automated traffic accident disability level appraisal.
Smart Images

Figure CN119961440A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of intelligent judicial identification, and in particular to a method for identifying the degree of disability in traffic accidents based on mixed prompt learning. Background Art
[0002] Traffic accident disability assessment refers to the forensic clinical judicial assessment activity in which the judicial appraiser analyzes and assesses the disability level based on the injury information of the person being assessed. The judicial appraiser understands the case in detail, carefully reads the medical records and other identification materials, and tries to fully grasp the trauma history, clinical manifestations and related auxiliary examinations (such as X-rays, CT, etc.) of the person being assessed, and comprehensively determines the disability level of the injured person. Faced with the large number of people injured in traffic accidents, the scientific, fair, rapid and efficient conduct of traffic accident disability assessment plays an important role in clarifying accident compensation liability, properly resolving accident disputes, and ensuring social harmony and stability.
[0003] The Chinese invention patent application with publication number CN115293229A discloses a "method for the identification and assessment basis deduction of disability levels based on natural language understanding". This method is mainly used to analyze the description text of illness and injury for labor capacity assessment. At the same time, this method obtains the classification result of disability level prediction by constructing an intelligent disability level identification model based on Bert text classification and an identification basis matching model based on text similarity, and then matches the basis through dimensionality reduction and text similarity calculation with the identification basis. It does not involve the identification of traffic accident disability levels and the application of mixed prompt learning methods.
[0004] However, the identification of traffic accident disability level is determined by judicial identification personnel based on the inspection materials, which requires high technical ability and experience level of the identification personnel and is greatly affected by personal subjectivity. At the same time, the entire identification process is conducted manually, which has a large workload and low work efficiency. Therefore, it is very necessary to conduct scientific research and innovation to propose a method for judicial identification of traffic accident disability level that is automatic, efficient, scientific and accurate, and requires low data volume. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and propose a method for identifying the level of disability in traffic accidents based on hybrid prompt learning. This method effectively improves the work efficiency and identification accuracy of traffic accident forensic identification and significantly reduces the amount of traffic accident data required for training the model.
[0006] A method for evaluating the level of disability in traffic accidents based on mixed prompt learning of the present invention comprises the following steps:
[0007] S1. Input traffic accident disability assessment text x tThe target text is obtained by screening, wherein the text data of the eighth, ninth and tenth grade rib fracture disability assessment, which are common in the assessment of disability levels of traffic accident personnel, are extracted as input;
[0008] S2, the input target text is processed through the text processing layer to obtain a supervised data set of traffic accident disability levels;
[0009] S3, the supervised data set of traffic accident disability level input prompt loader, obtains the input representation input of the text, as shown in the following formula:
[0010] input=text+label
[0011] S4. Combine the text input representation input with the hybrid prompt template through the gating mechanism to obtain a text representation h with weighted fusion t , where the mixed prompt template is initialized as '[cls]+traffic accident disability information includes:{"text"}+[sep]+disability level belongs to+{"mask"}+{"soft":"level attribution"}+[sep]';
[0012] S5. Text representation using weighted fusion h t As the input of the pre-trained model based on the Transformer architecture, transfer learning is carried out to achieve the prediction of traffic accident disability level based on injury assessment.
[0013] Preferably, in step 2, the processing of the text processing layer includes the following sub-steps:
[0014] S2.1 removes stop words from the target text, deleting common but meaningless words to reduce noise and provide clean and standardized data input for the model;
[0015] S2.2 processes the target text by length and cuts off the long text to improve the learning efficiency of the model;
[0016] S2.3 Check and correct the target text to ensure the accuracy of input data;
[0017] Preferably, in step 3, the process of prompting the loader includes the following sub-steps:
[0018] S3.1 uses the supervised dataset of traffic accident disability levels as the input of the double underline method to obtain the initial object representation;
[0019] S3.2 converts the initialization object representation into a dictionary format representation through the Tensor Representation method, further enhancing the representation learning ability of the model so that it can more accurately capture the hierarchical relationship between data;
[0020] S3.3 uses the JSON serialization method to convert the dictionary format representation into a text input representation input, ensuring that the input is always a fixed formatted string, reducing the risk of processing abnormal input;
[0021] Preferably, in step 4, the mixed prompt template includes the following sub-steps:
[0022] S4.1 includes multiple prompt units, each of which is used to provide users with specific operation prompts related to the disability level of traffic accidents. Multiple prompt units provide the model with a rich source of information, helping the model to more effectively infer the disability level of traffic accidents;
[0023] S4.2 uses a policy gradient-based algorithm to adjust the prompt information of each prompt unit to obtain the optimal prompt. In the policy gradient-based algorithm, an initial parameterized strategy π in a discrete action space is first selected for the model. θ , initialization strategy π θ It is expressed as follows:
[0024]
[0025] Among them, φ(s) is the feature representation of state s, θ a is the parameter of action a. Secondly, at each time step t, according to the initialization strategy π θ (a|s) from state s t Select an action a t , the discrete action space is expressed as follows:
[0026] a t ~π θ (a t |s t )
[0027] Perform the selected actiona t , and based on the reward r of the environmental feedback t and the next state s t+1 , transfer the environment to a new state. The current state, action and reward are combined into a sequence to generate a trajectory τ = (s0, a0, r0, s1, a1, r1, ...); then, the trajectory τ is used as the input for the reward calculation to obtain the reward value R (τ), which is expressed as follows:
[0028]
[0029] Among them, T is the end time of the trajectory. Finally, the gradient ascent method is used to update the policy parameters to adjust the prompt information of each prompt unit. The following are expressed:
[0030]
[0031] Among them, π θ (a t |s t ) is the policy network in state s t Next select action a t The probability of R(τ t ) is from state s t Cumulative returns from the start to the end state. is the gradient of the log-likelihood, indicating that the current strategy is in state s t Next select action a t gradient.
[0032] Preferably, in step 4, the gating mechanism is represented as follows:
[0033] g t =σ(W g [x t ;p t ]+b g );
[0034] h t =g t ⊙x t +(1-g t )⊙p t ;
[0035] Among them, g t represents the gate value, p t Represents the prompt template vector, W g represents the weight matrix, b g represents the bias vector, σ represents the activation function, and h t Represents weighted fusion text representation. The gating mechanism improves the learning efficiency and convergence speed of the pre-trained model through selective attention.
[0036] Preferably, in step 5, the pre-trained model based on the Transformer architecture is stacked by an encoder-decoder, wherein the encoder part is composed of a series of Transformer encoding layers, each layer is composed of a self-attention mechanism, a feedforward neural network, a residual connection and a layer normalization to complete the representation and learning of traffic accident disability information; the decoder needs to generate a complete target sequence through a step-by-step data flow, and the data flow formula is as follows:
[0037] Y l ′=layerNorm(MaskedMHA(Y l-1 )+Y l-1 ;
[0038] Y l = layerNorm(CrossMHA(Y l ′,X L )+Y l ′;
[0039] Y l =layerNorm((FFN(Y l ″)+Y l ″);
[0040] In the formula, X L is the context information output by the encoder, Y l-1 and Y l is the input and output of the decoder, Y l ′ and Y l ″ is the intermediate representation of the input after passing through the MaskedMHA and CrossMHA layers, and layerNorm represents the layer normalization technology. The use of the pre-trained model based on the Transformer architecture can quickly adapt to the task of traffic accident disability level identification in scenarios with limited data, significantly improve prediction efficiency and performance, and ensure the scientific nature of the identification results.
[0041] The advantages and technical effects of the present invention are:
[0042] The invention discloses a method for evaluating the disability level of traffic accidents based on hybrid prompt learning. The method comprises the following steps: screening the inputted text of the disability evaluation of traffic accidents to obtain the target text; processing the inputted target text through the text processing layer to obtain the supervised data set of the disability level of traffic accidents; inputting the supervised data set of the disability level of traffic accidents into the prompt loader to obtain the input representation input of the text; combining the input representation input of the text with the hybrid prompt template through the gating mechanism to obtain the text representation with weighted fusion; using the weighted fusion text representation h t As the input of the pre-trained model based on the Transformer architecture, transfer learning is carried out to achieve the prediction of traffic accident disability level based on injury assessment.
[0043] Compared with the prior art, the effect of the present invention is positive and obvious. The present invention realizes the automated identification of disability levels in traffic accidents, effectively improves the work efficiency and identification accuracy of judicial identification, and helps to carry out judicial identification of disability levels in traffic accidents in a scientific, fair, rapid and efficient manner. It is of great significance to clarify accident compensation liability, properly resolve accident disputes, and ensure social harmony and stability. In addition, the hybrid prompt learning method is applied to the fine-tuning link of the traffic accident disability level prediction model, and a high-performance prediction model is obtained by providing limited traffic accident disability level identification samples. This method significantly reduces the amount of traffic accident data required for training the model, which helps to promote the practical application of this method. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a technical framework diagram of traffic accident disability level identification based on mixed prompt learning in the present invention;
[0045] Figure 2 A comparison chart of adding a mixed template and not adding a mixed template to the invention. DETAILED DESCRIPTION
[0046] The embodiments of the invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the invention, and cannot be understood as limiting the invention.
[0047] The present invention takes the identification of disability level of rib fracture in traffic accidents as an example, combines the hybrid prompt learning method and the T5 model to complete the identification of disability level of traffic accidents. The model parameters are no longer randomly initialized, but are trained by transfer learning on the pre-trained model;
[0048] Specifically, the present invention provides a method for identifying the disability level of rib fractures in traffic accidents and the basis for identification based on mixed prompt learning, comprising the following steps:
[0049] S1. Input the text of traffic accident rib fracture disability assessment x t The target text is obtained by screening, wherein, at the data level, the traffic accident rib fracture disability assessment data corresponding to the intermediate process is cancelled, and only the final traffic accident rib fracture disability assessment data is retained. At the same time, the rib fracture data corresponding to levels one to seven are cancelled, and only the rib fracture data of levels eight, nine, and ten are retained;
[0050] S2, the input target text is processed through the text processing layer to obtain a supervised data set of disability levels of rib fractures caused by traffic accidents;
[0051] Among them, the text processing layer includes obtaining a supervised dataset of the disability grades of rib fractures in traffic accidents by performing at least one of the following operations on the text of the disability assessment of rib fractures in traffic accidents:
[0052] Performing stop-word removal processing on the original disability assessment data of rib fractures in traffic accidents;
[0053] Performing text length processing on the original disability assessment data of rib fractures in traffic accidents;
[0054] Performing spelling check and correction processing on the original disability assessment data of rib fractures in traffic accidents;
[0055] Among them, performing stop-word removal processing on the original disability assessment data of rib fractures in traffic accidents can be understood as removing words without actual analysis significance (such as common words like "of", "is", "and", etc.) to enhance the expression accuracy of the data. The stop-word removal processing can include dictionary-based filtering or part-of-speech tagging methods, etc.
[0056] Among them, performing text length processing on the original disability assessment data of rib fractures in traffic accidents can be understood as streamlining the data content to keep the assessment text with necessary information and avoid being verbose. Through an automated processing algorithm, key information is screened out to reduce unnecessary details. For example, the identity information of the person being assessed can ensure that the text length is shortened while the content is complete.
[0057] Among them, performing spelling check and correction processing on the original disability assessment data of rib fractures in traffic accidents can be understood as improving the data accuracy to ensure the reliability of subsequent analysis and applications. This process includes automatically or manually identifying and correcting spelling mistakes in the text data caused by input errors or inconsistent formats, and converting the assessment results into a standard form through an algorithm.
[0058] S3. Input the supervised dataset of the disability grades of rib fractures in traffic accidents into a prompt loader to obtain the input representation input of the text, as shown in the following formula:
[0059] input = text + label
[0060] Among them, the prompt loader includes the following steps:
[0061] S3.1 Input the supervised dataset of the disability grades of rib fractures in traffic accidents into a double-underscore method to obtain an initial object representation;
[0062] S3.2 Convert the initial object representation into a dictionary format representation through a serialization method;
[0063] S3.3 uses the JSON serialization method to convert the dictionary format representation into a text input representation input, ensuring that the input is always a fixed formatted string, reducing the risk of processing abnormal input;
[0064] S4. Combine the text input representation input with the hybrid prompt template through the gating mechanism to obtain a text representation h with weighted fusion t , where the mixed prompt template is initialized as '[cls]+traffic accident rib injury information includes:{"text"}+[sep]+disability level belongs to+{"mask"}+{"soft":"level attribution"}+[sep]';
[0065] The mixed prompt template includes the following steps:
[0066] S4.1 includes a plurality of prompt units, each of which is used to provide the user with specific operation prompts related to the disability level of rib fracture caused by traffic accidents;
[0067] S4.2 uses a policy gradient-based algorithm to adjust the prompt information of each prompt unit to obtain the optimal prompt. In the policy gradient-based algorithm, an initial parameterized strategy π in a discrete action space is first selected for the model. θ , initialization strategy π θ It is expressed as follows:
[0068]
[0069] Among them, φ(s) is the feature representation of state s, θ a is the parameter of action a. Secondly, at each time step t, according to the initialization strategy π θ (a|s) from state s t Select an action a t , the discrete action space is expressed as follows:
[0070] a t ~π θ (a t |s t )
[0071] Perform the selected actiona t , and based on the reward r of the environmental feedback t and the next state s t+1 , transfer the environment to a new state. The current state, action and reward are combined into a sequence to generate a trajectory τ = (s0, a0, r0, s1, a1, r1, ...); then, the trajectory τ is used as the input for the reward calculation to obtain the reward value R (τ), which is expressed as follows:
[0072]
[0073] Among them, T is the end time of the trajectory. Finally, the gradient ascent method is used to update the policy parameters to adjust the prompt information of each prompt unit. The following are expressed:
[0074]
[0075] Among them, π θ (a t |s t ) is the policy network in state s t Next select action a t The probability of R(τ t ) is from state s t Cumulative returns from the start to the end state. is the gradient of the log-likelihood, indicating that the current strategy is in state s t Next select action a t gradient.
[0076] Among them, the gating mechanism is expressed as follows:
[0077] g t =σ(W g [x t ;p t ]+b g );
[0078] h t =g t ⊙x t +(1-g t )⊙p t ;
[0079] In the formula, g t represents the gate value, p t Represents the prompt template vector, W g represents the weight matrix, b g represents the bias vector, σ represents the activation function, and h t Represents weighted fusion text representation.
[0080] S5. Text representation using weighted fusion h t As the input of the pre-trained model based on the Transformer architecture, transfer learning is performed to achieve the prediction of the disability level of rib fractures in traffic accidents based on injury assessment.
[0081] Among them, the pre-trained model based on the Transformer architecture is composed of an encoder-decoder stack. The encoder part consists of a series of Transformer encoding layers, each of which consists of a self-attention mechanism, a feedforward neural network, a residual connection, and a layer normalization to complete the representation and learning of rib fracture disability information in traffic accidents; the decoder needs to go through a step-by-step data flow to generate a complete target sequence. The data flow formula is as follows:
[0082] Y l ′=layerNorm(MaskedMHA(Y l-1 )+Y l-1
[0083] Y l = layerNorm(CrossMHA(Y l ′,X L )+Y l '
[0084] Y l =layerNorm((FFN(Y l ″)+Y l ″)
[0085] In the formula, X L is the context information output by the encoder, Y l-1 and Y l is the input and output of the decoder, Y l ′ and Y l ″ is the intermediate representation of the input after passing through the MaskedMHA and CrossMHA layers, and layerNorm represents the layer normalization technique.
[0086] Among them, the prediction of disability level of rib fractures in traffic accidents based on injury assessment is realized. Through the trained model, the input traffic accident disability information description can be matched with the features learned by the model to obtain the prediction result of disability level of rib fractures in traffic accidents.
[0087] Using the judicial appraisal data of rib fractures in traffic accidents in a certain city, based on the structured training set of the hybrid prompt learning method, the transfer learning of the disability level of rib fractures in traffic accidents is completed, and a high-performance prediction model for the disability level of rib fractures in traffic accidents is constructed. The existing prediction model for the disability level of rib fractures in traffic accidents can effectively improve the efficiency of judicial appraisal work while solving the problem of insufficient data in actual traffic accidents, and has certain practical application value.
[0088] The specific implementation steps of the traffic accident disability level assessment model provided by the present invention are:
[0089] S1. Data preprocessing: The quality of text data determines the upper limit of model performance. After removing dirty samples in the data set, the data is first classified into three categories. The traffic accident rib fracture disability level labels of level one to level eight are temporarily marked as "8", and the remaining level nine and level ten are marked as "9" and "10" respectively. Sample examples are shown in Table 1:
[0090] Table 1 Sample data for identification of disability level of rib fractures in traffic accidents
[0091]
[0092] S2. Combine the text input representation input with the hybrid prompt template through the gating mechanism to obtain a text representation h with weighted fusion t , where the mixed prompt template is initialized as '[cls]+traffic accident rib injury information includes:{"text"}+[sep]+disability level belongs to+{"mask"}+{"soft":"level attribution"}+[sep]'; the sample prompt template data for traffic accident rib fracture disability level identification is shown in Table 2;
[0093] Table 2 Sample prompt template data example for traffic accident rib fracture disability level identification
[0094]
[0095] S3. After passing through the input layer, it is further input into the transformer architecture to obtain the classification results predicted by the decoder at the output end of the model.
[0096] In terms of model evaluation, on the test set, the accuracy of the model combining hybrid prompts and T5 was 76.25%, the precision was 65%, and the recall was 69%. The method of traffic accident rib fracture disability level identification using the model combining hybrid prompts and T5 was generally good. Based on this method, the accuracy can be further improved after obtaining more data.
[0097] Finally, all the unexplained parts of the invention adopt mature products and mature technical means in the existing technology.
[0098] In the description of this specification, reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in the embodiment or example of the invention.
[0099] Although embodiments of the invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
Claims
1. A method for assessing disability level in traffic accidents based on mixed prompt learning, characterized in that: The following steps are involved: S1. Input traffic accident disability assessment text x t Filter to obtain the target text; S2, the input target text is processed through the text processing layer to obtain a supervised data set of traffic accident disability levels; S3, the supervised data set of traffic accident disability level input prompt loader, obtains the input representation input of the text, as shown in the following formula: input=text+label S4. Combine the text input representation input with the hybrid prompt template through the gating mechanism to obtain a text representation h with weighted fusion t ; S5. Text representation using weighted fusion h t As the input of the pre-trained model based on the Transformer architecture, transfer learning is carried out to achieve the prediction of traffic accident disability level based on injury assessment.
2. The method for assessing the level of disability caused by traffic accidents based on mixed prompt learning according to claim 1, characterized in that: In step 2, the processing of the text processing layer includes the following sub-steps: S2.1 removes stop words from the target text and deletes common but meaningless words; S2.2 processes the target text by length and cuts off the long text; S2.3 Perform spelling check and correction on the target text.
3. The method for assessing the degree of disability caused by traffic accidents based on mixed prompt learning according to claim 1, characterized in that: In step 3, the processing of prompting the loader includes the following sub-steps: S3.1 The supervised dataset of disability level is input into the double underline method to obtain the initialization object representation; S3.2 converts the initialization object representation into a dictionary format representation through a serialization method; S3.3 uses the JSON serialization method to convert the dictionary format representation into a text input representation input.
4. The method for assessing the level of disability caused by traffic accidents based on mixed prompt learning according to claim 1, characterized in that: The step 4 includes the following sub-steps: S4.1 includes a plurality of prompt units, each of which is used to provide the user with specific operation prompts related to the disability level; S4.2 uses a policy gradient-based algorithm to adjust the prompt information of each prompt unit to obtain the optimal prompt. In the policy gradient-based algorithm, an initial parameterized strategy π in a discrete action space is first selected for the model. θ , initialization strategy π θ It is expressed as follows: Among them, φ(s) is the feature representation of state s, θ a is the parameter of action a; secondly, at each time step t, according to the initialization strategy π θ (a|s) from state s t Select an action a t , the discrete action space is expressed as follows: a t ~π θ (a t |s t ) Perform the selected actiona t , and based on the reward r of the environmental feedback t and the next state s t+1 , transfer the environment to a new state; combine the current state, action and reward into a sequence to generate a trajectory τ = (s0, a0, r0, s1, a1, r1, ...); then, use the trajectory τ as the input for reward calculation to obtain the reward value R(τ), which is expressed as follows: Among them, T is the end time of the trajectory; finally, the gradient ascent method is used to update the strategy parameters to adjust the prompt information of each prompt unit. The following are expressed: Among them, π θ (a t |s t ) is the policy network in state s t Next select action a t The probability of R(τ t ) is from state s t Cumulative returns from the start to the end state; is the gradient of the log-likelihood, indicating that the current strategy is in state s t Next select action a t The gradient of Preferably, in step 4, the gating mechanism is represented as follows: g t =σ(W g [x] t ;p t ]+b g ); h t =g t ⊙x t +(1-g t )⊙p t ; Among them, g t represents the gate value, p t Represents the prompt template vector, W g represents the weight matrix, b g represents the bias vector, σ represents the activation function, and h t Represents weighted fusion of text representation; the gating mechanism improves the learning efficiency and convergence speed of the pre-trained model through selective attention.
5. The method for assessing the level of disability caused by traffic accidents based on mixed prompt learning according to claim 1, characterized in that: In step 5, the pre-trained model based on the Transformer architecture is composed of an encoder-decoder stack, wherein the encoder part is composed of a series of Transformer encoding layers, each layer is composed of a self-attention mechanism, a feedforward neural network, a residual connection and a layer normalization to complete the representation and learning of disability information, and the decoder needs to generate a complete target sequence through a step-by-step data flow. The data flow formula is as follows: AND l ′=layerNorm(MaskedMHA(Y l-1 )+Y l-1 ; Y l ″=layerNorm(CrossMHA(Y l ′,X L )+Y l ′; AND l =layerNorm((FFN(Y l ″)+Y l ″); Where, X L is the context information output by the encoder, Y l-1 and Y l is the input and output of the decoder, Y l ′ and Y l ″ is the intermediate representation of the input after passing through the MaskedMHA and CrossMHA layers, and layerNorm represents the layer normalization processing.
Citation Information
Patent Citations
Natural language understanding-based disability grade identification and evaluation basis deduction method
CN115293229A