Training method, system, equipment and product for multi-round dialogue query rewriting task

By performing entity labeling and vector aggregation screening on historical conversation data, combined with LLM-Chat model training, we solved the accuracy and cost issues in multi-round conversation query rewriting and achieved more efficient query rewriting.

CN120724162AActive Publication Date: 2025-09-30BEIJING BAICHEBAO TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511240323.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-09-30
Estimated Expiration
2045-09-02

AI Technical Summary

Technical Problem

Existing multi-round dialogue query rewriting technology has problems such as insufficient accuracy, prone to information loss, affecting query accuracy and timeliness, and high data acquisition costs.

Method used

By acquiring historical conversation data, performing entity labeling and vector aggregation calculations, filtering and combining data sets, and using the LLM-Chat model for SFT training, we can improve the accuracy and timeliness of query rewriting and reduce data acquisition costs.

Benefits of technology

It improves the accuracy and timeliness of multi-round dialogue query rewriting, reduces information loss, lowers data acquisition costs, and facilitates application and promotion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120724162A_ABST
    Figure CN120724162A_ABST
Patent Text Reader

Abstract

The invention discloses a training method, system, equipment and product for a multi-round dialogue query rewriting task, and belongs to the technical field of artificial intelligence, and the method comprises the steps: obtaining historical dialogue data, carrying out entity labeling, obtaining entity data, obtaining a first data set based on the historical dialogue data and the entity data, obtaining a query set based on the historical data set, and obtaining a query rewriting task; based on the first data set and the query set, obtaining a second data set, calculating a vector aggregation degree of the query set in the second data set, screening the query set, based on a screening result, obtaining a third data set, carrying out sampling combination on the third data set, obtaining a fourth data set, inputting the fourth data set into an LLM-Chat model, and carrying out SFT training to obtain a trained LLM-Chat model. Under the scene of multiple rounds of dialogues, the data acquisition cost can be reduced, the information loss condition is reduced, and the query rewriting accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a training method, system, device and product for multi-round dialogue query rewriting tasks. Background Art

[0002] In recent years, advancements in artificial intelligence (AI) have led to the adoption of multi-turn dialogue systems based on large language models (LLMs) to ensure naturalness, coherence, and contextual consistency in conversations. These systems leverage the language understanding and generation capabilities of the Large Language Model (LLM). Through extensive pre-training and fine-tuning, they can memorize and reference previous conversations during multiple rounds, generating highly natural and human-like responses. This multi-turn dialogue system, based on LLMs, not only provides more accurate contextual understanding but also generates language that is more consistent with human expression habits, thereby enhancing the naturalness and realism of the conversational experience.

[0003] To further enhance the accuracy and real-time performance of multi-turn dialogue systems, retrieval-augmented generation (RAG) technology has been introduced in recent years. Combining information retrieval with generative models, RAG dynamically accesses the latest information from the knowledge base when generating content, significantly improving both the accuracy and breadth of the content. The RAG workflow involves performing information retrieval on user input, extracting relevant content from an external knowledge base, and combining the extracted content with the user input by the generative model to generate richer, more contextually relevant responses. In RAG systems, query rewriting is a key step, aiming to optimize the user's query by adjusting or rephrasing the query so that the retrieval model can extract the most relevant information from the knowledge base. This typically involves restructuring the input, adjusting the wording, or expanding keywords to maximize the match to relevant content in the knowledge base. For example, if the user's input is ambiguous or too brief, query rewriting can expand the input to help the generative model extract more relevant information, thereby improving the accuracy and depth of the response.

[0004] Currently, there are three common ways to implement query rewriting: (1) performing word-level operations on the original query, such as synonym replacement, spelling correction, pause word removal, and query expansion; (2) based on the original query, recalling similar queries from historical queries to complete the query rewriting task; (3) based on a generative model, using data mining technology to mine related query pairs from the historical query set, and using the related query pairs to train the corresponding generative model to complete the corresponding query rewriting task.

[0005] However, the above three methods all have corresponding defects, such as: (1) This method relies on word-level replacement and correction operations, which has high manual mining costs and cannot deeply understand complex semantic relationships. Rewriting complex queries lacks accuracy. At the same time, simply removing pause words or correcting spelling errors may ignore some potential semantic information, resulting in information loss; (2) This method relies on the coverage and instructions of historical queries. Since it relies entirely on static similarity, for queries with complex or ambiguous user intentions, the recalled queries may not fully meet current needs. Moreover, if the historical queries contain outdated or inaccurate information, the recalled results will affect the accuracy and timeliness of the queries; (3) This method relies on the instructions of the mined query on the data. In order to ensure good results, it needs to be manually screened and cleaned, and 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 information loss, impact on query accuracy and timeliness, and high data acquisition cost in the existing technology has become a difficult problem that needs to be solved urgently in the existing technology. Summary of the Invention

[0007] The purpose of the present invention is to provide a training method, system, device and product for multi-round dialogue query rewriting tasks to solve the above-mentioned problems existing in the prior art.

[0008] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a training method for a multi-round dialogue query rewriting task, comprising: Acquire historical conversation data, construct a historical data set based on the historical conversation data, perform entity annotation on the historical conversation data to obtain entity data, and obtain a first data set based on the historical data set and the entity data; Based on a preset number of times, the large model is used to rewrite the query of the historical data set to obtain a query set, and the second data set is obtained based on the first data set and the query set; Calculating the vector aggregation of the query set in the second data set, filtering the query set based on the vector aggregation of each query set to obtain a filtering result, and obtaining a third data set based on the filtering result; 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 a trained LLM-Chat model.

[0009] In one possible design, the vector clustering of the query set in the second data set is calculated, and the query set is filtered based on the vector clustering of each query set to obtain a filtering result, including: Using the sentence vector model to vector encode the query set in the second dataset to obtain multiple encoded query sets; Based on each encoding query set, the vector aggregation degree of each encoding query set is obtained; The coded query set is screened based on the preset vector concentration and the vector concentration of each coded query set to obtain a screening result, where the screening result includes the screened query set and a second data set corresponding to the query set.

[0010] In one possible design, the third data set is sampled and combined to obtain a fourth data set, including: Sampling the third data set to obtain a sample rQ; Combine the sample rQ and the first data set to obtain a four-tuple data set; The four-tuple data sets are encoded and combined to obtain a fourth data set.

[0011] In one possible design, the historical data set includes history data and query data; and encoding and combining the four-tuple data set to obtain a fourth data set includes: Concatenate the history data and query data in the quadruple dataset to obtain text data; Perform vector encoding on text data based on the sentence vector model to obtain encoded text data; Perform vector encoding on the entity data to obtain encoded entity data; Combining the encoded text data and the encoded entity data to obtain a connected dataset; Perform clustering extraction on the connected data set to obtain a fourth data set.

[0012] In a possible design, cluster extraction is performed on the connected dataset to obtain a fourth dataset, including: Clustering the connected data set to obtain multiple clusters; Extract samples from each cluster based on a preset number of samples to obtain multiple cluster samples; Each cluster sample and the four-tuple data set are concatenated to obtain a fourth data set.

[0013] In one possible design, the fourth dataset is input into the LLM-Chat model for SFT training, including: Filter the fourth data set to obtain triple data; The triplet data is input into the LLM-Chat model for SFT training.

[0014] In one possible design, the large model is gpt-4o.

[0015] In a second aspect, the present invention provides a training system for a multi-round dialogue query rewriting task, configured to implement the method described in the first aspect, including: An acquisition and annotation module is used to acquire historical conversation data, construct a historical data set based on the historical conversation data, perform entity annotation on the historical conversation data to obtain entity data, and obtain a first data set based on the historical data set and the entity data; A query rewriting module is used to rewrite the query of the historical data set using the large model based on a preset number of times to obtain a query set, and obtain a second data set based on the first data set and the query set; a calculation and screening module, configured to calculate the vector aggregation of the query set in the second data set, screen the query set based on the vector aggregation of each query set to obtain screening results, and obtain a third data set based on the screening results; The task training module is used to sample and combine the third data set to obtain a fourth data set, input the fourth data set into the LLM-Chat model for SFT training, and obtain a trained LLM-Chat model.

[0016] In a third aspect, the present invention provides a computer device comprising a memory, a processor and a transceiver communicatively connected in sequence, 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 any one of the training methods described above.

[0017] In a fourth aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, cause the computer to execute any one of the training methods described above.

[0018] The beneficial effects of the present invention are as follows: The present invention discloses a training method, system, device and product for a multi-round dialogue query rewriting task, comprising acquiring 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, obtaining a first data set based on the historical data set and the entity data, performing query rewriting on the historical data set using a large model based on a preset number of times to obtain a query set, obtaining a second data set based on the first data set and the query set, calculating a 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, obtaining a third data set based on the screening result, sampling and combining the third data set to obtain a fourth data set, inputting the fourth data set into an LLM-Chat model for SFT training, and obtaining a trained LLM-Chat model. In the scenario of multi-round dialogue, the present invention performs entity annotation on historical dialogue data, sets a vector aggregation index, and filters samples based on the vector aggregation, thereby reducing data acquisition costs and the occurrence of information loss. The historical dialogue data is integrated into the query rewriting results to improve the accuracy of query rewriting, thereby increasing the accuracy and timeliness of queries and facilitating application and promotion. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flowchart of the training method provided in the first aspect of this embodiment; Figure 2 This is a module block diagram of the training system provided in the second aspect of this embodiment. DETAILED DESCRIPTION

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly introduced below in conjunction with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the 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 work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.

[0021] It should be understood that although the terms "first," "second," etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element without departing from the scope of the exemplary embodiments of the present invention.

[0022] It should be understood that the term "and / or" that may appear in this document is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may indicate three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this document describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B may indicate two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0023] Example: like Figure 1 As shown, a first aspect of this embodiment provides a training method for a multi-turn dialogue query rewriting task, which can be performed by, but is not limited to, a computer device or a virtual machine with certain computing resources, such as a personal computer or a smart phone, or a virtual machine. The training method for the multi-turn dialogue query rewriting task includes, but is not limited to, the following steps: S1. Obtain historical conversation data, construct a historical data set based on the historical conversation data, perform entity annotation on the historical conversation data to obtain entity data, and obtain a first data set based on the historical data set and the entity data; Among them, the historical data set includes history data and query data. The historical conversation data is domain knowledge data. By adding domain knowledge data to multiple rounds of conversations, the effect of subsequent query rewriting is enhanced.

[0024] For example, the historical conversation data is automobile repair consultation question-and-answer conversation data. A sample data in the historical data set has the following history data: [{"from": "human", "value": "Where are the oil filler and drain ports for the 2012 XX car transmission? How much oil should be added?"}, {"from": "assistant", "value": "Hello, the transmission oil drain screw is located at the bottom of the transmission; the oil filler screw is located near the axle protection cage. Normally, the transmission oil filling amount should be 4.5 liters."}]; the query data is ["How do I check the oil level?"]. The preset entity extraction fields are obtained. The preset entity extraction fields include "car brand", "car manufacturer", "car model", "car year", "car parts", and "car failure symptoms". Entity recognition is performed on the historical conversation data based on the preset entity extraction fields. The resulting entity data is: {"Manufacturer": "None","Brand": "XX","Car Model": "xx","Year": "2012","Parts": "Transmission", "Failure Symptom": "None"}; Merge the entity data with the corresponding sample data in the historical dataset, and the first dataset obtained is: { "history": [ { "from": "human", "value": "Where are the refueling and drain ports of the XX car transmission in 2012, and how much oil should be added?"},{ "from": "assistant", "value": "Hello, the gearbox's oil drain screw is located at the bottom of the gearbox; the oil filling screw is located near the half-shaft protection cage. Normally, the gearbox oil filling volume should be 4.5 liters."} ],"query": "How to check the oil level and oil level","ner_word": {"Manufacturer": "None","Brand": "XX","Model": "xx","Year": "2012", "Components": "Gearbox", "Failure phenomenon": "None"}}.

[0025] S2. Based on a preset number of times, the query of the historical data set is rewritten using the large model to obtain a query set, and a second data set is obtained based on the first data set and the query set; Preferably, in this embodiment, the preset number of times is 5 times, the large model is gtp-4o, and the hyperparameter temperature of gtp-4o is set to 1.0.

[0026] In this embodiment, a large model is used to rewrite queries in historical datasets based on a preset number of times and a prompt. For example, the prompt is: "Please rewrite the original query into a new query based on the original query and the historical conversation content. The rewritten query must meet the following conditions: 1. If the historical conversation content contains content related to the original query, the original query will be rewritten into a new query based on the historical conversation content. 2. If the historical conversation content does not contain content related to the original query, the rewritten query will remain consistent with the original query. 3. The rewritten query must be within 100 words. 4. The plain text is directly output." The resulting query set is: ["How to check the transmission oil level and oil level standard for a 2012 XX car?", "How to check the transmission oil level for a XX car and what is the oil level?", "How to check the transmission oil level for a XX car and is 4.5 liters a suitable oil level?", "How to check the transmission oil level and oil level for a 2012 XX car?", "How to check the transmission oil level and oil level for a 2012 XX car?"]; At this time, the second data set is: { "history": [{"from": "human", "value":"Where are the oil filling and drain ports of the XX car transmission in 2012? How much oil should be added?"},{"from": "assistant","value":"Hello, the oil drain screw of the transmission is located at the bottom of the transmission; the oil filling screw is located near the half-shaft protection cage. Under normal circumstances, the transmission oil filling amount should be 4.5 liters."}],"query":"How to check the oil level and oil volume","ner_word":{"Manufacturer":"None","Brand":"XX","Model":"xx","Year":"2012","Components":"Transmission","Failure phenomenon":"None"}, "rewrite_labels": ["How to check the oil level and oil volume standard of the XX car transmission in 2012?","How to check the oil level of the XX car transmission and how much oil volume should be?","How to check the oil level of the XX car transmission and whether 4.5 liters of oil volume is appropriate?","12 How do I check the oil level and oil level in a 2012 XX car transmission?

[0027] S3. Calculate the vector aggregation of the query set in the second data set, filter the query set based on the vector aggregation of each query set, obtain the filtering results, and obtain the third data set based on the filtering results; Specifically, in step S3, the vector aggregation of the query set in the second data set is calculated, and the query set is screened based on the vector aggregation of each query set to obtain a screening result, including: S31. Use the sentence vector model to vector encode the query set in the second data set to obtain multiple encoded query sets; In this embodiment, the sentence vector model is preferably bce-embedding-base_v1. bce-embedding-base_v1 is a Chinese-English bilingual embedding model launched by NetEase Youdao. Its principle is to convert text (such as sentences or paragraphs) into a vector representation of fixed dimension.

[0028] For example, the query set is a string array of length 5, and the latent vector dimension of bce-embedding-base_v1 is 768. Therefore, the dimension of the encoded query set is (5,768).

[0029] S32. Based on each encoding query set, obtain the vector aggregation of each encoding query set; For example, in this embodiment, the calculation expression of vector concentration is: ; Where, is the vector aggregation degree, is the summation function, is the absolute value function, To encode the query set, To encode the query set, we calculate the mean by column and get the first vector. The vector dimension of the first vector is (1,768). We replicate and expand the first vector by row to get , the vector dimension is (5,768), is the hidden vector dimension of bce-embedding-base_v1, The number of encoded query sets is 5, for example. After the sum function is used for calculation, the summed result is normalized and then , to obtain the vector aggregation degree.

[0030] Furthermore, a smaller vector clustering degree indicates a higher clustering degree of the vector set, and a larger vector clustering degree indicates a lower clustering degree of the vector set.

[0031] S33. Filter the coded query set based on the preset vector concentration and the vector concentration of each coded query set to obtain a filtering result, where the filtering result includes the filtered query set and a second data set corresponding to the query set.

[0032] S4. Sample and combine the third data set to obtain a fourth data set, input the fourth data set into the LLM-Chat model for SFT training, and obtain a trained LLM-Chat model.

[0033] Specifically, in step S4, sampling and combining the third data set to obtain a fourth data set includes: S41. Sampling the third data set to obtain a sample rQ; S42. Combining the sample rQ and the first data set to obtain a four-tuple data set; S43. Encode and combine the four-tuple data sets to obtain a fourth data set.

[0034] Specifically, in step S43, the four-tuple data set is encoded and combined to obtain a fourth data set, including: S431. Concatenate the history data and query data in the quadruple dataset to obtain text data; For example, the text data is: "human: Where are the oil filler and drain ports on a 2012 XX car's transmission? How much oil should I add? nassistant: Hello, the transmission's oil drain screw is located at the bottom of the transmission; the oil filler screw is located near the axle protection cage. Typically, the transmission oil should be filled to 4.5 liters. nhuman: How do I check the oil level?"

[0035] S432. Perform vector encoding on the text data based on the sentence vector model to obtain encoded text data; The dimension of the vector encoding the text data is (1,768).

[0036] S433. Perform vector encoding on the entity data to obtain encoded entity data; 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 encoding vectors, and the vector dimension of the 6 encoding vectors is (1,768). The 6 encoding vectors are averaged to obtain the encoded entity data, and the vector dimension of the encoded entity data is (1,768).

[0037] S434. Combining the encoded text data and the encoded entity data to obtain a connected data set; Specifically, the encoded text data and the encoded entity data are concatenated to obtain a concatenated dataset, and the vector dimension of the concatenated dataset is (1,1536).

[0038] S435. Perform cluster extraction on the connected data set to obtain a fourth data set.

[0039] Specifically, in step S435, cluster extraction is performed on the connected data set to obtain a fourth data set, including: S4351. Clustering the connected data set to obtain multiple clusters; Preferably, the KMeans clustering algorithm is used to cluster the connected data set.

[0040] S4352. Extract samples from each cluster based on a preset number of samples to obtain multiple cluster samples; Specifically, the cluster samples are the samples closest to the cluster center in each cluster.

[0041] S4353. Concatenate each cluster sample and the four-tuple data set to obtain a fourth data set.

[0042] Specifically, in step S4, the fourth data set is input into the LLM-Chat model for SFT training, including: S44. Filter the fourth data set to obtain triple data; The entity data in the fourth data set is filtered to obtain triple data.

[0043] S45. Input the triplet data into the LLM-Chat model for SFT training.

[0044] For example, this embodiment uses the Qwen-1.8B-Chat model as the fine-tuning model. The Qwen-1.8B-Chat model is a multilingual conversational 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 the gradient and model parameters.

[0045] like Figure 2 As shown, the second aspect of this embodiment provides a training system for a multi-round dialogue query rewriting task, including: An acquisition and annotation module is used to acquire historical conversation data, construct a historical data set based on the historical conversation data, perform entity annotation on the historical conversation data to obtain entity data, and obtain a first data set based on the historical data set and the entity data; A query rewriting module is used to rewrite the query of the historical data set using the large model based on a preset number of times to obtain a query set, and obtain a second data set based on the first data set and the query set; a calculation and screening module, configured to calculate the vector aggregation of the query set in the second data set, screen the query set based on the vector aggregation of each query set to obtain screening results, and obtain a third data set based on the screening results; The task training module is used to sample and combine the third data set to obtain a fourth data set, input the fourth data set into the LLM-Chat model for SFT training, and obtain a trained LLM-Chat model.

[0046] 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 described in detail here.

[0047] A third aspect of this embodiment provides a computer device comprising a memory, a processor, and a transceiver communicatively connected in sequence, 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 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-input first-output (FIFO), and / or first-input last-output (FILO) memory; the processor may include, but is not limited to, a microprocessor from the STM32F105 series. Furthermore, the computer device may include, but is not limited to, a power module, a display screen, and other necessary components.

[0048] 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 described in detail here.

[0049] A 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 described in the first aspect.

[0050] The working process, working details and technical effects of the aforementioned computer program product provided in this embodiment can be referred to the training method described in the first aspect, and will not be repeated here.

[0051] Finally, it should be noted that the above description is only 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 shall be included in the scope of protection of the present invention.

Claims

1. A training method for multi-round dialogue query rewriting tasks, characterized by: include: Acquire historical conversation data, construct a historical data set based on the historical conversation data, perform entity annotation on the historical conversation data to obtain entity data, and obtain a first data set based on the historical data set and the entity data; Based on a preset number of times, the large model is used to rewrite the query of the historical data set to obtain a query set, and the second data set is obtained based on the first data set and the query set; Calculating the vector aggregation of the query set in the second data set, filtering the query set based on the vector aggregation of each query set to obtain a filtering result, and obtaining a third data set based on the filtering result; 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 a trained LLM-Chat model.

2. The training method for multi-round dialogue query rewriting task according to claim 1, characterized in that: Calculate the vector clustering of the query set in the second data set, filter the query set based on the vector clustering of each query set, and obtain filtering results, including: Using the sentence vector model to vector encode the query set in the second dataset to obtain multiple encoded query sets; Based on each encoding query set, the vector aggregation degree of each encoding query set is obtained; The coded query set is screened based on the preset vector concentration and the vector concentration of each coded query set to obtain a screening result, where the screening result includes the screened query set and a second data set corresponding to the query set.

3. The training method for multi-round dialogue query rewriting task according to claim 1, characterized in that: The third data set is sampled and combined to obtain a fourth data set, including: Sampling the third data set to obtain a sample rQ; Combine the sample rQ and the first data set to obtain a four-tuple data set; The four-tuple data sets are encoded and combined to obtain a fourth data set.

4. The training method for multi-round dialogue query rewriting task according to claim 3, characterized in that: The historical data set includes history data and query data; The encoding and combining of the four-tuple data sets to obtain a fourth data set includes: Concatenate the history data and query data in the quadruple dataset to obtain text data; Perform vector encoding on text data based on the sentence vector model to obtain encoded text data; Perform vector encoding on the entity data to obtain encoded entity data; Combining the encoded text data and the encoded entity data to obtain a connected dataset; Perform clustering extraction on the connected data set to obtain a fourth data set.

5. The training method for multi-round dialogue query rewriting task according to claim 4, characterized in that: Perform clustering extraction on the connected dataset to obtain the fourth dataset, including: Clustering the connected data set to obtain multiple clusters; Extract samples from each cluster based on a preset number of samples to obtain multiple cluster samples; Each cluster sample and the four-tuple data set are concatenated to obtain a fourth data set.

6. The training method for multi-round dialogue query rewriting task according to claim 1, characterized in that: The fourth dataset is fed into the LLM-Chat model for SFT training, including: Filter the fourth data set to obtain triple data; The triplet data is input into the LLM-Chat model for SFT training.

7. The training method for multi-round dialogue query rewriting task according to claim 1, characterized in that: The large model is gpt-4o.

8. A training system for multi-round dialogue query rewriting tasks, used to implement the method according to any one of claims 1 to 7, characterized in that: include: An acquisition and annotation module is used to acquire historical conversation data, construct a historical data set based on the historical conversation data, perform entity annotation on the historical conversation data to obtain entity data, and obtain a first data set based on the historical data set and the entity data; A query rewriting module is used to rewrite the query of the historical data set using the large model based on a preset number of times to obtain a query set, and obtain a second data set based on the first data set and the query set; a calculation and screening module, configured to calculate the vector aggregation of the query set in the second data set, screen the query set based on the vector aggregation of each query set to obtain screening results, and obtain a third data set based on the screening results; The task training module is used to sample and combine the third data set to obtain a fourth data set, input the fourth data set into the LLM-Chat model for SFT training, and obtain a trained LLM-Chat model.

9. A computer device, characterized in that: It comprises a memory, a processor and a transceiver which are communicatively connected in sequence, 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 according to any one of claims 1 to 7.

10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or the instruction is executed by a computer, the training method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Question sentence rewriting method and related device

    CN118709701A

  • Input rewriting method and device of intelligent question answering system and computer equipment

    CN119782485A

  • Automatic answer rephrasing based on talking style

    US20190115008A1