Training method, system, device and product for multi-turn dialogue query rewriting task
By performing entity annotation and vector clustering filtering on historical dialogue data, and combining it with SFT training of the LLM-Chat model, the accuracy and timeliness issues in multi-turn dialogue query rewriting are solved, the data acquisition cost is reduced, and the query performance of multi-turn dialogue systems is improved.
Patent Information
- Application Number
- CN202511240323.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-02
AI Technical Summary
Existing multi-turn dialogue query rewriting technologies suffer from problems such as insufficient accuracy, information loss, poor query timeliness, and high data acquisition costs.
By acquiring historical dialogue data, performing entity annotation and vector aggregation calculation, filtering and combining datasets, and using the LLM-Chat model for SFT training, the accuracy and timeliness of query rewriting are improved, while reducing data acquisition costs.
It improves the accuracy and timeliness of multi-turn dialogue query rewriting, reduces information loss, lowers data acquisition costs, and is suitable for query rewriting tasks in multi-turn dialogue systems.
Smart Images

Figure CN120724162B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of artificial intelligence, and particularly relates to a training method, system, device and product for a multi-turn dialogue query rewriting task. BACKGROUND
[0002] In recent years, with the development of artificial intelligence technology, in order to ensure the naturalness, coherence and context consistency of dialogue, a multi-turn dialogue system based on a large language model is adopted, which fully utilizes the language understanding and generation capabilities of the LLM (Large Language Model), and through a large amount of pre-training and fine-tuning, can remember and refer to the dialogue of the previous turn in the multi-turn dialogue, to generate highly natural and humanized responses in continuous dialogue. The multi-turn dialogue system based on the large language model generates language that is more in line with human expression habits on the basis of more accurate context understanding, thereby improving the naturalness and realism of the dialogue experience.
[0003] In order to further improve the accuracy and real-time performance of the multi-turn dialogue system, retrieval augmented generation technology (RAG) has been introduced in recent years. Retrieval augmented generation technology combines information retrieval and generation model, and can dynamically obtain the latest information in the knowledge base when generating content, significantly improving the accuracy and breadth of the content. The workflow of retrieval augmented generation technology includes: performing information retrieval on the content input by the user, extracting relevant content from the external knowledge base, and combining the extracted relevant content and the content input by the user by the generation model to generate more rich and contextually consistent answers. In the RAG system, query rewriting is a key link, aiming to optimize the user's input query, and by adjusting or re-expressing the query content, the retrieval model can extract the most relevant information from the knowledge base. It usually involves restructuring the input, adjusting the wording or expanding the keywords to maximize the matching of relevant content in the knowledge base, for example, if the user's input is ambiguous or too brief, query rewriting will help the generation model obtain more relevant information by expanding the input, thereby improving the accuracy and depth of the answer.
[0004] The current implementation of query rewriting includes the following three methods: (1) performing word granularity operations on the original query, such as synonym replacement, spelling correction, removing stop words, and query expansion; (2) based on the original query, recalling similar queries from historical queries to complete the query rewriting task; (3) based on the generation model, using data mining techniques to mine associated query pairs from the historical query set, and using the associated query pairs to train the corresponding generation model to complete the corresponding query rewriting task.
[0005] But the above three ways have corresponding defects, such as: (1) this method relies on word granularity level replacement and correction operation, manual mining cost is high, and also cannot deeply understand complex semantic relationship, rewriting complex query lacks accuracy, and simple removal of pause words or spelling correction may ignore some potential semantic information, resulting in information loss; (2) this method relies on the coverage and instructions of historical query, since it completely depends on static similarity, for complex or ambiguous user intent query, the recalled query may not fully meet the current demand, and if the historical query contains outdated or inaccurate information, the recall result will affect the accuracy and timeliness of the query; (3) this method relies on the instructions of the mined query to data, in order to ensure good effect, it needs to be screened and cleaned by artificial, the data acquisition cost is high.
[0006] Based on the above shortcomings, how to provide an effective technical solution to solve the problems of lack of accuracy, easy to lose information, affect the accuracy and timeliness of the query and high data acquisition cost in the prior art has become a difficult problem to be solved in the prior art. SUMMARY
[0007] The purpose of the present application is to provide a training method, system, device and product for multi-round dialogue query rewriting task, to solve the above problems existing in the prior art.
[0008] In order to achieve the above purpose, the present application adopts the following technical scheme:
[0009] In a first aspect, the present application provides a training method for multi-round dialogue query rewriting task, comprising:
[0010] Obtaining historical dialogue data, constructing a historical data set based on the historical dialogue data, performing entity annotation on the historical dialogue data to obtain entity data, and obtaining a first data set based on the historical data set and the entity data;
[0011] Based on a preset number of times, using a large model to rewrite the query of the historical data set to obtain a query set, and obtaining a second data set based on the first data set and the query set;
[0012] Calculating the vector aggregation degree of the query set in the second data set, screening the query set based on the vector aggregation degree of each query set to obtain a screening result, and obtaining a third data set based on the screening result;
[0013] The third data set is sampled and combined to obtain a fourth data set, and the fourth data set is input into the LLM-Chat model for SFT training to obtain the trained LLM-Chat model.
[0014] In a possible design, vector aggregation degrees of the query sets in the second data set are calculated, the query sets are screened based on the vector aggregation degrees of the query sets, and a screening result is obtained.
[0015] The query sets in the second data set are vector encoded using a sentence vector model to obtain a plurality of encoded query sets;
[0016] Based on each encoded query set, a vector aggregation degree of each encoded query set is obtained.
[0017] The encoded query sets are screened based on a preset vector aggregation degree and the vector aggregation degrees of the encoded query sets to obtain a screening result, and the screening result includes the screened query sets and the second data set corresponding to the query sets.
[0018] In a possible design, the third data set is sampled and combined to obtain a fourth data set, including:
[0019] The third data set is sampled to obtain a sample rQ.
[0020] The sample rQ and the first data set are combined to obtain a quadruple data set.
[0021] The quadruple data set is encoded and combined to obtain the fourth data set.
[0022] In a possible design, the history data set includes history data and query data; and the quadruple data set is encoded and combined to obtain the fourth data set, including:
[0023] The history data and the query data in the quadruple data set are spliced to obtain text data.
[0024] The text data is vector encoded based on a sentence vector model to obtain encoded text data.
[0025] The entity data is vector encoded to obtain encoded entity data.
[0026] The encoded text data and the encoded entity data are combined to obtain a connection data set.
[0027] The connection data set is clustered and extracted to obtain the fourth data set.
[0028] In a possible design, the connection dataset is clustered to obtain a fourth dataset, including:
[0029] The connection dataset is clustered to obtain a plurality of clusters.
[0030] Based on a preset sample quantity, sample extraction is performed on each cluster to obtain a plurality of cluster samples.
[0031] Each cluster sample and the four-tuple dataset are spliced to obtain the fourth dataset.
[0032] In a possible design, the fourth dataset is input into an LLM-Chat model for SFT training, including:
[0033] The fourth dataset is filtered to obtain a triple dataset.
[0034] The triple dataset is input into the LLM-Chat model for SFT training.
[0035] In a possible design, the large model is gpt-4o.
[0036] In a second aspect, the present application provides a training system for a multi-round dialogue query rewriting task, which is used to implement the method of the first aspect, including:
[0037] An acquisition module is configured to acquire historical dialogue data, construct a historical dataset based on the historical dialogue data, perform entity annotation on the historical dialogue data to obtain entity data, and obtain a first dataset based on the historical dataset and the entity data.
[0038] A query rewriting module is configured to use a large model to rewrite queries of the historical dataset based on a preset number of times to obtain a query set, and obtain a second dataset based on the first dataset and the query set.
[0039] A calculation and screening module is configured to calculate vector aggregation degrees of the query set in the second dataset, screen the query set based on the vector aggregation degrees of each query set to obtain a screening result, and obtain a third dataset based on the screening result.
[0040] A task training module is configured to sample and combine the third dataset to obtain a fourth dataset, input the fourth dataset into an LLM-Chat model for SFT training, and obtain a trained LLM-Chat model.
[0041] Thirdly, the present invention provides a computer device comprising a memory, a processor, and a transceiver connected in sequence and communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the training method as described in any one of the above.
[0042] Fourthly, the present invention provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the training method as described in any of the preceding claims.
[0043] The beneficial effects of this invention are as follows:
[0044] This invention discloses a training method, system, device, and product for multi-turn dialogue query rewriting tasks. The method includes acquiring historical dialogue data, constructing a historical dataset based on the historical dialogue data, annotating the historical dialogue data with entities to obtain entity data, obtaining a first dataset based on the historical dataset and entity data, rewriting queries on the historical dataset using a large model based on a preset number of iterations to obtain a query set, obtaining a second dataset based on the first dataset and the query set, calculating the vector clustering degree of the query sets in the second dataset, filtering the query sets based on the vector clustering degree of each query set to obtain a filtering result, obtaining a third dataset based on the filtering result, sampling and combining the third dataset to obtain a fourth dataset, and inputting the fourth dataset into an LLM-Chat model for SFT training to obtain the trained LLM-Chat model. This invention addresses multi-turn dialogue scenarios by annotating historical dialogue data with entities, setting a vector clustering index, and filtering samples based on the vector clustering index. This reduces data acquisition costs, minimizes information loss, and incorporates historical dialogue data into the query rewriting results, improving the accuracy of query rewriting and enhancing query precision and timeliness, thus facilitating application and promotion. Attached Figure Description
[0045] Figure 1 A flowchart of the training method provided in the first aspect of this embodiment;
[0046] Figure 2 This is a block diagram of the training system provided in the second aspect of this embodiment. Detailed Implementation
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.
[0048] It should be understood that although the terms first, second, etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, without departing from the scope of the exemplary embodiments of the invention.
[0049] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.
[0050] Example:
[0051] like Figure 1 As shown, the first aspect of this embodiment provides a training method for a multi-turn dialogue query rewriting task, which can be executed, but is not limited to, by a computer device or virtual machine with certain computing resources, such as a personal computer or smartphone, or by a virtual machine; the training method for the multi-turn dialogue query rewriting task includes, but is not limited to, the following steps:
[0052] S1. Obtain historical dialogue data, construct a historical dataset based on the historical dialogue data, perform entity annotation on the historical dialogue data to obtain entity data, and obtain the first dataset based on the historical dataset and entity data;
[0053] The historical dataset includes history data and query data. The historical dialogue data is domain knowledge data, and the effect of subsequent query rewriting is enhanced by adding domain knowledge data in multi-turn dialogues.
[0054] For example, the historical dialogue data consists of car repair consultation Q&A dialogue data. One sample data point in the historical dataset has the following history data: [{"from": "human", "value": "Where are the filler and drain plugs for the transmission of a 2012 XX car, and how much oil should I add?"}, {"from": "assistant", "value": "Hello, the drain plug for the transmission is located at the bottom of the transmission; the filler plug is located near the half-shaft protection cage. Normally, the transmission fluid level should be 4.5 liters."}]; the query data is ["How do I check the fluid level?"]. Preset entity extraction fields are obtained, including "car brand", "car manufacturer", "car model", "car year", "car parts", and "car malfunction". Based on these preset entity extraction fields, entity recognition is performed on the historical dialogue data, resulting in the following entity data: {"Manufacturer": "None", "Brand": "XX", "Model": "xx", "Year": "2012", "Parts": "Transmission", "Malfunction": "None"};
[0055] Merging the entity data with the corresponding sample data from the historical dataset, the first dataset is: { "history": [ { "from": "human", "value": "Where are the filler and drain plugs for the transmission of a 2012 XX car, and how much fluid should be added?"},{ "from": "assistant", "value": "Hello, the drain plug for the transmission is located at the bottom of the transmission; the filler plug is located near the half-shaft protection cage. Normally, the transmission fluid level should be 4.5 liters."} ],"query": "How to check the fluid level","ner_word": {"Manufacturer": "None","Brand": "XX","Model": "xx","Year": "2012", "Components": "Transmission", "Fault Phenomenon": "None"}}.
[0056] S2. Based on a preset number of iterations, use a large model to rewrite the queries in the historical dataset to obtain a query set. Based on the first dataset and the query set, obtain the second dataset.
[0057] Preferably, in this embodiment, the preset number of times is 5, the large model is gtp-4o, and the hyperparameter temperature of gtp-4o is set to 1.0.
[0058] In this embodiment, based on a preset number of attempts and a prompt, a large model is used to rewrite the queries on the historical dataset. For example, the prompt is: "Please rewrite the original query into a new query based on the historical dialogue content. The rewritten query must meet the following conditions: 1. If the historical dialogue content contains content related to the original query, then the original query is rewritten into a new query based on the historical dialogue content. 2. If the historical dialogue content does not contain content related to the original query, then the rewritten query remains consistent with the original query. 3. The rewritten query must be within 100 characters. 4. Output plain text directly."
[0059] The resulting query set is: ["How to check the transmission fluid level and standard fluid level of a 2012 XX car?", "How to check the transmission fluid level and fluid level of an XX car?", "How to check the transmission fluid level and fluid level of an XX car? Is 4.5 liters of fluid appropriate?", "How to check the transmission fluid level and fluid level of a 2012 XX car?", "How to check the transmission fluid level and fluid level of a 2012 XX car?"];
[0060] At this point, the second dataset is: { "history": [{"from": "human", "value":"Where are the filler and drain plugs for the transmission of a 2012 XX car, and how much fluid should be added?"},{"from": "assistant","value":"Hello, the drain plug is located at the bottom of the transmission; the filler plug is located near the half-shaft protection cage. Normally, the transmission fluid level should be 4.5 liters."}],"query":"How to check the fluid level and fluid quantity?"",ner_word":{"Manufacturer":"None","Brand":"XX","Model":"xx","Year":"2012","Components":"Transmission","Fault Phenomenon":"None"}, "rewrite_labels": ["How to check the transmission fluid level and fluid quantity standard for a 2012 XX car?","How to check the transmission fluid level and fluid quantity for an XX car?","How to check the transmission fluid level and fluid quantity for an XX car, is 4.5 liters appropriate?","12 How to check the oil level and quantity in the transmission of a 2012 XX car?
[0061] S3. Calculate the vector clustering degree of the query sets in the second dataset, filter the query sets based on the vector clustering degree of each query set, obtain the filtering results, and obtain the third dataset based on the filtering results;
[0062] Specifically, in step S3, the vector clustering degree of the query sets in the second dataset is calculated, and the query sets are filtered based on the vector clustering degree of each query set to obtain the filtering results, including:
[0063] S31. Use the sentence vector model to vectorize the query set in the second dataset to obtain multiple encoded query sets;
[0064] In this embodiment, the preferred sentence vector model is bce-embedding-base_v1, which is a Chinese-English bilingual embedding model launched by NetEase Youdao. Its principle is to convert text (such as sentences or paragraphs) into vector representations of fixed dimensions.
[0065] For example, if the query set is a string array of length 5, and the latent vector dimension of bce-embedding-base_v1 is 768, then the dimension of the encoded query set is (5, 768).
[0066] S32. Based on each set of encoded queries, obtain the vector clustering degree of each set of encoded queries;
[0067] For example, in this embodiment, the expression for calculating the vector aggregation degree is:
[0068] ;
[0069] In the formula, For vector aggregation degree, For the summation function, It is an absolute value function. For encoding a collection of queries, To encode the query set, the mean is calculated column-wise to obtain the first vector, which has dimensions (1, 768). This first vector is then copied and expanded row-wise to obtain... The vector dimension is (5,768). The latent vector dimension of bce-embedding-base_v1. To encode the number of queries in the set, for example, 5, the summation function is used to calculate the sum, and then the result is normalized. This is used to obtain the vector aggregation degree.
[0070] Furthermore, a smaller vector clustering degree indicates a higher degree of clustering in the vector set, while a larger vector clustering degree indicates a lower degree of clustering in the vector set.
[0071] S33. Based on the preset vector aggregation degree and the vector aggregation degree of each encoded query set, the encoded query set is filtered to obtain the filtering result, which includes the filtered query set and the second dataset corresponding to the query set.
[0072] S4. Sample and combine the third dataset to obtain the fourth dataset. Input the fourth dataset into the LLM-Chat model for SFT training to obtain the trained LLM-Chat model.
[0073] Specifically, in step S4, the third dataset is sampled and combined to obtain the fourth dataset, which includes:
[0074] S41. Sample the third dataset to obtain sample rQ;
[0075] S42. Combine the sample rQ with the first dataset to obtain the quadruple dataset;
[0076] S43. Encode and combine the quadruple datasets to obtain the fourth dataset.
[0077] Specifically, in step S43, the quadruple dataset is encoded and combined to obtain the fourth dataset, which includes:
[0078] S431. Concatenate the history data and query data in the quadruple dataset to obtain text data;
[0079] For example, the text data is: 'human: Where are the filler and drain plugs for the transmission of a 2012 XX car? How much fluid should I add? nassistant: Hello, the drain plug is located at the bottom of the transmission; the fill plug is located near the axle guard. Normally, the transmission fluid level should be 4.5 liters. nhuman: How do I check the fluid level?'
[0080] S432. Based on the sentence vector model, the text data is vector-encoded to obtain encoded text data;
[0081] The vector dimension of the encoded text data is (1,768).
[0082] S433. Perform vector encoding on the entity data to obtain encoded entity data;
[0083] For example, since the entity data is a set of length 6, the entity data is encoded based on the sentence vector model to obtain 6 encoded vectors. The vector dimensions of the 6 encoded vectors are all (1, 768). The average value of the 6 encoded vectors is then applied to obtain the encoded entity data, which has a vector dimension of (1, 768).
[0084] S434. Combine the encoded text data and the encoded entity data to obtain a concatenated dataset;
[0085] Specifically, the encoded text data and encoded entity data are concatenated to obtain a concatenated dataset with a vector dimension of (1, 1536).
[0086] S435. Perform clustering extraction on the connected dataset to obtain the fourth dataset.
[0087] Specifically, in step S435, clustering is performed on the connected dataset to obtain the fourth dataset, which includes:
[0088] S4351. Cluster the connected dataset to obtain multiple clusters;
[0089] Preferably, the KMeans clustering algorithm is used to cluster the connected datasets.
[0090] S4352. Extract samples from each cluster based on a preset number of samples to obtain multiple cluster samples;
[0091] Specifically, the cluster sample is the sample closest to the cluster center in each cluster.
[0092] S4353. Concatenate each cluster sample and the quadruple dataset to obtain the fourth dataset.
[0093] Specifically, in step S4, the fourth dataset is input into the LLM-Chat model for SFT training, including:
[0094] S44. Filter the fourth dataset to obtain triplet data;
[0095] Specifically, the entity data in the fourth dataset is filtered to obtain triplet data.
[0096] S45. Input the triplet data into the LLM-Chat model for SFT training.
[0097] For example, in this embodiment, the Qwen-1.8B-Chat model is used as the fine-tuning model. The Qwen-1.8B-Chat model is a multilingual dialogue language model developed by Alibaba Cloud. In SFT (Supervised Fine-Tuning) training, the loss function used is the autoregressive cross-entropy loss. At the same time, the loss of the instruction part is excluded through the mask mechanism, and only the loss of the output part is calculated to complete the update of gradient and model parameters.
[0098] like Figure 2As shown, the second aspect of this embodiment provides a training system for a multi-turn dialogue query rewriting task, including:
[0099] The annotation module is used to acquire historical dialogue data, construct a historical dataset based on the historical dialogue data, annotate the historical dialogue data to obtain entity data, and obtain the first dataset based on the historical dataset and the entity data.
[0100] The query rewriting module is used to rewrite the queries on the historical dataset using a large model based on a preset number of times, to obtain a query set. Based on the first dataset and the query set, a second dataset is obtained.
[0101] The calculation and filtering module is used to calculate the vector clustering degree of the query sets in the second dataset, filter the query sets based on the vector clustering degree of each query set, obtain the filtering results, and obtain the third dataset based on the filtering results;
[0102] The task training module is used to sample and combine the third dataset to obtain the fourth dataset. The fourth dataset is then input into the LLM-Chat model for SFT training to obtain the trained LLM-Chat model.
[0103] The working process, working details and technical effects of the training system provided in the second aspect of this embodiment can be found in the training method described in the first aspect, and will not be repeated here.
[0104] This embodiment provides a computer device including a memory, a processor, and a transceiver sequentially and communicatively connected. The memory stores a computer program, the transceiver sends and receives messages, and the processor reads the computer program and executes the training method described in the first aspect. Specifically, the memory may include, but is not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; the processor may include, but is not limited to, an STM32F105 series microprocessor. Furthermore, the computer device may also include, but is not limited to, a power supply module, a display screen, and other necessary components.
[0105] The working process, working details and technical effects of the aforementioned computer device provided in the third aspect of this embodiment can be found in the training method described in the first aspect, and will not be repeated here.
[0106] The fourth aspect of this embodiment provides a computer program product, including a computer program or instructions, which, when executed by a computer, are used to implement the training method as described in the first aspect.
[0107] The working process, working details, and technical effects of the aforementioned computer program product provided in this embodiment can be found in the training method described in the first aspect, and will not be repeated here.
[0108] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A training method for multi-turn dialogue query rewriting tasks, characterized in that, include: Acquire historical dialogue data, construct a historical dataset based on the historical dialogue data, annotate the historical dialogue data to obtain entity data, and obtain the first dataset based on the historical dataset and the entity data; Based on a preset number of iterations, a large model is used to rewrite the queries in the historical dataset to obtain a query set. Based on the first dataset and the query set, a second dataset is obtained. Calculate the vector clustering degree of the query sets in the second dataset. Based on the vector clustering degree of each query set, filter the query sets to obtain the filtering results. Based on the filtering results, obtain the third dataset. The process of calculating the vector clustering degree of the query sets in the second dataset and filtering the query sets based on the vector clustering degree of each query set to obtain the filtering results includes: The query set in the second dataset is vectorized using a sentence vector model to obtain multiple encoded query sets. Based on each set of encoded queries, obtain the vector clustering degree of each set of encoded queries; The encoded query set is filtered based on the preset vector clustering degree and the vector clustering degree of each encoded query set to obtain the filtering result. The filtering result includes the filtered query set and the second dataset corresponding to the query set. The smaller the vector clustering degree, the higher the clustering degree of the set. The third dataset is sampled and combined to obtain the fourth dataset. The fourth dataset is then input into the LLM-Chat model for SFT training to obtain the trained LLM-Chat model.
2. The training method for multi-turn dialogue query rewriting task according to claim 1, characterized in that, The third dataset is sampled and combined to obtain the fourth dataset, which includes: The third dataset is sampled to obtain sample rQ; Combine the sample rQ with the first dataset to obtain the quadruple dataset; The fourth dataset is obtained by encoding and combining the quadruple dataset.
3. The training method for multi-turn dialogue query rewriting task according to claim 2, characterized in that, The historical dataset includes history data and query data; The encoding and combination of the quadruple datasets to obtain the fourth dataset includes: The history and query data in the quadruple dataset are concatenated to obtain the text data; Text data is vector-encoded based on a sentence vector model to obtain encoded text data. Vector encoding is performed on entity data to obtain encoded entity data; By combining encoded text data and encoded entity data, a connected dataset is obtained; Clustering was performed on the connected dataset to obtain the fourth dataset.
4. The training method for multi-turn dialogue query rewriting task according to claim 3, characterized in that, Clustering and extraction were performed on the connected datasets to obtain the fourth dataset, which includes: Cluster the connected dataset to obtain multiple clusters; Samples are extracted from each cluster based on a preset sample size to obtain multiple cluster samples; The fourth dataset is obtained by concatenating each cluster sample and the quadruple dataset.
5. The training method for multi-turn dialogue query rewriting task according to claim 1, characterized in that, The fourth dataset was input into the LLM-Chat model for SFT training, including: Filter the fourth dataset to obtain triplet data; The triplet data is input into the LLM-Chat model for SFT training.
6. The training method for multi-turn dialogue query rewriting task according to claim 1, characterized in that, The large model is gpt-4o.
7. A training system for multi-turn dialogue query rewriting tasks, used to implement the method according to any one of claims 1 to 6, characterized in that, include: The annotation module is used to acquire historical dialogue data, construct a historical dataset based on the historical dialogue data, annotate the historical dialogue data to obtain entity data, and obtain the first dataset based on the historical dataset and the entity data. The query rewriting module is used to rewrite the queries on the historical dataset using a large model based on a preset number of times, to obtain a query set. Based on the first dataset and the query set, a second dataset is obtained. The filtering module calculates the vector clustering degree of the query sets in the second dataset, filters the query sets based on the vector clustering degree of each query set, and obtains the filtering results. Based on the filtering results, the third dataset is obtained. The process of calculating the vector clustering degree of the query sets in the second dataset and filtering the query sets based on the vector clustering degree of each query set to obtain the filtering results includes: The query set in the second dataset is vectorized using a sentence vector model to obtain multiple encoded query sets. Based on each set of encoded queries, obtain the vector clustering degree of each set of encoded queries; The encoded query set is filtered based on the preset vector clustering degree and the vector clustering degree of each encoded query set to obtain the filtering result. The filtering result includes the filtered query set and the second dataset corresponding to the query set. The smaller the vector clustering degree, the higher the clustering degree of the set. The task training module is used to sample and combine the third dataset to obtain the fourth dataset. The fourth dataset is then input into the LLM-Chat model for SFT training to obtain the trained LLM-Chat model.
8. A computer device, characterized in that, The device includes a memory, a processor, and a transceiver that are sequentially and communicatively connected, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the training method as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or the instructions are executed by the computer, they implement the training method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Input rewriting method and device of intelligent question answering system and computer equipment
CN119782485A
Automatic answer rephrasing based on talking style
US20190115008A1