Generation method, server and storage medium
Patent Information
- Application Number
- CN202311868849.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-12-29
AI Technical Summary
In existing technologies, the generation of voice request training data in the field of vehicle voice control faces the problem of balancing diversity and accuracy. Especially when there are new functions or a small number of data samples, manually compiled training data is highly random and cannot guarantee the accuracy and diversity of the data.
By employing predefined sentence templates and graph construction methods, speech request training data is generated by determining the target sentence structure and replacement words. The predefined sentence templates ensure that the sentence expression conforms to human language habits, while the graph provides entity and relation links, expanding the diversity and accuracy of the training data.
The generated training data is rich in sentence structure and vocabulary, and comes with built-in labels, balancing diversity and accuracy, and can effectively expand the quantity and quality of training data.
Smart Images

Figure CN117807986B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of voice interaction technology, and more specifically, to a method for generating voice request training data, a server, and a computer-readable storage medium. Background Technology
[0002] In the field of vehicle voice control, a large amount of voice request training data is needed to ensure that the business correctly understands and processes natural language. Training data can come from user data during actual use. However, for new features or features with a small data sample size, it is often necessary to rely on manually written voice request training data. However, manually written training data is highly random and may have deficiencies in diversity and accuracy. Summary of the Invention
[0003] This application provides a method for generating training data for voice requests, a server, and a computer-readable storage medium.
[0004] The method for generating voice request training data according to embodiments of this application includes:
[0005] Determine the target sentence pattern based on a predefined sentence pattern template;
[0006] The replacement words are determined based on the predefined graph and the target sentence structure;
[0007] Target speech request training data is generated based on the target sentence structure and the replacement words.
[0008] Thus, in this embodiment, when generating voice request training data, the target sentence pattern is determined based on a predefined sentence pattern template, ensuring that the vocabulary organization during sentence expression conforms to human language organization habits and methods. The predefined atlas extends knowledge based on tag information such as entities, slots, and attributes, and links related knowledge. Based on the attributes of replaceable components defined in the target sentence, replacement words can be determined in the atlas, thereby generating target voice request training data. The generated target voice request training data has rich sentence patterns and vocabulary, and based on the atlas, the training data is self-labeled, balancing diversity and accuracy.
[0009] In some implementations, the predefined map is constructed through the following steps:
[0010] The predefined atlas is constructed based on the attributes of vehicle components, component relationships, component functions, component function relationships, and component function attributes.
[0011] Thus, the graph provides the relationships between vehicle components, between components and functions, and between functions in the vehicle domain, providing a basis for word replacement generation and providing reasoning capabilities. Training data can be generated in batches using the graph and sentence patterns.
[0012] In some implementations, determining the target sentence pattern based on a predefined sentence pattern template includes:
[0013] The target sentence pattern is randomly determined based on the predefined sentence pattern template.
[0014] In this way, when there is a lack of targets, target sentence patterns can be randomly determined from sentence pattern templates to generate training data, thereby expanding the amount of training data, enriching the diversity of training data, and ensuring that the training data conforms to the habits and methods of human language organization.
[0015] In some implementations, determining the target sentence pattern based on a predefined sentence pattern template includes:
[0016] The sentence structure of the target voice request is determined based on the predefined sentence template;
[0017] The sentence structure of the target voice request is determined as the target sentence structure.
[0018] Thus, when the training data sample size is small, the applicable sentence pattern can be determined first, and that sentence pattern can be used as the target sentence pattern. Training data can then be generated based on the existing target speech requests, and more training data can be generated by using existing sentence patterns that conform to expression habits as the target sentence patterns.
[0019] In some implementations, determining the replacement word based on the predefined graph and the target sentence structure includes:
[0020] Determine the attribute information of the replacement components in the target sentence structure;
[0021] Based on the attribute information, select target objects with the same attribute information from the predefined graph;
[0022] The replacement word is determined based on the target object.
[0023] Thus, relying on the attribute information of entities in the sentence, the rationality of the combination of various components can be ensured. Based on the attribute information of the replacement components in the target sentence, the target object can be determined in the graph, thereby ensuring that the generated training data is basically reasonable and accurate.
[0024] In some implementations, generating target speech request training data based on the target sentence structure and the replacement words includes:
[0025] Inherit the retained components in the target sentence structure;
[0026] Fill the replacement word into the replacement component;
[0027] First speech request training data is generated based on the retained components and the replaced components after filling.
[0028] Thus, based on the components of each entity in the target sentence, some are inherited, and the replacement parts are composed using the previously determined replacement components, thereby initially generating the first speech request training data.
[0029] In some implementations, generating target speech request training data based on the target sentence structure and the replacement words further includes:
[0030] The first speech request training data is generalized according to a preset generalization vocabulary to generate the target speech request training data.
[0031] Thus, based on the generated first speech request training data, the first speech request training data can be generalized according to a preset generalization vocabulary. This allows for synonym substitution based on hierarchy, attribute relationships, etc., thereby expanding to obtain more training data.
[0032] In some embodiments, the step of generalizing the first voice request training data according to a preset generalization vocabulary to generate target voice request training data includes:
[0033] The entity words and action words in the first voice request training data are generalized to obtain the second voice request training data.
[0034] The second voice request training data is filtered according to predefined action attribute rules to generate the target voice request training data.
[0035] Thus, the generalization process mainly targets entity words and action words in the voice request. The training data of the second voice request obtained after generalization is filtered according to the predetermined action attribute rules to ensure the reasonableness and accuracy of the generalized sentence.
[0036] The server in this application includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the method described above.
[0037] The computer-readable storage medium of this application stores a computer program that, when executed by one or more processors, implements the above-described method.
[0038] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0039] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:
[0040] Figure 1 This is a flowchart illustrating the generation method of an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of a scenario illustrating the generation method of an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of a scenario illustrating the generation method of an embodiment of this application;
[0043] Figure 4 This is a schematic diagram of a scenario illustrating the generation method of an embodiment of this application;
[0044] Figure 5 This is a flowchart illustrating the generation method of an embodiment of this application;
[0045] Figure 6 This is a flowchart illustrating the generation method of an embodiment of this application;
[0046] Figure 7 This is a flowchart illustrating the generation method of an embodiment of this application;
[0047] Figure 8 This is a schematic diagram of a scenario illustrating the generation method of an embodiment of this application;
[0048] Figure 9 This is a flowchart illustrating the generation method of an embodiment of this application;
[0049] Figure 10 This is a flowchart illustrating the generation method of an embodiment of this application;
[0050] Figure 11 This is a flowchart illustrating the generation method of an embodiment of this application;
[0051] Figure 12 This is a schematic diagram of a scenario illustrating the generation method of an embodiment of this application. Detailed Implementation
[0052] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.
[0053] In the field of vehicle voice control, to ensure that the business correctly understands and processes natural language, a large amount of voice request (voice request text) training data is needed to train relevant models. Training data typically comes from voice requests issued by users during real-world voice interactions with the vehicle. However, for functions that are rarely used in interactions, or for new functions that are about to be launched, due to the small sample size, it is often necessary to rely on manually generated voice request training data. Typically, manually generated training data includes methods such as adding or deleting components of existing voice requests, replacing synonyms, and reversing components. Generally speaking, manually generated training data has a high degree of randomness, generating training data without rules based on the corresponding processing methods. However, while this increases the quantity and diversity of training data, it cannot guarantee the accuracy of the newly generated data, requiring additional manual accuracy annotation. If accuracy requirements are considered, many restrictions are added during the data generation process, resulting in a loss of diversity; it is usually difficult to achieve both. How to generate voice request training data that balances diversity and accuracy is an urgent problem to be solved.
[0054] Based on the issues mentioned above, please refer to Figure 1 This application provides a method for generating training data for voice requests. The generation method includes:
[0055] 01: Determine the target sentence pattern based on a predefined sentence pattern template;
[0056] 02: Determine replacement words based on predefined graphs and target sentence structures;
[0057] 03: Generate target speech request training data based on the target sentence structure and replacement words.
[0058] This application also provides a server, including a memory and a processor. The generation method of this application can be implemented by the server of this application. Specifically, the memory stores a computer program, the processor is used to determine a target sentence pattern according to a predefined sentence pattern template, to determine replacement words according to a predefined graph and the target sentence pattern, and to generate target speech request training data according to the target sentence pattern and the replacement words.
[0059] This application also provides a generation apparatus. The generation method of this application can be implemented by the generation apparatus of this application. Specifically, the generation apparatus includes a determining module and a generation module. The determining module is used to determine a target sentence pattern based on a predefined sentence pattern template, and to determine replacement words based on a predefined graph and the target sentence pattern. The generation module is used to generate target speech request training data based on the target sentence pattern and the replacement words.
[0060] Please see Figure 2Specifically, the diversity of training data can be understood to mainly fall into two categories: sentence-level diversity and lexical diversity. At the sentence level, different users have different habits and methods of organizing words when expressing an intention. For example, for the sentence "turn on the air conditioner," some users might use the phrase "air conditioner turned on." At the lexical level, different users have different ways of expressing the same entity. For example, for "windshield wipers," some users might use the phrase "windshield wipers."
[0061] In this application's implementation, the training data generation problem is broken down into several modules, including a sentence structure module and a graph module.
[0062] First is the sentence structure module. Predefined sentence structure templates are designed to address the aforementioned issue of sentence-level diversity. By collecting users' daily expressions and regularly annotated datasets, the collected data is organized and summarized to obtain language organization patterns, which, once solidified, become sentence structure templates.
[0063] For example, in the voice request "Have you eaten?", it can be understood that "eat" is strongly related to the intent, while other words such as "you," "eat," and "have" are weakly related or irrelevant to the intent. In this implementation, for the collected voice request data, the parts that are weakly or irrelevant to the intent are retained, while the parts that are strongly related to the intent are discarded, thus forming a predefined sentence template. This preserves the reusability of the sentence pattern, as only the expressions that are strongly related to the intent need to be replaced, such as "Have you exercised?", and also ensures fluency to a certain extent because it is a user's habitual expression.
[0064] Understandably, predefined sentence templates do not contain semantic information, which is why they can be translated between different semantics and different devices.
[0065] Taking a predefined sentence template as an example, for a collected voice request, natural language processing can be used to identify named entities. The values of these named entities are then replaced with tags (keys) through manual description. Actions are further categorized into predetermined classes, such as OpenAction, CloseAction, SetUpAction, SetDownAction, and SetAction. This generates candidate sentence templates, which are then manually verified to determine their validity. If valid, these templates are added to the database as sentence templates.
[0066] For example, a voice request collected is "Please turn on the air conditioner," where the entity is "air conditioner" and the corresponding tag is... <device>Furthermore, the action "open" in this voice request is categorized as<AT_1_OpenAction> Therefore, the sentence structure "Please help me" can be generated.<AT_1_OpenAction> <device>After manual verification, the sentence structure was confirmed as valid and can be added to the database as a sentence template.
[0067] Secondly, there is the graph module. The graph is used to solve the problems of knowledge expansion and knowledge linking. That is, after defining the sentence template, the graph, as an objectively existing expression of relations, provides basic relation descriptions and entity descriptions for the outside world, enabling the application to support more rule formulation and reasoning.
[0068] For example, describing the relationship between vehicle parts: seat → has_device → [seat] leg rest.
[0069] For example, describing the relationship between components and functions: Seat → has_function → [Seat] massage.
[0070] The graph is constructed according to certain rules, such as a top-down approach based on intent, which will be explained in detail below. After the graph is constructed, sentence templates can be input into it, and the graph will output a set of graph data structures that satisfy the sentence templates. Essentially, it involves finding and determining replacement words in the graph for replaceable parts of the sentence templates based on the relationships within the graph, and then combining this with the non-replaceable parts of the sentence templates to generate training data. In this process, the sentence templates serve as the basis for selecting paths in the graph.
[0071] In one example, the historical voice request is: "Please turn down the passenger seat temperature." The current task is to generate target training data based on this voice request. According to a predefined sentence template, the corresponding target sentence is determined to be: "Please help me..." <position> <function><set_type> <value>.
[0072] The target sentence structure is input into a predefined graph, traversed, and all results matching the above path are found in the graph, along with their data structure representation:
[0073]
[0074] The corresponding target voice request training data are "Please turn the passenger seat temperature up a little," "Please turn the driver's seat temperature down a little," and "Please turn the driver's seat fan speed down one level," etc. Thus, from the historical data of one voice request, after processing with the sentence template and graph according to the implementation method of this application, at least three new target voice request training data can be generated. Of course, the output is only illustrative; the actual output results are far more than three. This effectively enriches the diversity of the training data. Furthermore, it is understandable that the graph is accurately constructed based on the objective relationships between entities, ensuring an objective description of the voice service, and thus ensuring the accuracy of the generated training data. Accuracy refers to the consistency between the entity labels determined based on the generated voice request and those manually labeled.
[0075] In summary, the generation method, generation apparatus, and server of this application, when generating voice request training data, determine the target sentence structure based on a predefined sentence template, ensuring that the vocabulary organization during sentence expression conforms to human language organization habits and methods. The predefined graph expands knowledge based on tag information such as entities, slots, and attributes, and links related knowledge. Based on the attributes of replaceable components defined in the target sentence, replacement words can be determined in the graph, thereby generating target voice request training data. The generated target voice request training data has rich sentence structures and vocabulary, and based on the graph, the training data is self-labeled, balancing diversity and accuracy.
[0076] In some implementations, the predefined map is constructed through the following steps:
[0077] A predefined atlas is constructed based on vehicle components, component relationships, component functions, component function relationships, and the operable attributes of component functions.
[0078] In some implementations, the processor is used to construct a predefined map based on vehicle components, component affiliations, component functions, component function affiliations, and operability attributes of component functions.
[0079] In some embodiments, the generating apparatus further includes a building module for constructing a predefined map based on vehicle parts, part attachments, part functions, part function attachments, and operable attributes of part functions.
[0080] Please see Figure 3 Specifically, the atlas is defined and constructed based on the relationships between vehicle components, between components, component functions, and the attributes of component functions. The pre-definition work for the atlas may include the following parts:
[0081] I. Entity Ontology: This section identifies and categorizes entities within the vehicle, including components and functionalities. Categories might include `devive`, `function`, `target_function`, `position`, and `value`. The functional scope of each category is defined. For example, `function` represents configurable functions, such as setting the fan speed to a specific level or the temperature to a specific degree, but cannot be turned on or off. `target_function` represents functions that can be directly turned on / off, such as standard mode or heating. Functions that can be both configurable and turn on / off can exist within both scopes; in this case, the label is `target_function` when on / off and `function` when configurable.
[0082] In addition, it includes tasks such as identifying entities, determining the domain categories involved in the entities, and the corresponding APIs.
[0083] Further steps are needed to clarify the entity's basic actions, which include OpenAction, CloseAction, SetUpAction, SetDownAction, and SetAction.
[0084] II. Physical values, specifically, the adjustable value functions are sorted out, such as air volume level, heating level, and temperature value.
[0085] III. Entity attributes, which include the entity's basic type and special attributes.
[0086] The entity basic type is used to classify entities, thereby enabling the classification and labeling of entity words appearing in the vehicle's data graph. Entity basic types include equipment entities and functional entities. Equipment entities are objectively existing parts in the vehicle, such as air conditioning, central control screen, and steering wheel. Functional entities are the functions possessed by the equipment, such as steering wheel heating, seat vibration, and seat massage.
[0087] Special attributes are extensions of the basic categories, used to describe the physical properties, physical capabilities, physical values, etc. of an entity. Examples include: Brightness (brightness attribute), Adjustable (an entity with adjustable values), and Folding (a foldable entity).
[0088] It should be understood that an entity must have a basic category, while special attributes can be extended according to business needs and provided by the action system during generation. Both are descriptions of the entity.
[0089] It should be noted that in the graph, the generation of links mainly relies on the action system. The design of the action system mainly includes action design and attribute design. Among them, action design determines the hierarchical relationship of actions by sorting out the subordinate relationships of functions, and thus determines the type of action. For example, higher-level actions include OpenAction, CloseAction, SetUpAction, SetDownAction, and SetAction, etc. Lower-level actions are those contained under higher-level actions. For example, OpenAction includes lower-level actions such as AT_75_LightAction, etc.
[0090] Attribute design mainly involves clarifying the relationship between verbs and entity attributes, and determining the hypernyms and hypernyms that entities with related attributes can be paired with. For example, entities that are applicable to the "Brightness" attribute include makeup mirrors, reading lights, screens, and instrument screens. Therefore, the action AT_75_LightAction (such as turning on the light) is only applicable to entities with the "Brightness" attribute, such as turning on the screen.
[0091] IV. Entity Relationships: Specifically, this involves identifying the relationships between entities such as parts and functional components within a vehicle.
[0092] For example, vehicle parts, including windows, seats, etc.
[0093] Component attachment relationships, for example: seat → has_device → [seat] leg rest.
[0094] Component functions, for example: seat → has_function → [seat] massage.
[0095] The functional relationships of components, for example: Driving mode → has_option → Standard mode | Get out of trouble mode | Comfort mode | Eco mode | Off-road mode | Sport mode.
[0096] Operable attributes of component functions, for example: air conditioner → has_action → OpenAction.
[0097] Furthermore, based on the above summary, establish basic data tables and relationship tables, such as entity tables, value tables, attribute tables, etc., and construct a graph based on them. Figure 4 Taking air conditioners as an example, the basic structure of the diagram is shown; this part is for illustrative purposes only.
[0098] Thus, the graph provides the relationships between vehicle components, between components and functions, and between functions in the vehicle domain, providing a basis for word replacement generation and providing reasoning capabilities. Training data can be generated in batches using the graph and sentence patterns.
[0099] Please see Figure 5 In some implementations, step 01 includes:
[0100] 011: Randomly determine the target sentence pattern based on the predefined sentence pattern template.
[0101] In some implementations, the processor is used to randomly determine the target sentence pattern based on the predefined sentence pattern template.
[0102] In some implementations, the determining module is used to randomly determine the target sentence pattern based on the predefined sentence pattern template.
[0103] Specifically, in this embodiment, training data can be generated without a specific target, that is, training data does not need to be generated for a particular sentence structure.
[0104] In this example, one or more predefined sentence templates can be randomly selected to generate training data for the target speech request.
[0105] For example, the randomly determined target sentence is "Please help me".<AT_1_OpenAction> <device>"Please help me"<AT_1_OpenAction> <device> <function>"etc." Furthermore, the target sentence pattern can be input into a predefined graph, and target training data can be generated through the graph. For example, the target sentence pattern "Please help me..."<AT_1_OpenAction> <device>bar", it is possible to generate target training data such as "Please help me turn on the air conditioner" and "Please help me open the car window". From the target sentence pattern "Please help me <AT_1_OpenAction> <device> <function>This can generate target training data such as "Please turn on the seat heating for me".
[0106] In this way, when there is a lack of targets, target sentence patterns can be randomly determined from sentence pattern templates to generate training data, thereby expanding the amount of training data, enriching the diversity of training data, and ensuring that the training data conforms to the habits and methods of human language organization.
[0107] Please see Figure 6 In some implementations, step 01 includes:
[0108] 012: Determine the sentence structure of the target speech request based on a predefined sentence template;
[0109] 013: Determine the sentence structure of the target speech request as the target sentence structure.
[0110] In some implementations, the processor is used to determine the sentence structure of the target voice request based on a predefined sentence structure template, and to determine the sentence structure of the target voice request as the target sentence structure.
[0111] In some implementations, the determining module is used to determine the sentence structure of the target voice request based on a predefined sentence structure template, and to determine the sentence structure of the target voice request as the target sentence structure.
[0112] Specifically, in this embodiment, targeted training data generation can be performed, that is, training data can be generated for a specific sentence pattern. For example, if the training data sample size under certain sentence pattern templates is small, it can be identified as the target sentence pattern, and then target training data can be generated. In one example, preliminary statistics show that "Can you..." <device><AT_1_OpenAction>"If the training data sample size under this sentence template is small, then this sentence template can be used as the target sentence template, and target training data can be generated based on the relevant links in the graph."
[0113] For example, for some newly launched features, there are currently no historical voice request records. In this case, the applicable sentence template can be determined based on the relationship links between related features in the graph, thereby determining the target sentence pattern. Then, target training data with entity representations related to the new feature can be generated from the target sentence pattern. In one example,
[0114] The above link can match the sentence template "Please help me".<AT_1_OpenAction><target_function> This is then used as the target sentence structure, which can then be used to generate target training data such as "Please help me turn on Dynamic Rhythm". By determining the applicable sentence structure based on the relevant attributes and labels of the function itself, and then generating training data, it is possible to ensure that the generated training data conforms to the user's general expression and can be accurately recognized by the in-vehicle system.
[0115] Furthermore, in the process of predefining sentence templates, defining only basic sentence patterns often fails to meet all functional expression requirements, resulting in training data with some deficiencies in comprehensiveness. Therefore, in addition to basic sentence patterns, auxiliary sentence patterns are introduced to satisfy these needs. For example, regarding the aforementioned seat rhythm, besides the expression "turn on seat rhythm," the expression "adjust to dynamic rhythm" might also be commonly used in daily life. However, for the dynamic rhythm function, `target_function` can only be paired with `open` type operations, not `set` type operations. Therefore...<AT_1_OpenAction><target_function> It can only generate "dynamic rhythm". To address this, an auxiliary sentence structure is introduced.<AT_7_SwitchToAction><target_function> Based on the existing basic sentence structure, a new sentence structure is formed by combining auxiliary sentence structures. In this new sentence structure, the voice request is generated based on the auxiliary sentence structure, and the basic sentence structure is still used for knowledge link matching in the graph and for providing the semantic basis of the sentence structure. That is, in the example above, based on the sentence template "Please help me..."<AT_1_OpenAction><target_function> This can generate the phrase "Please help me turn on Dynamic Rhythm". Based on the newly combined sentence template "Please help me..."<AT_1_OpenAction><target_function> |<AT_7_SwitchToAction><target_function> "It can generate 'Please help me adjust it to dynamic rhythm'."
[0116] Thus, when the training data sample size is small, the applicable sentence pattern can be determined first, and that sentence pattern can be used as the target sentence pattern. Training data can then be generated based on the existing target speech requests, and more training data can be generated by using existing sentence patterns that conform to expression habits as the target sentence patterns.
[0117] Please see Figure 7 In some implementations, step 02 includes:
[0118] 021: Determine the attribute information of the replacement elements in the target sentence structure;
[0119] 022: Based on attribute information, select target objects with the same attribute information from the predefined graph;
[0120] 023: Determine the replacement words based on the target object.
[0121] In some implementations, the processor is used to determine the attribute information of the replacement components in the target sentence, and to select target objects with the same attribute information from a predefined graph based on the attribute information, and to determine replacement words based on the target objects.
[0122] In some implementations, the determining module is used to determine the attribute information of the replacement components in the target sentence, and to select target objects with the same attribute information from a predefined graph based on the attribute information, and to determine replacement words based on the target objects.
[0123] Please see Figure 8 Specifically, as mentioned above, the sentence template includes replaceable components and non-replaceable retained components. In this embodiment, target speech request training data is generated by replacing the replaceable components in the target sentence. During the replacement process, the entity attribute information of the replaceable components in the target sentence is determined, and then entities with the same attribute information are searched in the graph. These entities are identified as target objects, and the target objects are used as replacement words to replace the replaceable components. The attribute information includes the aforementioned basic entity category and special attributes.
[0124] For example, based on the target speech request "Please help me turn on the air conditioner", the target sentence structure is determined to be "Please help me".<AT_1_OpenAction> <device>In the context of the target speech request, the replacement element is the entity "air conditioner," which has the attribute "device" and the actionable attribute "OpenAction." Therefore, the graph searches for objects with the attribute "device" and a link "device→has_action→OpenAction," such as "car window" and "trunk." Furthermore, "car window" and "trunk" are identified as replacement words.
[0125] For example, in the phrase "Please help me turn on the screen", the entity "screen" not only has the attribute "device" but also a special attribute "Brightness". In this example, we need to find the device with the "Brightness" attribute in the graph, and then find the link in the graph based on "lighting" (LightAction, which is the subordinate action of OpenAction) to determine the target object as the replacement word. This will not be elaborated further here.
[0126] Thus, relying on the attribute information of entities in the sentence, the rationality of the combination of various components can be ensured. Based on the attribute information of the replacement components in the target sentence, the target object can be determined in the graph, thereby ensuring that the generated training data is basically reasonable and accurate.
[0127] Please see Figure 9 In some implementations, step 03 includes:
[0128] 031: Inherit the retained components in the target sentence structure;
[0129] 032: Fill in the replacement words into the replacement components;
[0130] 033: Generate the first speech request training data based on the retained components and the replaced components after filling.
[0131] In some implementations, the processor is used to inherit retained components from the target sentence structure, fill in replacement words into the replacement components, and generate first speech request training data based on the retained components and the filled replacement components.
[0132] In some implementations, the generation module is used to inherit the retained components in the target sentence, to fill the replacement components with replacement words, and to generate first speech request training data based on the retained components and the filled replacement components.
[0133] Specifically, after determining the replacement words, training data can be generated based on the replacement words and the target sentence structure. In other words, the target sentence structure is input into the graph, and target objects matching the attributes of replaceable components in the sentence structure are searched within the graph. These target objects are then used as replacement words and inserted into the replaceable components of the sentence structure. The retained components in the target sentence structure are inherited. In this way, preliminary training data for the speech request, i.e., the first request training data, can be generated.
[0134] In one example, the target phrase is "Please help me".<AT_1_OpenAction> <device>In the text, "Please help me" is a retained component.<AT_1_OpenAction> as well as <device>All are replacement components. During the generation of target speech request training data, "Please help me" is inherited and determined in the graph according to...<AT_1_OpenAction> as well as <device>The process involves identifying replacement words, filling them into sentences, and generating target speech request training data, such as "Please turn on the air conditioner" or "Please open the car window."
[0135] Thus, based on the components of each entity in the target sentence, some are inherited, and the replacement parts are composed using the previously determined replacement components, thereby initially generating the first speech request training data.
[0136] Please see Figure 10 In some implementations, step 03 includes:
[0137] 034: Perform generalization processing on the first speech request training data according to the preset generalization vocabulary to generate the target speech request training data.
[0138] In some implementations, the processor is used to generalize the first speech request training data according to a preset generalization vocabulary to generate target speech request training data.
[0139] In some implementations, the generation module is used to generalize the first speech request training data according to a preset generalization vocabulary to generate target speech request training data.
[0140] Specifically, and understandably, in addition to providing descriptions of relationships and entities, the graph also provides standard terms for entities, laying the foundation for generalization. Generalization of these standard terms can be achieved by further enriching the diversity of training data, building upon clear semantics and labels, to meet the needs of different users; that is, lexical diversity is addressed through generalization.
[0141] After generating the first speech request training data based on the target sentence structure and the graph, the first speech request training data is further generalized to generate the final target speech request training data. It should be understood that generalization is not merely about collecting a list of expression forms; the specific attributes of the aforementioned entities are also closely related to generalization. For example, as mentioned above, "light up" is a generalization of "open," but the entity that can be paired with "light up" must have the attribute "Brightness." Therefore, the generalization process also needs to be based on the attributes of the entities.
[0142] For example, in the phrase "turn on the air conditioner," "turn on" can be generalized to "open," "turn on briefly," "start," etc. Thus, the training data for the first voice request can be further expanded, and the amount of training data can be further increased.
[0143] Thus, based on the generated first speech request training data, the first speech request training data can be generalized according to a preset generalization vocabulary. This allows for synonym substitution based on hierarchy, attribute relationships, etc., thereby expanding to obtain more training data.
[0144] Please refer to Figure 11 , in some embodiments, step 034 includes:
[0145] 0341: performing generalization processing on entity words and action words in first voice request training data to obtain second voice request training data;
[0146] 0342: screening the second voice request training data according to a predefined action attribute rule, to generate target voice request training data.
[0147] In some embodiments, the processor is configured to perform generalization processing on entity words and action words in the first voice request training data to obtain the second voice request training data, and is configured to screen the second voice request training data according to the predefined action attribute rule to generate the target voice request training data.
[0148] In some embodiments, the generation module is configured to perform generalization processing on entity words and action words in the first voice request training data to obtain the second voice request training data, and is configured to screen the second voice request training data according to the predefined action attribute rule to generate the target voice request training data.
[0149] Please refer to Figure 12 , specifically, the generalization processing in the embodiments of the present application is performed based on a specific target object. It can be understood that, in general, for a voice request, the part that clearly expresses semantics lies in the entity and verb parts, while prefixes and suffixes such as "hello", "please", and polite expressions such as "please help me", "excuse me", etc., do not contain semantic information.
[0150] Therefore, in the embodiments of the present application, generalization of entities and verbs, that is, entity words and action words in the first voice request training data, is supported.
[0151] Entity generalization includes: vehicle component (device), that is, operable equipment on the vehicle;
[0152] function (function / target_function), that is, functions included in the component, including a parent function and optional child functions under the parent function;
[0153] position (position), that is, positions on the vehicle such as main driver seat, front passenger seat, front and rear rows, etc.;
[0154] controllable value (value), that is, controllable data of the function corresponding to the vehicle component, including specific values and referred magnitudes, for example, "60%" can be generalized to "a little over half", "somewhat over half", "just a bit over half", etc.
[0155] It should be noted that the generalized terms of entities are synonyms with the standard terms in the graph, referring to other representations of the same entity.
[0156] Verb generalization includes generalization of basic actions and generalization of basic actions based on the attributes of entities.
[0157] The basic actions are OpenAction, CloseAction, SetUpAction, SetDownAction, and SetAction. Generalizations of these basic actions include OpenAction: open, turn on, turn briefly, start, etc.
[0158] The basic action is generalized based on the entity's attributes. For example, for an entity with the attribute "Brightness", OpenAction can be generalized to "light up". Similarly, for an entity with the attribute "Folding", OpenAction can be generalized to "expand", "spread", "open", etc. A standard word-generalized word thesaurus can be constructed from the above generalization results. This thesaurus is then queried during the generalization process.
[0159] In the generalization process, the generalization results of entity words and action words in the first speech request training data can be enumerated using a vocabulary to obtain the second speech request training data. Then, using predetermined action attribute rules, the second speech request training data is filtered, and those that do not conform to the rules are removed. For example, "turn on the air conditioner" does not conform to the rules and is removed, while "turn on the reading light" conforms to the rules and can be retained, thus obtaining the final target speech request training data.
[0160] Thus, the generalization process mainly targets entity words and action words in the voice request. The training data of the second voice request obtained after generalization is filtered according to the predetermined action attribute rules to ensure the reasonableness and accuracy of the generalized sentence.
[0161] This application also provides a computer-readable storage medium containing a computer program. When the computer program is executed by one or more processors, it causes the one or more processors to perform the generation method of this application.
[0162] It is understood that a computer program includes computer program code. Computer program code can be in the form of source code, object code, executable files, or some intermediate form. Computer-readable storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, external hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.
[0163] In the description of this specification, the terms "specifically," "furthermore," "particularly," "understandably," etc., refer to specific features, structures, materials, or characteristics described in connection with embodiments or examples that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0164] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0165] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.< / device> < / device> < / device> < / device> < / device> < / function> < / device> < / device> < / function> < / device> < / device> < / value> < / function> < / position> < / device> < / device>
Claims
1. A method for generating training data for voice requests, characterized in that, The method includes: Determine the target sentence pattern based on a predefined sentence pattern template; The replacement words are determined based on the predefined graph and the target sentence structure, including: Determine the attribute information of the replacement components in the target sentence structure; Based on the attribute information, select target objects with the same attribute information from the predefined graph; The replacement word is determined based on the target object; Generate target speech request training data based on the target sentence structure and the replacement words, including: Inherit the retained components in the target sentence structure; Fill the replacement word into the replacement component; First voice request training data is generated based on the retained components and the replaced components after filling. The first speech request training data is generalized according to a preset generalization vocabulary to generate the target speech request training data.
2. The generation method according to claim 1, characterized in that, The predefined map is constructed through the following steps: The predefined atlas is constructed based on the attributes of vehicle components, component relationships, component functions, component function relationships, and component function attributes.
3. The generation method according to claim 1, characterized in that, The step of determining the target sentence pattern based on a predefined sentence pattern template includes: The target sentence pattern is randomly determined based on the predefined sentence pattern template.
4. The generation method according to claim 1, characterized in that, The step of determining the target sentence pattern based on a predefined sentence pattern template includes: The sentence structure of the target voice request is determined based on the predefined sentence template; The sentence structure of the target voice request is determined as the target sentence structure.
5. The generation method according to claim 1, characterized in that, The step of generalizing the first speech request training data according to a preset generalization vocabulary to generate target speech request training data includes: The entity words and action words in the first voice request training data are generalized to obtain the second voice request training data. The second voice request training data is filtered according to predefined action attribute rules to generate the target voice request training data.
6. A server, characterized in that, The server includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the method according to any one of claims 1-5.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by one or more processors, implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Training method and system of semantic comprehension system
CN111680129A
System and method for natural language generation
WO2018131048A1
