Data processing method, device and electronic equipment

CN122947837APending Publication Date: 2026-10-20AVATR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611131333.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0002]人工用于生成模型的训练样本,但是需要长时间的数据采集,以及人工对采集后的数据进行处理才能得到丰富的训练样本,导致人工投入大

Benefits of technology

[0010]该方案中,可预先获取第一样本数据,为提高样本的泛化能力,可通过语法规则自动生成第二样本数据,第二样本数据和第一样本数据不同,从而扩充了样本的数量并提高样本的丰富度,从而减少了技术人员采集并处理数据的操作,减少了人工投入;以及通过电子设备扩充样本的数量并提高样本泛化能力的范式,减少了人工操作导致的错误,也提高了样本的生成速率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This application provides a data processing method, apparatus, and electronic device. The method includes at least: acquiring grammar rules and acquiring first sample data corresponding to the grammar rules; wherein the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate the entity recognition result corresponding to the word segmentation data, and the first sample data is used to indicate the sentence; and generating second sample data corresponding to the grammar rules based on the grammar rules and the first sample data corresponding to the grammar rules. This reduces manual input.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to data processing methods, apparatus and electronic devices. Background Technology

[0002] Training samples for the model are generated manually, but this requires a long period of data collection and manual processing of the collected data to obtain a rich set of training samples, resulting in a large human investment. Summary of the Invention

[0003] To address the aforementioned issues, this application provides at least one data processing method, apparatus, and electronic device capable of automatically generating new sample data, thereby reducing manual input.

[0004] The technical solution of this application is implemented as follows: In a first aspect, this application provides a data processing method, which includes: acquiring a grammar rule, and acquiring first sample data corresponding to the grammar rule; wherein the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate the entity recognition result corresponding to the word segmentation data, and the first sample data is used to indicate a sentence; and generating second sample data corresponding to the grammar rule based on the grammar rule and the first sample data corresponding to the grammar rule.

[0005] Secondly, this application provides a data processing apparatus, which includes at least: a first acquisition unit, configured to acquire grammar rules and acquire first sample data corresponding to the grammar rules; wherein the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate entity recognition results corresponding to the word segmentation data, and the first sample data is used to indicate sentences; and a first generation unit, configured to generate second sample data corresponding to the grammar rules based on the grammar rules and the first sample data corresponding to the grammar rules.

[0006] Thirdly, this application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program or instructions, and when the computer program or instructions are executed by the processor, the method provided in the first aspect is implemented.

[0007] In one possible implementation, the electronic device can be a vehicle.

[0008] Fourthly, this application also provides a storage medium storing a computer program or instructions that, when executed by a processor, implement any of the methods provided in the first aspect above.

[0009] Fifthly, this application also provides a computer program product comprising a computer program or instructions that, when executed by a processor, implement any of the methods provided in the first aspect above.

[0010] In this scheme, first sample data can be obtained in advance. To improve the generalization ability of the samples, second sample data can be automatically generated through syntax rules. The second sample data is different from the first sample data, thereby expanding the number of samples and increasing the richness of the samples. This reduces the operation of technicians to collect and process data, and reduces manual input. In addition, the paradigm of expanding the number of samples and improving the generalization ability of samples through electronic devices reduces errors caused by manual operation and also increases the sample generation rate. Attached Figure Description

[0011] Figure 1 A schematic flowchart of an optional data processing method provided in an embodiment of this application; Figure 2 Signaling diagrams provided for embodiments of this application; Figure 3 Signaling diagrams for feedback provided in embodiments of this application; Figure 4 This is a schematic diagram of an optional structure of the data processing apparatus provided in the embodiments of this application.

[0012] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of the application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.

[0014] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0015] In the following description, the terms "first," "second," and "third" are used only to distinguish different objects and do not represent a specific order of objects, nor are they constituting a chronological order. It is understood that "first," "second," and "third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0016] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0017] In related technologies, on the one hand, the acquisition and annotation of training corpora are fraught with difficulties in the model training stage. High-quality Natural Language Processing (NLP) models rely on a large amount of diverse and accurately annotated corpora for training. Traditional manual annotation methods not only require huge investments of manpower, resources, and time, but are also highly susceptible to the influence of the annotator's subjective factors, leading to inconsistencies in annotation results and increased error rates. Taking the construction of a model in the field of smart home control as an example, natural language has high flexibility and richness, and manually exhaustively enumerating all possible semantic expressions is almost an impossible task. This makes NLP models lack generalization ability when faced with expressions that have not appeared in the training set, and unable to accurately understand and process user input.

[0018] On the other hand, when recall errors occur in real-world applications, there is a lack of effective means to quickly pinpoint the root cause of the problem. For example, in intelligent navigation applications, if the model incorrectly interprets the user's input "navigate to nearby restaurants" as other instructions, it is difficult for relevant personnel to quickly determine whether this is due to a lack of relevant expressions in the training corpus, a flaw in the annotation rules, or a deviation during model training. This significantly prolongs the problem-solving and fixing cycle, severely impacting the product's iteration and optimization speed and user experience.

[0019] Furthermore, among related technologies, those based on the Java Speech Grammar Format (JSGF) protocol are mainly used for grammatical definition in speech recognition. Their functionality is relatively limited and cannot meet the complex needs of NLP model training corpus generation and reverse lookup localization. Traditional NLP data annotation tools and processes are mostly unidirectional, only capable of converting raw text into annotation results, but unable to trace back from the model's output annotation results to the corresponding original grammatical rules and training corpus. This causes significant inconvenience in model optimization and error debugging.

[0020] This application provides data processing methods, apparatus, electronic devices, storage media, and program products. The following describes various embodiments of the data processing methods, apparatus, electronic devices, storage media, and program products provided in this application.

[0021] In a first aspect, embodiments of this application provide a data processing method, which can be executed by a data processing device that can be deployed in an electronic device and implemented by a program stored in a memory by a processor.

[0022] The following explanation uses an electronic device as an example to illustrate the data processing method. Figure 1 As shown, it includes S101 to S102.

[0023] S101, the electronic device acquires grammar rules and acquires first sample data corresponding to the grammar rules; wherein, the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate the entity recognition result corresponding to the word segmentation data, and the first sample data is used to indicate the sentence.

[0024] In this embodiment of the disclosure, electronic devices include, but are not limited to, vehicles, mobile phones, computers, tablets, cloud computing, servers, wearable devices, etc. Syntax rules include, but are not limited to, rules entered by technical personnel, rules read from a rule database, etc.

[0025] Syntax rules are used to indicate at least one of the following: time, place, person, action performed, object of the action, etc. Syntax rules may include those generated via the JSGF protocol. For example, one syntax rule is `@JsgfRule("<@who><@open><@door>")`, where `JsgfRule("<@who><@open><@door>")` means: the rule specified by the JSGF protocol is "<@who><@open><@door>"; another syntax rule is `@JsgfExpression(" <please> <open> <door>"), where @JsgfExpression(" <please> <open> <door>The meaning of ") is: the expression defined by the JSGF protocol is " <please> <open> <door>Syntax rules can include syntax prefixes and expressions. Syntax prefixes can be `@JsgfExpression` or similar, and are not limited to any particular prefix. Expressions can indicate at least one of the following: time, place, person, action performed, object of the action, etc. Expressions can include at least one sub-rule, which is `<>` and the content within `<>`. For example, sub-rules include `<@who>`, `<...` <open>and the like.

[0026] The first sample data may include phrases, word groups, characters, etc. arranged based on the order of expressions. The first sample data may be obtained from articles, books, newspapers, and the Internet, or may be obtained after recognizing the user's speech. Taking a vehicle recognizing and executing a user's voice instruction as an example, the first sample data may be obtained after recognizing and splitting the user's speech, and the first sample data includes: please open, please help me, open, car window, car door, air conditioner, etc. Alternatively, the first sample data may include a syntax tree, or the first sample data may also include sentences, articles, etc., and the first sample data is not limited herein. For example, when the first syntax rule is @JsgfExpression("<@who><@open><@door>"), one corresponding first sample data thereof includes: please help me open the door.

[0027] The first sample data corresponding to the syntax rule may be located in a json file, different syntax rules correspond to different json files, each json file includes at least one piece of first sample data, and the json file may be a file generated by a technician based on the syntax rule, or a file automatically generated by an electronic device based on the syntax rule.

[0028] The corpus label includes a code or code sequence determined by BIOES. BIOES is a sequence labeling method applied in natural language processing (NLP), which is mainly used for tasks such as named entity recognition (NER). Its full name is "Beginning, Inside, Outside, End, Single", where: B (Beginning) represents the start of an entity; I (Inside) represents the inside of an entity; O (Outside) represents a word that does not belong to any entity; E (End) represents the end of an entity; S (Single) represents a single entity, so that the boundary and category of the entity can be better identified through the corpus label. For example, a plurality of word segmentation data include "I", "help me", "please help me", etc. The corpus label corresponding to the word segmentation data "I" is "B-P", the corpus label corresponding to "help me" is "B-P E-P", and the corpus label corresponding to "please help me" is "B-P I-P E-P", that is, the corpus label corresponding to each character in the word segmentation data can be determined.

[0029] For example, multiple word segmentation data include "navigate to" and "People's Square". The correspondence between each character and the corpus tag is as follows: guide → O, navigation → O, arrive → O, person → B-POI, people → I-POI, square → I-POI, square → I-POI, square → I-POI. Here, O can indicate unimportant characters, POI (Point of Interest) represents a location on the map, B-POI represents the starting position of the location on the map, and I-POI represents part of the phrase of the location on the map.

[0030] S102, Based on the grammar rules and the first sample data corresponding to the grammar rules, generate the second sample data corresponding to the grammar rules.

[0031] In this embodiment of the disclosure, the electronic device can generalize the first sample data through grammatical rules to obtain at least one second sample data. The second sample data and the first sample data are subject to the same grammatical rules. When the first sample data includes a sentence, the first sample data includes a first sentence and a first corpus label. The second sample data may include a second sentence and a second corpus label. The intent of the first sentence and the intent of the second sentence are the same or similar.

[0032] For example, the syntax rule is `@JsgfExpression("<@who><@open><@door>")`. The first sentence in the first sample data is "Please open the door for me". After generalization, multiple second sentences are obtained, such as "Open the door", "Open the car door", "Please open the door", "Open the door immediately", and "Please open the car door for me immediately". In the user-vehicle interaction scenario, the intent of the first and second sentences is the same: to instruct the vehicle to open the car door automatically, reducing the user's manual operation of opening the door and thus improving the user experience. After obtaining multiple second sentences, the corresponding corpus tags for each second sentence are determined. Then, based on the corpus tags corresponding to each second sentence, second sample data is obtained, thus obtaining multiple second sample data. This increases the number of sample data, eliminating the need for technicians to specifically collect second sentences, reducing data collection time and manual input, increasing the rate of sample data generation, and also improving the generalization degree of the sample data.

[0033] In this embodiment of the disclosure, the first sample data can be automatically generalized through grammatical rules to obtain the second sample data. Thus, by updating the grammatical rules, the second sample data corresponding to each grammatical rule can be obtained one by one. There is no need for manual collection and processing of samples, which reduces manual input, improves the efficiency and speed of corpus generation, and also increases the number and diversity of samples.

[0034] In some embodiments, the method further includes S103 to S104, wherein: S103. Obtain the first corpus database; wherein, the first corpus database includes grammar rules and sample data corresponding to the grammar rules, and the sample data includes first sample data and / or second sample data.

[0035] In some embodiments, the first corpus database includes Elasticsearch (ES) databases, which have advantages such as inverted indexes and intelligent word segmentation, thereby facilitating fast retrieval of stored sentences based on keywords. The first corpus database includes first sample data and / or second sample data.

[0036] S104. Based on the second corpus database, train the initial model to generate the target model.

[0037] In some embodiments, the initial model or target model includes a model for analyzing and recognizing sentences to achieve at least one of the following functions: recognizing sentence intent, extracting sentence key points, generating similarity scores for multiple sentences, etc. For example, the initial model includes a BERT (Bidirectional Encoder Representation from Transformers) model, a Large Language Model (LLM), etc. The electronic device can train the initial model based on sample data to obtain a target model with the above functions.

[0038] The input to the initial model may include a first sample sentence and first sample corpus labels. The output of the initial model may include output results, which can indicate at least one of the following: sentence intent, sentence emphasis, similarity among multiple sentences, etc., thereby calculating a loss value based on the output results of the initial model and the true results. The initial model is updated based on the loss value to optimize its parameters. Training ends when the loss value meets the first model condition, resulting in the target model. The first model condition can indicate at least one of the following: the loss value of at least one iteration is less than a first loss threshold, the loss difference across multiple iterations is less than a second loss threshold, the loss value trend is less than a third loss threshold, etc., where the loss difference is the difference between two adjacent loss values, and the loss value trend is the ratio of two adjacent loss values. The input to the target model may include a third sentence and predicted corpus labels, where the predicted corpus labels are obtained after analyzing the third sentence.

[0039] Alternatively, the input to the initial model may include a first sample sentence. During the analysis of this first sample sentence, the initial model obtains predicted corpus labels and ultimately outputs a result. A first loss value is calculated based on the output and the true result. A second loss value is obtained based on the predicted corpus labels and the first sample corpus labels. A target loss value is then derived based on both the first and second loss values. The initial model is updated based on the target loss value. Training ends when the target loss value satisfies the second model condition, yielding the target model. The second model condition is similar to the first model condition described above and will not be elaborated upon here. The input to the target model may include a third sentence. The target model analyzes the third sentence to obtain predicted corpus labels and then outputs a result.

[0040] By training the initial model with sample data, it is possible to analyze the user's intent or focus by combining corpus tags, so that the target model can obtain more accurate output results and realize the corresponding function of the target model.

[0041] In some embodiments, the method further includes S105 to S106, wherein: S105. Identify the first statement data using the target model to determine the first classification semantics and the first entity semantics; wherein, the first entity semantics is used to indicate the corpus label corresponding to the first statement data.

[0042] In some embodiments, the first statement data may include a third sentence, and the first classification semantics may be used to indicate navigation, playback, display, etc. The third sentence may be obtained after recognizing the user's output speech, or it may be user-output, obtained from books, web pages, etc. For example, the third sentence is "I want to go to Chengdu," and the first classification semantics is used to indicate navigation. The first classification semantics includes "NAVI:navi_poi," where "NAVI" and "navi" both represent navigation, and "poi" represents a location. The first entity semantics may be used to indicate the corpus label corresponding to each character in the third sentence. For example, as in the above third sentence, the first entity semantics are: I→O, want→O, go→O, Chengdu→B-POI, all→I-POI. Then, combining the first classification semantics and the first entity semantics, the location in the third sentence is Chengdu, i.e.: { "domain": "NAVI" "intent": "navi_poi" "slots": { POI: Chengdu } } Here, "Domain" represents the domain, "intent" represents the intent, "slots" represents the slots as a data structure that can execute the user's expected actions, and "POI" represents the location. The first intent data is: the user wants to navigate to Chengdu, so at least one category can be pre-set to obtain the target category corresponding to the third sentence, that is, the first category semantics; the corpus labels of each character in the third sentence are analyzed to obtain the first entity semantics.

[0043] S106. Based on the first category semantics and the first entity semantics, determine the first intent data corresponding to the first statement data.

[0044] In some embodiments, combining the corpus tags of the third sentence with the classification of the third sentence can yield the intent of the third sentence, improving the accuracy and reliability of predicting the user's intent.

[0045] In human-computer interaction scenarios, electronic devices include vehicles. The vehicles can run target models, collect and convert the user's voice output to obtain a third sentence, and use the target model to identify and analyze the user's intent in the third sentence to obtain the first intent data, thus improving the accuracy of intent recognition.

[0046] The above S105 and S106 illustrate the purpose of the target model as obtaining the user's intent. This disclosure does not limit the function of the target model. When the function of the target model changes, for example, when its function is to analyze the key points of a sentence, the target model can be used to combine the semantics of the first entity with the sentence's intent to obtain the sentence's key points, thereby improving the accuracy of the target model's output.

[0047] In some embodiments, the method further includes S107 to S108, wherein: S107, Obtain the second statement data; wherein, the difference between the second intent data corresponding to the second statement data and the true intent is greater than the difference threshold, and the second intent data includes the data obtained by analyzing the second statement data through the target model.

[0048] In some embodiments, the second statement data may include a third sentence. The intent of the third sentence can be analyzed by the target model to obtain the second intent data. If the difference between the second intent data and the true intent is greater than the difference threshold, it means that the matching degree between the second intent data and the user's true intent is low, which often leads to the vehicle not being able to execute the user's voice commands well.

[0049] S108, determine the target grammar rules and / or target sample data corresponding to the second sentence data from the first corpus database.

[0050] In some embodiments, target sample data may include a first target sentence, and second sentence data may include a second target sentence. Target sample data may refer to data where the first target sentence and the second target sentence have the same word segmentation data and / or similar intents; or, target sample data may refer to sample data corresponding to target grammar rules. To locate the reason why the difference between the second intent data corresponding to the second sentence data and the true intent is greater than the difference threshold, target grammar rules and / or target sample data related to the second sentence data can be determined from the first corpus database based on the second sentence data. This determines whether the poor performance of the trained target model is due to a conflict in target grammar rules, insufficient sample data, or incorrect sample data.

[0051] Technicians can determine whether there are rule conflicts or missing rules by analyzing the existence and number of target grammar rules returned. For example, a rule conflict can indicate that the same sentence is covered by multiple different target grammar rules; a missing rule can indicate that the target grammar rule corresponding to the sentence cannot be detected. Alternatively, electronic devices can determine whether there are rule conflicts or missing rules based on the number of target grammar rules. If the number of target grammar rules is 0, a rule conflict is determined, and a rule conflict warning is generated; if the number of target grammar rules is greater than 1, a missing rule is determined, and a missing rule warning is generated.

[0052] Insufficient coverage can be used to indicate a shortage of target sample data or low diversity performance of the target sample data. Technicians can determine whether there is a problem of low diversity performance of the target sample data by tracing the source of the target sample data. Electronic devices can determine whether there is a problem of insufficient sample coverage based on the quantity of target sample data. When the quantity of target sample data is less than the quantity threshold, it is determined that there is a problem of insufficient sample coverage, and a prompt for insufficient sample coverage is generated. This allows for the generation of different prompts for different situations, and the prompts can be output in a visual and / or auditory manner, enabling technicians to view the problem indicated by the prompt in a timely manner, achieving precise problem location. In turn, technicians can use the precise location of the root cause of the problem to repair and cover it, thus accelerating the error troubleshooting speed.

[0053] For example, the third sentence is "Help me open the car door." Using the source tracing mechanism, the multiple target grammar rules determined from the first corpus database and the target sample data corresponding to each grammar rule are as follows: -CAR_CONTROL --open_door.json <open>(Door | Car Door) --open_position_door.json <open>[Left|Right](Door|Car Door) Here, CAR_CONTROL represents data related to vehicle control in human-machine interaction scenarios. The expressions in the two target syntax rules are as follows: <open>(door|car door) and <open>[Left|Right](Door|Car Door), the two target grammar rules correspond to two intentions respectively, that is <open>(Door|Car Door) corresponds to the user's intention to open the door or car door. <open>The intent corresponding to [left|right](door|car door) is that the user wants to open the door, car door, left door, right door, left car door or right car door. At this time, the model will determine two intents: CAR_CONTROL:open_door and CAR_CONTROL:open_position_door, which will cause NLU recall failure.

[0054] Technicians are able to analyze expressions in multiple target syntax rules and discover that the rule conflict is caused by defining two target syntax rules, thus... <open>[Left|Right](Door|Car Door) modified to <open>(Left|Right)(Door|Car Door), thus making left and right mandatory conditions. After the improvement, the target grammar rule for the third sentence "Help me open the car door" is: <open>(door|vehicle door), which solves the problem of rule conflicts.

[0055] For another example, the third sentence is "I want to listen to XX", where XX may refer to the name of a song, a radio drama, or a traditional opera, etc., but XX is also the name of a place or a certain brand. In the case where XX is both a song name and a place name, the recall probabilities of the target model for the two classified semantics of navigation and playback may be approximate or identical, which may further lead to the target model making an error in intent recognition corresponding to the third sentence. At this time, it is necessary to utilize the traceability capability to query whether the sample data including XX is included; when the quantity of the sample data including XX is small, it is determined that the deviation or error in intent recognition of the model is caused by insufficient coverage, and a technician may instruct the electronic device to increase the probability of the quantity of samples corresponding to XX through the method from S101 to S102, so as to utilize "go to" and "listen to" to increase the corresponding recall probability, and improve the accuracy and generalization degree of the model.

[0056] In some embodiments, S101 includes S1011 to S1013, wherein: In S1011, the electronic device acquires a second corpus database; wherein the second corpus database comprises sub-sample data, and the sub-sample data further comprises slot names.

[0057] In the embodiments of the present disclosure, the second corpus database may refer to a json file or the like that stores sub-sample data, for example, the multiple word segmentation data included in the second corpus database are "please", "open", "the door". Each piece of word segmentation data corresponds to a corpus label, for example, the corpus label corresponding to the word segmentation data "please" is "B-P".

[0058] In S1012, for each grammar rule, the electronic device determines a target slot name corresponding to the grammar rule from the second corpus database based on the grammar rule.

[0059] In the embodiments of the present disclosure, the slot name is related to the grammar rule, and the slot name may be related to the sub-content in the expression of the grammar rule, where the sub-content includes a sub-rule. For example, the grammar rule includes @JsgfExpression("<@who><@open><@door>"), and the multiple pieces of word segmentation data are "please help me", "I want to", etc., whose slot name is "who", that is, the slot name is related to the sub-rule <@who> in the expression, and the content after @ in the sub-rule is the same as the slot name; alternatively, the grammar rule includes @JsgfRule(" <who> <open> <door>"), the multiple word segmentation data are "please help me", "I want", etc., whose slot name is "who", and the content in the sub-rule is the same as the slot name. The sub-content and the slot name may also be similar, or correspond to the translation thereof, which is not limited herein.

[0060] The second corpus database may have a ternary mapping relationship corresponding to slot names, word segmentation data, and corpus labels, so that rich and diverse corpora can be quickly generated starting from the expressions specified by the JSGF protocol. The electronic device can determine, for each grammar rule and its corresponding target slot name, the sub-sample data corresponding to each sub-rule in the grammar rule from the second corpus database; and generate at least one first sample data based on the sub-sample data corresponding to each sub-rule. For example, the symbols in the expression include at least one of the following: |, (), [], <>, @, {}, etc., and Table 1 is a mapping table of symbols, names and their corresponding meanings in an expression provided by the embodiment of the present disclosure. As shown in Table 1 below, Table 1 Mapping Table

[0061] For example, the sub-rules include <action> 、 <target>wait. <action>=Please open | close, etc. <target>=Car doors, windows, air conditioners, etc., can define basic rules, such as want: [I want|I need], open: (open|turn on|activate), temp: (degrees|Celsius[degrees]|℃), where temp is the temperature, and its sub-rules are defined as degrees, degrees Celsius, degrees Celsius, or ℃. The expression is: <want> <open>(door|car door) means that doors and car doors have an OR relationship; the expression is: <want> <open>(Left|Right)(Door|Car Door), meaning there's an OR relationship between left and right, and an OR relationship between doors and car doors. The expression can include at least one sub-content, which includes sub-rules, or non-sub-rule content and symbols from the above symbols. Sub-rules include... <door>This indicates that the slot label includes "door," and the corresponding word segmentation data can be retrieved from the second corpus database. The sub-content includes {(People's Square)@poi}, meaning that the original corpus labels corresponding to each character in "People's Square" were B, I, I, I, and after adding @poi, the corpus labels corresponding to each character are B-POI, I-POI, I-POI, I-POI, I-POI.

[0062] Different grammar rules can correspond to different domains. For example, multiple domains include vehicle control and navigation. Electronic devices can automatically generate first sample data based on a second corpus database, place multiple first sample data in a JSON file, and determine the grammar rules corresponding to the vehicle control domain and the corresponding JSON file for those rules. That is: -CAR_CONTROL --open_door.json <want> <open>(Door | Car Door) --open_position_door.json <want> <open>(Left|Right) (Door|Car Door) … -NAVI --navi_poi.json <want>(Navigate to / Go to) {(People's Square / Chengdu)@poi} … In this context, "..." indicates "etc.", CAR_CONTROL represents the topic corresponding to the vehicle control domain, and NAVI represents the topic corresponding to the navigation domain. The electronic device can obtain at least one syntax rule in the domain corresponding to the syntax rule, so that when generalizing to obtain the second sample data in the subsequent process, it can obtain second sample data that is more in line with the domain based on different domains.

[0063] That is, electronic devices can determine the target slot name corresponding to each sub-content in the syntax rules of different domains, and can also determine the target slot name corresponding to the target sub-content declared by "@".

[0064] S1013, the electronic device determines the first sample data corresponding to the syntax rule based on the sub-sample data where the target slot name is located.

[0065] In this embodiment of the disclosure, the sub-sample data includes the target slot name. Different sub-sample data may include the same target slot name, thereby determining at least one sub-sample data corresponding to the sub-content. The at least one sub-sample data corresponding to the sub-content can be arranged sequentially according to the order of the sub-content in the expression to obtain the first sample data.

[0066] In some embodiments, S108 includes: determining, through a first mapping engine, target grammar rules and / or target sample data corresponding to the second statement data from a first corpus database; wherein, the mapping engine includes a first mapping engine, and the first target code corresponding to the first mapping engine includes grammar rules, the grammar rules being embedded in the first target code in the form of annotations.

[0067] In this embodiment of the disclosure, the mapping engine includes a first mapping engine and / or a second mapping engine. The target code corresponding to the mapping engine includes syntax rules, which are embedded in the target code as annotations. The first mapping engine corresponds to the first target code, and the second mapping engine corresponds to the second target code.

[0068] Similarly, referring to the above, when the language of the first target code is Java, the syntax rules can be embedded in the first target code as Java annotations. Alternatively, the expressions in the syntax rules can also be embedded in the first target code as Java annotations, thereby enabling JSGF expression parsing driven by Java annotations. By running the first target code, the first mapping engine can trace the source of the target syntax rules and / or target sample data. In the event of errors or deviations in the intent recognition of the target model, the engine can determine whether at least one of the following problems exists: rule conflicts, missing rules, and insufficient coverage, thereby facilitating technicians to accurately locate the root cause of the problem and perform repairs.

[0069] When the mapping engine includes a first mapping engine and a second mapping engine, it becomes a bidirectional mapping engine, capable of both forward corpus generation and reverse querying and locating. Furthermore, through Java annotations, technical personnel can easily embed custom JSGF expressions into the code, achieving clear declaration and efficient management of syntax rules. This declarative definition method greatly improves the readability and maintainability of syntax rules, reducing the technical threshold and workload for developers. For example, simply writing `@JsgfRule("<@who><@open><@door>")` clearly defines a syntax rule.

[0070] In some embodiments, S1012 includes: determining the target slot name corresponding to the grammar rule from the second corpus database based on the grammar rule through the second mapping engine; wherein the second target code corresponding to the second mapping engine includes the grammar rule, and the grammar rule is embedded in the second target code in the form of annotations.

[0071] In this embodiment of the disclosure, when the language of the second target code is Java, the syntax rules can be embedded in the second target code as Java annotations. Alternatively, the expressions in the syntax rules can also be embedded in the second target code as Java annotations. Thus, through JSGF expression parsing driven by Java annotations, the first sample data corresponding to the syntax rules can be automatically obtained. Subsequently, the electronic device can automatically generate a JSON file corresponding to each syntax rule. The JSON file includes at least one sample data, which reduces the time spent on manually creating JSON files and reduces the problem of inconsistent standards in the creation of multiple JSON files due to different understandings of the meaning of sentences by different people, thereby reducing manual operations.

[0072] In some embodiments, the first sample data includes a first sentence, and the first sentence includes at least one word segmentation data; S102 includes S1021 to S1024, wherein: S1021: generating a syntax tree based on grammar rules, and word segmentation data and corpus labels corresponding to the grammar rules.

[0073] In the embodiments of the present disclosure, the syntax tree may be used to indicate the correspondence between the grammar rules and the word segmentation data. For example, each sub-content in the grammar rules corresponds to at least one piece of word segmentation data, the word segmentation data may be composed of characters, and each character corresponds to one corpus label. The syntax tree is further used to indicate the correspondence between the corpus label of each character in the word segmentation data and the word segmentation data. For example, the root node of the syntax tree is used to indicate the "expression" of the grammar rule, the root node may be connected to at least one first child node, the first child node is used to indicate the sub-content in the expression, and each sub-content corresponds to one first child node; the first child node where the sub-content is located is connected to at least one second child node, the second child node is used to indicate the word segmentation data, and each piece of word segmentation data corresponds to one second child node; the second child node is connected to a third child node, and the third child node is used to indicate the corpus label corresponding to each character in the word segmentation data, so as to construct the syntax tree.

[0074] For example, the expression is <@want><@open><@door>, where the syntax tree may include 3 first child nodes, which are <@want>, <@open> and <@door> respectively. <@want> corresponds to 3 pieces of word segmentation data, which are: I want, I need, please; <@open> corresponds to two pieces of word segmentation data, which are: open, turn on; <@door> corresponds to two pieces of word segmentation data, which are door, car door, and the number of the second child nodes is 7. Similarly, the number of the third child nodes is 7, for example, the second child node corresponding to the word segmentation data "I want" is connected to the first child node corresponding to the sub-content <@want>.

[0075] S1022: generating a plurality of sentences based on the syntax tree; wherein the plurality of sentences are intent-related.

[0076] In the embodiments of the present disclosure, S1022 includes generating second sentences by performing Cartesian product combination on the second child nodes of the syntax tree, and intent-related means that the intents are the same or similar. For example, in combination with the content of the above structural tree, by combining each piece of word segmentation data in an enumeration manner, the obtainable second sentences include: I want to open the door, I need to open the door, please open the door, I want to open the car door, I need to open the car door, please open the car door, so that a plurality of second sentences with the same intent can be obtained.

[0077] Alternatively, the first sample data includes a first sentence, and the expression is <want> <open>[Left|Right] (Door|Car Door), and in conjunction with the above, <want>and <open>All are predefined sub-rules. The first sentence is "Please help me open the left door of the car." The second sentence can include at least one of the following: "Please help me open the right door of the car," "Please help me open the door," "I want to open the door," "I want to open the left door of the car," "I want to open the right door of the car," "I want to open the door," "I want to open the door," etc. This allows for generalization from a first sample data to obtain multiple second sentences. The intent of the first sentence is: "The user wants to open the left door." The intents of the multiple second sentences can include: "The user wants to open the door," "The user wants to open the left door," and "The user wants to open the right door." That is, the intents of the first and second sentences are related; both are about wanting to open the car door, thus increasing the number and diversity of sentences.

[0078] For example, the expression is <want>(Navigate to|Go to){(People's Square|Chengdu)@poi}, the first sentence is "I want to go to People's Square", and the second sentence may include at least one of the following: navigate to People's Square, I want to navigate to People's Square, I need to navigate to People's Square, I want to go to People's Square, etc., so that the first sentence and the second sentence have the same intent, the number of sentences is increased for the same intent, and then the quantity and diversity of sample data are increased when training the model, which improves the training effect of the model.

[0079] S1023, determining the corpus label corresponding to each sentence.

[0080] In the embodiment of the present disclosure, the corpus label corresponding to each character in the second sentence may be determined through BIOES encoding. For example, the second sentence is "navigate to People's Square", and the corresponding relationship between the second sentence and the corpus label is: Navigate→O, To→O, People→B-POI, Min→I-POI, Guang→I-POI, Chang→I-POI; the entity name can be determined as People's Square through the code B and the code I, and the entity name is determined to refer to a location through POI, so that the key points in the second sentence can be indicated by the corpus label.

[0081] S1024, generating second sample data based on the sentences and the corpus labels corresponding to the sentences.

[0082] In the embodiment of the present disclosure, the second sample data includes a second sentence and a corpus label corresponding to the second sentence, where the second sentence is composed of at least one word segmentation data, and the second sample data may further include a slot name. For example, the first sample data includes a first slot name and first word segmentation data, the first slot name corresponds to the first word segmentation data, the first slot name corresponds to the first sub-content in the expression, the second sample data includes second word segmentation data, and the second word segmentation data corresponds to the first sub-content, so that through the corresponding relationship between the first slot name and the first sub-content and the corresponding relationship between the first sub-content and the second word segmentation data, it can be determined that the second slot name corresponding to the second word segmentation data is the first slot name, thereby forming a ternary corresponding relationship among the slot name, the sentence and the corpus label, which increases the number of samples and also improves the diversity of the samples.

[0083] In some embodiments, the method further comprises: updating a grammar rule in response to a rule modification instruction; wherein the updating is used to indicate at least one of the following: adding, deleting, modifying.

[0084] In this embodiment of the disclosure, technicians can add, delete, or modify syntax rules through rule modification instructions. For example, a rule modification instruction can be issued to the electronic device before step 101, and the electronic device can modify the syntax rules in response to the rule modification instruction; or, a rule modification instruction can be issued to the electronic device after step 102, and the electronic device can add a new syntax rule in response to the rule modification instruction; or, a rule modification instruction can be issued to the electronic device after step 108, and the electronic device can delete a syntax rule in response to the rule modification instruction, etc.

[0085] The above is an example of a technician instructing an electronic device to add, delete, or modify syntax rules. It does not limit the timing of the technician's adjustment of syntax rules. The technician can update the syntax rules, thereby prompting the electronic device to adjust the second sample data, so that the second sample data can better conform to the syntax rules.

[0086] In some embodiments, the electronic device includes an annotation processor, an expression parser, a slot manager, a corpus generator, and a memory, which can be used to store data in a database. Figure 2 The signaling diagram provided for the embodiments of this application, such as Figure 2 As shown, it includes S201 to S208, wherein: S201, The technician inputs the syntax rule into the electronic device. The syntax rule is @JsgfExpression("<@please><@open><@door>"); S202, the annotation processor parses the syntax rules to obtain expressions, and sends the expressions of the syntax rules, such as <@please><@open><@door>, to the expression parser; S203, The expression parser triggers the slot manager to query the sub-sample data corresponding to the expression <@please><@open><@door>; S204, the slot manager determines the sub-sample data corresponding to <@please>, <@open>, and <@door> respectively; and sends the sub-sample data corresponding to <@please>, <@open>, and <@door> respectively to the expression parser; S205, the expression parser obtains the first sample data based on the sub-sample data corresponding to <@please>, <@open>, and <@door> respectively; and sends the first sample data and syntax rules to the corpus generator; S206, the corpus generator generalizes the first sample data based on the grammar rules to obtain the second sample data; and sends the grammar rules and the sample data corresponding to the grammar rules to the memory. The sample data corresponding to the grammar rules includes the first grammar rule and the second grammar rule. S207, The memory binds and stores the grammar rules and sample data. If the binding and storage are successful, a message indicating successful storage is sent to the corpus generator. S208, the corpus generator shall provide feedback on at least one of the following: a message indicating successful storage, grammar rules, and sample data corresponding to the grammar rules.

[0087] In this embodiment, the annotation processor embeds grammar rules input by a technician into the code as annotations and parses expressions from the grammar rules. The expression parser parses the expressions, identifies sub-rules within them, and then queries the pre-initialized slot manager for relevant sub-sample data. The expression parser constructs a syntax tree based on this sub-sample data. The corpus generator, based on the syntax tree, generates multiple second sample data sets by combining the Cartesian products of the sub-sample data, thus achieving sample generalization. The memory can run a first corpus database, which stores the ternary correspondence between slot names, second sentences, and grammar tags, as well as the grammar rules corresponding to the second sentences. Upon successful storage, a success message can be sent to the corpus generator, which can then send this message to the technician, allowing the technician to know that the sample data corresponding to the grammar rule has been successfully generated and stored. The grammar rule and its corresponding sample data can also be sent back for the technician's convenience.

[0088] The second mapping engine includes a reverse query engine, and the memory is used to store data from the first corpus database. Figure 3 The signaling diagram for feedback provided in the embodiments of this application is as follows: Figure 3 As shown, it includes S301 to S307, wherein: S301, User input command: Navigate to the company; S302, the NLU module detects the user's input instruction and returns an incorrect semantic understanding result to the user; S303, User feedback indicates that the NLU module outputs an incorrect semantic understanding result for the instruction "Navigate to the company". S304. After learning about this, the technicians used the navigation to the company as input to trigger the reverse query engine to perform a search. S305, The reverse query engine triggers a memory retrieval of the target syntax rules and / or target sample data corresponding to the instruction "Navigate to the company"; S301, the memory feeds back the target syntax rules and / or target sample data to the reverse query engine; S301, the reverse query engine feeds back the target syntax rules and / or target sample data to the technical personnel.

[0089] In this embodiment of the disclosure, the reverse query engine can achieve reverse retrieval. Technicians can directly use the user's original command as the query content and quickly retrieve all expressions / or sample data that may trigger the command in the ES database. This allows for the intuitive and reliable disclosure of expressions / or sample data that may cause the NLU model to output errors through tracing the source, accurately locating problems such as rule conflicts, rule omissions, or insufficient coverage, reducing the time technicians spend locating problems and improving problem-solving efficiency.

[0090] Secondly, embodiments of this application provide a data processing apparatus, with reference to Figure 4 The data processing device 400 shown may include a first acquisition unit 401 and a first generation unit 402.

[0091] The first acquisition unit 401 is used to acquire grammar rules and acquire first sample data corresponding to the grammar rules; wherein, the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate the entity recognition result corresponding to the word segmentation data, and the first sample data is used to indicate the sentence; The first generation unit 402 is used to generate second sample data corresponding to the grammar rule based on the grammar rule and the first sample data corresponding to the grammar rule.

[0092] In some embodiments, the apparatus 400 further includes: a second acquisition unit and a second generation unit; The second acquisition unit is used to acquire the first corpus database; wherein, the first corpus database includes grammar rules and sample data corresponding to the grammar rules, and the sample data includes first sample data and / or second sample data; The second generation unit is used to train the initial model based on the second corpus database and generate the target model.

[0093] In some embodiments, the device 400 further includes: a first determining unit, configured to: The target model is used to identify the first sentence data to determine the first category semantics and the first entity semantics; wherein, the first entity semantics is used to indicate the corpus label corresponding to the first sentence data; Based on the first category semantics and the first entity semantics, determine the first intent data corresponding to the first statement data.

[0094] In some embodiments, the device 400 further includes: a second determining unit, configured to: Obtain second statement data; wherein the difference between the second intent data corresponding to the second statement data and the true intent is greater than the difference threshold, and the second intent data includes data obtained by analyzing the second statement data through the target model; Determine the target grammar rules and / or target sample data corresponding to the second statement data from the first corpus database.

[0095] In some embodiments, the first acquisition unit 401 is configured to: Obtain the second corpus database; wherein, the second corpus database includes subsample data, and the subsample data also includes slot names; For each grammar rule, the target slot name corresponding to the grammar rule is determined from the second corpus database based on the grammar rule; Based on the subsample data containing the target slot name, determine the first sample data corresponding to the syntax rule.

[0096] In some embodiments, the second determining unit is configured to: determine, through a first mapping engine, the target grammar rules and / or target sample data corresponding to the second statement data from a first corpus database; And / or; the first acquisition unit 401 is used to: determine the target slot name corresponding to the grammar rule from the second corpus database based on the grammar rule through the second mapping engine; The mapping engine includes a first mapping engine and / or a second mapping engine. The target code corresponding to the mapping engine includes syntax rules, which are embedded in the target code as annotations.

[0097] In some embodiments, the first generation unit 402 is configured to: generate a syntax tree based on syntax rules, word segmentation data and corpus tags corresponding to the syntax rules; Multiple sentences are generated based on a syntax tree; the intents of these sentences are related. Determine the corpus labels corresponding to each sentence; Second sample data is generated based on sentences and their corresponding corpus labels.

[0098] In some embodiments, the apparatus 400 further includes an update unit, configured to update a syntax rule in response to a rule modification instruction; wherein the update is configured to indicate at least one of the following: addition, deletion, or modification.

[0099] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0100] It should be noted that, in the embodiments of this application, if the above-described data processing method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0101] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program or instructions, and when the computer program or instructions are executed by the processor, they implement the method provided in the first aspect.

[0102] In one possible implementation, the electronic device may be deployed in a controller within the vehicle, which controls the vehicle to implement the method provided in the first aspect.

[0103] Fourthly, embodiments of this application provide a storage medium, namely a computer-readable storage medium, on which a computer program or instructions are stored, which, when executed by a processor, implement the steps of any of the methods provided in the first aspect of the above embodiments.

[0104] Fifthly, embodiments of this application provide a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the steps of any of the methods provided in the first aspect of the above embodiments.

[0105] It should be noted that the descriptions of the above embodiments of storage media, devices, apparatuses, and program products are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of storage media, devices, apparatuses, and program products of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0106] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0107] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0108] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another electronic device, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0109] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0110] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0111] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0112] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0113] The above are merely embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.< / want> < / open> < / want> < / open> < / want> < / want> < / open> < / want> < / open> < / want> < / door> < / open> < / want> < / open> < / want> < / target> < / action> < / target> < / action> < / door> < / open> < / who> < / open> < / open> < / open> < / open> < / open> < / open> < / open> < / open> < / open> < / open> < / door> < / open> < / please> < / door> < / open> < / please> < / door> < / open> < / please>

Claims

1. A data processing method, characterized in that, include: Acquire grammar rules and acquire first sample data corresponding to the grammar rules; wherein, the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate the entity recognition result corresponding to the word segmentation data, and the first sample data is used to indicate the sentence; Based on the grammar rule and the first sample data corresponding to the grammar rule, the second sample data corresponding to the grammar rule is generated.

2. The method according to claim 1, characterized in that, The method further includes: Obtain a first corpus database; wherein the first corpus database includes the grammar rules and the sample data corresponding to the grammar rules, and the sample data includes first sample data and / or second sample data; Based on the second corpus database, the initial model is trained to generate the target model.

3. The method according to claim 2, characterized in that, The method further includes: The target model is used to identify the first statement data to determine the first category semantics and the first entity semantics; wherein, the first entity semantics is used to indicate the corpus label corresponding to the first statement data; Based on the first classification semantics and the first entity semantics, the first intent data corresponding to the first statement data is determined.

4. The method according to claim 2, characterized in that, The method further includes: Obtain second statement data; wherein the difference between the second intent data corresponding to the second statement data and the true intent is greater than a difference threshold, and the second intent data includes data obtained by analyzing the second statement data through the target model; Determine the target grammar rules and / or target sample data corresponding to the second statement data from the first corpus database.

5. The method according to claim 4, characterized in that, The step of obtaining the first sample data corresponding to the syntax rule includes: Obtain a second corpus database; wherein the second corpus database includes subsample data, and the subsample data further includes slot names; For each grammar rule, the target slot name corresponding to the grammar rule is determined from the second corpus database based on the grammar rule; Based on the subsample data where the target slot name is located, determine the first sample data corresponding to the syntax rule.

6. The method according to claim 5, characterized in that, The step of determining the target grammar rules and / or target sample data corresponding to the second statement data from the first corpus database includes: The first mapping engine determines the target grammar rules and / or target sample data corresponding to the second statement data from the first corpus database. and / or; The step of determining the target slot name corresponding to the grammar rule from the second corpus database based on the grammar rule includes: The second mapping engine determines the target slot name corresponding to the grammar rule from the second corpus database based on the grammar rule. The mapping engine includes a first mapping engine and / or a second mapping engine, and the target code corresponding to the mapping engine includes the syntax rules, which are embedded in the target code as annotations.

7. The method according to any one of claims 1 to 6, characterized in that, The step of generating second sample data corresponding to the grammar rule based on the grammar rule and the first sample data corresponding to the grammar rule includes: Based on the grammar rules, the word segmentation data corresponding to the grammar rules, and the corpus tags, a syntax tree is generated; Multiple sentences are generated based on the syntax tree; wherein the intents of the multiple sentences are related. Determine the corpus labels corresponding to each of the sentences; The second sample data is generated based on the sentence and the corresponding corpus tags.

8. The method according to any one of claims 1 to 6, characterized in that, The method further includes: In response to a rule modification instruction, the syntax rule is updated; wherein the update is used to indicate at least one of the following: addition, deletion, or modification.

9. A data processing apparatus, characterized in that, The device includes: The first acquisition unit is used to acquire grammar rules and acquire first sample data corresponding to the grammar rules; wherein, the first sample data includes at least one subsample data, the subsample data includes word segmentation data and corpus tags, the corpus tags are used to indicate the entity recognition result corresponding to the word segmentation data, and the first sample data is used to indicate the sentence; The first generation unit is used to generate second sample data corresponding to the grammar rule based on the grammar rule and the first sample data corresponding to the grammar rule.

10. A vehicle / electronic device, characterized in that, The vehicle includes a processor and a memory, the memory storing a computer program or instructions, which, when executed by the processor, implement the method according to any one of claims 1-8.