Model training method, intent recognition method, device and related equipment

CN121092716BActive Publication Date: 2026-10-20ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511245808.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2026-10-20
Estimated Expiration
2045-09-02

AI Technical Summary

Technical Problem

但这种方法存在显著局限性:一方面,泛化性严重不足,面对语言表达的多样性和新出现的表达形式时,难以准确识别意图;另一方面,在多分类场景下,需要针对不同意图类别撰写大量规则,规则撰写工作量巨大且复杂,并且由于自然语言的无限可能性,根本无法覆盖所有实际应用场景,导致意图识别准确率低

Benefits of technology

[0027]本实施例中,采用教师模型输出的第一嵌入特征、第一意图识别结果和学生模型输出的第二嵌入特征、第二意图识别结果构建目标损失值,通过目标损失值对学生模型进行训练,使得学生模型在不输入提示词(即指令规则)的情况下,具备教师模型的意图识别能力,一方面,由于学生模型可以选用轻量级的模型,能够降低目标模型部署所需要的资源,另一方面,在采用目标模型进行推理时,只需要将指令结构化表示输入到目标模型中,并不需要向目标模型输入任何提示词,由于没有提示词,会大幅降低计算量,缩短推理耗时,进而提高响应效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121092716B_ABST
    Figure CN121092716B_ABST
Patent Text Reader

Abstract

The application discloses a model training method, an intent recognition method, a device and related equipment. The method comprises the following steps: obtaining an instruction structured representation, wherein the instruction structured representation comprises instruction text and a core syntax component in the instruction text; inputting the instruction structured representation and an instruction rule into a teacher model to obtain first embedding features and a first intent recognition result; inputting the instruction structured representation into a student model to obtain second embedding features and a second intent recognition result; determining a target loss value according to the first embedding features, the first intent recognition result, the second embedding features and the second intent recognition result; training the student model according to the target loss value, and jumping to the step of obtaining the instruction structured representation for execution until an iteration stop condition is met, and a target model is obtained. When the target model is used for reasoning, any prompt word does not need to be input into the target model. Since there is no prompt word, the reasoning time consumption is shortened, and the response efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, and in particular relates to a model training method, an intent recognition method, a device, and related equipment. Background Technology

[0002] In the current era of rapid development in artificial intelligence technology, intelligent agents have been widely applied in numerous fields such as intelligent customer service, smart homes, and intelligent vehicles. Their core capability lies in accurately understanding the ambiguous intentions of users' natural language and precisely executing instructions accordingly. However, natural language is highly flexible, ambiguous, and diverse, and users express their intentions in vastly different ways. This makes accurately identifying the ambiguous intentions of users' natural language a key technical challenge that urgently needs to be overcome in the field of intelligent agents.

[0003] Currently, in the field of user intent recognition technology, methods based on simple character rule matching have been widely adopted. This method performs pattern matching on user input using pre-defined character rules to classify intents. For example, in intelligent customer service systems, when a user's input contains keywords such as "refund" or "return," their intent is classified as an after-sales related issue. However, this method has significant limitations: firstly, its generalization ability is severely lacking, making it difficult to accurately identify intents when faced with the diversity of language expressions and newly emerging forms of expression; secondly, in multi-classification scenarios, a large number of rules need to be written for different intent categories, resulting in a huge and complex workload for rule writing. Furthermore, due to the infinite possibilities of natural language, it is impossible to cover all practical application scenarios, leading to low intent recognition accuracy.

[0004] In existing technologies, to improve the accuracy of intent recognition, a large number of rules need to be written into the prompt words, resulting in a significant increase in the length of the prompt words. During the reasoning process, longer prompt words will significantly increase the amount of computation, prolong the reasoning time, and thus reduce the response efficiency. Summary of the Invention

[0005] This application provides a model training method, intent recognition method, apparatus, and related equipment to train a lightweight student model to obtain a target model with the functions required by the teacher model. When using the target model for reasoning, no prompt words need to be input into the target model. Thus, the target model significantly reduces the amount of computation and shortens the reasoning time during the reasoning process due to the absence of prompt words, thereby improving response efficiency.

[0006] In a first aspect, embodiments of this application provide a model training method, the method comprising:

[0007] Obtain a structured representation of the instruction, which includes the instruction text and the core syntactic components in the instruction text, and the instruction text is determined according to the instruction rules;

[0008] The structured representation of the instruction and the instruction rules are input into the teacher model to obtain a first embedded feature and a first intent recognition result, wherein the first embedded feature is a vector representation of the first intent recognition result;

[0009] The structured representation of the instruction is input into the student model to obtain the second embedded feature and the second intent recognition result, wherein the second embedded feature is a vector representation of the second intent recognition result;

[0010] The target loss value is determined based on the first embedding feature, the first intent recognition result, the second embedding feature, and the second intent recognition result;

[0011] The student model is trained based on the target loss value, and then the process jumps to the step of obtaining the structured representation of the instructions until the preset iteration stopping condition is met, thus obtaining the target model.

[0012] Secondly, embodiments of this application provide an intent recognition method, the method comprising:

[0013] Obtain the structured representation of the target instruction text;

[0014] The instruction structure representation of the target instruction text is input into the target model to obtain the intent recognition result. The target model is obtained according to the model training method described in the first aspect.

[0015] Thirdly, embodiments of this application provide a model training apparatus, the apparatus comprising:

[0016] The first acquisition module is used to acquire a structured representation of instructions, which includes instruction text and core syntactic components in the instruction text, and the instruction text is determined according to instruction rules;

[0017] The second acquisition module is used to input the instruction structured representation and the instruction rules into the teacher model to obtain a first embedded feature and a first intention recognition result, wherein the first embedded feature is a vector representation of the first intention recognition result;

[0018] The third acquisition module is used to input the structured representation of the instruction into the student model to obtain the second embedded feature and the second intent recognition result, wherein the second embedded feature is a vector representation of the second intent recognition result;

[0019] The determining module is configured to determine a target loss value based on the first embedded feature, the first intent recognition result, the second embedded feature, and the second intent recognition result;

[0020] The training module is used to train the student model based on the target loss value and then jump to the step of obtaining the structured representation of the instructions until a preset iteration stopping condition is met to obtain the target model.

[0021] Fourthly, embodiments of this application provide an intent recognition device, the device comprising:

[0022] The fourth acquisition module is used to acquire the structured representation of the target instruction text;

[0023] The recognition module is used to input the instruction structured representation of the target instruction text into the target model to obtain the intent recognition result. The target model is obtained according to the model training method described in the first aspect.

[0024] Fifthly, embodiments of this application provide an electronic device, including: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the model training method as described in the first aspect or the intent recognition method as described in the second aspect.

[0025] Sixthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the model training method as described in the first aspect or the intent recognition method as described in the second aspect.

[0026] In a seventh aspect, embodiments of this application provide a computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the model training method as described in the first aspect or the intent recognition method as described in the second aspect.

[0027] In this embodiment, a target loss value is constructed using the first embedding feature and the first intent recognition result output by the teacher model, and the second embedding feature and the second intent recognition result output by the student model. The student model is trained using the target loss value, enabling the student model to have the intent recognition capability of the teacher model without inputting prompt words (i.e., instruction rules). On the one hand, since the student model can use a lightweight model, the resources required for deploying the target model can be reduced. On the other hand, when using the target model for inference, only the structured representation of the instruction needs to be input into the target model, and no prompt words need to be input into the target model. Since there are no prompt words, the amount of computation is greatly reduced, the inference time is shortened, and the response efficiency is improved. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart illustrating the model training method provided in the embodiments of this application;

[0030] Figure 2 This is another schematic diagram of the model training method provided in the embodiments of this application;

[0031] Figure 3 This is a flowchart illustrating the intent recognition method provided in an embodiment of this application;

[0032] Figure 4 This is a schematic diagram of the structure of the model training device provided in the embodiments of this application;

[0033] Figure 5 This is a schematic diagram of the structure of the intent recognition device provided in the embodiments of this application;

[0034] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0035] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0036] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0037] In all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. Additionally, when embodiments of this application require access to sensitive personal information, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.

[0038] With the rise of large language models, their powerful natural language processing capabilities have brought new solutions to intent classification. Introducing large language models into intent classification tasks and fine-tuning them to adapt to specific domains has, to some extent, improved the poor generalization problem of traditional methods. For example, in intelligent question-answering systems in the financial field, fine-tuning large language models can better understand complex user intents such as inquiries about financial products and account queries. However, to improve the model's intent recognition accuracy, a large number of rules need to be written into the prompt words. The increase in the number of rules directly leads to a continuous increase in the length of the prompt words. During the reasoning process, longer prompt words significantly increase the computational load, prolong the reasoning time, and thus reduce response efficiency.

[0039] To address the problems of the prior art, embodiments of this application provide a model training method, apparatus, device, medium, and product. The model training method provided in this application embodiment will be described first below.

[0040] Figure 1 A schematic flowchart of a model training method provided in one embodiment of this application is shown. Figure 1 As shown, the model training method provided in this application embodiment includes the following steps 101-105, wherein:

[0041] Step 101: Obtain the instruction structured representation, which includes the instruction text and the core syntactic components in the instruction text, and the instruction text is determined according to the instruction rules.

[0042] During the model training phase, a large amount of instruction text is required. To improve the efficiency of obtaining instruction text, an automatic generation method can be adopted. For example, the instruction rules can be input into a large language model, which can then generate instruction text. Alternatively, multiple templates can be configured using instruction rules, entities can be set, and then a script can be used to generate instruction text based on the templates and entities.

[0043] Instruction rules can be set from multiple dimensions such as semantics, syntax, and pragmatics, which can more comprehensively cover the diversity of user intent expression. Taking the intelligent agent text content generation task as an example, "generating a news speech" and "generating meeting minutes" correspond to different instruction rules. The instruction rule for "generating a news speech" focuses on the semantic news value and propaganda appeal, adopts standard written sentence structure, and is pragmatically geared towards public media. The news speech generated according to this instruction rule is an instruction text. The instruction rule for "generating meeting minutes" emphasizes the semantic objective and truthful recording, adopts a bullet-point structure, and serves as a reference for participants and subsequent departmental work. The meeting minutes generated according to this instruction rule is an instruction text.

[0044] The core grammatical components in the instruction text can include a subject, a predicate, and an object, where there can be one or more of each.

[0045] Step 102: Input the structured representation of the instruction and the instruction rules into the teacher model to obtain the first embedded feature and the first intention recognition result, wherein the first embedded feature is the vector representation of the first intention recognition result.

[0046] The structured representation of the instruction and the instruction rules are input into the teacher model. The instruction rules serve as prompt words, which help the teacher model to identify the intent of the instruction text based on the instruction rules. The intermediate layer of the teacher model (e.g., the intermediate layer connected to the final output layer) generates the first embedding feature, and the final output layer of the teacher model outputs the first intent recognition result.

[0047] Step 103: Input the structured representation of the instruction into the student model to obtain the second embedded feature and the second intent recognition result, wherein the second embedded feature is a vector representation of the second intent recognition result.

[0048] The input to the student model is only a structured representation of instructions, without instruction rules. The student model can use a lightweight model, which can reduce the resources required for student model deployment.

[0049] The second embedding feature is output from an intermediate layer of the student model. For example, the second embedding feature could be output from an intermediate layer connected to the final output layer of the student model, with the final output layer of the student model outputting the second intent recognition result. It should be noted that the second embedding feature and the first embedding feature have the same dimension.

[0050] Step 104: Determine the target loss value based on the first embedding feature, the first intent recognition result, the second embedding feature, and the second intent recognition result.

[0051] The loss value is an indicator used to evaluate the difference between the output of the teacher model and the output of the student model. In this step, an appropriate loss function can be selected, and the target loss value is determined based on the first embedded feature, the first intent recognition result, the second embedded feature, and the second intent recognition result. The loss function can be chosen according to the actual situation and is not limited here.

[0052] For example, a loss value can be calculated based on the first embedding feature and the second embedding feature, and a loss value can be obtained based on the first intent recognition result and the second intent recognition result. The two loss values ​​are then weighted and summed to obtain the target loss value.

[0053] Step 105: Train the student model according to the target loss value, and then proceed to the step of obtaining the structured representation of the instruction until the preset iteration stopping condition is met to obtain the target model.

[0054] The student model is trained using a target loss value. Specifically, the parameters of the student model are adjusted so that the student model can recognize the intent of the teacher model even without input prompts (i.e., instruction rules).

[0055] The iteration stopping condition can be preset. For example, the iteration stopping condition includes: the decrease in the target loss value is less than a first preset threshold for multiple consecutive training cycles. The difference between the target loss value in the (i-1)th training cycle and the target loss value in the (i-1)th training cycle is less than the first preset threshold; and the difference between the target loss value in the (i-2)th training cycle and the target loss value in the (i-1)th training cycle is less than the first preset threshold. In other words, the decrease in the target loss value is less than the first preset threshold for two consecutive training cycles. In this case, it indicates that the student model has basically converged. To avoid wasting computing resources, training is stopped, the student model training is complete, and the student model can be used as the target model. For example, the first preset threshold can be 0.01.

[0056] In this embodiment, a target loss value is constructed using the first embedding feature and the first intent recognition result output by the teacher model, and the second embedding feature and the second intent recognition result output by the student model. The student model is trained using the target loss value, enabling the student model to possess the intent recognition capability of the teacher model without inputting prompt words (i.e., instruction rules). On the one hand, since the student model can be a lightweight model, the resources required for deploying the target model can be reduced. On the other hand, when using the target model for inference, only the structured representation of the instruction needs to be input into the target model, and no prompt words are required. Thus, the target model significantly reduces the amount of computation and shortens the inference time during the inference process due to the absence of prompt words, thereby improving response efficiency.

[0057] In one embodiment of this application, the structured representation of the acquisition instruction includes:

[0058] The instruction rules are input into a large language model to obtain the instruction text, and / or, the instruction text is generated using a script program based on a pre-configured template and entities, wherein the template is configured according to the instruction rules;

[0059] The instruction text is subjected to syntactic analysis to obtain the structured representation of the instruction.

[0060] Specifically, to improve the efficiency of command text acquisition, this application provides two methods for automatically acquiring command text. One method uses a large language model, inputting command rules into the large language model to generate command text. The other method uses a script to generate a large number of command texts in batches. When using a script, templates and entities need to be pre-configured. For example, based on the command rules, the template is configured to generate statements containing the keyword "XX," and the entity is "classical music." When generating command text, the script fills the "XX" field in the template with the entity "classical music," resulting in the command text: statements containing the keyword "classical music." By combining entities with fixed templates, the script can flexibly generate different types of commands with high generation efficiency and controllability.

[0061] The instruction text is parsed to obtain the grammatical components and the relationships between them, and a structured representation of the instruction is constructed.

[0062] In this embodiment, two methods for automatically generating instruction text are provided, which can improve the efficiency of instruction text acquisition and save labor costs.

[0063] In one embodiment of this application, the step of performing syntactic analysis on the instruction text to obtain the structured representation of the instruction includes:

[0064] The instruction text is segmented according to the smallest semantic unit to obtain multiple target semantic units;

[0065] Each target semantic unit is subjected to part-of-speech tagging and syntactic analysis to obtain the syntactic attributes of each target semantic unit and the syntactic function of each target semantic unit in the instruction text;

[0066] Based on the syntactic attributes of each target semantic unit and the syntactic function of each target semantic unit in the instruction text, the core syntactic components in the instruction text are determined.

[0067] In the above process, natural language processing (NLP) techniques are used to finely deconstruct the generated instruction text. First, word segmentation is employed to divide the instruction text into the smallest semantic units, which are referred to as target semantic units for ease of description. Then, part-of-speech tagging and syntactic analysis are used to identify the grammatical attributes and grammatical functions of each target semantic unit within the instruction text. Based on this, named entity recognition and semantic role labeling are used to extract core grammatical components such as subject, predicate, and object from the instruction text. For complex instruction texts, semantic dependency analysis is also performed to uncover the semantic relationships between components, thereby constructing a complete and accurate structured representation of the instruction. This structured representation includes the instruction text, its subject, predicate, object, and the semantic relationships between them. This structured representation not only provides clear and standardized input data for subsequent student model training, but also helps improve the accuracy and efficiency of the student model's understanding of the instruction text's intent, enabling the agent to more accurately identify user intent and execute corresponding operations.

[0068] In one embodiment of this application, the instruction structured representation further includes semantic associations between various core grammatical components in the instruction text, wherein the semantic associations between various core grammatical components are obtained by performing semantic dependency analysis on the instruction text when each core grammatical component satisfies preset conditions.

[0069] The preset conditions include at least one of the following:

[0070] There are multiple core grammatical components marked as subjects;

[0071] There are multiple core grammatical components marked as predicates;

[0072] There are multiple core grammatical components marked as objects.

[0073] In this embodiment, named entity recognition and semantic role labeling are used to extract core grammatical components such as subject, predicate, and object from the instruction text. If the preset conditions are met, semantic dependency analysis is performed on the instruction text to obtain the semantic relationships between the core grammatical components. These semantic relationships can help the teacher model understand the intent of the instruction text and improve the accuracy of intent recognition.

[0074] In one embodiment of this application, determining a target loss value based on the first embedding feature, the first intent recognition result, the second embedding feature, and the second intent recognition result includes:

[0075] The second embedding feature is fused with the rule embedding feature to obtain the third embedding feature, wherein the parameter values ​​of the rule embedding feature are random numbers during initialization;

[0076] Based on the first embedding feature and the third embedding feature, a first loss value is obtained;

[0077] Based on the first intent recognition result and the second intent recognition result, a second loss value is obtained;

[0078] The target loss value is obtained based on the first loss value and the second loss value.

[0079] Specifically, the rule embedding feature and the second embedding feature have the same dimension. The parameter values ​​of the rule embedding feature are initialized with random numbers, and the parameter values ​​of the rule embedding feature are also adjusted when training the student model.

[0080] The fusion of the second embedding feature and the rule embedding feature can be understood as the addition of the second embedding feature and the rule embedding feature to obtain the third embedding feature. In this embodiment, the target loss value consists of two parts: the first part is the first loss value determined by the first embedding feature and the third embedding feature; the second part is the second loss value determined by the first intent recognition result and the second intent recognition result.

[0081] The student model is trained using a target loss value, enabling it to recognize the teacher model's intent without inputting prompts (i.e., instruction rules).

[0082] Accordingly, training the student model based on the target loss value includes:

[0083] The parameters of the student model and the parameters of the rule embedding features are adjusted based on the target loss value. By training the student model with the target loss value, the student model can achieve the intent recognition ability of the teacher model without inputting prompts (i.e., instruction rules). Furthermore, the parameters of the rule embedding features are adjusted based on the target loss value. Through continuous optimization, the final rule embedding features can serve as a vector representation of the instruction rules.

[0084] In this embodiment of the application, obtaining the target loss value based on the first loss value and the second loss value includes:

[0085] In each iteration, obtain M third embedding features, M first loss values ​​and M second loss values ​​obtained in this iteration, where M is a positive integer greater than 1;

[0086] The dispersion loss is calculated for the M third embedding features to obtain the dispersion loss value;

[0087] The mean of the first loss is calculated by averaging the M first loss values;

[0088] The mean of the second loss is calculated by taking the average of the M second loss values;

[0089] The target loss value is obtained by performing a weighted summation operation on the dispersed loss value, the first loss mean, and the second loss mean.

[0090] In this embodiment, multiple iterations are required during the training of the student model. In each iteration, M different instruction texts are used. For each instruction text, a corresponding third embedding feature, a first loss value, and a second loss value can be obtained. The specific acquisition method is described above and will not be repeated here. In each iteration, the rule embedding feature used for each instruction text is the same, which is the rule embedding feature obtained after adjustment in the previous iteration.

[0091] Discretization loss functions, such as dispersive loss, are used as optimization strategies to enhance the discreteness of intent features. By forcing instruction texts with different intents to be dispersed as much as possible in the feature vector space, and instruction texts with the same intent to be aggregated in the feature vector space, clear distinction of intents is achieved.

[0092] During the training of the student model, the Dispersive loss function (used to determine the dispersion loss value) and the knowledge distillation loss function (used to determine the first and second loss values) work together. In each training iteration, the student model first processes the instruction text to generate corresponding third embedded features. Then, the Dispersive loss function analyzes these feature vectors, calculates the degree of dispersion between different intentions, and generates the dispersion loss value based on the calculation logic of the Dispersive loss function. This dispersion loss value, through backpropagation, guides the student model to adjust parameters specifically, strengthening the separation effect of features representing different intentions. Taking an intelligent customer service scenario as an example, when a user inputs two similar but different instructions, "Help me summarize the full text as a summary" and "Help me summarize the summary of the full text," the Dispersive loss function will push the student model during training to stretch the features representing the intention of "Help me summarize the full text as a summary" and the features representing the intention of "Help me summarize the summary of the full text" in different directions of the feature space, creating a clear gap between them. This allows the trained target model to achieve accurate intent differentiation when faced with semantically ambiguous instruction text, improving recognition accuracy. The knowledge distillation loss function ensures that the student model learns accurate semantic representations and rule constraints from the teacher model, guaranteeing the accuracy of intent understanding.

[0093] In this embodiment, during each iteration, the dispersion loss value, the first mean loss, and the second mean loss are calculated based on the M instruction texts of that iteration. The dispersion loss value is calculated using the dispersion loss function, the first mean loss is calculated using the M first loss values, and the second mean loss is calculated using the M second loss values. The first and second loss values ​​are calculated using the knowledge distillation loss function. Through this dual optimization mechanism, the student model can accurately capture the intent differences between instructions while maintaining a correct understanding of the instruction text.

[0094] In another embodiment of this application, determining the target loss value based on the first embedding feature, the first intent recognition result, the second embedding feature, and the second intent recognition result includes:

[0095] The second embedding feature is fused with the rule embedding feature to obtain the third embedding feature, wherein the parameter values ​​of the rule embedding feature are random numbers during initialization;

[0096] The dispersion loss is calculated for the third embedded feature to obtain the dispersion loss value;

[0097] Based on the first embedding feature and the third embedding feature, a first loss value is obtained;

[0098] Based on the first intent recognition result and the second intent recognition result, a second loss value is obtained;

[0099] The target loss value is obtained by performing a weighted summation operation on the dispersed loss value, the first loss mean, and the second loss mean.

[0100] Specifically, the rule embedding feature and the second embedding feature have the same dimension. The parameter values ​​of the rule embedding feature are initialized with random numbers, and the parameter values ​​of the rule embedding feature are also adjusted when training the student model.

[0101] The fusion of the second embedding feature and the rule embedding feature can be understood as the addition of the second embedding feature and the rule embedding feature to obtain the third embedding feature.

[0102] Discretization loss functions, such as dispersive loss, are used as optimization strategies to enhance the discreteness of intent features. By forcing instruction texts with different intents to be dispersed as much as possible in the feature vector space, and instruction texts with the same intent to be aggregated in the feature vector space, clear distinction of intents is achieved.

[0103] During the training of the student model, the Dispersive loss function (used to determine the dispersion loss value) and the knowledge distillation loss function (used to determine the first and second loss values) work together. In each training iteration, the student model first processes the instruction text to generate corresponding third embedded features. Then, the Dispersive loss function analyzes these feature vectors, calculates the degree of dispersion between different intentions, and generates the dispersion loss value based on the calculation logic of the Dispersive loss function. This dispersion loss value, through backpropagation, guides the student model to adjust parameters specifically, strengthening the separation effect of features representing different intentions. Taking an intelligent customer service scenario as an example, when a user inputs two similar but different instructions, "Help me summarize the full text as a summary" and "Help me summarize the summary of the full text," the Dispersive loss function will push the student model during training to stretch the features representing the intention of "Help me summarize the full text as a summary" and the features representing the intention of "Help me summarize the summary of the full text" in different directions of the feature space, creating a clear gap between them. This allows the trained target model to achieve accurate intent differentiation when faced with semantically ambiguous instruction text, improving recognition accuracy. The knowledge distillation loss function ensures that the student model learns accurate semantic representations and rule constraints from the teacher model, guaranteeing the accuracy of intent understanding.

[0104] In this embodiment, through the aforementioned dual optimization mechanism, the student model can accurately capture the differences in intent between instructions while maintaining a correct understanding of the instruction text.

[0105] The intent recognition method provided in the embodiments of this application will be illustrated by examples below. Figure 2 The diagram shown is another flowchart illustrating the model training method provided in this application embodiment. Figure 2 As shown, it includes the instruction generation and parsing stage and the teacher-student distillation learning architecture construction stage.

[0106] During the instruction generation and parsing phase, instruction rules can be constructed based on product definitions and industry practices. Large language models or scripts can then be used to generate instruction text that conforms to these rules. The instruction text is then deconstructed to extract core grammatical components such as subject, predicate, and object, providing input data for the subsequent training of the student model. This input data constitutes the structured representation of the instructions.

[0107] The teacher-student distillation learning architecture construction phase aims to integrate instruction rules into the student model to obtain the target model, thereby improving the inference efficiency of the target model. Specifically, the parsed instruction structured representation and instruction rules are input into the teacher model to generate the corresponding first embedded features and first intent recognition results. The student model then uses the instruction structured representation as its sole input and, through parameter optimization algorithms such as gradient descent, aligns with the teacher model at the levels of embedded feature space and intent recognition results, thereby achieving knowledge distillation and rule internalization.

[0108] To address the challenge of intent segmentation for ambiguous instructions, this application introduces a discrete optimization objective function during the student model optimization process. This function maximizes the distance between instructions with different intents in the embedded feature space, enabling instructions with similar text but different intents to be clearly distinguished at the feature level, thereby improving the accuracy and robustness of the target model in recognizing the intent of ambiguous instructions.

[0109] The core principle of this application is to improve inference efficiency by designing a distillation learning paradigm that integrates instruction rules into the student model parameters. Furthermore, it achieves accurate intent determination for easily confused instructions with similar texts through instruction component analysis and intent space discrete loss optimization.

[0110] In the instruction generation and parsing phase, rules are systematically organized from multiple dimensions, including semantics, syntax, and pragmatics, based on established industry conventions and common language expression paradigms. Through in-depth analysis of a large amount of industry text data and user interaction history, core elements covering various intention expressions are extracted, thereby constructing a targeted and universal "instruction rule" library for different intelligent agent tasks. These rules are not simply a list of keywords, but include multi-level information such as word collocation patterns, sentence structure features, and semantic logical relationships, thus comprehensively covering the diversity of user intention expressions. Taking the intelligent agent text content generation task as an example, "generating news speeches" and "generating meeting minutes" correspond to different rules. The rules for "generating news speeches" focus on the semantic news value and persuasiveness, using standard written sentence structures, and are pragmatically geared towards public media. The rules for "generating meeting minutes" emphasize the objective and truthful recording of semantics, using a bullet-point structure, and serving as a reference for participants and subsequent departmental work.

[0111] Instruction generation (i.e., instruction text) is primarily achieved through two approaches. First, leveraging the powerful natural language generation capabilities of large language models, "instruction rules" are taken as input. Combined with specific instruction generation task requirements, appropriate parameters and generation strategies are set to drive the large language model to generate compliant instructions. During generation, the large language model outputs instruction samples (i.e., queries) based on its massive pre-trained language knowledge and rule-guided targeted generation. Second, instruction generation is achieved using script programs. Based on pre-written templates and entities, script programs can efficiently and quickly generate a large number of instructions. This approach is particularly suitable for scenarios with clear structure requirements and batch generation needs. By combining parameterized inputs (i.e., entities) with fixed templates, script programs can flexibly generate different types of instructions with high generation efficiency and controllability.

[0112] During the instruction component parsing process, natural language processing (NLP) techniques are employed to meticulously deconstruct the generated instruction text. Specifically, word segmentation is first used to divide the instruction text into the smallest semantic units. Then, through techniques such as part-of-speech tagging and syntactic analysis, the grammatical attributes and grammatical functions of each semantic unit are accurately identified. Building upon this, named entity recognition and semantic role labeling are used to precisely extract core grammatical components such as subject, predicate, and object from the instruction. For complex instructions, semantic dependency analysis is also performed to uncover the semantic relationships between components, thereby constructing a complete and accurate structured representation of the instruction. This structured output not only provides clear and standardized input data for subsequent model training, helping to improve the accuracy and efficiency of the model's understanding of instruction intent, but also lays a solid foundation for the agent to quickly and accurately parse user input instructions in practical applications, enabling the agent to more accurately identify user intent and execute corresponding operations.

[0113] The teacher-student distillation architecture is a classic paradigm for lightweight models. It constructs a wide-ranging and diverse set of questions, uses a teacher model with a large number of parameters and excellent performance to generate accurate answers, and then trains a student model with a small number of parameters based on question-answer pair samples. This gives the student model the efficient reasoning ability of a small model and the high accuracy of the teacher model.

[0114] Regarding the model input mechanism, traditional architectures often use the original question as the input to both teacher and student models. This application, however, inputs the structured representation of the instruction and instruction rules into the teacher model, enabling it to generate embedded features (the vector output from the penultimate layer of the large model, or other intermediate layers, which is the first embedded feature) and a generated result (i.e., the first intent recognition result) through complex neural network operations. The student model, on the other hand, only uses the parsed instruction as a single input. This differentiated design reduces the student model's dependence on rules and lowers input complexity. In terms of the distillation alignment strategy, this application not only captures the deep representation of the instruction semantics at the embedded feature layer but also calibrates the accuracy of the generated result at the model's target output layer (i.e., the output layer that outputs the intent recognition result), achieving two-dimensional distillation alignment. Simultaneously, training the rule embedding part greatly reduces training parameters and computational cost, achieving efficient transfer of knowledge from the large model and deep internalization of instruction rules with minimal training cost, significantly improving intent recognition accuracy and inference efficiency.

[0115] Taking intelligent customer service scenarios as an example, when a user inquires, "My purchased product has a quality problem, how do I handle it?", a traditional teacher-student distillation architecture might directly input the question into both the teacher and student models simultaneously. While the teacher model can accurately determine the intent as after-sales rights protection, the student model, lacking targeted learning of after-sales handling rules, may misjudge. In this application, the teacher model receives input that integrates "after-sales problem handling rules" and parsed instructions, generating embedded features containing key problem elements and after-sales handling process constraints, and an accurate response, "You can first provide pictures of the product problem, and we will arrange a return or exchange for you." The student model only receives the parsed instructions. During training, it aligns with the teacher model through the embedded feature layer, learns the semantic features and rule information of after-sales problems, calibrates the accuracy of the response at the target output layer, and finally trains the rule embedding parameters (which the student model also needs to train). This allows it to quickly and accurately output solutions that conform to after-sales rules, ensuring both the accuracy of intent recognition and significantly shortening inference time, thus improving the efficiency of user inquiry response.

[0116] In this embodiment, matching instruction text is generated based on different instruction rules. Simultaneously, a lightweight student model is trained to deeply learn and memorize the instruction rule patterns of the teacher model. This enables the target model to possess "rule-free" capabilities during the reasoning phase, allowing it to accurately understand intent even in the absence of explicit instruction rules, significantly improving reasoning efficiency and response speed.

[0117] To address the issue of semantically similar statements being easily confused in large models, this application proposes a two-stage processing strategy. The first stage utilizes deep instruction component analysis technology to accurately extract key elements such as the executing subject, the executed subject, and the task form, reconstructing the instruction expression structure and effectively improving the model's ability to recognize semantic information, thus mitigating semantic ambiguity caused by text similarity. The second stage introduces a discretization loss function, which optimizes the feature space distribution, forcing the feature vectors of different semantic instructions to achieve spatial discretization. This further enhances semantic distinguishability at the feature representation level and significantly reduces the probability of semantic confusion.

[0118] Figure 3 This is a flowchart illustrating the intent recognition method provided in an embodiment of this application. (Refer to...) Figure 3 The intent recognition method provided in this application includes the following steps 301-302, wherein:

[0119] Step 301: Obtain the instruction structured representation of the target instruction text;

[0120] The target instruction text can be obtained from user input, which can be in text or speech form. If it is a speech instruction, it needs to be converted into text. After obtaining the target instruction text, syntactic analysis is performed to obtain a structured representation of the target instruction text. This structured representation includes the instruction text itself and its core syntactic components.

[0121] Step 302: Input the instruction structured representation of the target instruction text into the target model to obtain the intent recognition result.

[0122] In this embodiment, when using the target model to identify the intent of the target instruction text, it is only necessary to input the structured representation of the target instruction text into the target model, without needing to input any prompt words into the target model. Since there are no prompt words, the amount of computation is greatly reduced, the reasoning time is shortened, and the response efficiency is improved.

[0123] Figure 4 A schematic diagram of the model training apparatus provided in an embodiment of this application is shown. Figure 4 As shown, the model training device 400 includes:

[0124] The first acquisition module 401 is used to acquire a structured representation of an instruction, the structured representation of which includes instruction text and core syntactic components in the instruction text, the instruction text being determined according to instruction rules;

[0125] The second acquisition module 402 is used to input the instruction structured representation and the instruction rules into the teacher model to obtain a first embedded feature and a first intention recognition result, wherein the first embedded feature is a vector representation of the first intention recognition result;

[0126] The third acquisition module 403 is used to input the instruction structured representation into the student model to obtain the second embedded feature and the second intent recognition result, wherein the second embedded feature is a vector representation of the second intent recognition result;

[0127] The determining module 404 is used to determine the target loss value based on the first embedding feature, the first intent recognition result, the second embedding feature, and the second intent recognition result;

[0128] The training module 405 is used to train the student model according to the target loss value and trigger the execution of the first acquisition module 401 until the preset iteration stopping condition is met to obtain the target model.

[0129] In one embodiment of this application, the first acquisition module 401 includes:

[0130] The first acquisition submodule is used to input the instruction rules into the large language model to obtain the instruction text, and / or to use a script program to generate the instruction text based on a pre-configured template and entity, wherein the template is configured according to the instruction rules;

[0131] The second acquisition submodule is used to perform syntactic analysis on the instruction text to obtain the structured representation of the instruction.

[0132] In one embodiment of this application, the second acquisition submodule includes:

[0133] The first acquisition unit is used to segment the instruction text according to the smallest semantic unit to obtain multiple target semantic units;

[0134] The second acquisition unit is used to perform part-of-speech tagging and syntactic analysis on each target semantic unit to obtain the syntactic attributes of each target semantic unit and the syntactic function of each target semantic unit in the instruction text;

[0135] The third acquisition unit is used to determine the core grammatical components in the instruction text based on the grammatical attributes of each target semantic unit and the grammatical function of each target semantic unit in the instruction text.

[0136] In one embodiment of this application, the instruction structured representation further includes semantic associations between various core grammatical components in the instruction text, wherein the semantic associations between various core grammatical components are obtained by performing semantic dependency analysis on the instruction text when each core grammatical component satisfies preset conditions.

[0137] The preset conditions include at least one of the following:

[0138] There are multiple core grammatical components marked as subjects;

[0139] There are multiple core grammatical components marked as predicates;

[0140] There are multiple core grammatical components marked as objects.

[0141] In one embodiment of this application, the determining module 404 includes:

[0142] The first determining submodule is used to fuse the second embedding feature with the rule embedding feature to obtain the third embedding feature, wherein the parameter value of the rule embedding feature is a random number during initialization;

[0143] The second determining submodule is used to obtain a first loss value based on the first embedding feature and the third embedding feature;

[0144] The third determining submodule is used to obtain a second loss value based on the first intent recognition result and the second intent recognition result;

[0145] The fourth determining submodule is used to obtain the target loss value based on the first loss value and the second loss value, and the target loss value is also used to adjust the parameter values ​​of the rule embedding feature.

[0146] In one embodiment of this application, the fourth determining submodule includes:

[0147] The first determining unit is used to obtain M third embedding features, M first loss values ​​and M second loss values ​​obtained in each iteration, where M is a positive integer greater than 1;

[0148] The first calculation unit is used to calculate the dispersion loss of the M third embedded features to obtain the dispersion loss value;

[0149] The second calculation unit is used to calculate the mean of the M first loss values ​​to obtain the first loss mean;

[0150] The third calculation unit is used to calculate the mean of the M second loss values ​​to obtain the second loss mean;

[0151] The fourth calculation unit is used to perform a weighted summation operation on the dispersed loss value, the first loss mean, and the second loss mean to obtain the target loss value.

[0152] In one embodiment of this application, the training module 405 is specifically used for:

[0153] The parameter values ​​of the student model and the parameter values ​​of the rule embedding features are adjusted according to the target loss value.

[0154] In another embodiment of this application, the determining module 404 includes:

[0155] The first determining submodule is used to fuse the second embedding feature with the rule embedding feature to obtain the third embedding feature, wherein the parameter value of the rule embedding feature is a random number during initialization;

[0156] The first calculation submodule is used to calculate the dispersion loss of the third embedded feature to obtain the dispersion loss value;

[0157] The second determining submodule is used to obtain a first loss value based on the first embedding feature and the third embedding feature;

[0158] The third determining submodule is used to obtain a second loss value based on the first intent recognition result and the second intent recognition result;

[0159] The second calculation submodule is used to perform a weighted summation operation on the dispersed loss value, the first loss mean, and the second loss mean to obtain the target loss value.

[0160] The model training device 400 provided in this application embodiment can implement the various processes implemented in the aforementioned model training method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0161] Figure 5 A schematic diagram of the intent recognition device provided in an embodiment of this application is shown. Figure 5 As shown, the intent recognition device 500 includes:

[0162] The fourth acquisition module 501 is used to acquire the instruction structured representation of the target instruction text;

[0163] The recognition module 502 is used to input the instruction structured representation of the target instruction text into the target model to obtain the intent recognition result.

[0164] The intent recognition device 500 provided in this application embodiment can implement the various processes implemented in the aforementioned intent recognition method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0165] Figure 6 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0166] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0167] Specifically, the processor 601 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0168] Memory 602 may include mass storage for data or instructions. For example, and not limitingly, memory 602 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 602 may include removable or non-removable (or fixed) media. Where appropriate, memory 602 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 602 is non-volatile solid-state memory.

[0169] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to the first or second aspect of this disclosure.

[0170] The processor 601 implements any of the information auditing methods described in the above embodiments by reading and executing computer program instructions stored in the memory 602.

[0171] In one example, the electronic device may also include a communication interface 603 and a bus 610. For example, Figure 6 As shown, the processor 601, memory 602, and communication interface 603 are connected through bus 610 and complete communication with each other.

[0172] The communication interface 603 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0173] Bus 610 includes hardware, software, or both, that couples components of an information auditing method or verification device together. For example, and not as a limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 610 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0174] Furthermore, in conjunction with the model training methods described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the model training methods or intent recognition methods described in the above embodiments.

[0175] This application also provides a computer program product, wherein when the instructions in the computer program product are executed by the processor of an electronic device, the electronic device performs any of the model training methods or intent recognition methods described in the above embodiments.

[0176] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described as examples. However, the method process of this application is not limited to the specific steps described. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0177] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0178] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0179] The foregoing flowcharts and / or block diagrams of methods, apparatus (systems) according to embodiments of the present disclosure have described various aspects of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0180] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A model training method, characterized in that, The method includes: Obtain a structured representation of instructions, which includes instruction text and core syntactic components within the instruction text, the instruction text being determined according to instruction rules; The structured representation of the instruction and the instruction rules are input into the teacher model to obtain a first embedded feature and a first intent recognition result, wherein the first embedded feature is a vector representation of the first intent recognition result; The structured representation of the instruction is input into the student model to obtain the second embedded feature and the second intent recognition result, wherein the second embedded feature is a vector representation of the second intent recognition result; The second embedding feature is fused with the rule embedding feature to obtain the third embedding feature, wherein the parameter values ​​of the rule embedding feature are random numbers during initialization; The target loss value is determined based on the first embedding feature, the first intent recognition result, the third embedding feature, and the second intent recognition result; The student model is trained based on the target loss value, and then the process jumps to the step of obtaining the structured representation of the instructions until the preset iteration stopping condition is met, thus obtaining the target model.

2. The model training method according to claim 1, characterized in that, The structured representation of the acquisition instruction includes: The instruction rules are input into a large language model to obtain the instruction text, and / or, the instruction text is generated using a script program based on a pre-configured template and entities, wherein the template is configured according to the instruction rules; The instruction text is subjected to syntactic analysis to obtain the structured representation of the instruction.

3. The model training method according to claim 2, characterized in that, The step of performing syntactic analysis on the instruction text to obtain the structured representation of the instruction includes: The instruction text is segmented according to the smallest semantic unit to obtain multiple target semantic units; Each target semantic unit is subjected to part-of-speech tagging and syntactic analysis to obtain the syntactic attributes of each target semantic unit and the syntactic function of each target semantic unit in the instruction text; Based on the syntactic attributes of each target semantic unit and the syntactic function of each target semantic unit in the instruction text, the core syntactic components in the instruction text are determined.

4. The model training method according to any one of claims 1-3, characterized in that, The structured representation of the instruction also includes the semantic associations between the core syntactic components in the instruction text. The semantic associations between the core syntactic components are obtained by performing semantic dependency analysis on the instruction text when each core syntactic component meets a preset condition. The preset conditions include at least one of the following: There are multiple core grammatical components marked as subjects; There are multiple core grammatical components marked as predicates; There are multiple core grammatical components marked as objects.

5. The model training method according to any one of claims 1-3, characterized in that, Based on the first embedding feature, the first intent recognition result, the third embedding feature, and the second intent recognition result, the target loss value is determined, including: Based on the first embedding feature and the third embedding feature, a first loss value is obtained; Based on the first intent recognition result and the second intent recognition result, a second loss value is obtained; The target loss value is obtained based on the first loss value and the second loss value.

6. The model training method according to claim 5, characterized in that, The target loss value is obtained based on the first loss value and the second loss value, including: In each iteration, obtain M third embedding features, M first loss values ​​and M second loss values ​​obtained in this iteration, where M is a positive integer greater than 1; The dispersion loss is calculated for the M third embedding features to obtain the dispersion loss value; The mean of the first loss is calculated by averaging the M first loss values; The mean of the second loss is calculated by taking the average of the M second loss values; The target loss value is obtained by performing a weighted summation operation on the dispersed loss value, the first loss mean, and the second loss mean.

7. The model training method according to claim 5, characterized in that, Training the student model based on the target loss value includes: The parameter values ​​of the student model and the parameter values ​​of the rule embedding features are adjusted according to the target loss value.

8. The model training method according to claim 1, characterized in that, Based on the first embedding feature, the first intent recognition result, the third embedding feature, and the second intent recognition result, the target loss value is determined, including: The dispersion loss is calculated for the third embedded feature to obtain the dispersion loss value; Based on the first embedding feature and the third embedding feature, a first loss value is obtained; Based on the first intent recognition result and the second intent recognition result, a second loss value is obtained; The target loss value is obtained by performing a weighted summation operation on the dispersion loss value, the first loss value, and the second loss value.

9. An intent recognition method, characterized in that, The method includes: Obtain the structured representation of the target instruction text; The instruction structure representation of the target instruction text is input into the target model to obtain the intent recognition result. The target model is obtained by the model training method according to any one of claims 1-8.

10. A model training device, characterized in that, The device includes: The first acquisition module is used to acquire a structured representation of instructions, which includes instruction text and core syntactic components in the instruction text, and the instruction text is determined according to instruction rules; The second acquisition module is used to input the instruction structured representation and the instruction rules into the teacher model to obtain a first embedded feature and a first intention recognition result, wherein the first embedded feature is a vector representation of the first intention recognition result; The third acquisition module is used to input the structured representation of the instruction into the student model to obtain the second embedded feature and the second intent recognition result, wherein the second embedded feature is a vector representation of the second intent recognition result; The determination module is used to fuse the second embedding feature with the rule embedding feature to obtain a third embedding feature. The parameter value of the rule embedding feature is initialized with a random number. The target loss value is determined based on the first embedding feature, the first intent recognition result, the third embedding feature and the second intent recognition result. The training module is used to train the student model based on the target loss value and then jump to the step of obtaining the structured representation of the instructions until a preset iteration stopping condition is met to obtain the target model.

11. An intent recognition device, characterized in that, The device includes: The fourth acquisition module is used to acquire the structured representation of the target instruction text. The recognition module is used to input the instruction structured representation of the target instruction text into the target model to obtain the intent recognition result, wherein the target model is obtained by the model training method according to any one of claims 1-8.

12. An electronic device, characterized in that, include: Processor and memory storing computer program instructions; When the processor executes the computer program instructions, it implements the model training method as described in any one of claims 1-8, or when the processor executes the computer program instructions, it implements the intent recognition method as described in claim 9.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the model training method as described in any one of claims 1-8, or, when executed by a processor, implement the intent recognition method as described in claim 9.

14. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the model training method as described in any one of claims 1-8 or the intent recognition method as described in claim 9.

Citation Information

Patent Citations

  • Intention recognition model training method and device, electronic equipment and storage medium

    CN115130684A

  • Data processing method and related equipment

    CN119537526A