Data processing method and device, computer device, storage medium and program product
By converting voice commands into text information and generating target action commands through vector matching using a pre-defined action classification library, the problems of voice command processing errors and high model training costs in existing technologies are solved, achieving more efficient and accurate voice command processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU XIAOPENG MOTORS TECH CO LTD
- Filing Date
- 2024-09-09
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for processing user voice commands are prone to errors and have high model training costs, especially when device actions change, requiring retraining and resulting in reduced accuracy.
By converting voice commands into text information and determining the target action category based on vector matching results from a pre-defined action classification library, the system generates the corresponding target action command. This avoids building a syntax rule tree and a normalized vocabulary, and uses JSON format to organize data to improve accuracy.
It improves the data processing efficiency and accuracy of voice commands, avoids problems caused by incomplete construction of syntax rule trees, and significantly improves the recognition rate and accuracy of voice commands.
Smart Images

Figure CN119207399B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent interactive control of vehicles, specifically to data processing methods, devices, computer equipment, storage media, and program products. Background Technology
[0002] With the continuous development of artificial intelligence, smart control centers, such as smart speakers and vehicle head units, can connect to an increasing number of devices, including audio systems, air conditioners, and doors and windows. Users can issue commands to the smart control center via voice, thereby controlling the target devices to perform specific operations in response to the user's voice commands, such as starting the air conditioner to cool down.
[0003] However, current technologies for processing user voice commands require predefined grammar rule trees and normalized vocabulary. If the user's voice command exceeds this predefined range, errors in processing can easily occur, especially with rule-based methods that classify user commands. Furthermore, these technologies necessitate manually constructing large amounts of training data to train the user command classification model, and the model needs to be retrained when the actions the device can perform change. Model training costs are high, particularly for classification models that categorize user commands. Moreover, when using large natural language models for classification, an excessive number of actions can lead to overly long prompts, and the accuracy of the large language model decreases when different actions have similar semantics. Summary of the Invention
[0004] In view of this, the present invention provides a data processing method, apparatus, computer equipment, storage medium, and program product to solve or partially solve the problem of low accuracy in responding to user voice commands in related technologies.
[0005] In a first aspect, the present invention provides a data processing method, the method comprising:
[0006] Receive voice commands awaiting a response;
[0007] Convert voice commands into text information;
[0008] Based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library, the target action category corresponding to the text information is determined.
[0009] Based on the text information and the target action category, generate target action instructions that respond to voice commands.
[0010] The preset action classification library is used to represent the first mapping relationship between multiple preset action categories and preset instruction descriptions. Based on the vector matching results between text information and multiple preset instruction descriptions in the preset action classification library, the target action category corresponding to the text information is determined.
[0011] The data processing method provided in this invention receives a voice command to be responded to, converts the voice command into text information, performs vector matching between the text information and multiple preset command descriptions in a preset action classification library, determines the target action category corresponding to the text information based on the vector matching result, and then generates a target action command in response to the voice command based on the text information and the target action category. Therefore, determining the action category of the target action based on vector matching effectively avoids the process of constructing a syntax rule tree and a normalized vocabulary in related technologies, improves the data processing time for voice commands, and effectively avoids problems caused by incomplete construction of syntax rule trees, etc.
[0012] In one optional implementation, the preset action classification library is further used to characterize a second mapping relationship between multiple preset action categories and preset action attribute information; based on text information and the target action category, a target action instruction responding to a voice command is generated, including:
[0013] Obtain at least one action attribute information corresponding to the target action category;
[0014] Generate the target action instruction based on the text information and action attribute information;
[0015] Among them, action attribute information is used to characterize the action parameters for performing the target action.
[0016] The data processing method provided in this invention acquires at least one action attribute information corresponding to a target action category, and generates a target action command based on text information and action attribute information. Based on the action category, it accurately acquires action attribute information corresponding to the target action command of the voice command, and generates the target action command based on the text information and action attribute information of the voice command. This significantly improves the accuracy of the target action command in response to the voice command.
[0017] In one optional implementation, generating a target action instruction based on text information and action attribute information includes: combining at least one action attribute information into an executable target action instruction according to a set combination conversion rule.
[0018] The data processing method provided in this invention, after determining the target action category based on voice commands, combines at least one action attribute information of the target action category into an executable target action command according to a set combination and conversion rule. Thus, after determining the target action category, it is only necessary to combine and convert the action attribute information corresponding to the target action category according to the set combination and conversion rule to obtain the executable target action command. This avoids the processing process based on syntax rule trees and normalized vocabularies, effectively avoiding the problems caused by the incomplete construction of syntax rule trees and normalized vocabularies in the natural language understanding process in related technologies. Furthermore, it avoids problems such as the inability to recognize voice commands, significantly improving the data processing efficiency and accuracy of voice commands.
[0019] In one optional implementation, according to a set combination conversion rule, at least one action attribute information is combined and converted into an executable target action instruction, including:
[0020] For the target action category, based on the set combination and transformation rules, extract the action attribute information of the target action category;
[0021] The extracted action attribute information is converted into target action instructions in a set format.
[0022] The data processing method provided in this embodiment of the invention extracts action attribute information and converts target action instructions for each target action category, effectively identifying and processing multiple target action instructions in voice commands.
[0023] In one alternative implementation, the format is set to JSON.
[0024] The data processing method provided in this embodiment of the invention organizes data and standardizes output in JSON format. By making full use of the strict hierarchical characteristics of JSON format, it can better handle the hierarchical relationship between different contents of voice commands and effectively improve the accuracy of determined target action commands.
[0025] In one alternative implementation, text information is represented by an input vector, and multiple preset instruction descriptions are represented by preset description vectors.
[0026] Based on the vector matching results between text information and multiple preset instruction descriptions in a preset action classification library, the target action category corresponding to the text information is determined, including:
[0027] Based on the vector similarity between the input vector and multiple preset description vectors, at least one action category that meets the set similarity conditions with the input vector is determined as the target action category corresponding to the text information.
[0028] In one embodiment of the present invention, the method further includes: before receiving a voice command to be responded to, extracting core words of multiple preset actions based on the device performing the preset action and / or the function performing the preset action; and configuring a preset action classification library based on the core words.
[0029] The data processing method provided in this invention determines the target action category based on the vector similarity between the input vector and multiple preset description vectors. It eliminates the need for pre-constructing syntax rule trees and normalized vocabularies, thus fundamentally avoiding a series of problems caused by incomplete syntax tree rule construction. This effectively improves the recognition rate and accuracy of voice commands, resulting in more accurate target action commands.
[0030] In a second aspect, the present invention provides a data processing apparatus, the apparatus comprising:
[0031] The receiving module is used to receive voice commands that are to be responded to.
[0032] The conversion module is used to convert voice commands into text information;
[0033] The matching module is used to determine the target action category corresponding to the text information based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library;
[0034] The generation module is used to generate target action instructions that respond to voice commands based on text information and target action categories.
[0035] Among them, the preset action classification library is used to represent the first mapping relationship between multiple preset action categories and preset instruction descriptions.
[0036] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the data processing method described in the first aspect or any corresponding embodiment thereof.
[0037] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the data processing method described in the first aspect or any corresponding embodiment thereof.
[0038] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the data processing method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0039] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating a data processing method according to an embodiment of the present invention;
[0041] Figure 2 This is a flowchart illustrating another data processing method according to an embodiment of the present invention;
[0042] Figure 3 This is a flowchart illustrating a specific application example of the data processing method according to an embodiment of the present invention;
[0043] Figure 4 This is a structural block diagram of a data processing apparatus according to an embodiment of the present invention;
[0044] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Currently, the application of smart devices to recognize user voice commands and automatically execute corresponding actions is becoming increasingly widespread. Examples include controlling air conditioner switches, temperature adjustments, light switches, and brightness adjustments via smart speakers in smart home systems, and controlling vehicle audio systems, air conditioning, doors, and windows via vehicle head units. For smart speaker applications in smart homes and head units in vehicles, the probability of updating the devices they can control and the actions they can perform is relatively high. To avoid retraining the model or supplementing predefined grammar rule trees and normalized vocabulary when the devices or actions they control change, and to avoid the problem of excessively long prompts when using large natural language models for classification due to a large number of actions, which can reduce the accuracy of the large language model when different actions are semantically similar, this invention provides a data processing method.
[0047] According to embodiments of the present invention, a data processing method embodiment is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, steps shown or described may be executed in a different order than that presented here. This method can be configured on a cloud server, where a user's vehicle-mounted voice acquisition device or smart speaker receives the user's voice commands and sends them to the server.
[0048] This embodiment provides a data processing method that can be used in the aforementioned servers, etc. Figure 1 This is a flowchart of a data processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0049] Step S101: Receive the voice command to be responded to.
[0050] In this embodiment of the invention, the user's voice commands can be received through a user terminal such as a smart speaker or a vehicle's voice acquisition device. For example: "Hey P, please turn on the air conditioner."
[0051] Step S102: Convert the voice command into text information.
[0052] In this embodiment of the invention, technologies such as natural language understanding and natural language recognition can be used to convert voice commands into text information.
[0053] Step S103: Based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library, determine the target action category corresponding to the text information. The preset action classification library is used to represent the first mapping relationship between multiple preset action categories and preset instruction descriptions.
[0054] In some optional implementations, multiple action categories in the preset action classification library can be determined based on the execution device that performs the preset action and the function or effect brought about by performing the preset action. For example, for vehicle instructions, the action category of air conditioning temperature adjustment can be uniformly classified as "air conditioning temperature adjustment" if the execution device is air conditioning and the effect of the action is a temperature change. In this way, when generating or determining the execution action, the rules for generating the target action instruction can be configured based on the common characteristics such as the device or parameters that need to be determined for this action category, so as to quickly and accurately generate the target action instruction.
[0055] In some optional implementations, text information is represented by an input vector, and multiple preset instruction descriptions are represented by preset description vectors. Step S103 may include:
[0056] Step S1031: Based on the vector similarity between the input vector and multiple preset description vectors, at least one action category that meets the set similarity conditions with the input vector is determined as the target action category corresponding to the text information.
[0057] Specifically, multiple preset action categories can be represented by the core words corresponding to the action categories. Table 1 below shows an example of the first mapping relationship used to represent multiple preset action categories and preset instruction descriptions.
[0058] For illustrative purposes, multiple preset instruction descriptions are shown here in text. In practical applications, in the first mapping relationship, these preset instruction descriptions can also be represented directly as vectors. Alternatively, while retaining the textual form of the preset instruction descriptions, a vector representation of the preset descriptions can be added to facilitate the updating and maintenance of the preset action classification library. Here, one preset action category can correspond to multiple preset instruction descriptions. The preset action library can include multiple action categories. When changes occur in devices such as air conditioners controlled by smart speakers or other smart devices, and the actions they perform, only the preset instruction descriptions and corresponding action categories in the preset action classification library need to be updated.
[0059] Table 1 Examples of the first mapping relationship
[0060]
[0061] Furthermore, when determining the target action category, the similarity between the input vector used to represent the text information and multiple preset description vectors can be determined first. Then, the action category corresponding to at least one preset description vector whose vector similarity with the input vector meets the set similarity conditions can be determined as the target action category corresponding to the text information.
[0062] Specifically, the similarity between the input vector and multiple preset description vectors can be sorted from highest to lowest, and a set number of action categories can be selected as target action categories. For example, 3. Alternatively, only the action category corresponding to the preset description vector with the highest similarity to the input vector can be selected as the target action category. Furthermore, action categories with a similarity greater than a set value to the input vector can also be selected as target action categories. The number of target action categories is not limited here; it can be one or more.
[0063] Step S104: Generate a target action instruction in response to a voice command based on the text information and the target action category.
[0064] In some optional implementations, the multiple action categories in the preset action classification library are primarily determined based on the execution device performing the preset action and the function or effect resulting from the execution of the preset action. For example, in vehicle commands, the action category of "air conditioning temperature adjustment" is categorized as "air conditioning temperature adjustment" if the execution device is the air conditioner and the effect of the action is a temperature change. Therefore, when generating or determining the execution action, rules for generating the target action command can be configured based on the common characteristics of the device or parameters that need to be determined for this action category, enabling the rapid and accurate generation of the target action command.
[0065] For example, for a voice command whose action category is "turning on / off the headlights," when generating the target action command, a large language model can be used to determine that the device executing the command is the headlights. Furthermore, information representing the headlight position, such as headlights, parking lights, and automatic headlights, can be extracted from the text information converted from the voice command to accurately determine the target action. Similarly, for other action categories, corresponding rules can be configured in the large language model used to generate the target action command to quickly and accurately generate it.
[0066] The data processing method provided in this invention receives a voice command to be responded to, converts the voice command into text information, performs vector matching between the text information and multiple preset command descriptions in a preset action classification library, determines the target action category corresponding to the text information based on the vector matching result, and then generates a target action command in response to the voice command based on the text information and the target action category. Therefore, determining the action category of the target action based on vector matching effectively avoids the process of constructing a syntax rule tree and a normalized vocabulary in related technologies, improves the data processing time for voice commands, and effectively avoids problems caused by incomplete construction of syntax rule trees, etc.
[0067] This embodiment provides a data processing method that can be used in the aforementioned servers, etc. Figure 2 This is a flowchart of a data processing method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0068] Step S201: Based on the device performing the preset action and / or the function performing the preset action, extract the core words of multiple preset actions.
[0069] In an optional embodiment of the present invention, to address the problem that voice commands may involve a large number of actions and that the functional effects of some actions are difficult to distinguish, the core words of multiple preset actions can be extracted based on the device performing the preset action and / or the function performing the preset action when configuring the preset action classification library. Then, based on the determined core words, the preset action classification library is further configured.
[0070] In an optional embodiment of the present invention, core words of multiple preset actions can be extracted based on at least one of the device performing the preset action and the function performing the preset action.
[0071] Specifically, the actions that intelligent devices such as smart speakers and vehicle control systems, which can communicate and be controlled, can perform are predetermined. Therefore, we can first categorize them based on the devices that execute multiple preset actions. For example: headlights, air conditioning, and doors. For preset actions that do not have specific executing devices, such as driving modes, virtual devices can be used as the executing devices for preset actions, and then the preset actions can be categorized according to the different functions of the devices.
[0072] For example, the device executing the preset action "turn on the air conditioner" is the air conditioner, and the function of turning on the air conditioner is a switch; the device executing the preset action "turn off the air conditioner" is also the air conditioner, and the function of turning off the air conditioner is also a switch. Therefore, these two preset actions can be classified into the same action category.
[0073] Action categories can be represented using core words, and can also be indicated by action category numbers. To ensure the recognizability of action categories, preset actions are categorized by the execution devices and functions of multiple preset actions, and core words are extracted from these devices and functions. Furthermore, to ensure the distinguishability of action categories and maximize the matching of voice commands to reasonable action categories, a command description is added for each action category. The preset command description can include the specific execution degree, effect, and alias of the preset action's function. For example, if the execution device of the preset action is an air conditioner, and the function of the preset action is temperature adjustment, the preset command description can include the specific temperature range or the specific effects of temperature adjustment such as increasing or decreasing the temperature. Table 2 below shows an example of the basis and results for core word extraction.
[0074] Step S202: Configure a preset action classification library based on core words.
[0075] In an optional embodiment of the present invention, a sentence vector model can be used to convert the core words of all action categories and the preset instruction descriptions into vectors for storage, which facilitates the calculation of the vector similarity between the input vector and the preset instruction description.
[0076] The data processing method provided in this invention determines the target action category based on the vector similarity between the input vector and multiple preset description vectors. It eliminates the need for pre-constructing syntax rule trees and normalized vocabularies, thus fundamentally avoiding a series of problems caused by incomplete syntax tree rule construction. This effectively improves the recognition rate and accuracy of voice commands, resulting in more accurate target action commands.
[0077] Table 2. Basis for core keyword extraction and examples of extraction results.
[0078]
[0079] Step S203: Receive the voice command to be responded to.
[0080] Please see details Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0081] Step S204: Convert the voice command into text information.
[0082] Please see details Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0083] Step S205: Based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library, determine the target action category corresponding to the text information. The preset action classification library is used to represent the first mapping relationship between multiple preset action categories and preset instruction descriptions.
[0084] Please see details Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0085] Step S206: Generate a target action instruction in response to the voice command based on the text information and the target action category.
[0086] In some optional implementations, the preset action classification library is also used to characterize a second mapping relationship between multiple preset action categories and preset action attribute information. Step S206 may include:
[0087] Step S2061: Obtain at least one action attribute information corresponding to the target action category, wherein the action attribute information is used to characterize the action parameters for performing the target action.
[0088] In an optional embodiment of the present invention, action attribute information is pre-configured based on each action category. For example, if the action category is a car window switch, then when executing the action, it is necessary to determine the device performing the action, the position of the car window, the opening ratio, etc. Here, these action parameters for executing the target action are referred to as action attribute information. For multiple preset action categories, action attribute information and the correspondence between action attribute information and action categories are pre-configured. Table 3 below is an exemplary description of the preset action category library, showing the relationship between multiple preset action categories and preset action attribute information. Furthermore, Table 3 also shows specific action execution instructions in the form of examples.
[0089] After determining the action category corresponding to the text information of the voice command, at least one action attribute information included in that action category can be determined based on a pre-configured preset action category library. It should be noted that the action attribute information in the preset action category library can be shown as parameter names or options, such as "Device": ["Window"], "Position": ["Driver's side", "Passenger's side", "Rear left", "Rear right"], "Opening ratio": ["Fully open", "Fully closed", "Value from 0 to 100"], etc.
[0090] Table 3 Examples of Preset Action Classification Library
[0091]
[0092]
[0093] To better illustrate Table 3 above, the following... Figure 4 The document explains the definitions of "core words of action category", "preset instruction description", "action attribute information" and "example" in the preset action category library, as well as the reasons for configuring the above content.
[0094] Table 4. Content Definition and Reasons for Content Configuration of the Preset Action Category Library
[0095]
[0096] Step S2062: Generate the target action instruction based on the text information and action attribute information.
[0097] Based on the action attribute information determined in step S2062, the specific value corresponding to each action attribute information is obtained from the text information. For example, the value for the attribute information of the opening ratio of the car window is 50%. Here, the specific value of "50%" can be determined based on pre-configured text information recognition rules. For example, if the text information is "open the right rear window halfway", the opening ratio is recognized as 50%; if the text information is "open the right rear window slightly", the opening ratio is recognized as 30%. These detailed rules can be selectively configured according to the actual situation.
[0098] In one alternative implementation, at least one action attribute information can be combined and converted into an executable target action instruction according to a set combination conversion rule.
[0099] Specifically, based on the set combination and conversion rules, action attribute information of the target action category can be extracted and converted into target action instructions in a set format.
[0100] For example, you can first extract the device executing the target action command from the text information, and then extract other attribute information. The combination and conversion rules here can include the extraction order of action attribute information, and rules for common parts of multiple action categories can be set. For example, for location information involved in both "window switch" and "air conditioning switch," a "common part" extraction rule can be configured.
[0101] In one optional implementation, the format is set to JSON. Furthermore, the target action commands in JSON format and the actions that the device can execute can be pre-configured. For example, the correspondence between JSON action commands and executable actions is shown in Table 5 below.
[0102] Table 5 shows the correspondence between JSON action instructions and executable actions.
[0103]
[0104] The data processing method provided in this embodiment of the invention organizes data and standardizes output in JSON format. By making full use of the strict hierarchical characteristics of JSON format, it can better handle the hierarchical relationship between different contents of voice commands and effectively improve the accuracy of determined target action commands.
[0105] The specific process of generating target action instructions described above can be trained and applied using a large language model. The core words of the above action categories, preset instruction descriptions, action attribute information, and examples can all serve as prompt words for the large language model.
[0106] As an example, the following is a concrete example of extracting a prompt word list for generating target action instructions based on a set combination conversion rule. This example is shown in Python format.
[0107] As a smart voice assistant, you need to complete the following steps to process a vehicle-related command.
[0108] 1. Select Function: Please select a function from ["Window Switch", "Air Conditioning Switch", "Headlight Switch"]. You cannot generate your own function, nor can the function be empty.
[0109] The functional differences are as follows:
[0110] "Window Switches": Window switches can control the raising and lowering of all windows in a vehicle, including the driver's side, passenger side, left rear, and right rear windows.
[0111] "Air Conditioning Switch": Turns the air conditioning on or off, and controls the air conditioning in the entire vehicle, including the driver's seat, passenger seat, left rear seat, and right rear seat.
[0112] "Headlight switch": The headlight switch controls the switching of headlights, headlights, side marker lights, and low beam headlights.
[0113] 2. Based on the selection made in the previous step, complete the following steps:
[0114] "'
[0115] -If you select "Window Switch", please make the following selection:
[0116] 1. Select "Device": The fixed value is "Car Window".
[0117] 2. Select "Location": Refer to the <Door Position> extraction rules in the [Public Section].
[0118] 3. Select "Open Ratio": Choose one from ['Full On', 'Full Off', 'Value between 0-100']. Do not allow it to be generated automatically, and do not allow it to be empty.
[0119] 4. The output is in JSON format, using selected capabilities such as "device" and "location" as keys, and the extracted content as values.
[0120] -If you select "Air Conditioner Switch", please make the following selections:
[0121] 1. Select "Device": The fixed value is "Air Conditioner".
[0122] 2. Select "Action": Refer to the "Action" extraction rules in the "Public Section".
[0123] 3. The output is in JSON format, using the selected capabilities such as "device" and "action" as keys, and the extracted content as values.
[0124] -If you select "Headlight Switch", please make the following selection:
[0125] 1. Select "Device": Choose one from ['Headlights', 'Low Beams', 'Parking Lights', 'Automatic Headlights']. You cannot generate your own headlights, nor can you leave the selection empty.
[0126] 2. Select "Action": Refer to the "Action" extraction rules in the "Public Section".
[0127] 3. The output is in JSON format, using the selected capabilities such as "device" and "action" as keys, and the extracted content as values.
[0128] "'
[0129] 3. [Public Section]:
[0130] - Rules for selecting the "door position":
[0131] "'
[0132] Choose one from the following list first: ["Driver's seat", "Passenger's seat", "Rear left", "Rear right"]
[0133] If none of the above options are suitable, select one from ["All seats", "Front seats", "Rear seats", "Left side", "Right side", "Any seat"].
[0134] You must choose from the two lists above; you cannot generate your own. You can leave it empty.
[0135] "'
[0136] - Extraction rules for <action>:
[0137] "'
[0138] Choose one from ["Open", "Close"]. You cannot allow it to be generated automatically, nor can it be empty.
[0139] "'
[0140] Example as follows:
[0141] "'
[0142] Command: "Open the driver's side window"
[0143] Output: "{'Device':'Window','Position':'Driver','Opening Ratio':'Fully Open'}"
[0144] Command: "Turn on the air conditioner"
[0145] Output: "{'Device':'Air Conditioner','Action':'Turn On'}"
[0146] Command: "Turn on low beam headlights"
[0147] Output: "{'Device':'Low Beam Headlight','Action':'On'}"
[0148] "'
[0149] Please refer to the steps and examples above to extract and output JSON for the following instructions. Please output a JSON format that can be parsed:
[0150] "'
[0151] Command: "Open the driver's side window"
[0152] Output: "'
[0153] The data processing method provided in this embodiment of the invention extracts action attribute information and converts target action instructions for each target action category, effectively identifying and processing multiple target action instructions in voice commands.
[0154] The data processing method provided in this invention, after determining the target action category based on voice commands, combines at least one action attribute information of the target action category into an executable target action command according to a set combination and conversion rule. Thus, after determining the target action category, it is only necessary to combine and convert the action attribute information corresponding to the target action category according to the set combination and conversion rule to obtain the executable target action command. This avoids the processing process based on syntax rule trees and normalized vocabularies, effectively avoiding the problems caused by the incomplete construction of syntax rule trees and normalized vocabularies in the natural language understanding process in related technologies. Furthermore, it avoids problems such as the inability to recognize voice commands, significantly improving the data processing efficiency and accuracy of voice commands.
[0155] This embodiment provides a specific application example of a data processing method, which can be used in servers, etc. Figure 3 This is a flowchart illustrating a specific application example of the data processing method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0156] Step S301: Pre-configure a preset action classification library.
[0157] Specifically, step S301 includes:
[0158] Step S3011: Classify multiple preset actions.
[0159] Step S3012: Determine the action category, core words of the action category, and preset instruction description of the action category for each preset action.
[0160] Step S3013: Determine the preset description vector of the preset instruction description.
[0161] Step S3014: Determine the action attribute information for each action category.
[0162] Step S3015: Pre-configure the large language model prompt words for the action categories.
[0163] Step S302, instruction pre-retrieval.
[0164] Specifically, step S302 includes:
[0165] Step S3021: Receive the voice command to be responded to and convert the voice command into text information.
[0166] Step S3022: Convert the text information into an input vector.
[0167] Step S3023: Determine the vector similarity between the text information and the preset description vectors of multiple preset instructions in the preset action classification library.
[0168] Step S303: Based on large model reasoning, obtain the target action command.
[0169] Specifically, step S303 may include:
[0170] Step S3031: Determine the target action category corresponding to the voice command based on vector similarity.
[0171] Step S3032: Based on the determined action category, determine the prompt words for the large language model.
[0172] Step S3033: Based on the prompt words and text information, generate an executable target action instruction.
[0173] For further implementation details of steps S301 to S303, please refer to Figure 1 and Figure 2 The relevant implementation details will not be elaborated here.
[0174] This invention employs an action category pre-retrieval method to effectively extract valid information from speech commands before generating executable target action instructions based on a large language model, thus significantly shortening the prompt word length of the large language model. Furthermore, it uses vectors to represent the semantics of speech commands and measures semantic similarity through vector similarity, avoiding the need to construct grammar rule trees and normalized vocabulary lists, effectively preventing errors caused by incomplete rule construction leading to unrecognized commands. Moreover, through the reasonable configuration of action attribute information, it avoids problems such as recognition errors of multiple actions.
[0175] This embodiment also provides a data processing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0176] This embodiment provides a data processing device, such as... Figure 4 As shown, it includes:
[0177] The receiving module 401 is used to receive voice commands to be responded to;
[0178] Conversion module 402 is used to convert voice commands into text information;
[0179] Matching module 403 is used to determine the target action category corresponding to the text information based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library;
[0180] The generation module 404 is used to generate target action instructions that respond to voice commands based on text information and target action category;
[0181] Among them, the preset action classification library is used to represent the first mapping relationship between multiple preset action categories and preset instruction descriptions.
[0182] In some optional implementations, the preset action classification library is also used to represent a second mapping relationship between multiple preset action categories and preset action attribute information; the generation module 404 includes:
[0183] The attribute acquisition unit is used to acquire at least one action attribute information corresponding to the target action category;
[0184] The generation unit is used to generate target action instructions based on text information and action attribute information;
[0185] Among them, action attribute information is used to characterize the action parameters for performing the target action.
[0186] In one optional implementation, the generation unit includes:
[0187] The combination conversion subunit is used to combine at least one action attribute information into an executable target action instruction according to the set combination conversion rules.
[0188] In one optional implementation, the combination conversion subunit combines at least one action attribute information into an executable target action instruction according to a set combination conversion rule, including:
[0189] For the target action category, based on the set combination and transformation rules, extract the action attribute information of the target action category;
[0190] The extracted action attribute information is converted into target action instructions in a set format.
[0191] In one alternative implementation, the format is set to JSON.
[0192] In one alternative implementation, text information is represented by an input vector, and multiple preset instruction descriptions are represented by preset description vectors.
[0193] The matching module includes:
[0194] The similarity matching unit is used to determine at least one action category that meets the set similarity conditions with the input vector as the target action category corresponding to the text information based on the vector similarity between the input vector and multiple preset description vectors.
[0195] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0196] In this embodiment, the data processing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0197] This invention also provides a computer device having the above-described features. Figure 4 The data processing device shown.
[0198] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.
[0199] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0200] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0201] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0202] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0203] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0204] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0205] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0206] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A data processing method, characterized in that, The method includes: Receive voice commands awaiting a response; Convert the voice command into text information; Based on the matching results between the text information and the vectors of multiple preset instruction descriptions in the preset action classification library, the target action category corresponding to the text information is determined; Obtain at least one action attribute information corresponding to the target action category; According to the set combination and conversion rules, at least one of the action attribute information is combined and converted into an executable target action instruction; The preset action classification library is used to represent a first mapping relationship between multiple preset action categories and preset instruction descriptions, and a second mapping relationship between multiple preset action categories and preset action attribute information. The action attribute information is used to represent the action parameters for performing the target action. The preset action classification library is pre-configured using the following operations: extracting core words of multiple preset actions based on the device performing the preset action and / or the function performing the preset action; and configuring the preset action classification library based on the core words.
2. The method according to claim 1, characterized in that, The step of combining at least one of the action attribute information into an executable target action instruction according to a set combination conversion rule includes: For the target action category, based on the set combination conversion rules, extract the action attribute information of the target action category; The extracted action attribute information is converted into a target action instruction in a set format.
3. The method according to claim 2, characterized in that, The specified format is JSON.
4. The method according to claim 1, characterized in that, The text information is represented by an input vector, and the multiple preset instruction descriptions are represented by preset description vectors. The determination of the target action category corresponding to the text information based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library includes: Based on the vector similarity between the input vector and multiple preset description vectors, at least one action category that meets the set similarity conditions with the input vector is determined as the target action category corresponding to the text information.
5. A data processing apparatus, characterized in that, The device includes: The receiving module is used to receive voice commands that are to be responded to. A conversion module is used to convert the voice commands into text information; The matching module is used to determine the target action category corresponding to the text information based on the vector matching results between the text information and multiple preset instruction descriptions in the preset action classification library; A generation module is used to generate a target action instruction in response to the voice instruction based on the text information and the target action category; The generation module includes: The attribute acquisition unit is used to acquire at least one action attribute information corresponding to the target action category; The generation unit is used to generate target action instructions based on text information and action attribute information; The generation unit includes: The combination conversion subunit is used to combine at least one action attribute information into an executable target action instruction according to the set combination conversion rules. The preset action classification library is used to represent a first mapping relationship between multiple preset action categories and preset instruction descriptions, and a second mapping relationship between multiple preset action categories and preset action attribute information. The action attribute information is used to represent the action parameters for performing the target action. The preset action classification library is pre-configured using the following operations: extracting core words of multiple preset actions based on the device performing the preset action and / or the function performing the preset action; and configuring the preset action classification library based on the core words.
6. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the data processing method of any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the data processing method according to any one of claims 1 to 4.
8. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the data processing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Equipment control method and device based on voice instruction and electronic equipment
CN117789725A