Conversation task execution method and device, electronic equipment and nonvolatile storage medium
By acquiring professional data and using dialogue data extraction and selection models for automated fine-tuning, the problem of low accuracy of intelligent dialogue systems when dealing with highly professional tasks is solved, achieving higher professional domain knowledge and execution accuracy.
Patent Information
- Application Number
- CN202411996670.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
When intelligent dialogue systems handle highly professional dialogue tasks, it is difficult to accurately solve highly professional tasks, resulting in low execution accuracy.
By obtaining a large amount of professional data that matches the major to which the dialog task is to be processed, the dialogue data extraction model and the dialogue data selection model are used to independently select the supervision data set that can be fine-tuned for the dialogue task model, without manual annotation, and automatic fine-tuning supervision data extraction is achieved.
It effectively improves the knowledge of the dialogue task model in the professional field, improves the accuracy of dialogue task execution, saves labor costs, and improves the fine-tuning efficiency of dialogue task model.
Smart Images

Figure CN119692480A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a dialogue task execution method, device, electronic device and non-volatile storage medium. Background Art
[0002] Relying on massive data and powerful computing power, the intelligent dialogue system built on a large-scale deep learning network model can interact with users and provide users with accurate and fast information query and answer services.
[0003] As intelligent dialogue systems are widely used in various professional fields, the intelligent dialogue systems of related technologies cannot fully understand and learn highly professional information by learning from general knowledge bases, resulting in the inability of intelligent problem systems to accurately solve highly professional tasks.
[0004] In view of this, improving the accuracy of intelligent dialogue systems in handling highly professional dialogue tasks is a technical problem that technical personnel in this field need to solve.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The present invention provides a dialogue task execution method, device, electronic device and non-volatile storage medium, which effectively improve the execution accuracy of highly professional dialogue tasks by an intelligent dialogue system.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] The present invention provides a method for executing a dialogue task, comprising:
[0009] According to the professional field to which the dialogue task to be processed belongs, matching professional data, a first prompt word and a second prompt word are obtained; the first prompt word and the professional data are input into a pre-trained dialogue data extraction model to obtain multiple groups of original dialogue data; the first prompt word is used to prompt the dialogue data extraction model to extract dialogue data from the professional data; when it is detected that the task execution of the dialogue data extraction model is completed, each original dialogue data, the professional data and the second prompt word are automatically input into a pre-trained dialogue data selection model to obtain each target dialogue data to construct a professional data set; the second prompt word is used to prompt the dialogue data selection model to select dialogue data matching the professional data from each original dialogue data; the dialogue task model that has completed the pre-training process is fine-tuned using the professional data set, and the fine-tuned dialogue task model is used to execute the dialogue task to be processed.
[0010] In a first exemplary embodiment, before automatically inputting each original dialogue data, the professional data and the second prompt word into a pre-trained dialogue data selection model, it also includes: obtaining a supervised classification sample data set, the supervised classification sample data set contains supervised classification sample data less than a first quantity threshold, each supervised classification sample includes multiple groups of document sample data and corresponding dialogue sample data, each supervised classification sample has a similarity value label and a label indicating whether the dialogue sample data meets a similarity condition, and the similarity label is used to identify the degree of similarity between the document sample data and its corresponding dialogue sample data; using the supervised classification sample data set to train a target language model so that the target language model has the ability to select dialogue data that meets the similarity condition; when the target training language model reaches a preset model training stop condition, the currently obtained target training language model is used as the dialogue data selection model.
[0011] In a second exemplary embodiment, after fine-tuning the dialogue task model that has completed the pre-training process using the professional dataset, it also includes: obtaining historical questions, historical answers and user feedback results of the dialogue task model performing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, incorrect answers and corresponding user correct answers; constructing a question-and-answer task dataset based on each historical question and its corresponding historical answer and user feedback result; determining the weight value of the loss corresponding to the task problem dataset and the professional dataset respectively according to the degree of influence of the task problem dataset and the professional dataset on the task execution result; adjusting the loss function of the dialogue task model in the initial fine-tuning process according to the weight value of the loss corresponding to the task problem dataset and the professional dataset respectively, and obtaining a joint loss function; when the data scale of the question-and-answer task dataset reaches a preset scale threshold, the joint loss function is adopted, and the dialogue task model is fine-tuned again using the task problem dataset and the professional dataset.
[0012] In a third exemplary embodiment, after fine-tuning the dialogue task model that has completed the pre-training process using the professional dataset, it also includes: obtaining historical questions, historical answers and user feedback results of the dialogue task model performing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, incorrect answers and corresponding user correct answers; constructing a question and answer task dataset based on each historical question and its corresponding historical answer and user feedback results; and whenever the scale of new data in the question and answer task dataset reaches a preset quantity threshold, fine-tuning the dialogue task model using the task question dataset.
[0013] In a fourth exemplary embodiment, the method of executing the dialog task to be processed using the fine-tuned dialog task model includes: pre-blocking a plurality of text data and converting each text block into corresponding text vector data to construct a knowledge base according to each text vector data; obtaining a target historical task related to the dialog task to be processed by the dialog task model; generating a historical text according to historical dialogs, historical prediction results and corresponding historical user feedback results corresponding to each target historical task; processing the historical text in blocks and calling a text vectorization model to vectorize each historical text block to obtain a historical text vector; sending the historical text vector to the knowledge base; vectorizing the task to be processed to obtain a dialog vector to be queried; determining at least one candidate text vector that meets a preset vector similarity condition for the dialog vector to be queried in the knowledge base; inputting a third prompt word, at least one candidate text vector and the dialog to be processed corresponding to the task to be processed into the fine-tuned dialog task model; the third prompt word is used to prompt the fine-tuned dialog task model to generate a corresponding result for the dialog to be processed.
[0014] In a fifth exemplary embodiment, the to-be-processed dialogue task is a question-and-answer task, which at least includes a to-be-processed question. After the to-be-processed dialogue task is executed using the fine-tuned dialogue task model, it also includes: obtaining a predicted answer corresponding to the to-be-processed question; obtaining user feedback on the satisfaction and accuracy of the predicted answer; taking the to-be-processed question, predicted answer and corresponding user feedback result corresponding to the to-be-processed dialogue task as a set of historical question-and-answer sample data, and importing the historical question-and-answer sample data into the knowledge base of the dialogue task model.
[0015] In a sixth exemplary embodiment, the conversation data extraction model includes a first conversation data extraction sub-model, a second conversation data extraction sub-model and a third conversation data extraction sub-model; the inputting the first prompt word and the professional data into a pre-trained conversation data extraction model includes: inputting the first prompt word and the professional data into the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model, respectively, the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model respectively extracting conversation data from the professional data according to the first prompt word; and obtaining multiple groups of original conversation data according to the conversation data extracted by the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model.
[0016] Another aspect of the present invention provides a dialogue task execution device, comprising:
[0017] A professional data acquisition module is used to obtain matching professional data, a first prompt word and a second prompt word according to the professional field to which the dialogue task to be processed belongs; a dialogue data extraction module is used to input the first prompt word and the professional data into a pre-trained dialogue data extraction model to obtain multiple groups of original dialogue data; the first prompt word is used to prompt the dialogue data extraction model to extract dialogue data from the professional data; the dialogue data extraction module is used to automatically input each original dialogue data, the professional data and the second prompt word into a pre-trained dialogue data selection model when it is detected that the task execution of the dialogue data extraction model is completed, to obtain each target dialogue data to construct a professional data set; the second prompt word is used to prompt the dialogue data selection model to select dialogue data matching the professional data from each original dialogue data; a dialogue task execution module is used to use the professional data set to fine-tune the dialogue task model that has completed the pre-training process, and use the fine-tuned dialogue task model to execute the dialogue task to be processed.
[0018] The present invention also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of the dialogue task execution method as described in any of the preceding items when executing a computer program stored in a memory.
[0019] Finally, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the dialogue task execution method as described in any of the preceding items are implemented.
[0020] The advantage of the technical solution provided by the present invention is that a large amount of specialized data and industry data matching the profession to which the dialogue task to be processed belongs is obtained, and a supervisory data set that can be used for fine-tuning the dialogue task model is independently selected from these professional data based on a dialogue data extraction model and a dialogue data selection model. The label of the supervisory data set is realized by the dialogue data extraction function of the dialogue data extraction model and the dialogue data selection function of the dialogue data selection model. There is no need for manual labeling, and automatic extraction of fine-tuning supervisory data is realized, which not only effectively improves the efficiency of fine-tuning the dialogue task model and saves labor costs, but also can effectively enhance the knowledge of the dialogue task model in the professional field and improve the accuracy of dialogue task execution.
[0021] In addition, the present invention also provides a corresponding implementation device, electronic device and non-volatile storage medium for the dialogue task execution method, which further makes the method more practical, and the device, electronic device and non-volatile storage medium have corresponding advantages.
[0022] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be arbitrarily combined with each other, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this article. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features. It should be understood that the above general description and the detailed description below are only exemplary and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A flowchart of a method for executing a dialogue task provided by the present invention;
[0025] Figure 2 A schematic diagram of an exemplary method for obtaining a professional data set provided by the present invention;
[0026] Figure 3 A flowchart of another method for executing a dialogue task provided by the present invention;
[0027] Figure 4 A schematic diagram of a framework of a dialogue task execution method provided by the present invention in an exemplary application scenario;
[0028] Figure 5 A structural diagram of a specific implementation of the dialogue task execution device provided by the present invention;
[0029] Figure 6 A structural diagram of a specific implementation of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, the terms "first", "second", "third", etc. in the specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations of the two are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described here as "exemplary" is not necessarily interpreted as being superior or better than other embodiments.
[0031] With the rapid development of artificial intelligence technology, information is growing explosively, and users are increasingly in need of how to quickly and accurately filter out valuable content from massive amounts of information. Thanks to the intelligent interaction insights provided by artificial intelligence technology, relying on massive data and powerful computing power, an intelligent dialogue system based on a large-scale deep learning model was born. The intelligent dialogue system has high accuracy and efficiency. It can not only communicate with users, but also quickly provide users with accurate information query and answer services, and gradually develops from a single dialogue function to a more intelligent and personalized direction.
[0032] In order to improve the accuracy of the answers of the intelligent dialogue system and reduce the "hallucination phenomenon" of the intelligent dialogue system, that is, to avoid the phenomenon of the intelligent dialogue system talking nonsense in a serious manner, the relevant technology will adopt methods such as RAG (Retrieval-Augmented Generation), Agent, Prompt Engineering, etc. to make the dialogue model more effectively use information and improve the performance and response quality of the dialogue model. Taking RAG, which combines the two methods of retrieval and generation, as an example, RAG, as a natural language processing technology, is widely used in natural language processing tasks that require high precision and context sensitivity. It can more effectively utilize a large amount of information when processing tasks such as dialogue tasks and text generation tasks, provide private knowledge reference for the generation of language models, and is more suitable for processing question-and-answer tasks that require professional knowledge or the latest information. When providing dialogue services, it can provide more personalized and information-rich responses, and can also assist in generating high-quality content by retrieving relevant materials, and generate or suggest code snippets based on existing code bases.
[0033] However, the intelligent dialogue system of the related technology is usually trained based on a large amount of public data. Therefore, in the professional field involved, there are fewer training corpora, and the understanding of private knowledge documents in the technical field is limited, resulting in that even when the relevant corpus materials are given, the answers summarized are difficult to meet the needs of users. Moreover, due to the limitations of the current document vectorization, the recall accuracy is not high, and the intelligent dialogue system often answers irrelevant questions. In order to solve this technical problem. The present invention obtains a large amount of specialized data and industry data that match the profession to which the dialogue task to be processed belongs, and independently selects a supervised data set for fine-tuning the dialogue task model from these professional data based on the dialogue data extraction model and the dialogue data selection model, which not only effectively improves the efficiency of fine-tuning the dialogue task model and saves labor costs, but also can effectively enhance the knowledge of the dialogue task model in the professional field and improve the accuracy of the dialogue task execution. After introducing the technical solution of the present invention, various non-limiting embodiments of the present invention are described in detail below. In order to better illustrate the present invention, many specific details are given in the specific embodiments below. Those skilled in the art should understand that the present invention can also be implemented without these specific details. In some other instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail in order to obscure the subject matter of the present invention.
[0034] First see Figure 1 , Figure 1 A flowchart of a method for executing a dialog task provided in this embodiment may include the following contents:
[0035] S101: Acquire matching professional data, a first prompt word, and a second prompt word according to the professional field to which the dialogue task to be processed belongs.
[0036] Among them, the dialogue tasks to be processed can be task-based dialogue tasks, question-answering dialogue tasks and open domain dialogue tasks. Task-based dialogue tasks have clear task goals and can accurately define the user's intentions and actions. Intelligent assistants are used for tasks such as ticket booking and navigation. Question-answering dialogue tasks need to accurately answer users' questions, meet users' information query needs or answer services, such as dialogue tasks provided by voice customer service systems of banks, telecom operators, and e-commerce stores. Open domain dialogue tasks do not limit fields and topics, similar to chatbots. It can be seen that in order to improve the execution accuracy of dialogue tasks to be processed, it is necessary to have sufficient understanding of professional domain knowledge. Professional data is a set of data that is relatively specialized and industry-oriented in a certain field. These data can be obtained from the private database of the enterprise corresponding to the profession through authorization, or from the public database corresponding to the profession and related documents, videos and other materials. Professional data may include relatively professional document materials in a certain field, such as various types of documents, technical documents, product documents, rules and regulations, etc., and can also be professional video materials and professional audio materials, such as videos or audios that explain industry-specific phenomena or rules. This does not affect the implementation of the present invention. Professional data includes professional terms, technical terms and jargon of the profession. The first prompt word is used to prompt the dialogue data extraction model of S102 to extract dialogue data from professional data, that is, to indicate what task the dialogue data extraction model is to perform. The second prompt word is used to prompt the dialogue data selection model of S103 to select dialogue data that matches the professional data from the original dialogue data, that is, to perform what task the dialogue data selection model is to perform. After obtaining the professional data, the first prompt word and the second prompt word, a fine-tuning data set for fine-tuning the dialogue task model of S104 can be automatically extracted, and automatic labeling of each fine-tuning sample data of the fine-tuning data set of the dialogue task model can be achieved.
[0037] S102: Input the first prompt word and the professional data into a pre-trained dialogue data extraction model to obtain multiple groups of original dialogue data.
[0038] After obtaining professional data in the previous step, no matter what format the professional data is in, it cannot be directly used to fine-tune the dialogue task model. It is necessary to extract supervised fine-tuning data in the form of dialogue, such as question-and-answer data. However, extracting high-quality dialogue data from a large amount of original professional data requires certain professional knowledge, which is a relatively time-consuming and labor-intensive but boring task. The practicality of investing manpower in this task is too low. Therefore, the present invention implements an automated fine-tuning data extraction method through S102 and S103. The dialogue data extraction model can be any open source large-scale language network model or a free model API (Application Programming Interface). The so-called large model API usually refers to an application programming interface provided for a large pre-trained model, such as a natural language processing model, an image recognition model, etc. Correspondingly, the training sample set can be a plurality of sample data, each of which is labeled with dialogue data as a label, so that the model can learn to extract dialogue data from the input data. As for how to train, any training method recorded in any related technology that matches the selected network model structure can be used. The trained dialogue data extraction model can automatically extract dialogue-style data from input data under the instruction of the first prompt word. For the sake of ease of description, the predicted data output by the dialogue data extraction model, that is, the dialogue-style data extracted from professional data, can be defined as original dialogue data.
[0039] S103: When it is detected that the task execution of the dialogue data extraction model is completed, the original dialogue data, professional data and the second prompt word are automatically input into the pre-trained dialogue data selection model to obtain the target dialogue data to construct a professional data set.
[0040] Considering that the original dialogue data may have task execution deviations due to the model performance of the dialogue data extraction model, and that the original dialogue data may contain data that is not appropriate to the professional data, in order to improve the task execution accuracy of the dialogue task model, it is necessary to screen the original dialogue data extracted in S102. The present invention can also use an open source large-scale language network model or a free model API to annotate the training sample set with screening criteria such as similarity or the same keywords as labels, so that the model can recognize whether the input data matches. The target dialogue data is selected from the original dialogue data and is more appropriate and more matched to the professional data. The obtained target dialogue data is used to form a professional data set as a fine-tuning data set. The present invention is based on an automated method for extracting dialogue-type supervision data from acquired professional data based on a multi-model hybrid. There is no need to manually annotate dialogue-type supervision data from professional data by investing a lot of manpower and time. It not only solves the problem that traditional data annotation requires a lot of manpower and time, but also solves the problem that the quality of manually annotated question and answer data is difficult to ensure.
[0041] S104: Fine-tune the dialogue task model that has completed the pre-training process using a professional data set, and use the fine-tuned dialogue task model to execute the dialogue task to be processed.
[0042] The models used by intelligent question-answering systems, chatbots, and intelligent dialogue systems are implemented through pre-training and fine-tuning. By pre-training on a large-scale corpus, the model can learn rich language knowledge and semantic information; then, the model is fine-tuned for specific application scenarios and tasks so that it can better adapt to and meet user needs. This step can obtain any model that has completed the pre-training process, that is, the dialogue task model has learned rich language knowledge and semantic information. In order to enhance the knowledge of the dialogue task model in the professional field and improve the execution accuracy of professional dialogue tasks, the professional data set obtained in the previous step is used to fine-tune the dialogue task model that already has understanding language knowledge and semantic information, so that the fine-tuned dialogue task model can have the ability to understand the professional field knowledge corresponding to the dialogue task to be processed, thereby outputting results that match the professional field. Take the dialogue task to be processed as a question-answering task and the professional data as document data as an example. Correspondingly, the dialogue data extraction model is a question-answer pair extraction model, and the dialogue data selection model is a question-answer pair selection model, such as Figure 2As shown, S102 extracts question-answer pairs from the document data based on prompt word 1, and S103 filters the question-answer pairs output by the question-answer pair extraction model through prompt word 2 to obtain target question-answer pairs that better match the professional data. The professional data set constructed using the target question-answer pairs is used to fine-tune the dialogue task model, thereby enhancing the knowledge of the dialogue task model in the professional field, thereby improving the accuracy of executing the question-answering task, and outputting more accurate answers that meet user needs.
[0043] In the technical solution provided in this embodiment, a large amount of specialized data and industry data matching the profession to which the dialogue task to be processed belongs is obtained, and a supervision data set that can be used for fine-tuning the dialogue task model is independently selected from these professional data based on the dialogue data extraction model and the dialogue data selection model. The label of the supervision data set is realized by the dialogue data extraction function of the dialogue data extraction model and the dialogue data selection function of the dialogue data selection model. There is no need for manual labeling, and automatic extraction of fine-tuning supervision data is realized, which not only effectively improves the efficiency of fine-tuning the dialogue task model and saves labor costs, but also can effectively enhance the knowledge of the dialogue task model in the professional field and improve the accuracy of dialogue task execution.
[0044] In the above embodiment, there is no limitation on obtaining the dialogue data selection model. In order to further improve the execution efficiency and accuracy of the dialogue task, the present invention also provides a training method for the dialogue data selection model, which may include the following contents:
[0045] Obtain a supervised classification sample data set, and use the supervised classification sample data set to train the target language model so that the target language model has the ability to select dialogue data that meets similar conditions; when the target training language model reaches the preset model training stop condition, the currently obtained target training language model is used as the dialogue data selection model.
[0046] Among them, the target language model can select any network model structure that can learn language knowledge and semantic information, such as a Transformer model. The supervised classification sample data set contains supervised classification sample data that is less than the first quantity threshold. The first quantity threshold can be selected as a value of about 100. For example, the supervised classification sample data set can contain 10-100 sample data. Each supervised classification sample includes multiple groups of document sample data and corresponding dialogue sample data. Each supervised classification sample has a similarity value label and a label indicating whether the dialogue sample data meets the similarity condition. The similarity label is used to identify the degree of similarity between the document sample data and its corresponding dialogue sample data, such as selecting a similarity value between the two of more than 95% and above as a similarity condition. By training with a small number of supervised samples, the optimal dialogue data can be quickly selected in a given context and candidate question-answer pairs. The preset model training stop condition can be that the number of iterations reaches the preset number of iterations, the model accuracy reaches the prediction accuracy threshold, or the model converges.
[0047] As can be seen from the above, this embodiment uses a small number of supervised samples to train a dialogue data selection model, and can quickly select the optimal dialogue data based on similarity, which is beneficial to improving the accuracy of dialogue task execution.
[0048] In order to further improve the task execution accuracy of the dialogue data extraction model and screen out more accurate dialogue data, based on the above embodiment, the present invention may also include the following contents:
[0049] The conversation data extraction model of this embodiment may include a first conversation data extraction sub-model, a second conversation data extraction sub-model and a third conversation data extraction sub-model. Of course, the number of sub-models included in the conversation data extraction model may be selected according to the computing resources and model operation conditions in the actual operation scenario, which does not affect the implementation of the present invention. The first prompt word and the professional data are respectively input into the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model. The first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model respectively extract conversation data from the professional data according to the first prompt word; multiple groups of original conversation data are obtained according to the conversation data extracted by the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model. Figure 2 For example, the dialogue data extraction model is a question-answer pair extraction model, which may include n large models, each of which outputs a question-answer pair, and all the question-answer pairs are input into the subsequent question-answer pair selection model for screening.
[0050] As can be seen from the above, this embodiment integrates multiple large models to process the same data, allowing multiple large models to extract conversational data and form multiple conversational data, which can overcome the deviation of a single model and screen out more accurate conversational data.
[0051] The artificial intelligence system is different from the traditional software system. It is a data-driven system. As the system runs, more and more data is accumulated. These data in turn continuously drive the model update. Finally, the overall performance of the system continues to evolve and improve as the system runs. Therefore, in order to further improve the execution accuracy of the dialogue task, based on the above embodiment, the present invention also provides an implementation method for enhancing the accuracy of the dialogue task execution model by effectively utilizing user feedback, which may include the following contents:
[0052] In this embodiment, after the dialogue task model completes each dialogue task, the system will provide an answer evaluation function. Users can give thumbs-up or complaints based on the quality of the dialogue task model's answers. If the user is not satisfied with the dialogue task model's answers, a user feedback function for ideal answers is added. In this way, each time the dialogue task model completes a dialogue task, a satisfactory answer can be collected. The answer can include both the better answer output by the dialogue task model and the answer that satisfies the user's needs as feedback. The present invention uses the collected user feedback data to import into the training samples used in the dialogue task model pre-training process and / or fine-tuning process. When the user feedback data is obtained, it can be automatically imported after the corresponding data format processing is performed according to the format required by the import location. These user feedback data are used to form knowledge precipitation and continuously improve the quality of the knowledge base. At the same time, these questions with marked answers are high-quality supervised fine-tuning data. When a certain number of them are accumulated, the dialogue task model is fine-tuned to improve the dialogue task model's understanding of the text content in the professional field. For different scenarios, the present invention provides the following multiple implementation methods for using these user feedback data, which may include the following contents:
[0053] In an exemplary embodiment, the present invention can use user feedback data and professional data sets to fine-tune the dialogue task model, which may include the following contents: obtaining historical questions, historical answers and user feedback results of the dialogue task model executing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, wrong answers and corresponding user correct answers; constructing a question-answering task dataset according to each historical question and its corresponding historical answer and user feedback result; determining the weight value of the loss corresponding to the task problem dataset and the professional dataset according to the degree of influence of the task problem dataset and the professional dataset on the task execution result; adjusting the loss function of the dialogue task model in the initial fine-tuning process according to the weight value of the loss corresponding to the task problem dataset and the professional dataset, and obtaining a joint loss function; when the data scale of the question-answering task dataset reaches a preset scale threshold, the joint loss function is adopted, and the dialogue task model is fine-tuned again using the task problem dataset and the professional dataset. In this embodiment, the joint loss function includes the loss of fine-tuning the dialogue task model based on the task problem dataset and the loss of fine-tuning the dialogue task model based on the professional dataset. The weights of these two losses can be adjusted according to the actual situation to ensure that the dialogue task model can adapt to various dialogue tasks.
[0054] In another exemplary implementation, the present invention can use a sufficient amount of user feedback data to fine-tune the dialogue task model, which may include the following: obtaining historical questions, historical answers, and user feedback results of the dialogue task model performing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, wrong answers, and corresponding user correct answers; constructing a question-and-answer task dataset based on each historical question and its corresponding historical answer and user feedback result; whenever the scale of new data in the question-and-answer task dataset reaches a preset quantity threshold, the task question dataset is used to fine-tune the dialogue task model. The preset quantity threshold can be flexibly selected according to actual conditions, and the present invention does not impose any limitation on this.
[0055] In another exemplary embodiment, Figure 3As shown, the present invention can use user feedback data to improve the retrieval accuracy of the dialogue task to be processed, thereby improving the accuracy of the output result of the dialogue task to be processed, and may include the following contents: pre-blocking a plurality of text data, and converting each text block into corresponding text vector data, so as to construct a knowledge base according to each text vector data; obtaining the historical execution tasks of the dialogue task model and the target historical tasks related to the dialogue task to be processed; generating historical texts according to the historical dialogues, historical prediction results and corresponding historical user feedback results corresponding to each target historical task; processing the historical texts in blocks, and calling the text vectorization model to vectorize each historical text block to obtain a historical text vector; sending the historical text vector to the knowledge base; vectorizing the task to be processed to obtain a dialogue vector to be queried; determining at least one candidate text vector that meets a preset vector similarity condition for the dialogue vector to be queried in the knowledge base; inputting a third prompt word, at least one candidate text vector and the dialogue to be processed corresponding to the task to be processed into the fine-tuned dialogue task model; the third prompt word is used to prompt the fine-tuned dialogue task model to generate a corresponding result for the dialogue to be processed. In this embodiment, in order to improve the task execution accuracy of the dialogue task model and ensure that the final output answer is an answer that meets the user's needs, the present invention imports all historical data related to the dialogue task to be processed into the knowledge base, so that the dialogue task model can learn knowledge that better meets the user's needs when executing the dialogue task to be processed. When the knowledge base is updated, the dialogue task model includes two stages of retrieval and generation when executing the dialogue task to be processed. The process of the retrieval stage includes: first, from a large-scale knowledge base or document collection, through TF-IDF (termfrequency–inverse document frequency, a common weighting technology for information retrieval and data mining), BM25 (Best Matching 25, matching method) or a large text vectorization model, a small amount of information or fragments most relevant to the input dialogue task to be processed are retrieved, which are defined as candidate text vectors in this embodiment. Secondly, the knowledge base needs to be preprocessed and indexed: the knowledge base can be cleaned, processed, and converted into a format suitable for the dialogue task model. This may involve steps such as text segmentation, entity recognition, and vectorization representation. The processed data will be stored in an efficient data structure, such as an inverted index or a vector database using an approximate nearest neighbor algorithm, to accelerate the subsequent retrieval process. Then, natural language understanding technology is used to understand and parse the tasks to be processed, accurately extract keywords or convert them into retrieval queries.The process of the generation phase includes: In order to further improve the accuracy of task execution, the retrieved information can be preprocessed, such as re-ranking, fusion, screening and sorting operations on the retrieval results, and then input into the fine-tuned dialogue task model together with the dialogue to be processed. The fine-tuned dialogue task model uses this contextual information to generate the final answer through the decoding process. The fine-tuned dialogue task model is not only based on its own parameters and training data, but also combines the specific content retrieved dynamically according to the query. In this way, the final output answer can be more accurate and more informative, and can also incorporate the latest or specific field or user preferred knowledge.
[0056] In another exemplary implementation, the present invention can use user feedback data to improve the quality of the knowledge base, which may include the following: obtaining answer prediction data and user feedback results on the answer prediction data; using the pending dialogue, answer prediction data and corresponding user feedback results corresponding to the pending dialogue task as a set of historical training sample data, and importing the historical training sample data into the knowledge base of the dialogue task model. Taking the pending dialogue task as a question-and-answer task as an example, the pending dialogue task at least includes a pending question, and obtaining the predicted answer corresponding to the pending question; obtaining user feedback results on the satisfaction and accuracy of the predicted answer; using the pending question, predicted answer and corresponding user feedback results corresponding to the pending dialogue task as a set of historical question-and-answer sample data, and importing the historical question-and-answer sample data into the knowledge base of the dialogue task model.
[0057] From the above, it can be seen that this embodiment adds a user feedback function. When the user is not satisfied with the answer, he can provide feedback and enter what he thinks is the ideal answer. In this way, the quality of the knowledge base can be effectively improved through user feedback data during the operation process, forming effective data reuse. The user feedback data can be used to fine-tune the dialogue task model, effectively improve the performance of the dialogue task model, improve the execution accuracy of the dialogue task, and meet user needs.
[0058] It is understandable that the fine-tuning method of the dialogue task model affects the model performance of the dialogue task model. In order to further improve the execution accuracy of the dialogue task, speed up the fine-tuning speed of the dialogue task model, and save computing resources, based on the above embodiment, this embodiment also provides an exemplary fine-tuning method, which may include the following contents:
[0059] Pre-construct a first training parameter A and a second training parameter B, the hyperparameter controlling the parameter amount of the first training parameter A and the second training parameter B is a rank parameter, the input dimension of the first training parameter is the same as the input dimension of the dialogue task model, and the first difference between the output dimension and the output dimension of the dialogue task model is greater than a first preset threshold; the output dimension of the second training parameter is the same as the output dimension of the pre-trained language model, and the second difference between the input dimension and the input dimension of the dialogue task model is greater than a second preset threshold; initialize the first training parameter to a Gaussian distribution, and initialize the second training parameter to 0; in the process of fine-tuning the dialogue task model using a professional data set, fix the pre-trained model parameters of the dialogue task model unchanged, the dimension of the pre-trained model parameters of the dialogue task model is d×d, and update the first training parameter and the second training parameter; when the first training parameter and the second training parameter are trained, merge the first training parameter, the second training parameter and the model parameter by a re-parameterization method.
[0060] This embodiment fine-tunes the dialogue task model based on Lora (Low-Rank) to adapt to downstream tasks. When using the dialogue task model to adapt to downstream tasks, only a small number of parameters need to be trained to achieve a good effect. LoRA uses professional data sets and only trains newly added parameters to adapt to the task of interacting with users through dialogue. Exemplarily, LoRA adds two parameters A and B next to the dialogue task model, which are initialized to Gaussian distribution and 0 respectively. The additional parameters are 0 at the beginning of training. The input dimension of A and the output dimension of B are the same as the input and output dimensions of the original model, while the output dimension of A and the input dimension of B are a value much smaller than the input and output dimensions of the original model, which can greatly reduce the parameters to be trained. Only the parameters of A and B are updated during training, and the pre-trained model parameters are fixed. After the new parameters are trained, the idea of re-parameterization can be used during inference to merge the new parameters with the old model parameters, so that the effect of fine-tuning the entire model can be achieved on the new task, and the time consumption of inference will not be increased during inference, which effectively improves the efficiency of model training.
[0061] It should be noted that there is no strict order of execution between the steps in the present invention. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1 and Figure 3 This is just a schematic and does not mean that this is the only execution order.
[0062] Finally, based on the technical solution of the present invention, Figure 4 Some possible application scenarios involved in the technical solution of the present invention are introduced by way of examples. Figure 4 A schematic diagram of a hardware composition framework applicable to an intelligent question-answering system provided by the present invention may include the following contents:
[0063] The hardware component framework may include a first electronic device 41 and a second electronic device 42, and the first electronic device 41 and the second electronic device 42 are connected via a network 43. The first electronic device 41 is deployed with a processor for executing the dialogue task execution method described in any of the above embodiments, and the second electronic device 42 is deployed with a user terminal for providing a human-computer interaction interface. The first electronic device 41 sends the fine-tuned dialogue task model to the second electronic device 42, and the second electronic device 42 directly processes the received dialogue task by calling the dialogue task model. Of course, when the second electronic device 42 receives a user's dialogue task such as a question-and-answer task, it sends the question directly to the first electronic device 41, and the first electronic device 41 calls the dialogue task model to process the question, and sends the answer to the second electronic device 42, which displays it on its human-computer interaction interface.
[0064] It should be noted that the above application scenarios are only shown to facilitate understanding of the concept and principle of the present invention, and the embodiments of the present invention are not limited in this respect. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.
[0065] The present invention also provides a corresponding device for the dialogue task execution method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The following is an introduction to the dialogue task execution device provided by the present invention, which is used to implement the dialogue task execution method provided by the present invention. In this embodiment, the dialogue task execution device may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the dialogue task execution method disclosed in Example 1. The program module referred to in this embodiment refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the dialogue task execution device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module in this embodiment, and the dialogue task execution device described below and the dialogue task execution method described above can be referred to in correspondence with each other.
[0066] From the perspective of functional modules, see Figure 5 , Figure 5 The structure diagram of the dialog task execution device provided in this embodiment under a specific implementation mode, the device may include:
[0067] The professional data acquisition module 501 is used to acquire matching professional data, a first prompt word and a second prompt word according to the professional field to which the dialogue task to be processed belongs.
[0068] The dialogue data extraction module 502 is used to input the first prompt word and professional data into a pre-trained dialogue data extraction model to obtain multiple groups of original dialogue data; the first prompt word is used to prompt the dialogue data extraction model to extract dialogue data from the professional data.
[0069] The dialogue data selection module 503 is used to automatically input the original dialogue data, professional data and the second prompt word into the pre-trained dialogue data selection model when it is detected that the task execution of the dialogue data extraction model is completed, so as to obtain the target dialogue data and construct a professional data set; the second prompt word is used to prompt the dialogue data selection model to select dialogue data that matches the professional data from the original dialogue data.
[0070] The dialogue task execution module 504 is used to fine-tune the dialogue task model that has completed the pre-training process using the professional data set, and execute the dialogue task to be processed using the fine-tuned dialogue task model.
[0071] Exemplarily, in some implementations of the present embodiment, the above-mentioned dialogue data selection module 503 can also be used to: obtain a supervised classification sample data set, the supervised classification sample data set contains supervised classification sample data that is less than a first quantity threshold, each supervised classification sample includes multiple groups of document sample data and corresponding dialogue sample data, each supervised classification sample has a similarity value label and a label indicating whether the dialogue sample data meets a similarity condition, and the similarity label is used to identify the degree of similarity between the document sample data and its corresponding dialogue sample data; use the supervised classification sample data set to train the target language model so that the target language model has the ability to select dialogue data that meets the similarity condition; when the target training language model reaches a preset model training stop condition, the currently obtained target training language model is used as the dialogue data selection model.
[0072] Exemplarily, in some other implementations of the present embodiment, the above-mentioned device may also include a user feedback module, which is used to: obtain historical questions, historical answers and user feedback results of the dialogue task model performing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, incorrect answers and corresponding user correct answers; construct a question and answer task dataset based on each historical question and its corresponding historical answer and user feedback result; determine the weight value of the loss corresponding to the task problem dataset and the professional dataset according to the degree of influence of the task problem dataset and the professional dataset on the task execution result; adjust the loss function of the dialogue task model in the initial fine-tuning process according to the weight value of the loss corresponding to the task problem dataset and the professional dataset, and obtain a joint loss function; when the data scale of the question and answer task dataset reaches the preset scale threshold, the joint loss function is adopted, and the dialogue task model is fine-tuned again using the task problem dataset and the professional dataset.
[0073] Exemplarily, in some other implementations of the present embodiment, the above-mentioned device may further include a user feedback module, which may also be used to: obtain historical questions, historical answers and user feedback results of the dialogue task model performing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, incorrect answers and corresponding user correct answers; construct a question and answer task data set based on each historical question and its corresponding historical answer and user feedback results; and whenever the scale of new data in the question and answer task data set reaches a preset quantity threshold, the dialogue task model is fine-tuned using the task question data set.
[0074] Exemplarily, in some other implementations of this embodiment, the above-mentioned dialogue task execution module 504 can also be used to: pre-process multiple text data into blocks, and convert each text block into corresponding text vector data, so as to build a knowledge base according to each text vector data; obtain the historical execution tasks of the dialogue task model and the target historical tasks related to the dialogue task to be processed; generate historical texts according to the historical dialogues, historical prediction results and corresponding historical user feedback results corresponding to each target historical task; process the historical text into blocks, and call the text vectorization model to vectorize each historical text block to obtain a historical text vector; send the historical text vector to the knowledge base; vectorize the task to be processed to obtain a dialogue vector to be queried; determine at least one candidate text vector that meets the preset vector similarity condition for the dialogue vector to be queried in the knowledge base; input the third prompt word, at least one candidate text vector and the dialogue to be processed corresponding to the task to be processed into the fine-tuned dialogue task model; the third prompt word is used to prompt the fine-tuned dialogue task model to generate a corresponding result for the dialogue to be processed. Exemplarily, in some other implementations of this embodiment, the above-mentioned device may also include a user feedback module, which can also be used to: obtain the predicted answer corresponding to the question to be processed; obtain the user's feedback results on the satisfaction and accuracy of the predicted answer; use the question to be processed, the predicted answer and the corresponding user feedback results corresponding to the dialogue task to be processed as a set of historical question and answer sample data, and import the historical question and answer sample data into the knowledge base of the dialogue task model.
[0075] Illustratively, in some other implementations of the present embodiment, the above-mentioned conversation data extraction module 502 can also be used for: the conversation data extraction model includes a first conversation data extraction sub-model, a second conversation data extraction sub-model and a third conversation data extraction sub-model; the first prompt word and the professional data are respectively input into the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model, and the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model respectively extract conversation data from the professional data according to the first prompt word; and multiple groups of original conversation data are obtained according to the conversation data extracted by the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model.
[0076] The dialog task execution device mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 6 The following is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention in one implementation manner. Figure 6 As shown, the electronic device includes a memory 60 for storing computer programs; a processor 61 for implementing the steps of the dialogue task execution method mentioned in any of the above embodiments when executing the computer program.
[0077] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 61 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 61 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0078] The memory 60 may include one or more computer non-volatile storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the memory 60 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 60 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 60 may also include both an internal storage unit of an electronic device and an external storage device. The memory 60 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the dialogue task execution method, but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the dialogue task execution method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include but is not limited to data corresponding to the execution result of the dialogue task, etc.
[0079] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64 or a network interface, a power supply 65 and a communication bus 66. Among them, the display screen 62 and the input / output interface 63, such as a keyboard, belong to the user interface, and exemplary user interfaces may also include standard wired interfaces, wireless interfaces, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 64 may exemplarily include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 66 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0080] It is understandable that if the dialogue task execution method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology 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 to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the dialogue task execution method recorded in any of the above embodiments are executed.
[0081] It is understandable that if the dialogue task execution method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product does not need to be stored in a physical storage medium. For example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to execute all or part of the steps of the methods of each embodiment of the present invention. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product that stores a computer program. When the computer program is executed by a processor, the steps of the dialogue task execution method recorded in any of the above embodiments are performed.
[0082] The above is a detailed introduction to a dialogue task execution method, electronic device, non-volatile storage medium, computer program product and server provided by the present invention. The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can refer to each other. Whether the units and algorithm steps of each example described in each disclosed embodiment are executed in electronic hardware or computer software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods for each specific application to implement the described functions, and such implementation should not be considered to exceed the scope of the present invention. Without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A method for executing a dialogue task, characterized in that: include: According to the professional field to which the dialogue task to be processed belongs, obtaining matching professional data, a first prompt word, and a second prompt word; Inputting the first prompt word and the professional data into a pre-trained dialogue data extraction model to obtain multiple groups of original dialogue data; The first prompt word is used to prompt the dialogue data extraction model to extract dialogue data from the professional data; When it is detected that the task execution of the dialogue data extraction model is completed, each original dialogue data, the professional data and the second prompt word are automatically input into the pre-trained dialogue data selection model to obtain each target dialogue data to construct a professional data set; The second prompt word is used to prompt the dialogue data selection model to select dialogue data matching the professional data from various original dialogue data; The professional data set is used to fine-tune the dialogue task model that has completed the pre-training process, and the fine-tuned dialogue task model is used to execute the dialogue task to be processed.
2. The method for executing a dialogue task according to claim 1, characterized in that: Before automatically inputting the original dialogue data, the professional data and the second prompt word into the pre-trained dialogue data selection model, the method further includes: Obtain a supervised classification sample data set, wherein the supervised classification sample data set contains supervised classification sample data less than a first quantity threshold, each supervised classification sample includes multiple groups of document sample data and corresponding dialogue sample data, each supervised classification sample has a similarity value label and a label indicating whether the dialogue sample data satisfies a similarity condition, and the similarity label is used to identify the degree of similarity between the document sample data and its corresponding dialogue sample data; Using the supervised classification sample data set to train a target language model, so that the target language model has the ability to select dialogue data that meets similar conditions; When the target training language model reaches the preset model training stop condition, the currently obtained target training language model is used as the dialogue data selection model.
3. The method for executing a dialogue task according to claim 1, characterized in that: After fine-tuning the dialogue task model that has completed the pre-training process using the professional data set, the method further includes: Obtaining historical questions, historical answers, and user feedback results of the dialogue task model executing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, incorrect answers, and corresponding correct answers of the user; Construct a question-answering task dataset based on each historical question and its corresponding historical answer and user feedback results; Determine the weight value of the loss corresponding to each of the task problem dataset and the professional dataset according to the influence degree of the task problem dataset and the professional dataset on the task execution result; According to the weight values of the losses corresponding to the task problem dataset and the professional dataset, respectively, adjusting the loss function of the dialogue task model in the initial fine-tuning process to obtain a joint loss function; When the data scale of the question-answering task data set reaches a preset scale threshold, the joint loss function is adopted to fine-tune the dialogue task model again using the task question data set and the professional data set.
4. The method for executing a dialogue task according to claim 1, characterized in that: After fine-tuning the dialogue task model that has completed the pre-training process using the professional data set, the method further includes: Obtaining historical questions, historical answers, and user feedback results of the dialogue task model executing historical dialogue tasks; wherein the user feedback results at least include satisfactory answers, incorrect answers, and corresponding correct answers of the user; Construct a question-answering task dataset based on each historical question and its corresponding historical answer and user feedback results; Whenever the scale of newly added data of the question-answering task dataset reaches a preset quantity threshold, the dialogue task model is fine-tuned using the task question dataset.
5. The method for executing a dialogue task according to claim 1, characterized in that: The using the fine-tuned dialog task model to execute the dialog task to be processed includes: Pre-processing a plurality of text data into blocks, and converting each text block into corresponding text vector data, so as to construct a knowledge base according to each text vector data; Acquire the historical execution tasks of the dialog task model and the target historical tasks related to the dialog task to be processed; Generate historical texts based on historical conversations, historical prediction results, and corresponding historical user feedback results corresponding to each target historical task; The historical text is processed into blocks, and a text vectorization model is called to perform vectorization processing on each historical text block to obtain a historical text vector; Sending the historical text vector to the knowledge base; Vectorizing the task to be processed to obtain a dialogue vector to be queried; Determining at least one candidate text vector satisfying a preset vector similarity condition for the dialogue vector to be queried in the knowledge base; The third prompt word, at least one candidate text vector and the dialogue to be processed corresponding to the task to be processed are input into the fine-tuned dialogue task model; the third prompt word is used to prompt the fine-tuned dialogue task model to generate a corresponding result for the dialogue to be processed.
6. The method for executing a dialogue task according to claim 1, characterized in that: The dialogue task to be processed is a question-answering task, which at least includes a question to be processed. After the dialogue task to be processed is executed by using the fine-tuned dialogue task model, the following step is further included: Obtaining a predicted answer corresponding to the problem to be processed; Obtaining user feedback on the satisfaction and accuracy of the predicted answer; The pending questions, predicted answers and corresponding user feedback results corresponding to the pending dialogue task are taken as a set of historical question and answer sample data, and the historical question and answer sample data are imported into the knowledge base of the dialogue task model.
7. The method for executing a dialogue task according to any one of claims 1 to 6, characterized in that: The dialogue data extraction model includes a first dialogue data extraction sub-model, a second dialogue data extraction sub-model and a third dialogue data extraction sub-model; The step of inputting the first prompt word and the professional data into a pre-trained dialogue data extraction model includes: inputting the first prompt word and the professional data into the first dialogue data extraction sub-model, the second dialogue data extraction sub-model and the third dialogue data extraction sub-model respectively, and the first dialogue data extraction sub-model, the second dialogue data extraction sub-model and the third dialogue data extraction sub-model respectively extract dialogue data from the professional data according to the first prompt word; A plurality of groups of original conversation data are obtained according to the conversation data extracted by the first conversation data extraction sub-model, the second conversation data extraction sub-model and the third conversation data extraction sub-model respectively.
8. A dialogue task execution device, characterized in that: include: A professional data acquisition module, used to acquire matching professional data, a first prompt word and a second prompt word according to the professional field to which the dialogue task to be processed belongs; A dialogue data extraction module, used for inputting the first prompt word and the professional data into a pre-trained dialogue data extraction model to obtain multiple groups of original dialogue data; The first prompt word is used to prompt the dialogue data extraction model to extract dialogue data from the professional data; A dialogue data selection module, for automatically inputting each original dialogue data, the professional data and the second prompt word into a pre-trained dialogue data selection model to obtain each target dialogue data to construct a professional data set when detecting that the task execution of the dialogue data extraction model is completed; The second prompt word is used to prompt the dialogue data selection model to select dialogue data matching the professional data from various original dialogue data; The dialogue task execution module is used to use the professional data set to fine-tune the dialogue task model that has completed the pre-training process, and use the fine-tuned dialogue task model to execute the dialogue task to be processed.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is used to implement the steps of the dialogue task execution method according to any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the dialogue task execution method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Knowledge base text matching question and answer method, device and equipment based on dialogue model
CN118427326A
Text dialogue generation model training method, text dialogue generation method and equipment
CN118520976A
Robot dialogue method, apparatus and device, and computer-readable storage medium
WO2021082836A1
Data construction method, model training method and apparatus, device, and medium
WO2024139292A1