Vehicle control methods, devices, electronic devices, and media based on embedded representations
By parsing the user's embedded vectors using the simBERT model and knowledge graph, and generating legal ellipsis sentences, the contradiction between the casualness of users' spoken expression and the standardization of machine expression is resolved, enabling intelligent vehicles to accurately understand and respond to ellipsis sentences.
Patent Information
- Application Number
- CN202310596307.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-05-23
AI Technical Summary
In voice interaction, there is a contradiction between the casualness of users' spoken expression and the strict normative expression of machines, which makes it difficult for machines to accurately understand the omitted sentences of users.
By using the simBERT model to generate embedded vectors, combined with the knowledge graph and standard vector library in the field of vehicle control, the user's omitted statements are parsed, legal ellipsis sentences are generated, and vehicle actions are controlled.
This technology enables intelligent vehicles to accurately understand and respond to omitted statements from users, resolving the contradiction between the arbitrariness of users' spoken expression and the standardized expression of machines, and improving the accuracy of vehicle control.
Smart Images

Figure CN116494899B_ABST
Abstract
Description
Technical Field
[0001] This application relates to voice interaction technology, and more particularly to a vehicle control method, device, electronic device, and medium based on embedded representation. Background Technology
[0002] With the development of technology and changes in market demand, voice interaction has become an important interaction method for current smart cars.
[0003] In practical applications, during voice interaction, users may omit certain words while still conveying complete semantic meaning in specific scenarios. However, machine language requires strong standardization and logic, creating a contradiction between the highly standardized expression of machines and the flexibility of omission in user speech. This application aims to resolve this contradiction. Summary of the Invention
[0004] This application provides a vehicle control method, device, electronic device, and medium based on embedded representation, which resolves the contradiction between the arbitrariness of omission in user spoken expression and the strong normative expression of machine.
[0005] On the one hand, this application provides a vehicle control method based on embedded representation, the method comprising:
[0006] When a vehicle control command is received, a first embedded vector corresponding to the vehicle control command is generated according to the simBERT model. The vehicle control command is used to instruct the vehicle to complete the target action. The simBERT model is obtained by training the original simBERT model based on similar corpus pairs in the vehicle control field. The sentences in the similar corpus pairs are used to instruct the vehicle to complete the same action.
[0007] The second embedded vector with the highest similarity to the first embedded vector is found in the standard vector library, and the second embedded vector is used as the target embedded vector; the standard vector library includes multiple second embedded vectors, and the second embedded vector is generated by the simBERT model based on the standard statement or legal ellipsis.
[0008] The target embedded vector is parsed and processed according to the knowledge graph of the vehicle control field to obtain the parsing result, and the vehicle is controlled to complete the target action according to the parsing result.
[0009] In another possible implementation, prior to obtaining the vehicle control command, the method further includes:
[0010] Obtain vehicle control corpus, and construct the knowledge graph based on the vehicle control corpus. The vehicle control corpus includes multiple statements used to instruct any feature of any entity in the vehicle to perform any operation.
[0011] The standard statement and the legal ellipsis statement are generated based on the knowledge graph, and the standard statement and the legal ellipsis statement are stored in a standard corpus; the standard statement includes words used to represent the entity, the operation, the feature, and the feature value; the legal ellipsis statement is obtained by omitting words from the standard statement that do not make the statement ambiguous;
[0012] The standard corpus is input into the simBERT model to obtain the second embedded vector corresponding to the standard sentence and the second embedded vector corresponding to the legal ellipsis.
[0013] In another possible implementation, generating the legal ellipsis based on the knowledge graph includes:
[0014] Based on the knowledge graph, first-level entity documents and second-level entity documents are determined for each entity. The first-level entity document includes the first word within a two-hop range corresponding to the entity, and the second-level entity document includes the second word within a one-hop range corresponding to the feature of the entity. The number of second-level entity documents is equal to the number of features included in the entity.
[0015] Calculate the first reverse file frequency value of the first word, and calculate the second reverse file frequency value of the second word, wherein the first reverse file frequency value is related to the number of first-level entity documents containing the first word, and the second reverse file frequency value is related to the number of second-level entity documents containing the second word;
[0016] The legal omission statement is generated based on the first reverse file frequency value and / or the second reverse file frequency value, and the standard statement.
[0017] In another possible implementation, the step of searching for the second embedded vector with the highest similarity to the first embedded vector in a standard vector library and using the second embedded vector as the target embedded vector includes:
[0018] Calculate the cosine distance between the first embedded vector and the second embedded vector;
[0019] Based on the cosine distance, find the second embedded vector that has the highest similarity to the first embedded vector, and use the second embedded vector as the target embedded vector.
[0020] In another possible implementation, the step of finding the second embedded vector with the highest similarity to the first embedded vector based on the cosine distance, and using the second embedded vector as the target embedded vector, includes:
[0021] Obtain a second embedded vector whose cosine distance is greater than a first preset threshold. The first preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0022] The second embedded vector is sorted according to the rule of cosine distance from largest to smallest to obtain a sorted queue, and the second embedded vector at the first position of the sorted queue is taken as the target embedded vector.
[0023] In another possible implementation, the method further includes:
[0024] Acquire online error handling corpus, update the knowledge graph based on the online error corpus, and obtain updated standard statements;
[0025] If there exists an update valid omission statement corresponding to the update standard statement, then update the standard corpus and the standard vector library according to the update standard statement and the update valid omission statement;
[0026] Otherwise, update the standard corpus and the standard vector library according to the updated standard statement.
[0027] In another possible implementation, prior to acquiring the online error processing corpus, the method further includes:
[0028] When receiving an error message from a user, the text corresponding to the vehicle control command is used as the online error processing corpus.
[0029] When the cosine distances are all less than the second preset threshold, the text corresponding to the vehicle control command is used as the online error processing corpus. The second preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0030] Secondly, this application provides a vehicle control device based on embedded representation, the device including a generation module, a lookup module, and a control module, wherein...
[0031] The generation module is used to generate a first embedded vector corresponding to the vehicle control command based on the simBERT model when the vehicle control command is obtained; the vehicle control command is used to instruct the vehicle to complete the target action; the simBERT model is obtained by training the original simBERT model based on similar corpus pairs in the vehicle control field; the sentences in the similar corpus pairs are used to instruct the vehicle to complete the same action.
[0032] The search module is used to find the second embedded vector with the highest similarity to the first embedded vector in the standard vector library, and use the second embedded vector as the target embedded vector; the standard vector library includes multiple second embedded vectors, and the second embedded vector is generated by the simBERT model from standard sentences or legal ellipsis sentences;
[0033] The control module is used to parse the target embedded vector according to the knowledge graph of the vehicle control field, obtain the parsing result, and control the vehicle to complete the target action according to the parsing result.
[0034] In another possible implementation, the generation module is also used for:
[0035] Obtain vehicle control corpus, and construct the knowledge graph based on the vehicle control corpus. The vehicle control corpus includes multiple statements used to instruct any feature of any entity in the vehicle to perform any operation.
[0036] The standard statement and the legal ellipsis statement are generated based on the knowledge graph, and the standard statement and the legal ellipsis statement are stored in a standard corpus; the standard statement includes words used to represent the entity, the operation, the feature, and the feature value; the legal ellipsis statement is obtained by omitting words from the standard statement that do not make the statement ambiguous;
[0037] The standard corpus is input into the simBERT model to obtain the second embedded vector corresponding to the standard sentence and the second embedded vector corresponding to the legal ellipsis.
[0038] In another possible implementation, the generation module is specifically used for:
[0039] Based on the knowledge graph, first-level entity documents and second-level entity documents are determined for each entity. The first-level entity document includes the first word within a two-hop range corresponding to the entity, and the second-level entity document includes the second word within a one-hop range corresponding to the feature of the entity. The number of second-level entity documents is equal to the number of features included in the entity.
[0040] Calculate the first reverse file frequency value of the first word, and calculate the second reverse file frequency value of the second word, wherein the first reverse file frequency value is related to the number of first-level entity documents containing the first word, and the second reverse file frequency value is related to the number of second-level entity documents containing the second word;
[0041] The legal omission statement is generated based on the first reverse file frequency value and / or the second reverse file frequency value, and the standard statement.
[0042] In another possible implementation, the lookup module is specifically used for:
[0043] Calculate the cosine distance between the first embedded vector and the second embedded vector;
[0044] Based on the cosine distance, find the second embedded vector that has the highest similarity to the first embedded vector, and use the second embedded vector as the target embedded vector.
[0045] In another possible implementation, the lookup module is specifically used for:
[0046] Obtain a second embedded vector whose cosine distance is greater than a first preset threshold. The first preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0047] The second embedded vector is sorted according to the rule of cosine distance from largest to smallest to obtain a sorted queue, and the second embedded vector at the first position of the sorted queue is taken as the target embedded vector.
[0048] In another possible implementation, the generation module is also used for:
[0049] Acquire online error handling corpus, update the knowledge graph based on the online error corpus, and obtain updated standard statements;
[0050] If there exists an update valid omission statement corresponding to the update standard statement, then update the standard corpus and the standard vector library according to the update standard statement and the update valid omission statement;
[0051] Otherwise, update the standard corpus and the standard vector library according to the updated standard statement.
[0052] In another possible implementation, the generation module is also used for:
[0053] When receiving an error message from a user, the text corresponding to the vehicle control command is used as the online error processing corpus.
[0054] When the cosine distances are all less than the second preset threshold, the text corresponding to the vehicle control command is used as the online error processing corpus. The second preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0055] Thirdly, this application provides an electronic device, including: at least one processor and a memory;
[0056] The memory stores computer-executed instructions;
[0057] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any of the first aspects above.
[0058] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the first aspects above.
[0059] This application provides a vehicle control method, device, electronic device, and medium based on embedded representation. The method is applied to intelligent vehicles. Based on this method, when a vehicle control command is received instructing the intelligent vehicle to complete a target action, the command is first input into a SimBERT model to obtain its corresponding first embedded vector. Next, a second embedded vector with the highest similarity to the first embedded vector is searched in a standard vector library, and this second embedded vector is used as the target embedded vector. Finally, the target embedded vector is parsed using a knowledge graph in the vehicle control domain to obtain the parsing result, thus completing the understanding of the vehicle control command and enabling the intelligent vehicle to control itself to complete the target action based on the parsing result.
[0060] In this application, the standard vector library includes second embedded vectors generated from standard statements and second embedded vectors generated from legally omitted statements. Therefore, during the use of intelligent vehicles, as long as the omissions in the user's vehicle control commands are directly and clearly understandable, the intelligent vehicle can accurately understand and provide corresponding feedback. The method of this application effectively resolves the contradiction between the arbitrariness of omissions in user spoken expression and the strong normative expression of machines. Attached Figure Description
[0061] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0062] Figure 1 A schematic diagram of a human-vehicle voice interaction scenario provided in an embodiment of this application;
[0063] Figure 2 A flowchart illustrating a vehicle control method based on embedded representation provided in this application embodiment. Figure 1 ;
[0064] Figure 3 A flowchart illustrating a vehicle control method based on embedded representation provided in this application embodiment. Figure 2 ;
[0065] Figure 4a A flowchart illustrating a method for obtaining a standard vector library provided in an embodiment of this application;
[0066] Figure 4b A schematic diagram of the structure of a knowledge graph in the field of vehicle control provided in an embodiment of this application;
[0067] Figure 5 A flowchart illustrating a vehicle control method based on embedded representation provided in this application embodiment. Figure 3 ;
[0068] Figure 6 A schematic diagram of the structure of a vehicle control device based on embedded representation provided in an embodiment of this application;
[0069] Figure 7 An electronic device provided in an embodiment of this application.
[0070] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0071] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0072] With the rise of vehicle-to-everything (V2X) and artificial intelligence technologies, more and more functions are being incorporated into smart vehicles. The proliferation of functions and increasingly complex interfaces are competing with drivers for their attention during driving. In the current stage of human-machine co-driving, voice interaction technology demonstrates its unique advantage in helping drivers reduce their reliance on manual operation of in-vehicle devices, thereby increasing driving safety.
[0073] Figure 1 This is a schematic diagram of a human-vehicle voice interaction scenario provided in an embodiment of this application, such as... Figure 1 As shown, a human-vehicle interaction system generally includes an electronic device 10 and a vehicle-controlled device 20 that is communicatively connected to the electronic device 10. Specifically, the electronic device 10 is used to collect vehicle control commands issued by the user. After obtaining the vehicle control commands, it parses and processes the commands to obtain the parsing results, and controls the corresponding vehicle-controlled device 20 according to the parsing results. Among them, the vehicle-controlled device 20 includes air conditioners, refrigerators, etc.
[0074] In the process described above, the vehicle control commands input by the user may be statements that are still clearly understood by the user after omitting one or more words, but are not clearly understood by the electronic device 10, thus making it impossible to accurately control the vehicle's controlled device 20. That is, there is a contradiction between the arbitrariness of omission in the user's spoken expression and the strict standardization of machine expression. For example, when the intelligent vehicle only contains one vehicle controlled device 20 that can set humidity (air conditioning), the user's input command, "lower humidity to 25," is already clearly stated. However, the electronic device 10 cannot promptly and accurately determine which specific vehicle controlled device 20 the user wants to control.
[0075] This application provides a vehicle control method, device, electronic device, and medium based on embedded representation to solve the aforementioned problems. First, this application generates a knowledge graph based on vehicle control corpus in the field of vehicle control. Second, it generates standard statements and legal ellipsis sentences based on the knowledge graph. The standard statements should include the vehicle-controlled device 20 and the actions it needs to perform. Legal ellipsis sentences are statements that can still be clearly expressed after omitting words used to represent the vehicle-controlled device 20 or its actions. Finally, when a vehicle control command is obtained, a standard statement or legal ellipsis sentence matching the vehicle control command is searched from a standard corpus containing standard statements and legal ellipsis sentences, and the corresponding vehicle-controlled device 20 is controlled based on the standard statement or legal ellipsis sentence.
[0076] The method of this application generates standard statements and legal ellipsis sentences based on a knowledge graph. When a user inputs a clearly expressed ellipsis sentence, it can accurately find the most similar legal ellipsis sentence, which is conducive to quickly and accurately understanding the user's command and thus accurately making corresponding feedback actions.
[0077] It is worth noting that the method of this application is executed by electronic device 10. Electronic device 10 can be installed independently on the intelligent vehicle and communicate with the vehicle controlled device 20. Alternatively, it can be directly embedded in each vehicle controlled device 20; this application does not limit its implementation. In this embodiment, electronic device 10 is installed independently on the intelligent vehicle, and this embodiment does not limit the communication method between electronic device 10 and vehicle controlled device 20, as long as communication can be achieved.
[0078] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Where the embodiments do not conflict, the following embodiments and features thereof can be combined with each other.
[0079] Figure 2 A flowchart illustrating a vehicle control method based on embedded representation provided in this application embodiment. Figure 1 ,like Figure 2As shown, the method provided in this embodiment includes:
[0080] S201, when a vehicle control command is obtained, the first embedded vector corresponding to the vehicle control command is generated according to the simBERT model.
[0081] Among them, vehicle control commands are used to instruct the vehicle to complete the target action. The simBERT model is obtained by training the original simBERT model based on similar corpus pairs in the vehicle control field. The sentences in the similar corpus pairs are used to instruct the vehicle to complete the same action.
[0082] Specifically, the vehicle control commands are input by the user. In this embodiment, the vehicle control commands are acquired after the electronic device is woken up. The electronic device can be woken up by the user's voice input of a preset wake-up command, or by the user pressing a preset button on the electronic device.
[0083] For example, in this embodiment, the electronic device is preset with the wake-up command "Hello, X". When the user inputs "Hello, X" by voice, the electronic device is woken up. At this time, if the user needs to control the air conditioner of the vehicle to be turned on, the user can input the vehicle control command "Turn on the air conditioner".
[0084] In this embodiment, the electronic device pre-trains the original simBERT model based on similar corpus in the vehicle control field to obtain a trained simBERT model, thereby enabling the simBERT model to generate a more accurate first embedded vector when generating the first embedded vector according to the vehicle control command.
[0085] S202, find the second embedded vector with the highest similarity to the first embedded vector in the standard vector library, and use the second embedded vector as the target embedded vector.
[0086] The standard vector library includes multiple second embedded vectors, which are generated from standard statements or legal ellipsis statements based on the simBERT model.
[0087] It is understood that in this embodiment, the electronic device obtains standard statements and legal ellipsis statements in advance, and inputs the standard statements and legal ellipsis statements into the simBERT model to obtain a standard vector library including multiple second embedded vectors.
[0088] In this embodiment, the electronic device can directly compare the first embedded vector with each of the second embedded vectors in the standard vector library to find the second embedded vector that is most similar to it. Alternatively, it can calculate the cosine distance between the first embedded vector and each of the second embedded vectors in the standard vector library, and then use the cosine distance to find the second embedded vector that is most similar to the first embedded vector. In practical applications, other methods can also be used to determine the target embedded vector corresponding to the first embedded vector, and this embodiment does not limit this method.
[0089] S203 analyzes the target embedded vector based on the knowledge graph in the vehicle control field to obtain the analysis result, and controls the vehicle to complete the target action based on the analysis result.
[0090] In this embodiment, the knowledge graph is constructed based on vehicle control corpus in the field of vehicle control. Its logical structure can be entity-feature-relationship-feature value or feature-feature value-relationship-entity. This embodiment does not limit it.
[0091] For example, if the logical structure of the knowledge graph is entity-feature-relation-feature value, then when parsing the target embedded vector, the four slots obtained correspond to the entity, feature, relation, and feature value, respectively. Further, if the vehicle control command is to set the air conditioning temperature to 25℃, then the slot values corresponding to each slot in the final parsing result obtained by the electronic device based on the knowledge graph are: air conditioning; temperature; set to; 25℃.
[0092] The method provided in this embodiment involves the electronic device generating a first embedded vector corresponding to the vehicle control command based on the simBERT model when it receives a vehicle control command. It then searches for a second embedded vector in a standard vector library that is most similar to the first embedded vector and uses this second embedded vector as the target embedded vector. The electronic device then parses and processes the target embedded vector using a knowledge graph to understand the user-input vehicle control command and controls the vehicle to complete the target action based on the command.
[0093] In the method of this application, the standard vector library includes second embedded vectors corresponding to standard statements and legally omitted statements. Legally omitted statements refer to statements that can be clearly understood by the user but not by the electronic device. In this application, the electronic device pre-generates legally omitted statements and generates corresponding second embedded vectors using the simBERT model. This ensures that if the user inputs such legally omitted statements during actual use, the electronic device can accurately understand them and thus accurately control the vehicle's controlled equipment.
[0094] Figure 3A flowchart illustrating a vehicle control method based on embedded representation provided in this application embodiment. Figure 2 This embodiment, based on the above embodiments, limits the method of searching for the target embedded vector in the standard vector library. Specifically, as follows: Figure 3 As shown, the method provided in this embodiment includes:
[0095] S301, when the first embedded vector is obtained, calculate the cosine distance between the first embedded vector and the second embedded vector.
[0096] The formula for calculating the cosine distance is: Specifically, A is used to represent the first embedded vector, and B is used to represent the second embedded vector.
[0097] S302, obtain the second embedded vector whose cosine distance is greater than the first preset threshold.
[0098] The first preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0099] For example, if the first preset threshold is calculated to be 0.8, then a second embedded vector with a cosine distance greater than 0.8 needs to be obtained.
[0100] S303, sort the second embedded vectors according to the rule of cosine distance from largest to smallest to obtain a sorted queue, and take the second embedded vector at the first position of the sorted queue as the target embedded vector.
[0101] In practical applications, the cosine distances can also be sorted in ascending order to obtain a sorted queue. In this case, the second embedded vector at the end of the queue is taken as the target embedded vector.
[0102] The method provided in this embodiment finds the second embedded vector that is most similar to the first embedded vector by using the cosine distance between the first embedded vector and the second embedded vector. This helps to obtain a more accurate target embedded vector, which in turn helps the vehicle to accurately complete the target action according to the vehicle control command.
[0103] Figure 4a This is a flowchart illustrating a method for obtaining a standard vector library according to an embodiment of this application. This embodiment, based on the foregoing embodiments, limits the method for obtaining the standard vector library. Specifically, as... Figure 4a As shown, the method provided in this embodiment includes:
[0104] S401a: Obtain vehicle control corpus and construct a knowledge graph based on the vehicle control corpus.
[0105] The vehicle control corpus includes multiple statements used to instruct any feature of any entity in the vehicle to perform any operation.
[0106] It is understood that the entity in this embodiment is the vehicle-controlled device in the aforementioned embodiments, that is, the entity is any controllable intelligent device on the vehicle. Features are the characteristics corresponding to the entity. For example, when the entity is an air conditioner, its corresponding features include temperature, humidity, airflow, fan speed, and circulation mode. "Air conditioner temperature set to 25℃" is a statement in the vehicle control corpus, which instructs the air conditioner in the vehicle to set the temperature to 25℃.
[0107] Furthermore, after obtaining the vehicle control corpus, a knowledge graph is constructed based on each entity in the corpus, each feature corresponding to each entity, and each feature value corresponding to each feature. For example, Figure 4b This is a schematic diagram of the structure of a knowledge graph in the field of vehicle control provided in an embodiment of this application. Specifically, based on the vehicle control corpus analysis, the entities included in the vehicle are: air conditioner, refrigerator, speaker, and window. The operations, features, and feature values corresponding to each entity can be found in [reference needed]. Figure 4b For example, in Figure 4b In the context of air conditioning, it includes three characteristics: mode, temperature, and humidity. Furthermore, the operation between the entity and temperature can be raising / lowering, and the characteristic value corresponding to temperature is X degrees.
[0108] S402a generates standard statements based on knowledge graphs.
[0109] The standard statements include terms used to represent entities, operations, features, and feature values.
[0110] Specifically, standard statements are generated using templates based on entities, operations, features, and feature values in the knowledge graph. For example, for the entity "air conditioner," its corresponding feature is temperature, its operation is "set," and its feature value is XX degrees. The generated standard statement would be "Set the air conditioner temperature to XX degrees." For the entity "car window," its corresponding feature is height, its operation is "raise," and its feature value is XX centimeters. The generated standard statement would be "Raise the car window height by XX centimeters."
[0111] S403a, based on the knowledge graph, determine the first-level entity document and second-level entity document for each entity.
[0112] The first-level entity document includes the first word within the two-hop range corresponding to the entity, and the second-level entity document includes the second word within the one-hop range corresponding to the feature of the entity. The number of second-level entity documents is equal to the number of features included in the entity.
[0113] Specifically, in this embodiment, firstly, the entities of the knowledge graph are determined. Secondly, for each entity, a first-level entity document is generated based on the words within the two-hop range of that entity, and a second-level entity document is generated based on the words within the one-hop range corresponding to the features of that entity. That is, each entity corresponds to one first-level entity document, and each feature of the entity corresponds to one second-level entity document. It can be understood that the words in the first-level entity document are called the first word, and the words in the second-level entity document are called the second word. The first word and the second word may be the same word.
[0114] For example, for such Figure 4b The knowledge graph shown first identifies four entities: air conditioner, refrigerator, stereo, and car window. Therefore, there are four first-level entity documents. For air conditioner, the first word within its two-hop range includes temperature, X degrees, humidity, X value, mode, cooling, heating, and ventilation. Thus, the first-level entity document for air conditioner includes "temperature, X degrees, humidity, X value, mode, cooling, heating, and ventilation." Similarly, the first-level entity document for refrigerator includes "temperature, X degrees, mode, energy saving, freezing, and refrigeration"; the first-level entity document for stereo includes "volume, X value, track, Xth, sound effect, high, medium, and low"; and the first-level entity document for car window includes "height, X centimeters, eye color, and X color."
[0115] An air conditioner has three characteristics: mode, temperature, and humidity. Therefore, there are three secondary entity documents for an air conditioner. The secondary entity document corresponding to the mode includes "cooling, heating, and ventilation", the secondary entity document corresponding to the temperature includes "X degrees", and the secondary entity document corresponding to the humidity includes "X value".
[0116] For a refrigerator, there are two features: temperature and mode. Therefore, there are two secondary entity documents for a refrigerator. The secondary entity document corresponding to temperature includes "X degrees", and the secondary entity document corresponding to mode includes "energy saving, freezing, refrigeration".
[0117] For audio equipment, there are three features: volume, track, and sound effect. Therefore, there are three secondary entity documents for audio equipment. The secondary entity document for volume includes "X value", the secondary entity document for track includes "Xth track", and the secondary entity document for sound effect includes "high-end, mid-range, and low-end".
[0118] For a car window, there are two features: height and color. Therefore, there are two secondary entity documents for the car window. The secondary entity feature corresponding to the height includes "X centimeters", and the secondary entity feature corresponding to the color includes "X color".
[0119] S404a, calculate the first reverse file frequency value of the first word, and calculate the second reverse file frequency value of the second word.
[0120] The first reverse file frequency value is related to the number of first-level entity documents containing the first word, and the second reverse file frequency value is related to the number of second-level entity documents containing the second word.
[0121] It is understandable that reverse file frequency is used to represent the prevalence of a word within a certain range. In this embodiment, the first reverse file frequency value and the second reverse file frequency value are calculated according to the calculation formula of the reverse file frequency value.
[0122] Specifically, the formula for calculating the frequency value of reverse files is as follows: Where i represents the number of the first or second word, |D| represents the number of first-level or second-level entity documents, and |j∶t i ∈d j | indicates that the word t is included. i The data in the first-level or second-level entity documents, 1 is to prevent the inclusion of the word t i An error occurs when the number of documents is 0.
[0123] for Figure 4b The knowledge graph shown first determines the number of first-level entity documents |D| as 4 when calculating the first inverse document frequency value of the first word "temperature". The number of first-level entity documents containing "temperature" is |j∶t. i ∈d j The value is 2, therefore, the first inverse file frequency value for "temperature" is 2.
[0124] Furthermore, after determining that the entity is an audio file, when calculating the second reverse file frequency value of the second word "Xth", it is first determined that its corresponding entity is an audio file, the number of second-level entity documents of the audio file |D| is 3, and the number of second-level entity documents containing "Xth" is |j∶t. i ∈d j | is 1, therefore, the frequency value of the second reverse file of the "Xth" is 1.
[0125] In this embodiment, after obtaining the knowledge graph, the electronic device pre-determines the first-level entity documents and second-level entity documents based on the knowledge graph, and calculates the first reverse file frequency of each first word and the second reverse file frequency value of each second word.
[0126] S405a: Generate a valid omitted statement based on the first reverse file frequency value, the second reverse file frequency value, and the standard statement.
[0127] Among them, a legal ellipsis is a standard statement obtained by omitting words that do not make the statement ambiguous.
[0128] Specifically, as can be seen from the limitation of S404a in this embodiment, the first reverse file frequency value is calculated based on the first-level entity documents of each entity and the first-level entity documents containing the first word, and the second reverse file frequency value is calculated based on the second-level entity documents of a certain entity and the second-level entity documents containing the second word. That is, the second reverse file frequency value is calculated for a certain entity, and the premise for calculating the second reverse file frequency value is that the entity has been determined.
[0129] Understandably, if only one first-level entity document contains the first word, it means that the first word enables its corresponding entity to be disambiguated. In other words, the mere presence of the first word definitively confirms its association with that entity. Therefore, for standard statements containing the first word, the words representing the entity can be omitted. In this case, the first inverse document frequency value of the first word is... The maximum first reverse file frequency value is given by the formula, where |D1| is the number of first-level entity documents.
[0130] If only one second-level entity document contains the second word, it means that the second word enables its corresponding feature to be disambiguated. In other words, the presence of the second word unequivocally confirms its association with a certain feature of the entity. Therefore, for standard statements containing the second word, the included feature can be omitted. In this case, the second inverse document frequency value of the second word is... The maximum second reverse file frequency value is given by the formula, where |D2| is the number of second-level entity documents.
[0131] Furthermore, in this embodiment, for each standard statement, based on the first reverse file frequency value and / or the second reverse file frequency value of each word in the standard statement, it is determined whether the entity and / or feature in the standard statement can be omitted, thereby obtaining a legally omitted statement.
[0132] Specifically, the electronic device first obtains the first reverse file frequency value corresponding to the words in the standard statement other than entities. If any word has a second reverse file frequency value, then the second reverse file frequency value is obtained at the same time.
[0133] The electronic device determines whether any of the words in the standard statement (excluding entities) have a first reverse file frequency value. The word "can" is used to determine whether an entity in a standard statement can be omitted. If it exists, the entity can be omitted to obtain a valid omitting statement.
[0134] Electronic devices determine whether a second reverse file frequency value exists in the standard statement. The word is used to determine whether a feature in the standard statement can be omitted. If it exists, the feature in the standard statement can be omitted to obtain a legally omitted statement.
[0135] It is understandable that if the standard statement contains a first reverse file frequency value... The words, and the frequency value of the second reverse file. The use of words in this standard statement indicates that both entities and features can be omitted.
[0136] For example, for Figure 4b In the knowledge graph shown, if a standard statement is "Adjust the car window color to X color", the electronic device first obtains the first reverse file frequency values of the words "color", "adjust", and "X color". By judgment, it is found that the first reverse file frequency values of both "color" and "X color" are the highest first reverse file frequency values, indicating that the entity "car window" and the feature "color" in the standard statement can be omitted. At this point, the legally valid omitted statements generated based on this standard statement include: "Adjust the car window color to X color", "Adjust the color to X color", and "Adjust to X color".
[0137] Optionally, for the legal elliptical sentences generated in the above examples, if the feature values corresponding to the features they contain are definite, then the words representing the operation they contain can also be omitted. That is, the legal elliptical sentences in the above standard sentences also include "window X color", "color X color", and "X color".
[0138] In this embodiment, the electronic device calculates the first reverse file frequency value of each word in the knowledge graph, and the second reverse file frequency value of some words, and generates a legal ellipsis statement based on the first reverse file frequency value and / or the second reverse file frequency value, as well as the standard statement.
[0139] Using the method in this embodiment, when the electronic device receives a vehicle control command from a user that has omitted some words but is still clearly understandable to the user, it can accurately understand the command and respond accordingly. Furthermore, the electronic device pre-generates valid omitted statements, which facilitates timely vehicle response.
[0140] Figure 5 A flowchart illustrating a vehicle control method based on embedded representation provided in this application embodiment. Figure 3 This embodiment, based on the aforementioned embodiments, further specifies the method for obtaining the standard vector library. Specifically, as follows: Figure 5 As shown, the method provided in this embodiment includes:
[0141] S501, when receiving error prompts from users, and when the cosine distance is less than a second preset threshold, uses the text corresponding to the vehicle control command as online error processing corpus.
[0142] The second preset threshold is obtained by calculating the cosine distance between embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings. It is understandable that if the cosine distance is less than the second preset threshold, it indicates that the two vectors are completely unrelated. In this case, it may mean that the previously collected corpus of vehicle control terminology did not contain a statement corresponding to that vector, or statements that are similar or related to it.
[0143] In this embodiment, the error message instruction provided by the user can be determined after the electronic device collects the user's dissatisfied statement online, or it can be a pre-set trigger statement in the electronic device, which determines that the user has provided an error message instruction when the user enters the trigger statement. In practical applications, other methods can also be used to determine whether the user has provided an error message instruction, and this embodiment does not limit such methods.
[0144] S502: Obtain online error processing corpus, update the knowledge graph based on the online error processing corpus, and obtain updated standard sentences.
[0145] Specifically, if the online error processing corpus contains entities, features, operations, or feature values that were originally present in the vehicle but not in the original knowledge graph, the original knowledge graph is updated based on the online error processing corpus to obtain an updated knowledge graph.
[0146] Furthermore, updated standard statements are generated based on the updated knowledge graph, in addition to the original standard statements.
[0147] S503 If there exists an update valid omission statement corresponding to the update standard statement, then update the standard corpus and standard vector library according to the update standard statement and the update valid omission statement.
[0148] S504. If there is no valid omission statement corresponding to the update standard statement, then update the standard corpus and standard vector library according to the update standard statement.
[0149] Understandably, electronic devices determine whether there is a valid ellipsis statement corresponding to the update standard statement by judging whether there is a word with the highest frequency value in the first reverse file and / or whether there is a word with the highest frequency value in the second reverse file in the update standard statement.
[0150] Optionally, the electronic device can acquire online error processing corpora in real time, and update the standard corpus and standard vector library each time it acquires online error processing corpora. Alternatively, the electronic device can acquire online error processing corpora periodically, and update the standard corpus and standard vector library based on the acquired online error processing corpora at the end of the period. This embodiment does not limit this approach.
[0151] In this embodiment, the electronic device captures online error processing corpus and updates the standard corpus and standard vector library based on the online error processing corpus. This enables the electronic device to understand vehicle control commands in a timely and accurate manner when it receives vehicle control commands that the user can clearly understand, thereby improving the user experience.
[0152] The above embodiments describe a vehicle control method based on embedded representation from the perspective of method flow. The following embodiments describe a vehicle control device based on embedded representation from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0153] This application provides a vehicle control device based on embedded representation, such as... Figure 6 As shown, the device includes a generation module 61, a search module 62, and a control module 63, wherein...
[0154] The generation module 61 is used to generate a first embedded vector corresponding to the vehicle control command based on the simBERT model when the vehicle control command is obtained. The vehicle control command is used to instruct the vehicle to complete the target action. The simBERT model is obtained by training the original simBERT model based on similar corpus pairs in the vehicle control field. The sentences in the similar corpus pairs are used to instruct the vehicle to complete the same action.
[0155] The search module 62 is used to find the second embedded vector with the highest similarity to the first embedded vector in the standard vector library, and use the second embedded vector as the target embedded vector; the standard vector library includes multiple second embedded vectors, which are generated by the simBERT model from standard sentences or legal ellipses;
[0156] The control module 63 is used to parse the target embedded vector according to the knowledge graph in the field of vehicle control, obtain the parsing result, and control the vehicle to complete the target action according to the parsing result.
[0157] In another possible implementation of this application embodiment, the generation module 61 is further configured to:
[0158] Acquire vehicle control corpus, and construct a knowledge graph based on the vehicle control corpus. The vehicle control corpus includes multiple statements used to instruct any feature of any entity in the vehicle to perform any operation.
[0159] Standard statements and legally elliptical statements are generated based on the knowledge graph and stored in a standard corpus. Standard statements include words used to represent entities, operations, features, and feature values. Legally elliptical statements are obtained by omitting words from standard statements that do not make the statement ambiguous.
[0160] The standard corpus is input into the simBERT model to obtain the second embedded vectors corresponding to standard sentences and the second embedded vectors corresponding to legal ellipsis sentences.
[0161] In another possible implementation of this application embodiment, the generation module 61 is specifically used for:
[0162] Based on the knowledge graph, determine the first-level entity document and the second-level entity document for each entity. The first-level entity document includes the first word within the two-hop range corresponding to the entity, and the second-level entity document includes the second word within the one-hop range corresponding to the features of the entity. The number of second-level entity documents is equal to the number of features included in the entity.
[0163] Calculate the first reverse file frequency value of the first word, and calculate the second reverse file frequency value of the second word, wherein the first reverse file frequency value is related to the number of first-level entity documents containing the first word, and the second reverse file frequency value is related to the number of second-level entity documents containing the second word;
[0164] Generate valid omitted statements based on the frequency values of the first and / or second reverse files and standard statements.
[0165] In another possible implementation of this application embodiment, the lookup module 62 is specifically used for:
[0166] Calculate the cosine distance between the first embedded vector and the second embedded vector;
[0167] Based on the cosine distance, find the second embedded vector that has the highest similarity to the first embedded vector, and use the second embedded vector as the target embedded vector.
[0168] In another possible implementation of this application embodiment, the lookup module 62 is specifically used for:
[0169] Obtain a second embedded vector whose cosine distance is greater than a first preset threshold. The first preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0170] The second embedded vectors are sorted according to the rule of cosine distance from largest to smallest to obtain a sorted queue. The second embedded vector at the head of the sorted queue is taken as the target embedded vector.
[0171] In another possible implementation of this application embodiment, the generation module 61 is further configured to:
[0172] Acquire online error handling corpus, update the knowledge graph based on the online error corpus, and obtain updated standard statements;
[0173] If there exists an update valid omission statement corresponding to the update standard statement, then update the standard corpus and standard vector library according to the update standard statement and the update valid omission statement;
[0174] Otherwise, update the standard corpus and standard vector library according to the updated standard statements.
[0175] In another possible implementation of this application embodiment, the generation module 61 is further configured to:
[0176] When receiving error messages from users, the text corresponding to the vehicle control commands is used as the online error handling corpus.
[0177] When the cosine distance is less than the second preset threshold, the text corresponding to the vehicle control command is used as the online error processing corpus. The second preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
[0178] The vehicle control device based on embedded representation provided in this application embodiment is applicable to the above method embodiment, and will not be described again here.
[0179] This application provides an electronic device, such as... Figure 7 As shown, Figure 7 The illustrated electronic device includes a processor 71 and a memory 72. The processor 71 and the memory 72 are connected, for example, via a bus 73. Optionally, the electronic device may also include a transceiver 74. It should be noted that in practical applications, the transceiver 74 is not limited to one type, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.
[0180] Processor 71 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 71 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0181] Bus 73 may include a pathway for transmitting information between the aforementioned components. Bus 73 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 73 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single thick line, but this does not mean that there is only one bus 73 or one type of bus 73.
[0182] The memory 72 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0183] The memory 72 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 71. The processor 71 is used to execute the application code stored in the memory 72 to implement the content shown in the foregoing method embodiments.
[0184] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used to implement the methods in the above embodiments.
[0185] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.
[0186] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0187] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A vehicle control method based on embedded representation, characterized in that, The method includes: When a vehicle control command is received, a first embedded vector corresponding to the vehicle control command is generated based on the similar text generation and retrieval simBERT model. The vehicle control command is used to instruct the vehicle to complete the target action. The simBERT model is obtained by training the original simBERT model based on similar corpus pairs in the vehicle control field. The sentences in the similar corpus pairs are used to instruct the vehicle to complete the same action. The second embedded vector with the highest similarity to the first embedded vector is found in the standard vector library, and the second embedded vector is used as the target embedded vector; the standard vector library includes multiple second embedded vectors, and the second embedded vector is generated by the simBERT model based on the standard statement or legal ellipsis statement; The target embedded vector is parsed and processed according to the knowledge graph of the vehicle control field to obtain the parsing result, and the vehicle is controlled to complete the target action according to the parsing result.
2. The method according to claim 1, characterized in that, Before obtaining vehicle control commands, the method further includes: Obtain vehicle control corpus, and construct the knowledge graph based on the vehicle control corpus. The vehicle control corpus includes multiple statements used to instruct any feature of any entity in the vehicle to perform any operation. The standard statement and the legally omitted statement are generated based on the knowledge graph, and the standard statement and the legally omitted statement are stored in a standard corpus; the standard statement includes words used to represent the entity, the operation, the feature, and the feature value; the legally omitted statement is obtained by omitting words from the standard statement that do not make the statement ambiguous; The standard corpus is input into the simBERT model to obtain the second embedded vector corresponding to the standard sentence and the second embedded vector corresponding to the legal omitted sentence.
3. The method according to claim 2, characterized in that, Generating the legal ellipsis statement based on the knowledge graph includes: Based on the knowledge graph, first-level entity documents and second-level entity documents are determined for each entity. The first-level entity document includes the first word within a two-hop range corresponding to the entity, and the second-level entity document includes the second word within a one-hop range corresponding to the feature of the entity. The number of second-level entity documents is equal to the number of features included in the entity. Calculate the first reverse file frequency value of the first word, and calculate the second reverse file frequency value of the second word, wherein the first reverse file frequency value is related to the number of first-level entity documents containing the first word, and the second reverse file frequency value is related to the number of second-level entity documents containing the second word; The legal omission statement is generated based on the first reverse file frequency value and / or the second reverse file frequency value, and the standard statement.
4. The method according to claim 2, characterized in that, The step of finding the second embedded vector with the highest similarity to the first embedded vector in the standard vector library and using the second embedded vector as the target embedded vector includes: Calculate the cosine distance between the first embedded vector and the second embedded vector; Based on the cosine distance, find the second embedded vector that has the highest similarity to the first embedded vector, and use the second embedded vector as the target embedded vector.
5. The method according to claim 4, characterized in that, The step of finding the second embedded vector with the highest similarity to the first embedded vector based on the cosine distance, and using the second embedded vector as the target embedded vector, includes: Obtain a second embedded vector whose cosine distance is greater than a first preset threshold. The first preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings. The second embedded vector is sorted according to the rule of cosine distance from largest to smallest to obtain a sorted queue, and the second embedded vector at the first position of the sorted queue is taken as the target embedded vector.
6. The method according to claim 4, characterized in that, The method further includes: Obtain online error processing corpus, update the knowledge graph based on the online error processing corpus, and obtain updated standard statements; If there exists an update valid omission statement corresponding to the update standard statement, then update the standard corpus and the standard vector library according to the update standard statement and the update valid omission statement; Otherwise, update the standard corpus and the standard vector library according to the updated standard statement.
7. The method according to claim 6, characterized in that, Before acquiring the online error handling corpus, the method further includes: When receiving an error message from a user, the text corresponding to the vehicle control command is used as the online error processing corpus. When the cosine distances are all less than the second preset threshold, the text corresponding to the vehicle control command is used as the online error processing corpus. The second preset threshold is obtained by calculating the cosine distance based on the embedded vectors of a large number of positive example statements with the same meaning and negative example statements with different meanings.
8. A vehicle control device based on embedded representation, characterized in that, The device includes: The generation module is used to generate a first embedded vector corresponding to the vehicle control command based on the similar text generation and retrieval simBERT model when the vehicle control command is obtained. The vehicle control command is used to instruct the vehicle to complete the target action. The simBERT model is obtained by training the original simBERT model based on similar corpus pairs in the vehicle control field. The sentences in the similar corpus pairs are used to instruct the vehicle to complete the same action. The search module is used to find the second embedded vector with the highest similarity to the first embedded vector in the standard vector library, and to use the second embedded vector as the target embedded vector; the standard vector library includes multiple second embedded vectors, which are generated by standard statements or legal ellipsis statements according to the simBERT model; The control module is used to parse the target embedded vector according to the knowledge graph of the vehicle control field, obtain the parsing result, and control the vehicle to complete the target action according to the parsing result.
9. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the vehicle control method based on embedded representation as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the vehicle control method based on embedded representation as described in any one of claims 1-7.
Citation Information
Patent Citations
APP control vehicle system
CN108023943A
Vehicle voice control method and device, equipment and medium
CN109003611A