CN117556829A - Comparison method, device and equipment of vehicle fault codes and storage medium - Google Patents
Comparison method, device and equipment of vehicle fault codes and storage medium Download PDFInfo
- Publication number
- CN117556829A CN117556829A CN202410037802.3A CN202410037802A CN117556829A CN 117556829 A CN117556829 A CN 117556829A CN 202410037802 A CN202410037802 A CN 202410037802A CN 117556829 A CN117556829 A CN 117556829A
- Authority
- CN
- China
- Prior art keywords
- text
- similarity
- keyword
- sub
- sentence vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 239000013598 vector Substances 0.000 claims abstract description 89
- 238000004590 computer program Methods 0.000 claims description 9
- 238000000605 extraction Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000011218 segmentation Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 239000011159 matrix material Substances 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012549 training Methods 0.000 description 4
- 238000013527 convolutional neural network Methods 0.000 description 3
- 238000013210 evaluation model Methods 0.000 description 3
- 238000003058 natural language processing Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000011176 pooling Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000012886 linear function Methods 0.000 description 1
- 230000000873 masking effect Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
- G07C5/00—Registering or indicating the working of vehicles
- G07C5/08—Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
- G07C5/0808—Diagnosing performance data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a comparison method, a device, equipment and a storage medium of vehicle fault codes, and relates to the technical field of computers. Converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first equipment keyword and a first state keyword from the first text, and extracting a second equipment keyword and a second state keyword from the second text; calculating a first sub-similarity based on the first sentence vector and the second sentence vector; calculating a second sub-similarity based on the first device keyword, the first state keyword, the second device keyword, and the second state keyword; determining semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity; and obtaining a comparison result according to the semantic similarity and the similarity threshold. The method can improve the accuracy of vehicle fault code comparison.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for comparing vehicle fault codes.
Background
A vehicle fault code is a description of the equipment and status based on the fault itself of the vehicle. For example, "battery power supply voltage is too low". Because the vehicle fault code description is natural language description, for the same fault code, a writer needs to confirm whether similar fault codes exist in the fault description library, and the writer needs to compare the description of the fault codes.
Because the fault codes are many, manual comparison is time-consuming and labor-consuming, and therefore, description of different vehicle fault codes is evaluated through a text similarity evaluation model. For example, for the following three fault codes of "the battery power supply voltage is too low", "the battery voltage is low", "the battery power supply voltage is too high", the similarity of the three is high through the evaluation of the traditional text similarity model, and even the result that the similarity of the "the battery power supply voltage is too low" and the "the battery power supply voltage is too high" is obtained.
However, "battery supply voltage too low" and "battery supply voltage too high" are completely different fault code descriptions. The traditional text similarity evaluation model is invalid, and the accuracy is poor.
Disclosure of Invention
The application provides a vehicle fault code comparison method, device, equipment and storage medium, which can improve the accuracy of vehicle fault code comparison.
In order to achieve the above purpose, the present application adopts the following technical scheme:
in a first aspect, a method of comparing vehicle fault codes includes:
acquiring a first text describing a first fault code of the vehicle and a second text describing a second fault code;
converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first device keyword and a first state keyword from the first text, and extracting a second device keyword and a second state keyword from the second text;
calculating a first sub-similarity based on the first sentence vector and the second sentence vector; calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword;
determining semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity;
and obtaining a comparison result aiming at the first text and the second text according to the semantic similarity and the similarity threshold.
In some possible implementations, the calculating the first sub-similarity based on the first sentence vector and the second sentence vector includes:
wherein,for the first sub-similarity, +.>For the first sentence vector, +.>Is the second sentence vector.
In some possible implementations, the calculating the second sub-similarity based on the first device keyword, the first state keyword, the second device keyword, and the second state keyword includes:
wherein,for the second sub-similarity, +.>Word vector for the first device keyword,/-for>Word vector for the second device keyword,/-for>Word vector for said first state keyword,/->Is a word vector of the second state keyword.
In some possible implementations, the determining the semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity includes:
wherein,for the semantic similarity, < >>For the first sub-similarity degree in question,for the second sub-similarity, +.>Weight for said first sub-similarity, +.>And the second sub-similarity is weighted.
In some possible implementations, the method further includes:
and under the condition that the comparison result characterizes that the semantics of the first text and the second text are the same, generating first prompt information, wherein the first prompt information is used for prompting a user to select a target text from the first text and the second text so as to be used as texts for describing the first fault code and the second fault code.
In some possible implementations, the method further includes:
acquiring character lengths of the first text and the second text under the condition that the comparison result represents that the semantics of the first text and the second text are the same;
and determining the text with the minimum character length as a target text, and taking the target text as the text describing the first fault code and the second fault code.
In some possible implementations, the method further includes:
obtaining a scoring result of the easy understanding degree of the target text;
and if the score of the score result representation target text is lower than a preset score threshold value, generating second prompt information, wherein the second prompt information is used for prompting a user to replace the target text.
In a second aspect, the present application provides a device for comparing vehicle fault codes, including:
the acquisition module is used for acquiring a first text describing a first fault code of the vehicle and a second text describing a second fault code;
the conversion module is used for converting the first text into a first sentence vector and converting the second text into a second sentence vector;
the extraction module is used for extracting a first equipment keyword and a first state keyword from the first text and extracting a second equipment keyword and a second state keyword from the second text;
the calculation module is used for calculating a first sub-similarity based on the first sentence vector and the second sentence vector; calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword; determining semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity;
and the comparison module is used for obtaining a comparison result aiming at the first text and the second text according to the semantic similarity and the similarity threshold.
In some possible implementations, the calculating module is specifically configured to calculate the first sub-similarity by the following formula:
wherein,for the first sub-similarity, +.>For the first sentence vector, +.>Is the second sentence vector.
In some possible implementations, the calculating module is specifically configured to calculate the second sub-similarity by the following formula:
wherein,for the second sub-similarity, +.>Word vector for the first device keyword,/-for>Word vector for the second device keyword,/-for>Word vector for said first state keyword,/->Is a word vector of the second state keyword.
In some possible implementations, the calculating module is specifically configured to calculate the semantic similarity by the following formula:
wherein,for the semantic similarity, < >>For the first sub-similarity degree in question,for the second sub-similarity, +.>Weight for said first sub-similarity, +.>And the second sub-similarity is weighted.
In some possible implementations, the apparatus further includes: a prompting module;
the prompting module is used for generating first prompting information when the comparison result represents that the semantics of the first text and the second text are the same, wherein the first prompting information is used for prompting a user to select a target text from the first text and the second text so as to be used as texts for describing the first fault code and the second fault code.
In some possible implementations, the apparatus further includes: a determining module;
the acquisition module is further used for acquiring character lengths of the first text and the second text under the condition that the comparison result represents that the semantics of the first text and the second text are the same;
the determining module is used for determining that the text with the minimum character length is a target text, and taking the target text as the text describing the first fault code and the second fault code.
In some possible implementations, the apparatus further includes: a prompting module;
the obtaining module is further used for obtaining a scoring result of the easy understanding degree of the target text;
the prompting module is used for generating second prompting information if the score of the scoring result representing the target text is lower than a preset score threshold value, and the second prompting information is used for prompting a user to replace the target text.
In a third aspect, the present application provides a computing device comprising a memory and a processor;
wherein one or more computer programs are stored in the memory, the one or more computer programs comprising instructions; the instructions, when executed by the processor, cause the computing device to perform the method of any of the first aspects.
In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program for performing the method of any one of the first aspects.
According to the technical scheme, the application has at least the following beneficial effects:
the application provides a comparison method of vehicle fault codes, which comprises the steps of obtaining a first text describing a first fault code of a vehicle and a second text describing a second fault code, converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first equipment keyword and a first state keyword from the first text, and extracting a second equipment keyword and a second state keyword from the second text. Then, a first sub-similarity is calculated based on the first sentence vector and the second sentence vector to evaluate the word similarity of the first text and the second text. Since the fault code consists of equipment and status, for example, a "battery" in "battery voltage too high" is equipment and "voltage too high" is status. And calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword to evaluate the expression similarity degree of the first text and the second text. And then determining the semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity, and obtaining a comparison result for the first text and the second text based on the semantic similarity and a similarity threshold. Under the scene of comparing the fault codes of the vehicles, the accuracy of the comparison result is improved.
It should be appreciated that the description of technical features, aspects, benefits or similar language in this application does not imply that all of the features and advantages may be realized with any single embodiment. Conversely, it should be understood that the description of features or advantages is intended to include, in at least one embodiment, the particular features, aspects, or advantages. Therefore, the description of technical features, technical solutions or advantageous effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and advantageous effects described in the present embodiment may also be combined in any appropriate manner. Those of skill in the art will appreciate that an embodiment may be implemented without one or more particular features, aspects, or benefits of a particular embodiment. In other embodiments, additional features and advantages may be recognized in certain embodiments that may not be present in all embodiments.
Drawings
FIG. 1 is a flow chart of a method for comparing vehicle fault codes provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a model structure according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a comparison device for vehicle fault codes according to an embodiment of the present application;
fig. 4 is a schematic diagram of a computing device according to an embodiment of the present application.
Detailed Description
The terms "first," "second," and "third," and the like, in the description and in the drawings, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
In the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
For clarity and conciseness in the description of the following embodiments, a brief description of the related art will be given first:
the pre-trained language model (Pretrained Language Model, PLM) predicts the next likely word to follow based on the above. Only the pre-trained static text representation is used in the traditional word vector method to initialize the first layer of the downstream task model, while the rest of the network structure of the downstream task model still needs to be trained from scratch. This is a shallow approach that sacrifices expressive power with efficiency priority, and does not capture more useful deep information. The pre-training language model is to pre-train a multi-layer network structure for initializing a downstream task model, and can learn shallow information and deep information at the same time. The pre-training language model is a dynamic text representation method, text representation can be dynamically adjusted according to the current context, the adjusted text representation can better express the specific meaning of the word in the context, and the word ambiguous problem can be effectively processed. The effect of a true bi-directional language model is achieved by a special pre-training mode of masking language model tasks based on a bi-directional pre-training language model of a transducer, such as BERT. The context and the following can be utilized simultaneously, so the information utilization is more sufficient.
The text matching task is one of the basic tasks of natural language processing (Natural Language Processing, NLP), given a source text and some candidate text, the text that matches most closely to the source text is found from the candidate text.
In the application scenario of the vehicle fault code, as the vehicle fault code is more, for example, the battery power supply voltage is too low, the battery voltage is low and the battery power supply voltage is too high, the similarity of the three is higher through the traditional text similarity model evaluation, and even the result that the similarity of the battery power supply voltage is too low and the battery power supply voltage is too high is obtained.
However, "battery supply voltage too low" and "battery supply voltage too high" are completely different fault code descriptions. The traditional text similarity evaluation model is invalid, and the accuracy is poor.
In view of this, the embodiment of the application provides a method for comparing vehicle fault codes, which can be executed by an electronic device, for example, a computer, a mobile phone, or a vehicle diagnostic device. The method comprises the following steps:
acquiring a first text describing a first fault code of the vehicle and a second text describing a second fault code; converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first device keyword and a first state keyword from the first text, and extracting a second device keyword and a second state keyword from the second text; then, calculating a first sub-similarity based on the first sentence vector and the second sentence vector, and calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword; and determining the semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity, and finally obtaining a comparison result of the first text and the second text according to the semantic similarity and a similarity threshold.
According to the method, the expression similarity of the first text and the second text and the word similarity of the first text and the second text are evaluated, the semantic similarity is determined based on the expression similarity and the word similarity, and compared with simple comparison characters, the accuracy of a comparison result can be improved under the condition of comparing vehicle fault codes.
In order to make the technical scheme of the application clearer and easier to understand, the comparison method of the vehicle fault code provided by the application is described below with reference to the accompanying drawings. As shown in fig. 1, the method is a flow chart of a comparison method of vehicle fault codes, and the method includes:
s101, acquiring a first text describing a first fault code of the vehicle and a second text describing a second fault code.
The first fault code may refer to a description of a fault of the vehicle, and the first text is a text describing the fault, for example, the first text may be "battery power supply voltage is too low". A similar second fault code also refers to a description of a fault in the vehicle, and the second text may be "battery voltage too high".
In some examples, the first text and the second text to be compared may be obtained from a fault code database. The manner of acquiring the first text and the second text is not particularly limited in the embodiments of the present application, and a person skilled in the art may select the manner of acquiring the first text and the second text based on actual needs.
S102, converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first device keyword and a first state keyword from the first text, and extracting a second device keyword and a second state keyword from the second text.
The first sentence vector is a vector corresponding to the first text, and the second sentence vector is a vector corresponding to the second text. Taking a typical model BERT of a transducer structure as an example, fig. 2 is a schematic diagram of a model structure provided in an embodiment of the present application. In the figure, "pooling_a" and "pooling_b" are pooling layers, and "conv_a" and "conv_b" are convolution layers.
For the first textAnd second text->The method cuts the first text intoSplitting the second text into +.>Wherein n and m represent the length of the text after segmentation, respectively, [ CLS ]]To start the identifier [ SEP ]]To end the identifier. Wherein identifiers of the sentence head and the sentence tail of the segmented text are not necessarily [ CLS ]]、[SEP]For example, can also be adopted<sop>、<eop>And the like, and are merely illustrative. Then will->And->The respective code is +.>And (3) withWhere h is the dimension of the model (hidden dimension). By pooling (e.g. pooling_a and pooling_b, the specific operation is to average in the first dimension for the whole matrix) the operation will +.>And->Respectively processing into two sentence vectors with the size of h, which are marked as +.>、/>Then calculate +.>And->Is a similarity of (3).
The first device keyword refers to a word of description of a device contained in the first text, and for example, the first device keyword of the first text may be "battery". Similarly, the second device keyword refers to a word of description of the device contained in the second text, for example, the second device keyword of the second text may be "battery".
In some embodiments, the segmentation of keywords is implemented by a segmentation tool, for example, for the text "battery power supply voltage is too low", which may be segmented into [ 'battery', 'power supply', 'voltage', 'too low'.]. The segmentation result is recorded as。
Segmentation result through first textSegmentation result with the second text +.>And +.>、/>Calculating word vectors, and taking an average value for each segmentation result, for example, two words of 'power supply' respectively have one [ h ]]Vector representation of dimensions, assumed to be +.>,The word vector of the word is +.>. After calculation in this way, we record the word vector matrix as: />. Where i, j are the number of words in sentence A, B (start and end identifiers removed), respectively.
The text content is then filtered through a convolutional neural network. For example, three 1D convolutional neural networks with convolution kernels of 1, 2 and 3 are respectively constructed, and the two groups respectively correspond to filtering of equipment and states. For one of the groups, the convolution layers are respectively denoted asThese three convolutional neural networks are in +.>And->And carrying out convolution operation on the matrix to obtain three corresponding matrixes, wherein the size of the convolution kernel is k. />. To->For example, the output value is [ i+i-1+i-2, k]. We then pass this matrix through [ k 1 ]]The probability corresponding to each position is obtained, and then [ i+i-1+i-2 ] is obtained through normalization of sigmoid activation function]The vector of length, the value of the maximum value position is output.
Wherein,three are providedConvolutional neural network in->The result of the convolution operation on the matrix; />As a linear function; />Is an activation function; />Is normalized value.
Thus, we can acquire two word vectors, corresponding to the device and the state respectively. We choose the vector of the position with the highest probability as the output of this step, denoted as. For->We obtained +.>. The effect of using 3 convolutions is to avoid the degradation of accuracy caused by the overlength of the text word. />Is calculated by the method and->Similarly, the description is omitted here.
In other embodiments, the device keywords and the state keywords may be defined in advance, so that in the process of extracting the device keywords and the state keywords, the predefined device keywords and the state keywords may be first matched from the text, thereby improving the extraction efficiency of the keywords.
S103, calculating a first sub-similarity based on the first sentence vector and the second sentence vector, and calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword.
After the first sentence vector and the second sentence vector are obtained, the first sub-similarity can be calculated by the following formula:
wherein,for the first sub-similarity, +.>For the first sentence vector, +.>Is the second sentence vector.
It can be seen that, because the scheme uses the extraction mode of the pooled sentence information, the similarity of the whole document necessarily depends on the main vocabulary appearing in the text, key information is not focused, and misjudgment is easily caused. If the semantic judgment is simply performed through the first sub-similarity, a larger error is generated.
After obtaining the first device keyword, the first state keyword, the second device keyword, and the second state keyword, the second sub-similarity may be calculated by the following formula:
wherein,for the second sub-similarity, +.>Word vector for the first device keyword,/-for>For the second setWord vector for preparing keywords, ++>Word vector for said first state keyword,/->Is a word vector of the second state keyword.
S104, determining the semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity.
After the first sub-similarity and the second sub-similarity are calculated, the semantic similarity of the first text and the second text can be calculated by the following formula:
wherein,for the semantic similarity, < >>For the first sub-similarity degree in question,for the second sub-similarity, +.>Weight for said first sub-similarity, +.>And the second sub-similarity is weighted. In some examples, a->=/>=0.5, in other examples, +_>And->Other values are also possible, and a person skilled in the art can reasonably set weights corresponding to the first sub-similarity and the second sub-similarity based on actual needs.
S105, obtaining a comparison result of the first text and the second text according to the semantic similarity and the similarity threshold.
In some examples, the similarity threshold may be 0.8, or other values. Under the condition that the semantic similarity is larger than or equal to a similarity threshold value, determining that the comparison result of the first text and the second text is the same in semantic; and under the condition that the semantic similarity is smaller than the similarity threshold value, determining that the comparison result of the first text and the second text is different in semantic.
In some embodiments, when the comparison result indicates that the semantics of the first text and the second text are the same, generating first prompt information, where the first prompt information is used to prompt the user to select a target text from the first text and the second text, so as to be used as text describing the first fault code and the second fault code. That is, the first text and the second text have the same meaning, and one of them is selected to describe the failure. And redundant texts can be deleted, so that the memory occupation is reduced, and the memory capacity is improved.
In some embodiments, the character lengths of the first text and the second text are obtained when the comparison results characterize the first text to the second text with the same semantics. Then, selecting a text with the minimum character length from the first text and the second text as a target text, and using the target text as a text describing the first fault code and the second fault code. Because the character length of the target text is short, after the fault code occurs, the user can quickly know the current fault content.
In some embodiments, a scoring result for the understandability of the target text may also be obtained, and if the scoring result characterizes the score of the target text is lower than a preset score threshold, a second prompting message is generated, where the second prompting message is used to prompt the user to replace the target text. In the case where the score of the target text is below the preset score threshold, it is not easy to understand on behalf of the target text, and thus the target text needs to be replaced.
Based on the foregoing, the embodiment of the application provides a method for comparing a fault code of a vehicle, which includes obtaining a first text describing a first fault code of the vehicle and a second text describing a second fault code, converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first device keyword and a first state keyword from the first text, and extracting a second device keyword and a second state keyword from the second text. Then, a first sub-similarity is calculated based on the first sentence vector and the second sentence vector to evaluate the word similarity of the first text and the second text. Since the fault code consists of equipment and status, for example, a "battery" in "battery voltage too high" is equipment and "voltage too high" is status. And calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword to evaluate the expression similarity degree of the first text and the second text. And then determining the semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity, and obtaining a comparison result for the first text and the second text based on the semantic similarity and a similarity threshold. Under the scene of comparing the fault codes of the vehicles, the accuracy of the comparison result is improved.
The comparison method of the vehicle fault codes provided by the embodiments of the present application is described in detail above with reference to fig. 1 to 2, and the devices and apparatuses provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
As shown in fig. 3, the diagram is a schematic diagram of a device for comparing vehicle fault codes, which is provided in an embodiment of the present application, and the device includes:
an obtaining module 301, configured to obtain a first text describing a first fault code of a vehicle and a second text describing a second fault code;
a conversion module 302, configured to convert the first text into a first sentence vector, and convert the second text into a second sentence vector;
an extracting module 303, configured to extract a first device keyword and a first status keyword from the first text, and extract a second device keyword and a second status keyword from the second text;
a calculating module 304, configured to calculate a first sub-similarity based on the first sentence vector and the second sentence vector; calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword; determining semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity;
and the comparison module 305 is configured to obtain a comparison result for the first text and the second text according to the semantic similarity and the similarity threshold.
In some possible implementations, the calculating module 304 is specifically configured to calculate the first sub-similarity by the following formula:
wherein,for the first sub-similarity, +.>For the first sentence vector, +.>Is the second sentence vector.
In some possible implementations, the calculating module 304 is specifically configured to calculate the second sub-similarity by the following formula:
wherein,for the second sub-similarity, +.>Word vector for the first device keyword,/-for>Word vector for the second device keyword,/-for>Word vector for said first state keyword,/->Is a word vector of the second state keyword.
In some possible implementations, the calculating module 304 is specifically configured to calculate the semantic similarity by the following formula:
wherein,for the semantic similarity, < >>For the first sub-similarity degree in question,for the second sub-similarity, +.>Weight for said first sub-similarity, +.>And the second sub-similarity is weighted.
In some possible implementations, the apparatus further includes: a prompting module;
the prompting module is used for generating first prompting information when the comparison result represents that the semantics of the first text and the second text are the same, wherein the first prompting information is used for prompting a user to select a target text from the first text and the second text so as to be used as texts for describing the first fault code and the second fault code.
In some possible implementations, the apparatus further includes: a determining module;
the obtaining module 301 is further configured to obtain a character length of the first text and the second text when the comparison result indicates that the semantics of the first text and the semantics of the second text are the same;
the determining module is used for determining that the text with the minimum character length is a target text, and taking the target text as the text describing the first fault code and the second fault code.
In some possible implementations, the apparatus further includes: a prompting module;
the obtaining module 301 is further configured to obtain a scoring result for the easy understanding degree of the target text;
the prompting module is used for generating second prompting information if the score of the scoring result representing the target text is lower than a preset score threshold value, and the second prompting information is used for prompting a user to replace the target text.
The comparison device for vehicle fault codes according to the embodiments of the present application may correspond to performing the method described in the embodiments of the present application, and the above other operations and/or functions of each module/unit of the comparison device for vehicle fault codes are respectively for implementing the corresponding flow of each method in the embodiment shown in fig. 1, which is not repeated herein for brevity.
The embodiment of the application also provides a computing device. The computing device is used to implement the functionality of the vehicle fault code comparison device in the embodiment shown in fig. 3. As shown in fig. 4, which is a schematic diagram of a computing device 400 provided in an embodiment of the present application, as shown in fig. 4, the computing device 400 includes a bus 401, a processor 402, a communication interface 403, and a memory 404. Communication between processor 402, memory 404 and communication interface 403 is via bus 401.
Bus 401 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus.
The processor 402 may be any one or more of a central processing unit (central processing unit, CPU), a graphics processor (graphics processing unit, GPU), a Microprocessor (MP), or a digital signal processor (digital signal processor, DSP).
The communication interface 403 is used for communication with the outside. For example, the communication interface 403 may be used to communicate with an external device, thereby acquiring the first text and the second text.
The memory 404 may include volatile memory (RAM), such as random access memory (random access memory). The memory 404 may also include non-volatile memory (ROM), such as read-only memory (ROM), flash memory, hard Disk Drive (HDD), or solid state drive (solid state drive, SSD).
The memory 404 has stored therein executable code that the processor 402 executes to perform the aforementioned vehicle fault code comparison method.
Specifically, in the case where the embodiment shown in fig. 3 is implemented, and each module or unit of the comparison apparatus for vehicle trouble codes described in the embodiment of fig. 3 is implemented by software, software or program codes required for executing the functions of each module/unit in fig. 3 may be partially or entirely stored in the memory 404. The processor 402 executes the program codes corresponding to the respective units stored in the memory 404, and performs the aforementioned comparison method of the vehicle trouble codes.
Embodiments of the present application also provide a computer-readable storage medium. The computer readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc. The computer-readable storage medium includes instructions that instruct a computing device to perform the above-described method of comparing vehicle fault codes applied to a device for comparing vehicle fault codes.
Embodiments of the present application also provide a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the processes or functions described in accordance with the embodiments of the present application are produced in whole or in part.
The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.).
The computer program product, when executed by a computer, performs any of the aforementioned methods of comparing vehicle trouble codes. The computer program product may be a software installation package that can be downloaded and executed on a computer in the event that any of the aforementioned methods of comparison of vehicle trouble codes is desired.
The descriptions of the processes or structures corresponding to the drawings have emphasis, and the descriptions of other processes or structures may be referred to for the parts of a certain process or structure that are not described in detail.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application.
Claims (10)
1. A method of comparing vehicle trouble codes, comprising:
acquiring a first text describing a first fault code of the vehicle and a second text describing a second fault code;
converting the first text into a first sentence vector, converting the second text into a second sentence vector, extracting a first device keyword and a first state keyword from the first text, and extracting a second device keyword and a second state keyword from the second text;
calculating a first sub-similarity based on the first sentence vector and the second sentence vector; calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword;
determining semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity;
and obtaining a comparison result aiming at the first text and the second text according to the semantic similarity and the similarity threshold.
2. The method of claim 1, wherein the calculating a first sub-similarity based on the first sentence vector and the second sentence vector comprises:
wherein,for the first sub-similarity, +.>For the first sentence vector, +.>Is the second sentence vector.
3. The method of claim 1, wherein the calculating a second sub-similarity based on the first device keyword, the first status keyword, the second device keyword, the second status keyword comprises:
wherein,for the second sub-similarity, +.>Word vector for the first device keyword,/-for>Word vector for the second device keyword,/-for>Word vector for said first state keyword,/->Is a word vector of the second state keyword.
4. The method of claim 1, wherein the determining the semantic similarity of the first text to the second text based on the first sub-similarity and the second sub-similarity comprises:
wherein,for the semantic similarity, < >>For the first sub-similarity degree in question,for the second sub-similarity, +.>Weight for said first sub-similarity, +.>And the second sub-similarity is weighted.
5. The method according to claim 1, wherein the method further comprises:
and under the condition that the comparison result characterizes that the semantics of the first text and the second text are the same, generating first prompt information, wherein the first prompt information is used for prompting a user to select a target text from the first text and the second text so as to be used as texts for describing the first fault code and the second fault code.
6. The method according to claim 1, wherein the method further comprises:
acquiring character lengths of the first text and the second text under the condition that the comparison result represents that the semantics of the first text and the second text are the same;
and determining the text with the minimum character length as a target text, and taking the target text as the text describing the first fault code and the second fault code.
7. The method according to claim 5 or 6, characterized in that the method further comprises:
obtaining a scoring result of the easy understanding degree of the target text;
and if the score of the score result representation target text is lower than a preset score threshold value, generating second prompt information, wherein the second prompt information is used for prompting a user to replace the target text.
8. A vehicle trouble code comparison device, characterized by comprising:
the acquisition module is used for acquiring a first text describing a first fault code of the vehicle and a second text describing a second fault code;
the conversion module is used for converting the first text into a first sentence vector and converting the second text into a second sentence vector;
the extraction module is used for extracting a first equipment keyword and a first state keyword from the first text and extracting a second equipment keyword and a second state keyword from the second text;
the calculation module is used for calculating a first sub-similarity based on the first sentence vector and the second sentence vector; calculating a second sub-similarity based on the first equipment keyword, the first state keyword, the second equipment keyword and the second state keyword; determining semantic similarity of the first text and the second text based on the first sub-similarity and the second sub-similarity;
and the comparison module is used for obtaining a comparison result aiming at the first text and the second text according to the semantic similarity and the similarity threshold.
9. A computing device comprising a memory and a processor;
wherein one or more computer programs are stored in the memory, the one or more computer programs comprising instructions; the instructions, when executed by the processor, cause the computing device to perform the method of any of claims 1 to 7.
10. A computer readable storage medium for storing a computer program for performing the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410037802.3A CN117556829B (en) | 2024-01-11 | 2024-01-11 | Comparison method, device and equipment of vehicle fault codes and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410037802.3A CN117556829B (en) | 2024-01-11 | 2024-01-11 | Comparison method, device and equipment of vehicle fault codes and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117556829A true CN117556829A (en) | 2024-02-13 |
CN117556829B CN117556829B (en) | 2024-04-09 |
Family
ID=89823528
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410037802.3A Active CN117556829B (en) | 2024-01-11 | 2024-01-11 | Comparison method, device and equipment of vehicle fault codes and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117556829B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106054858A (en) * | 2016-05-27 | 2016-10-26 | 大连楼兰科技股份有限公司 | Decision tree classification and fault code classification-based vehicle remote diagnosis and spare part retrieval method |
CN106056154A (en) * | 2016-05-27 | 2016-10-26 | 大连楼兰科技股份有限公司 | Fault code recognition and classification method |
CN110866095A (en) * | 2019-10-10 | 2020-03-06 | 重庆金融资产交易所有限责任公司 | Text similarity determination method and related equipment |
WO2021139229A1 (en) * | 2020-07-31 | 2021-07-15 | 平安科技(深圳)有限公司 | Text rhetorical sentence generation method, apparatus and device, and readable storage medium |
CN116028868A (en) * | 2023-02-15 | 2023-04-28 | 深圳市信润富联数字科技有限公司 | Equipment fault classification method and device, electronic equipment and readable storage medium |
CN116542246A (en) * | 2023-04-12 | 2023-08-04 | 长城汽车股份有限公司 | Keyword quality inspection text-based method and device and electronic equipment |
CN116719999A (en) * | 2023-06-16 | 2023-09-08 | 平安科技(深圳)有限公司 | Text similarity detection method and device, electronic equipment and storage medium |
-
2024
- 2024-01-11 CN CN202410037802.3A patent/CN117556829B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106054858A (en) * | 2016-05-27 | 2016-10-26 | 大连楼兰科技股份有限公司 | Decision tree classification and fault code classification-based vehicle remote diagnosis and spare part retrieval method |
CN106056154A (en) * | 2016-05-27 | 2016-10-26 | 大连楼兰科技股份有限公司 | Fault code recognition and classification method |
CN110866095A (en) * | 2019-10-10 | 2020-03-06 | 重庆金融资产交易所有限责任公司 | Text similarity determination method and related equipment |
WO2021139229A1 (en) * | 2020-07-31 | 2021-07-15 | 平安科技(深圳)有限公司 | Text rhetorical sentence generation method, apparatus and device, and readable storage medium |
CN116028868A (en) * | 2023-02-15 | 2023-04-28 | 深圳市信润富联数字科技有限公司 | Equipment fault classification method and device, electronic equipment and readable storage medium |
CN116542246A (en) * | 2023-04-12 | 2023-08-04 | 长城汽车股份有限公司 | Keyword quality inspection text-based method and device and electronic equipment |
CN116719999A (en) * | 2023-06-16 | 2023-09-08 | 平安科技(深圳)有限公司 | Text similarity detection method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117556829B (en) | 2024-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108959246B (en) | Answer selection method and device based on improved attention mechanism and electronic equipment | |
CN112287670A (en) | Text error correction method, system, computer device and readable storage medium | |
CN103280216B (en) | Improve the speech recognition device the relying on context robustness to environmental change | |
WO2022121251A1 (en) | Method and apparatus for training text processing model, computer device and storage medium | |
CN111985228B (en) | Text keyword extraction method, text keyword extraction device, computer equipment and storage medium | |
CN106528694B (en) | semantic judgment processing method and device based on artificial intelligence | |
CN108416032A (en) | A kind of file classification method, device and storage medium | |
CN113836938B (en) | Text similarity calculation method and device, storage medium and electronic device | |
CN108804427B (en) | Voice machine translation method and device | |
CN111667817A (en) | Voice recognition method, device, computer system and readable storage medium | |
CN116956835B (en) | Document generation method based on pre-training language model | |
CN113655893A (en) | Word and sentence generation method, model training method and related equipment | |
CN112632248A (en) | Question answering method, device, computer equipment and storage medium | |
CN114118100A (en) | Method, apparatus, device, medium and program product for generating dialogue statements | |
CN111161730B (en) | Voice instruction matching method, device, equipment and storage medium | |
CN117556829B (en) | Comparison method, device and equipment of vehicle fault codes and storage medium | |
CN115858776B (en) | Variant text classification recognition method, system, storage medium and electronic equipment | |
CN116257601A (en) | Illegal word stock construction method and system based on deep learning | |
WO2021082570A1 (en) | Artificial intelligence-based semantic identification method, device, and semantic identification apparatus | |
CN114239601A (en) | Statement processing method and device and electronic equipment | |
CN111159339A (en) | Text matching processing method and device | |
CN113836346B (en) | Method, device, computing equipment and storage medium for generating abstract for audio file | |
CN113204964B (en) | Data processing method, system, electronic equipment and storage medium | |
US12073299B2 (en) | Systems and methods for using contrastive pre-training to generate text and code embeddings | |
CN115688771B (en) | Document content comparison performance improving method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |