Conversation feedback data determination method and device and electronic equipment
By determining the target dialogue scene and templates and using the structured target template to generate target text, the problem of insufficient classification accuracy of dialogue labels in long text and multiple rounds of dialogue is solved, and more accurate semantic understanding is achieved.
Patent Information
- Application Number
- CN202411782617.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-18
AI Technical Summary
When dealing with long text and multiple rounds of dialogue, the classification accuracy of dialogue tags in the prior art is insufficient, resulting in inaccurate semantic understanding.
By obtaining the target dialogue data, determining its corresponding target dialogue scenarios and templates, using the structured target template to fill in the dialogue data to generate target text, and then determining the target dialogue tag and feedback data.
It improves the accuracy and efficiency of dialogue tag classification, ensures the accuracy of semantic understanding when dealing with long text and multiple rounds of dialogue, and solves the problem of insufficient accuracy of dialogue tag classification.
Smart Images

Figure CN119848251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device and electronic device for determining dialogue feedback data. Background Art
[0002] In related technologies, when processing conversations, traditional pre-trained models such as BERT and Electra are used for conversation classification and semantic understanding. However, when processing long texts and multi-round conversations, the classification accuracy of conversation labels is insufficient, leading to technical problems such as inaccurate semantic understanding.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method, device and electronic device for determining dialogue feedback data, so as to at least solve the technical problem that when processing long texts and multi-round dialogues, dialogue tag classification accuracy is insufficient, resulting in inaccurate semantic understanding.
[0005] According to one aspect of an embodiment of the present invention, there is provided a method for determining dialogue feedback data, comprising: acquiring target dialogue data; determining a target dialogue scene corresponding to the target dialogue data; determining a target template corresponding to the target dialogue scene, wherein the target template comprises fixed items and interactive items, the fixed items comprising scene items and candidate label items, the scene items being text items describing corresponding candidate dialogue scenes, the candidate label items being selection items comprising a plurality of candidate labels corresponding to the candidate dialogue scenes, and the interactive items being items to be filled in, corresponding to the dialogue data; filling in the interactive items in the target template according to the target dialogue data to obtain a target text; determining a target dialogue label corresponding to the target dialogue data according to the target text; and determining target feedback data corresponding to the target dialogue data according to the target dialogue label.
[0006] Optionally, determining the target feedback data corresponding to the target dialogue data based on the target dialogue label includes: calling a target dialogue processing model, wherein the target dialogue processing model is obtained by training an initial model based on first sample data, the first sample data includes multiple sample pairs, each of the multiple sample pairs includes sample dialogue data, a sample dialogue label corresponding to the sample dialogue data, and a sample template corresponding to the sample dialogue data; inputting the target text into a label determination module of the target dialogue processing model to determine the target dialogue label corresponding to the target dialogue data; inputting the target dialogue label into a semantic understanding module of the target dialogue processing model to determine the target feedback data corresponding to the target dialogue data.
[0007] Optionally, before calling the target dialogue processing model, it also includes: obtaining the initial model; determining a target layer corresponding to the initial model, wherein the target layer is provided with an initial matrix, and the initial matrix includes initial setting parameters of the target layer; determining an incremental matrix to be adjusted corresponding to the initial matrix, wherein the incremental matrix to be adjusted is determined based on a first low-rank matrix and a second low-rank matrix, the rows of the first low-rank matrix are equal to the rows of the initial matrix, the columns of the first low-rank matrix are predetermined values, the columns of the second low-rank matrix are equal to the columns of the initial matrix, and the rows of the second low-rank matrix are the predetermined values; training the incremental matrix to be adjusted based on the first sample data to obtain a target incremental matrix; linearly combining the initial matrix and the target incremental matrix to obtain a correction matrix; determining a target dialogue processing model including the target layer, wherein the target layer is provided with the correction matrix.
[0008] Optionally, the determining the target layer corresponding to the initial model includes: determining the target layer corresponding to the initial model from a plurality of layers included in the initial model according to the target dialogue scenario.
[0009] Optionally, before determining the target template corresponding to the target dialogue scenario, it also includes: determining multiple candidate dialogue scenarios, wherein the multiple candidate dialogue scenarios include the target dialogue scenario; determining fixed items and interactive items corresponding to the multiple candidate dialogue scenarios respectively; and constructing templates corresponding to the multiple candidate dialogue scenarios respectively based on the fixed items and interactive items corresponding to the multiple candidate dialogue scenarios respectively.
[0010] Optionally, determining the target feedback data corresponding to the target conversation data based on the target conversation tag includes: determining a target task corresponding to the target text; determining a semantic feature corresponding to the target conversation data; and determining the target feedback data corresponding to the target conversation data based on the target conversation tag, the target task, and the semantic feature.
[0011] Optionally, determining a target dialogue tag corresponding to the target dialogue data based on the target text includes: determining a plurality of candidate tags corresponding to the target dialogue scene; determining matching probability values respectively corresponding to the plurality of candidate tags, wherein the matching probability values are used to represent the accuracy of the candidate tags corresponding to the target dialogue data; determining a target dialogue tag from the plurality of candidate tags based on the matching probability values respectively corresponding to the plurality of candidate tags, wherein the target dialogue tag is the candidate tag with the highest corresponding matching probability value.
[0012] According to one aspect of an embodiment of the present invention, there is provided a device for determining dialogue feedback data, comprising: an acquisition module for acquiring target dialogue data; a first determination module for determining a target dialogue scene corresponding to the target dialogue data; a second determination module for determining a target template corresponding to the target dialogue scene, wherein the target template comprises fixed items and interactive items, the fixed items comprising scene items and candidate label items, the scene items being text items describing corresponding candidate dialogue scenes, the candidate label items being selection items comprising a plurality of candidate labels corresponding to the candidate dialogue scenes, and the interactive items being items to be filled in and corresponding to the dialogue data; a third determination module for filling in the interactive items in the target template according to the target dialogue data to obtain a target text; a fourth determination module for determining a target dialogue label corresponding to the target dialogue data according to the target text; and a fifth determination module for determining target feedback data corresponding to the target dialogue data according to the target dialogue label.
[0013] According to one aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any of the above methods for determining dialogue feedback data.
[0014] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned methods for determining dialogue feedback data.
[0015] In an embodiment of the present invention, target dialogue data is obtained; a target dialogue scene corresponding to the target dialogue data is determined; a target template corresponding to the target dialogue scene is determined, wherein the target template includes fixed items and interactive items, the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenes, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenes, and the interactive items are items to be filled in and corresponding to the dialogue data; according to the target dialogue data, the interactive items in the target template are filled in to obtain the target text; according to the target text, the target dialogue label corresponding to the target dialogue data is determined; according to the target dialogue label, the target feedback data corresponding to the target dialogue data is determined. In this embodiment, the target dialogue data is inserted into the target template corresponding to the target dialogue scene to obtain the target text, and then the target dialogue label can be accurately determined according to the interactive items and fixed items in the target text. Since the target conversation data is fit into the target template, even if the conversation data is too long, it is still possible to capture key information and accurately determine the target conversation label, thereby avoiding the problem of inaccurate determination of target conversation labels due to difficulty in capturing key information due to the length of the conversation data when processing long texts and multi-round conversations. In other words, it solves the technical problem of inaccurate semantic understanding caused by insufficient classification accuracy of conversation labels when processing long texts and multi-round conversations. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flowchart of a method for determining dialogue feedback data according to an embodiment of the present invention;
[0018] Figure 2 is a flow chart of conversation tag classification based on a large model in an optional implementation manner of the present invention;
[0019] Figure 3 It is a schematic diagram of the model principle in an optional embodiment of the present invention;
[0020] Figure 4 4 is a structural block diagram of a device for determining dialogue feedback data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0024] Qwen model: The Qwen model is a series of large language models trained and open-sourced by Alibaba. It is based on the Transformer architecture and has been pre-trained on large amounts of data to improve performance in natural language processing tasks. The Qwen model can understand and generate text and is suitable for a variety of application scenarios, such as sentiment analysis and machine translation. The Qwen model provides versions of different sizes to meet the needs of different tasks and computing resources, and has broad application prospects.
[0025] LoRA technology: LoRA (Low-Rank Adaptation) technology is an efficient parameter fine-tuning method for natural language processing and machine learning. Based on the principle of low-rank decomposition of matrices, it decomposes the original high-dimensional parameter matrix into the product of two low-rank matrices, thereby significantly reducing the number of model parameters and computational complexity, avoiding direct updates to the original large-scale matrix, and reducing the computational burden. LoRA technology provides an efficient and resource-saving solution for the training and reasoning of large-scale models.
[0026] Example 1
[0027] According to an embodiment of the present invention, an embodiment of a method for determining dialogue feedback data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flow chart of a method for determining dialogue feedback data according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0029] S102, obtaining target conversation data;
[0030] In step S102 provided in the present application, target conversation data is acquired.
[0031] Among them, target dialogue data is involved, which is data collected during the dialogue process and is used to reflect the content of the target dialogue, such as problem description, service request, question reply, etc.
[0032] By obtaining the target conversation data and based on the large amount of text information contained in the target conversation data, such as question descriptions, question responses, service requests, etc., we can provide a data basis for accurately determining the target conversation labels and understanding the conversation content.
[0033] It should be noted that there is no specific limitation on the method of obtaining the target conversation data, and the method can be customized according to the actual application and scenario.
[0034] S104, determining a target dialogue scenario corresponding to the target dialogue data;
[0035] In step S104 provided in the present application, a target dialogue scene corresponding to the target dialogue data is determined.
[0036] Among them, a target dialogue scenario is involved, and the target dialogue scenario is a specific situation involved in the target dialogue determined based on the target dialogue data.
[0037] By determining the target conversation scenario, we can supplement the context that may be missing in the conversation data, improve the scenario adaptability and pertinence of conversation feedback in subsequent conversation processing, help focus on keywords related to the target conversation scenario, and help achieve accurate determination of target conversation tags and accurate understanding of the target conversation, thereby enhancing the user experience.
[0038] It should be noted that the method for determining the target dialogue scenario corresponding to the target dialogue data is not specifically limited here, and can be customized according to actual applications and scenarios.
[0039] S106, determining a target template corresponding to the target dialogue scenario, wherein the target template includes fixed items and interactive items, wherein the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenarios, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenarios, and the interactive items are items to be filled in and corresponding to the dialogue data;
[0040] In step S106 provided in the present application, a target template corresponding to the target dialogue scenario is determined.
[0041] Among them, a target template is involved, which is a pre-designed structured input format used to guide the model to classify the target dialogue label.
[0042] Among them, a fixed item is involved, which is a format item predetermined in the target template. After the target dialogue scene corresponding to the target dialogue is determined, the fixed item does not change with the change of specific dialogue data.
[0043] Among them, an interaction item is involved, and the interaction item is used to reflect the target dialogue data and is a format item of specific dialogue data that needs to be filled in the target template.
[0044] Among them, the scenario item is involved, which is an item set in the fixed item and used to describe the candidate dialogue scenario. For example, the dialogue scenario corresponding to the scenario item can be return process consultation, express logistics inquiry, etc.
[0045] Among them, the candidate tag item is involved. The candidate tag item is set in the fixed item and determined according to the candidate dialogue scene. It reflects the topic tag to which the dialogue content in the candidate dialogue scene belongs. The candidate tag corresponding to the candidate tag item can be obtained by summarizing and processing the historical dialogue data. For example, in the express logistics scene, the candidate tag corresponding to the candidate tag item can be express delivery, logistics query, after-sales service, etc.
[0046] Among them, a candidate dialogue scene is involved, which is a specific situation involved in the dialogue, and is a predetermined dialogue scene used to match the target dialogue data. The candidate dialogue scene can be obtained by summarizing and processing the historical dialogue data.
[0047] Among them, a text item is involved, and the text item is an item in the target dialogue template used to describe the corresponding candidate dialogue scene.
[0048] Among them, a selection item is involved, which is an item used to fill in the candidate label in the set candidate label items and corresponds to the candidate dialogue scene.
[0049] By determining the target template corresponding to the target dialogue scenario, the scenario items in the target template can be used to provide rich contextual information related to the target dialogue data for subsequent dialogue processing, thereby helping to accurately understand the target dialogue data in dialogue processing. In addition, the candidate label items determined based on the candidate dialogue scenario help the model focus on label classifications that are highly relevant to the target dialogue scenario, thereby improving the accuracy and efficiency of dialogue label classification. Through this structured input form of the target template including fixed items and interactive items, the key information of the target dialogue can be more accurately captured and analyzed, reducing blind exploration in dialogue processing, thereby speeding up classification and ensuring the reliability and consistency of classification results. At the same time, this structured target template simplifies the processing flow of the target dialogue data, speeds up the response speed of dialogue processing, and improves the overall dialogue processing efficiency.
[0050] It should be noted that there is no specific limitation on the method of determining the target template corresponding to the target dialogue scenario, and the settings can be customized according to the actual application and scenario.
[0051] S108, filling in the interactive items in the target template according to the target dialogue data to obtain the target text;
[0052] In step S108 provided in the present application, the interactive items in the target template are filled in according to the target dialogue data to obtain the target text.
[0053] Among them, the target text is involved, which is a complete input text generated after filling in the target dialogue data in the interaction item in the target template corresponding to the target dialogue scene.
[0054] By determining the target text, the inconsistency of understanding caused by directly using the original dialogue text as input and the problem of being unable to accurately determine the key information of the dialogue are avoided. Through the structured input format of the target text, structured and standardized input information can be obtained, which helps to more accurately understand the key information of the dialogue and the dialogue scene in the dialogue processing, thereby helping to solve the problem of insufficient dialogue label classification accuracy and inaccurate semantic understanding when processing long texts and multi-round dialogues.
[0055] It should be noted that the method of filling in the interactive items in the target template according to the target dialogue data to obtain the target text is not specifically limited here and can be customized according to the actual application and scenario.
[0056] S110, determining a target dialogue tag corresponding to the target dialogue data according to the target text;
[0057] In step S110 provided in the present application, a target conversation tag corresponding to the target conversation data is determined according to the target text.
[0058] Among them, the target dialogue tag is involved. The target dialogue tag is obtained by analyzing the target text and is used to represent the core content of the target dialogue. For example, when the dialogue content in the target dialogue data is about express logistics query, then according to the multiple candidate tags corresponding to the express logistics scenario in the target text, there are express delivery, express check, and after-sales service, so the target dialogue data is express check.
[0059] During the dialogue processing process, by analyzing the target text, it is possible to ensure that the key information of the target dialogue is accurately captured based on a full understanding of the target dialogue context, and then the target dialogue label corresponding to the target dialogue data can be accurately determined, thereby improving the dialogue processing efficiency. Moreover, since the target text contains rich scene information, dialogue content, and candidate labels corresponding to the scene information, the target dialogue label determined based on the target text is more accurate, which helps to achieve accurate understanding of the target dialogue.
[0060] It should be noted that there is no specific limitation on the method of determining the target conversation tag corresponding to the target conversation data, and the method can be customized according to the actual application and scenario.
[0061] S112, determining target feedback data corresponding to the target dialogue data according to the target dialogue tag.
[0062] In step S112 provided in the present application, target feedback data corresponding to the target dialogue data is determined according to the target dialogue tag.
[0063] Among them, target feedback data is involved, and the target feedback data is data determined based on the target dialogue tag and used to provide feedback on the target dialogue.
[0064] By determining the target feedback data corresponding to the target dialogue data based on the target dialogue tag, the target feedback data is highly correlated with the target dialogue data, avoiding the problem of inaccurate feedback information due to inaccurate semantic understanding in dialogue processing. In addition, by determining the target feedback data corresponding to the target dialogue data through the target dialogue tag, dialogue processing can be analyzed more specifically, which helps to solve the problems of slow dialogue processing and inaccurate dialogue understanding when processing long texts and multi-round dialogues, thereby enhancing the user experience.
[0065] It should be noted that the method for determining the target feedback data corresponding to the target dialogue data is not specifically limited here, and can be customized according to actual applications and scenarios.
[0066] Through the above steps S102-S112, the target dialogue data is obtained; the target dialogue scene corresponding to the target dialogue data is determined; the target template corresponding to the target dialogue scene is determined, wherein the target template includes fixed items and interactive items, the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenes, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenes, and the interactive items are items to be filled in and corresponding to the dialogue data; according to the target dialogue data, the interactive items in the target template are filled in to obtain the target text; according to the target text, the target dialogue label corresponding to the target dialogue data is determined; according to the target dialogue label, the target feedback data corresponding to the target dialogue data is determined. In this embodiment, the target dialogue data is inserted into the target template corresponding to the target dialogue scene to obtain the target text, and then the target dialogue label can be accurately determined according to the interactive items and fixed items in the target text. Since the target conversation data is fit into the target template, even if the conversation data is too long, it is still possible to capture key information and accurately determine the target conversation label, thereby avoiding the problem of inaccurate determination of target conversation labels due to difficulty in capturing key information due to the length of the conversation data when processing long texts and multi-round conversations. In other words, it solves the technical problem of inaccurate semantic understanding caused by insufficient classification accuracy of conversation labels when processing long texts and multi-round conversations.
[0067] As an optional embodiment, target feedback data corresponding to target dialogue data is determined based on a target dialogue label, including: calling a target dialogue processing model, wherein the target dialogue processing model is obtained by training an initial model based on first sample data, the first sample data includes multiple sample pairs, each of the multiple sample pairs includes sample dialogue data, a sample dialogue label corresponding to the sample dialogue data, and a sample template corresponding to the sample dialogue data; inputting the target text into a label determination module of the target dialogue processing model to determine the target dialogue label corresponding to the target dialogue data; inputting the target dialogue label into a semantic understanding module of the target dialogue processing model to determine the target feedback data corresponding to the target dialogue data.
[0068] In this embodiment, specific steps of determining target feedback data corresponding to target dialogue data based on target dialogue tags are described.
[0069] Among them, a target dialogue processing model is involved, and the target dialogue processing model is a model used for dialogue processing obtained by training an initial model based on the first sample data.
[0070] Among them, the initial model is involved, which is a pre-selected model with certain language processing capabilities, such as the Qwen-1.8B large model.
[0071] Among them, the first sample data is involved. The first sample data is acquired in advance and is used to train the initial model to obtain data of the target dialogue processing model. The first sample data includes multiple sample pairs and sample templates corresponding to the sample dialogue data.
[0072] Among them, a sample pair is involved, which is a data pair constructed based on sample conversation data and a sample conversation label corresponding to the sample conversation data.
[0073] Among them, sample conversation data is involved, and the sample conversation data is data reflecting the content of the conversation used to train the initial model for conversation classification and conversation understanding.
[0074] Among them, sample conversation labels are involved, which are labels used to train the initial model to learn and identify conversation topics, and describe and classify sample conversation data.
[0075] Among them, a sample template is involved, which is a pre-designed structured input format used to guide the initial model to classify sample dialogue labels.
[0076] Among them, a label determination module is involved, which is a module in the model used to identify and determine dialogue labels.
[0077] Among them, a semantic understanding module is involved, which is a module in the model used to perform conversation semantics understanding and analysis and generate feedback data corresponding to the conversation data.
[0078] In the steps involved in this embodiment, a trained target dialogue processing model is called up, the target text is input into the target dialogue processing model, the target dialogue label corresponding to the target dialogue data is determined according to the label determination module in the target dialogue processing model, and then the target dialogue label is input into the semantic understanding module of the target dialogue processing model, and finally the target feedback data corresponding to the target dialogue data is obtained.
[0079] By conducting targeted training on the initial model based on the first sample data including multiple sample pairs and sample templates corresponding to the sample dialogue data, the model can concretely learn the characteristics of various dialogue scenarios and enhance its adaptability and expressiveness in practical applications. The trained target dialogue processing model obtained can achieve high-precision scene recognition capabilities when processing long texts and multi-round dialogues. And through the label determination module in the trained target dialogue processing model, the dialogue labels can be quickly and accurately identified, providing analysis direction for subsequent semantic understanding and feedback. Through the semantic understanding module in the trained target dialogue processing model, the key information in the dialogue data can be accurately captured according to the dialogue labels, and in-depth analysis can be performed, thereby improving the accuracy of dialogue understanding.
[0080] As an optional embodiment, before calling the target dialogue processing model, it also includes: obtaining an initial model; determining a target layer corresponding to the initial model, wherein the target layer is provided with an initial matrix, and the initial matrix includes initial setting parameters of the target layer; determining an incremental matrix to be adjusted corresponding to the initial matrix, wherein the incremental matrix to be adjusted is determined based on a first low-rank matrix and a second low-rank matrix, the rows of the first low-rank matrix are equal to the rows of the initial matrix, the columns of the first low-rank matrix are predetermined values, the columns of the second low-rank matrix are equal to the columns of the initial matrix, and the rows of the second low-rank matrix are predetermined values; based on the first sample data, the incremental matrix to be adjusted is trained to obtain a target incremental matrix; the initial matrix and the target incremental matrix are linearly combined to obtain a correction matrix; determining a target dialogue processing model including the target layer, wherein the target layer is provided with a correction matrix.
[0081] In this embodiment, the specific steps before calling the target dialogue processing model are described.
[0082] Among them, the target layer is involved, which is a pre-selected specific layer in the initial model that needs to be trained to optimize parameters, such as the fully connected layer.
[0083] Among them, the initial matrix is involved, which is the parameter weight matrix set in the target layer before the initial model starts training.
[0084] Among them, initial setting parameters are involved, and the initial setting parameters are weight values constituting the initial matrix, that is, elements of the initial matrix.
[0085] Among them, an incremental matrix to be adjusted is involved, and the incremental matrix to be adjusted is a matrix determined based on the initial matrix, additionally introduced, and used to adjust the target layer parameters.
[0086] Among them, a first low-rank matrix is involved, which is determined based on the initial matrix and constitutes a low-rank matrix of the incremental matrix to be adjusted, wherein the rows of the first low-rank matrix are equal to the rows of the initial matrix, the columns of the first low-rank matrix are predetermined values, and the parameter amount of the second low-rank matrix is less than the parameter amount of the initial matrix.
[0087] Among them, a second low-rank matrix is involved. The first low-rank matrix is determined based on the initial matrix and constitutes a low-rank matrix of the incremental matrix to be adjusted. The columns of the second low-rank matrix are equal to the columns of the initial matrix, the columns of the second low-rank matrix are predetermined values, and the parameter amount of the second low-rank matrix is less than the parameter amount of the initial matrix.
[0088] Therein, a predetermined value is involved, which is a predetermined value of a column of the first low-rank matrix and the second low-rank matrix.
[0089] Among them, a target incremental matrix is involved, which is an incremental matrix to be adjusted after training based on the first sample data and capable of achieving a predetermined effect.
[0090] Herein, a correction matrix is involved, which is a matrix obtained by linearly combining the initial matrix of the target layer and the target incremental matrix.
[0091] In the steps involved in this embodiment, an initial model is obtained, and a target layer corresponding to the initial model is determined, wherein the target layer is provided with an initial matrix, and the initial matrix includes initial setting parameters of the target layer; an incremental matrix to be adjusted corresponding to the initial matrix is determined, wherein the incremental matrix to be adjusted is determined based on a first low-rank matrix and a second low-rank matrix, the rows of the first low-rank matrix are equal to the rows of the initial matrix, the columns of the first low-rank matrix are predetermined values, the columns of the second low-rank matrix are equal to the columns of the initial matrix, and the rows of the second low-rank matrix are predetermined values; the incremental matrix to be adjusted is trained based on the first sample data to obtain a target incremental matrix; the initial matrix and the target incremental matrix are linearly combined to obtain a correction matrix; a target dialogue processing model including the target layer is determined, wherein the target layer is provided with a correction matrix.
[0092] By obtaining an initial model with language processing capabilities, a basis for subsequent fine-tuning and optimization can be provided. Identifying the target layer in the initial model that is related to dialogue processing and needs to be fine-tuned makes the training of the initial model more accurate and avoids unnecessary adjustments to the entire initial model. By introducing an incremental matrix to be adjusted corresponding to the initial matrix, the incremental matrix to be adjusted includes a first low-rank matrix and a second low-rank matrix, and training the incremental matrix to be adjusted, the problem of excessive number of parameters in traditional fine-tuning, resulting in high computational cost and easy overfitting is effectively solved. The low number of parameters in the first low-rank matrix and the second low-rank matrix makes the fine-tuning process more efficient, reduces computing resources and time costs, and maintains the generalization ability of the initial model. By combining the initial matrix and the target incremental matrix obtained by training to form a correction matrix, it is ensured that the trained target dialogue processing model has both the general capabilities of the initial model and optimization for dialogue processing, so that the target dialogue processing model can provide faster and more accurate label classification when processing large, complex and changeable dialogues, thereby improving the accuracy of dialogue understanding and making corresponding feedback.
[0093] As an optional embodiment, determining the target layer corresponding to the initial model includes: determining the target layer corresponding to the initial model from multiple layers included in the initial model according to the target dialogue scenario.
[0094] In this embodiment, specific steps of determining a target layer corresponding to an initial model are described.
[0095] In the steps involved in this embodiment, according to the target dialogue scenario, a target layer corresponding to the initial model and closely related to the dialogue processing, playing a key role or having an important influence is determined from multiple layers in a predetermined initial model (for example, an input layer, a fully connected layer, an output layer, etc.).
[0096] In large-scale pre-trained models, the degree of closeness and relevance of each layer to the dialogue processing in the current dialogue scenario is different. By determining the target layer that is closely related to the dialogue processing in the current dialogue scenario from multiple layers in the predetermined initial model according to the target dialogue scenario, the model can be more closely matched to the dialogue scenario, which helps to enhance the model's understanding depth and classification accuracy when processing dialogues in such scenarios. And by locating the target layer, the subsequent training model can focus on the key parts, and then the model can be trained and optimized in a targeted manner, avoiding comprehensive adjustments to the entire model, significantly reducing the consumption of computing resources, and improving training efficiency. At the same time, by adjusting only the target layer, additional noise will not be introduced due to the adjustment of irrelevant layers, affecting the generalization ability of the model, and it also reduces excessive reliance on training data, reduces the possibility of overfitting, and ensures that the model can maintain good performance on unseen data.
[0097] As an optional embodiment, before determining the target template corresponding to the target dialogue scenario, it also includes: determining multiple candidate dialogue scenarios, wherein the multiple candidate dialogue scenarios include the target dialogue scenario; determining fixed items and interactive items corresponding to the multiple candidate dialogue scenarios respectively; and constructing templates corresponding to the multiple candidate dialogue scenarios respectively based on the fixed items and interactive items corresponding to the multiple candidate dialogue scenarios respectively.
[0098] In this embodiment, the specific steps before determining the target template corresponding to the target dialogue scene are described.
[0099] In the steps involved in this embodiment, multiple candidate dialogue scenarios including the target dialogue scenario are determined, and according to each candidate dialogue scenario, its unique fixed items and interactive items are identified and defined. Then, according to the fixed items and interactive items corresponding to each candidate dialogue scenario, a corresponding template is constructed for each candidate dialogue scenario. The design of the template needs to fully consider the characteristics of the scenario, ensure that the model can recognize the basic pattern of the scenario, and can guide the model to focus on key information, while being able to flexibly adapt to the dynamic changes of the dialogue.
[0100] By building corresponding templates for different candidate dialogue scenarios, the model can be more effectively adapted to a variety of dialogue scenarios, improving its performance in complex and changing dialogue scenarios. And through the clear definition of fixed items and interactive items in the template, the model can more accurately understand and respond to key information in the dialogue, thereby effectively classifying dialogue tags and improving the overall quality of dialogue processing.
[0101] As an optional embodiment, target feedback data corresponding to the target dialogue data is determined based on the target dialogue tag, including: determining a target task corresponding to the target text; determining semantic features corresponding to the target dialogue data; and determining target feedback data corresponding to the target dialogue data based on the target dialogue tag, the target task, and the semantic features.
[0102] In this embodiment, specific steps of determining target feedback data corresponding to target dialogue data based on target dialogue tags are described.
[0103] Among them, the target task is involved, which is obtained by the target dialogue processing model through analyzing the received target text. It is a specific task that the target dialogue processing model needs to perform in processing the target dialogue data, such as the dialogue tag classification task.
[0104] Among them, semantic features are involved. The semantic features are features closely related to the meaning of the target dialogue, extracted from the target dialogue data, obtained by the target dialogue processing model through analyzing the received target text. The extraction of the semantic features helps the target dialogue processing model to deeply understand the substantive content of the target dialogue.
[0105] In the steps involved in this embodiment, when the target dialogue processing model receives the target text, it first analyzes the target text to identify and determine the target task that the target dialogue processing model needs to perform in processing the target dialogue data, and further parses the target dialogue data in the target text based on the obtained target task, extracting semantic features closely related to the meaning of the target dialogue. This step is the key to deeply understand the dialogue and helps the model to accurately grasp the core of the dialogue. Then, based on the target dialogue label, target task, and semantic features, target feedback data is generated for the target dialogue data.
[0106] By analyzing the target text, the target tasks that the target dialogue processing model needs to perform in processing the target dialogue data are identified and determined, so that the model can quickly identify and focus on the tasks, avoiding waste of resources and redundancy in the processing process, so that faster and more accurate dialogue processing can be performed. According to the obtained target tasks, the target dialogue data in the target text is parsed to extract semantic features closely related to the meaning of the target dialogue, which helps the model to accurately grasp the core of the dialogue, thereby enhancing the model's ability to understand the content of the target dialogue and improving the accuracy and personalization of dialogue processing. According to the target dialogue label, target task, and semantic features, target feedback data is generated for the target dialogue data, ensuring that the generated target feedback data is closely related to the target dialogue data, and achieving accurate response to the requests involved in the target dialogue.
[0107] As an optional embodiment, determining a target conversation tag corresponding to the target conversation data based on the target text includes: determining multiple candidate tags corresponding to the target conversation scene; determining matching probability values corresponding to the multiple candidate tags, wherein the matching probability values are used to represent the accuracy of the candidate tags corresponding to the target conversation data; determining a target conversation tag from the multiple candidate tags based on the matching probability values corresponding to the multiple candidate tags, wherein the target conversation tag is the candidate tag with the highest corresponding matching probability value.
[0108] In this embodiment, specific steps of determining a target dialogue tag corresponding to target dialogue data based on a target text are described.
[0109] Among them, a matching probability value is involved, which represents the accuracy of the target conversation tag represented by the candidate tag and the target conversation data.
[0110] In the steps involved in this embodiment, after multiple candidate tags corresponding to the target conversation scene are determined, a corresponding matching probability value is determined for each candidate tag. This value reflects the possibility that the model believes that the target conversation data belongs to the tag. Then, based on the matching probability value corresponding to each candidate tag, the candidate tag with the highest corresponding matching probability value is selected from the multiple candidate tags as the target conversation tag.
[0111] Through the diversity of candidate tags, the model can cover a wider range of dialogue scenarios and improve the accuracy and applicability of classification. By determining the matching probability value corresponding to each tag, the matching degree of each tag with the target dialogue is quantified, and an objective evaluation standard is provided, thereby improving the accuracy of the target dialogue tag classification. After determining the matching probability values corresponding to all candidate tags, the tag with the highest matching probability value is selected as the target dialogue tag to ensure the optimization of classification, avoid classification errors based on subjective judgment, and improve the accuracy and efficiency of classification.
[0112] Based on the above embodiments and optional embodiments, an optional implementation is provided, which is described in detail below.
[0113] In related technologies, when processing conversations, traditional pre-trained models such as BERT and Electra are used for conversation classification and semantic understanding. However, when processing long texts and multi-round conversations, the classification accuracy of conversation labels is insufficient, leading to technical problems such as inaccurate semantic understanding.
[0114] To address the above-mentioned problems, no effective solution has been proposed yet.
[0115] In view of this, an optional implementation of the present invention provides a method for determining dialogue feedback data, which can also be called a dialogue tag classification method based on a large model, which can effectively solve the technical problem of insufficient dialogue tag classification accuracy and inaccurate semantic understanding when processing long texts and multi-round dialogues.
[0116] Figure 2 is a flow chart of dialog tag classification based on a large model in an optional implementation manner of the present invention, Figure 3 It is a schematic diagram of the model principle structure in an optional embodiment of the present invention, such as Figure 2 ,as well as Figure 3 As shown, the optional implementation methods of the present application are described in detail below.
[0117] S1. Obtain target conversation data;
[0118] For example, data preparation and preprocessing: a large amount of conversation data is collected from the shopping environment, of which there are more than 5,000 conversation data involving 56 classification labels. The data is denoised and standardized to ensure data quality, including but not limited to unified text encoding, removal of special characters, unification of uppercase and lowercase letters, and manual labeling to ensure the balance of data under each classification label.
[0119] S2, determining a target dialogue scenario corresponding to the target dialogue data;
[0120] S3, determining a target template corresponding to the target dialogue scene, wherein the target template includes fixed items and interactive items, wherein the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenes, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenes, and the interactive items are items to be filled in and corresponding to the dialogue data;
[0121] Specifically, S3 also includes:
[0122] S31, determining a plurality of candidate dialogue scenarios, wherein the plurality of candidate dialogue scenarios include a target dialogue scenario;
[0123] S32, determining fixed items and interactive items corresponding to a plurality of candidate dialogue scenarios respectively;
[0124] S33. Construct templates corresponding to the multiple candidate dialogue scenarios respectively based on the fixed items and interactive items corresponding to the multiple candidate dialogue scenarios respectively.
[0125] For example, designing a prompt strategy (guidance strategy) (same as the target template above): carefully designing prompts, that is, constructing specific guiding sentences to activate the Qwen model's ability to understand the conversation. These prompts need to be carefully customized for different conversation content and label categories to ensure that the model can focus on the key information of the conversation and improve the accuracy and efficiency of classification. The designed prompt template is as follows:
[0126] "Hello, now you are an intelligent text classifier, answering strictly according to human instructions. The following is a shopping scenario conversation between VISITOR and USER: [Conversation content] is what category in [list of all tags]."
[0127] S4, filling in the interaction items in the target template according to the target dialogue data to obtain the target text;
[0128] S5. Determine a target dialogue tag corresponding to the target dialogue data based on the target text;
[0129] S6. Determine target feedback data corresponding to the target dialogue data based on the target dialogue tag.
[0130] Specifically, S6 also includes:
[0131] S61, determining a target task corresponding to the target text;
[0132] S62, determining semantic features corresponding to the target dialogue data;
[0133] S63. Determine target feedback data corresponding to the target dialogue data based on the target dialogue tag, target task, and semantic features.
[0134] Specifically, S6 also includes determining target feedback data corresponding to the target dialogue data through the trained model:
[0135] S601, obtaining an initial model;
[0136] S602, determining a target layer corresponding to the initial model, wherein the target layer is provided with an initial matrix, and the initial matrix includes initial setting parameters of the target layer;
[0137] Specifically, S602 further includes:
[0138] S6021. According to the target dialogue scenario, determine the target layer corresponding to the initial model from the multiple layers included in the initial model.
[0139] For example, the advanced Qwen-1.8B large model is selected as the basic model (same as the initial model mentioned above), which has the ability to process long text capture and deep contextual understanding. Qwen-1.8B can process input sequences with a maximum of 8192 tags, which meets the context length of the conversation. In addition, the model with this parameter volume can reduce computing resources and memory for training and reasoning compared to large parameter models such as Qwen-7B and Qwen-14B on the basis of meeting the classification accuracy, which means lower costs and faster response times. This is more friendly to application scenarios with limited computing resources or sensitive to delays.
[0140] S603, determining an incremental matrix to be adjusted corresponding to the initial matrix, wherein the incremental matrix to be adjusted is determined according to the first low-rank matrix and the second low-rank matrix, the rows of the first low-rank matrix are equal to the rows of the initial matrix, the columns of the first low-rank matrix are predetermined values, the columns of the second low-rank matrix are equal to the columns of the initial matrix, and the rows of the second low-rank matrix are predetermined values;
[0141] S604, training the incremental matrix to be adjusted according to the first sample data to obtain a target incremental matrix;
[0142] S605, linearly combining the initial matrix and the target incremental matrix to obtain a correction matrix;
[0143] S606: Determine a target dialogue processing model including a target layer, wherein the target layer is provided with a correction matrix.
[0144] For example, LoRA (Low-Rank Adaptation) technology is used for fine-tuning. LoRA introduces a small number of additional parameters to achieve lightweight adjustment of the model, making it more suitable for the tag classification task of the conversation without retraining the entire large model. The details are as follows:
[0145] Based on the designed Prompt training data, fine-tuning the Qwen model based on LoRA technology can significantly reduce the amount of additional parameters required while maintaining model performance. The core idea of LoRA is to achieve fine-tuning by low-rank approximation of the weight matrix of a large pre-trained model. Instead of directly modifying all the weights of the model, it introduces a set of low-rank matrices (usually with a rank much smaller than the rank of the original weight matrix) and multiplies them with the original weights to form a correction matrix. Doing so can effectively capture small changes for specific downstream tasks while keeping the overall structure of the model unchanged.
[0146] Its working principle is that the basic idea of LoRA is to keep the pre-trained matrix (that is, the parameters of the original model) (same as the initial matrix mentioned above) frozen (that is, in a fixed state), and only add a small increment to the original matrix (same as the incremental matrix to be adjusted above), and its parameter amount is much less than the original matrix.
[0147] For example, consider the matrix w, which can be the parameters of the fully connected layer or one of the matrices used to calculate the self-attention mechanism in the Transformer:
[0148] W LORA =W orig +ΔW
[0149] Among them, W LORA is the correction matrix, W orig is the initial matrix, and the trained ΔW (same as the incremental matrix to be adjusted above) is the target incremental matrix
[0150] Obviously, if w orig The dimension is n×m (i.e., n is the number of rows and m is the number of columns). If you just initialize a new incremental matrix with the same dimension for fine-tuning, although similar functions can be achieved, the number of parameters will be doubled. The technology used by LoRA is to construct ΔW by training the low-dimensional matrix B (same as the first low-rank matrix mentioned above) and A (same as the second low-rank matrix mentioned above) through matrix multiplication, so that the number of parameters of ΔW is lower than that of the original matrix.
[0151] ΔW=BA
[0152] Let's define rank r, which is significantly smaller than the basic matrix dimensions r<<n and r<<m, where r is a predetermined value. Then the matrix B is n×r and the matrix A is r×m. Multiplying them together will result in a W matrix of dimension n×m, but the number of parameters constructed is much smaller. In addition, the increment ΔW is zero at the beginning of training, so that fine-tuning starts from the same as the original model. Therefore, B is usually initialized to all zeros, while A is initialized to random values (usually normally distributed).
[0153] The fine-tuned model (the same as the target dialogue processing model mentioned above) is generated into a C++ format model using the FastLLM framework technology to reduce the complexity of the environment configuration and improve the deployment efficiency and reasoning performance of the large language model, which is especially important for scenarios with limited resources.
[0154] S607, calling a target dialogue processing model, wherein the target dialogue processing model is obtained by training an initial model based on first sample data, the first sample data includes a plurality of sample pairs, each of the plurality of sample pairs includes sample dialogue data, a sample dialogue label corresponding to the sample dialogue data, and a sample template corresponding to the sample dialogue data;
[0155] For example, the construction of a training data set (same as the first sample data mentioned above), the sample of the training data set is as follows:
[0156]
[0157]
[0158] S608, inputting the target text into the label determination module of the target dialogue processing model to determine the target dialogue label corresponding to the target dialogue data;
[0159] S609: Input the target dialogue tag into the semantic understanding module of the target dialogue processing model to determine the target feedback data corresponding to the target dialogue data.
[0160] Through the above optional implementation, at least the following beneficial effects can be achieved:
[0161] (1) Compared with the related art, the present invention can provide rich contextual information related to the target dialogue data for subsequent dialogue processing by using the scene items in the target template by determining the target template corresponding to the target dialogue scene, thereby helping to achieve accurate understanding of the target dialogue data in the dialogue processing. In addition, the candidate label items determined based on the candidate dialogue scene help the model focus on the label classification that is highly relevant to the target dialogue scene, thereby improving the accuracy and efficiency of dialogue label classification. By using the target template in the form of structured input including fixed items and interactive items, the key information of the target dialogue can be captured and analyzed more accurately, reducing blind exploration in dialogue processing, thereby speeding up the classification speed and ensuring the reliability and consistency of the classification results. At the same time, this structured target template simplifies the processing flow of the target dialogue data, speeds up the response speed of dialogue processing, and improves the overall dialogue processing efficiency, thereby solving the technical problem of insufficient dialogue label classification accuracy and inaccurate semantic understanding when processing long texts and multi-round dialogues.
[0162] (2) Compared with the related art, the present invention generates a structured entry, namely, a target text, by filling specific target dialogue data into the interaction items of the template after determining the target template. By analyzing the target text, the target task that the target dialogue processing model needs to perform in processing the target dialogue data is identified and determined, so that the model can quickly identify and focus on the task, avoiding waste of resources and redundancy of the processing process, thereby enabling faster and more accurate dialogue processing. According to the obtained target task, the target dialogue data in the target text is parsed, and semantic features closely related to the meaning of the target dialogue are extracted, which helps the model to accurately grasp the core of the dialogue, thereby enhancing the model's ability to understand the content of the target dialogue and improving the accuracy and personalization of dialogue processing. According to the target dialogue label, target task, and semantic features, target feedback data is generated for the target dialogue data, ensuring that the generated target feedback data can be closely related to the target dialogue data, achieving accurate response to the requests involved in the target dialogue, and thus solving the technical problem of insufficient dialogue label classification accuracy and inaccurate semantic understanding when processing long texts and multi-round dialogues.
[0163] (3) Compared with the related art, the present invention determines the target layer that is closely related to the dialogue processing in the current dialogue scene from the multiple layers in the pre-determined initial model according to the target dialogue scene, so that the model can be more closely matched with the dialogue scene, which helps to enhance the model's understanding depth and classification accuracy when processing dialogues in such scenes. And by locating the target layer, the subsequent training model can focus on the key parts, and then the model can be trained and optimized in a targeted manner, avoiding the comprehensive adjustment of the entire model, significantly reducing the consumption of computing resources, and improving training efficiency. At the same time, by adjusting only the target layer, additional noise will not be introduced due to the adjustment of irrelevant layers, affecting the generalization ability of the model, and it also reduces excessive dependence on training data, reduces the possibility of overfitting, and ensures that the model can maintain good performance on unseen data.
[0164] (4) Compared with the related art, the present invention introduces an incremental matrix to be adjusted corresponding to the initial matrix, which includes a first low-rank matrix and a second low-rank matrix, and trains the incremental matrix to be adjusted, which effectively solves the problem of excessive parameter quantity in traditional fine-tuning, resulting in high computational cost and easy overfitting. The low parameter quantity in the first low-rank matrix and the second low-rank matrix makes the fine-tuning process more efficient, reduces computing resources and time costs, and maintains the generalization ability of the initial model. By combining the initial matrix and the target incremental matrix obtained through training to form a correction matrix, it is ensured that the target dialogue processing model obtained through training has both the general ability of the initial model and the optimization for dialogue processing, so that the target dialogue processing model can provide faster and more accurate label classification when processing large, complex and changeable dialogues, thereby improving the accuracy of dialogue understanding and providing corresponding feedback.
[0165] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0167] Example 2
[0168] According to an embodiment of the present invention, a device for implementing the above-mentioned method for determining dialogue feedback data is also provided. Figure 4 is a structural block diagram of a device for determining dialogue feedback data according to an embodiment of the present invention. Figure 4 As shown, the device includes: an acquisition module 402, a first determination module 404, a second determination module 406, a third determination module 408, a fourth determination module 410 and a fifth determination module 412. The device is described in detail below.
[0169] An acquisition module 402 is used to acquire target dialogue data; a first determination module 404 is connected to the acquisition module 402 and is used to determine a target dialogue scene corresponding to the target dialogue data; a second determination module 406 is connected to the first determination module 404 and is used to determine a target template corresponding to the target dialogue scene, wherein the target template includes fixed items and interactive items, the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenes, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenes, and the interactive items are items to be filled in and corresponding to the dialogue data; a third determination module 408 is connected to the second determination module 406 and is used to fill in the interactive items in the target template according to the target dialogue data to obtain a target text; a fourth determination module 410 is connected to the third determination module 408 and is used to determine a target dialogue tag corresponding to the target dialogue data according to the target text; a fifth determination module 412 is connected to the fourth determination module 410 and is used to determine target feedback data corresponding to the target dialogue data according to the target dialogue tag.
[0170] It should be noted here that the above-mentioned acquisition module 402, the first determination module 404, the second determination module 406, the third determination module 408, the fourth determination module 410 and the fifth determination module 412 correspond to steps S102 to S112 in the method for determining the dialogue feedback data, and the instances and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0171] Example 3
[0172] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement any of the above methods for determining dialogue feedback data.
[0173] Example 4
[0174] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above methods for determining dialogue feedback data.
[0175] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0176] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0177] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0179] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0180] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0181] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for determining dialogue feedback data, characterized in that: include: Get the target conversation data; Determining a target dialogue scene corresponding to the target dialogue data; Determine a target template corresponding to the target dialogue scene, wherein the target template includes fixed items and interactive items, the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenes, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenes, and the interactive items are items to be filled in and corresponding to the dialogue data; Filling in the interactive items in the target template according to the target dialogue data to obtain a target text; Determining a target dialogue tag corresponding to the target dialogue data according to the target text; According to the target dialogue tag, target feedback data corresponding to the target dialogue data is determined.
2. The method according to claim 1, characterized in that The step of determining target feedback data corresponding to the target dialogue data according to the target dialogue tag includes: Retrieving a target dialogue processing model, wherein the target dialogue processing model is obtained by training an initial model based on first sample data, wherein the first sample data includes a plurality of sample pairs, each of the plurality of sample pairs includes sample dialogue data, a sample dialogue label corresponding to the sample dialogue data, and a sample template corresponding to the sample dialogue data; Inputting the target text into the label determination module of the target dialogue processing model to determine the target dialogue label corresponding to the target dialogue data; The target dialogue tag is input into the semantic understanding module of the target dialogue processing model to determine the target feedback data corresponding to the target dialogue data.
3. The method according to claim 2, characterized in that Before calling the target dialogue processing model, the method further includes: Acquire the initial model; Determine a target layer corresponding to the initial model, wherein the target layer is provided with an initial matrix, and the initial matrix includes initial setting parameters of the target layer; Determine an incremental matrix to be adjusted corresponding to the initial matrix, wherein the incremental matrix to be adjusted is determined based on a first low-rank matrix and a second low-rank matrix, the rows of the first low-rank matrix are equal to the rows of the initial matrix, the columns of the first low-rank matrix are predetermined values, the columns of the second low-rank matrix are equal to the columns of the initial matrix, and the rows of the second low-rank matrix are the predetermined values; According to the first sample data, the incremental matrix to be adjusted is trained to obtain a target incremental matrix; Linearly combining the initial matrix and the target incremental matrix to obtain a correction matrix; A target dialogue processing model including the target layer is determined, wherein the target layer is provided with the correction matrix.
4. The method according to claim 3, characterized in that The determining of the target layer corresponding to the initial model comprises: According to the target dialogue scenario, a target layer corresponding to the initial model is determined from a plurality of layers included in the initial model.
5. The method according to claim 1, characterized in that: Before determining the target template corresponding to the target dialogue scenario, the method further includes: Determining a plurality of candidate dialogue scenarios, wherein the plurality of candidate dialogue scenarios include the target dialogue scenario; Determining fixed items and interactive items corresponding to the plurality of candidate dialogue scenarios respectively; Templates corresponding to the multiple candidate dialogue scenarios are constructed based on the fixed items and the interactive items corresponding to the multiple candidate dialogue scenarios.
6. The method according to claim 1, characterized in that The step of determining target feedback data corresponding to the target dialogue data according to the target dialogue tag includes: Determining a target task corresponding to the target text; Determining semantic features corresponding to the target conversation data; According to the target dialogue tag, the target task, and the semantic feature, target feedback data corresponding to the target dialogue data is determined.
7. The method according to any one of claims 1 to 6, characterized in that: The step of determining a target dialogue tag corresponding to the target dialogue data based on the target text includes: Determining a plurality of candidate tags corresponding to the target dialogue scenario; Determine matching probability values corresponding to the plurality of candidate tags respectively, wherein the matching probability values are used to indicate the accuracy of the candidate tags corresponding to the target conversation data; According to the matching probability values respectively corresponding to the multiple candidate tags, a target dialogue tag is determined from the multiple candidate tags, wherein the target dialogue tag is the candidate tag with the highest corresponding matching probability value.
8. A device for determining dialogue feedback data, characterized in that: include: An acquisition module, used to acquire target conversation data; A first determination module, used to determine a target dialogue scene corresponding to the target dialogue data; A second determination module is used to determine a target template corresponding to the target dialogue scene, wherein the target template includes fixed items and interactive items, the fixed items include scene items and candidate label items, the scene items are text items describing the corresponding candidate dialogue scenes, the candidate label items are selection items including multiple candidate labels corresponding to the candidate dialogue scenes, and the interactive items are items to be filled in and corresponding to the dialogue data; A third determination module is used to fill in the interaction items in the target template according to the target dialogue data to obtain a target text; A fourth determination module, configured to determine a target dialogue tag corresponding to the target dialogue data according to the target text; The fifth determination module is used to determine the target feedback data corresponding to the target dialogue data according to the target dialogue tag.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for determining dialogue feedback data as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for determining dialogue feedback data as described in any one of claims 1 to 7.