Problem rewriting method and device, terminal equipment and storage medium

Through the combination of dialogue role analysis and problem rewriting model, the problem that the generative large language model cannot accurately understand user problems is solved, the quality of answers is improved, and the user experience is improved.

CN118939773APending Publication Date: 2024-11-12SHENZHEN ZHUIYI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410983734.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The generative large language model cannot accurately understand the questions raised by users, resulting in poor answer quality and affecting the user experience.

Method used

By obtaining the initial conversation, extracting the role identifier in the conversation, and combining preset guidance information, inputting the trained question rewriting model, and rewriting the question sentences, thereby improving the quality of the question.

Benefits of technology

Improve the quality of answers of generative large language models and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939773A_ABST
    Figure CN118939773A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of natural language processing, and provides a problem rewriting method and device, terminal equipment and a storage medium. The problem rewriting method comprises the following steps: acquiring an initial dialogue; dialogue role analysis is carried out on the initial dialogue to obtain a role identifier; combining the initial dialogue, the role identifier and preset guide information to obtain an input text; inputting the input text into the trained question rewriting model to obtain a rewriting dialogue; a rewrite problem is extracted from the rewrite dialog. According to the embodiment of the invention, the roles in the initial dialogue can be analyzed, the dialogue roles can be distinguished, and the understanding accuracy is improved. According to the question rewriting method and device, question rewriting is carried out on the input text through the trained question rewriting model, the rewritten question can be obtained, the question quality is improved, the answer quality of the generative large language model can be improved, and then the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of natural language processing, and in particular, relates to a method, apparatus, terminal device and storage medium for rewriting a question. Background Art

[0002] With the continuous development of artificial intelligence technology, generative large language models are becoming more and more popular among users. Users can interact with generative large language models through dialogue. For example, users can ask various questions to the generative large language model, and the generative large language model can give corresponding answers based on the questions asked by the users. In many cases, there are often problems with the questions asked by users, such as imperfect semantics and unclear intentions, which makes it impossible for the generative large language model to accurately understand the questions asked by users, which in turn leads to poor quality of answers given by the generative large language model, affecting the user experience. Summary of the invention

[0003] The embodiments of the present application provide a question rewriting method, apparatus, terminal device and storage medium, which can solve the problem in the related art that the generative large language model cannot accurately understand the questions raised by the user, resulting in poor quality of answers given by the generative large language model, affecting the user experience.

[0004] In a first aspect, an embodiment of the present application provides a method for rewriting a question, comprising:

[0005] Get the initial conversation;

[0006] Extracting a corresponding role identifier from the initial conversation;

[0007] Combining the initial dialogue, the role identification and the preset guidance information to obtain input text;

[0008] Inputting the input text into a trained question rewriting model to obtain a rewritten dialogue;

[0009] Rewriting questions are extracted from the rewriting dialogue.

[0010] In a second aspect, an embodiment of the present application provides a question rewriting device, including:

[0011] An acquisition module, used to acquire the initial conversation;

[0012] An analysis module, used to extract corresponding role identification from the initial dialogue;

[0013] A combining module, used for combining the initial dialogue, the role identification and the preset guiding information with the input text;

[0014] An input module, used for inputting the input text into the trained question rewriting model to obtain a rewritten dialogue;

[0015] The extraction module is used to extract the rewriting problems from the rewriting dialogue.

[0016] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the rewriting method for the above-mentioned problem when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the rewriting method for the above-mentioned problem are implemented.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the rewriting method for the above-mentioned problem.

[0019] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the initial dialogue, perform dialogue role analysis on the initial dialogue, obtain the role identification, then combine the initial dialogue, the role identification and the preset guidance information to obtain the input text, and input the input text into the trained question rewriting model to obtain the rewritten dialogue, and extract the rewritten question from the rewritten dialogue. The embodiments of the present application can analyze the roles in the initial dialogue, which helps to distinguish the dialogue roles and improve the accuracy of understanding. By rewriting the input text through the trained question rewriting model, the rewritten question can be obtained, which improves the quality of the question, helps to improve the answer quality of the generative large language model, and thus improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 It is a schematic diagram of an implementation flow of a method for rewriting a question provided in an embodiment of the present application;

[0022] Figure 2 It is a structural schematic diagram of a question rewriting device provided in an embodiment of the present application;

[0023] Figure 3It is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.

[0025] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.

[0026] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0027] With the continuous development of artificial intelligence technology, generative large language models are becoming more and more popular among users. Users can interact with generative large language models through dialogue. For example, users can ask various questions to the generative large language model, and the generative large language model can give corresponding answers based on the questions asked by the users. In many cases, there are often problems with the questions asked by users, such as imperfect semantics and unclear intentions, which makes it impossible for the generative large language model to accurately understand the questions asked by users, which in turn leads to poor quality of answers given by the generative large language model, affecting the user experience.

[0028] In view of this, the embodiment of the present application can analyze the roles in the initial dialogue, which helps to distinguish the dialogue roles and improve the accuracy of understanding. By rewriting the input text through the trained question rewriting model, the rewritten question can be obtained, which improves the quality of the question, helps to improve the answer quality of the generative large language model, and thus improves the user experience.

[0029] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0030] Figure 1 The present invention provides a schematic diagram of a method for rewriting a question in an embodiment of the present invention, which can be applied to a terminal device, such as a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.

[0031] Specifically, the rewriting method for the above problem may include the following steps S101 to S105.

[0032] Step S101, obtaining an initial conversation.

[0033] Among them, the initial dialogue includes the interaction content between the user and the generative large language model.

[0034] In the implementation of the present application, the user can input the interactive content in the interactive interface of the terminal device, and the terminal device can extract the interactive content between the user and the generative large language model to obtain the initial dialogue. It should be understood that the initial dialogue can be the dialogue content that has not been preprocessed or the dialogue content that has been preprocessed.

[0035] In some implementations of the present application, if the initial conversation is a conversation that has not been preprocessed, the initial conversation is preprocessed. The preprocessing step includes: format conversion and text cleaning of the initial conversation.

[0036] Step S102, extracting the corresponding role identification from the initial dialogue.

[0037] Among them, the role identifier is used to mark the identity or type of different roles in the dialogue.

[0038] It is understandable that in a scenario where multiple people use a large generative language model at the same time, multiple users may interact in one round of conversation. At this time, each user needs to be distinguished in order to improve the accuracy of understanding the questions raised by each user.

[0039] In the implementation manner of the present application, in some scenarios, if the terminal device can directly identify the corresponding role identifier in the initial conversation, the terminal device can directly obtain the speaker of each conversation in the initial conversation, that is, extract the corresponding role identifier, which can be specifically changing the name of the role to a specific name identifier. In addition, in other scenarios, if the terminal device cannot directly identify the corresponding role identifier in the initial conversation, the terminal device can use natural language processing (NLP) technology, such as named entity recognition (NER) or rule matching, to analyze the text content in the initial conversation, thereby identifying different roles in the conversation and assigning a unique identifier to each role.

[0040] In some specific implementations of the present application, the above-mentioned extraction of the corresponding role identification from the initial conversation may include steps S401 to S403.

[0041] Step S401, inferring role information in the initial dialogue.

[0042] In an embodiment of the present application, the terminal device may utilize natural language processing technology to extract role information in the initial conversation, for example, named entity recognition (NER) and dependency syntactic analysis may be performed on the initial conversation. Specifically, the terminal device may identify named entities in the conversation, such as names of people, names of organizations, etc., through the NER algorithm. Named entities may correspond to roles in the initial conversation. The terminal device may also understand the relationship between the various components in a sentence through dependency syntactic analysis. By analyzing the sentence structure in the initial conversation, the roles represented by the words or phrases in the initial conversation may be inferred.

[0043] Step S402: assigning a role identifier according to the role information.

[0044] In the implementation of the present application, the terminal device can define a fixed label or identifier for each role type. For example, the label "USER" can be assigned to the "user" role, and the label "AGENT" can be assigned to the "customer service" role.

[0045] Step S403: Associating the role identification with the conversation content in the initial conversation.

[0046] In an embodiment of the present application, the terminal device may associate the role identifier with the initial conversation content. Specifically, this may be achieved by adding additional metadata to the text representation of the conversation. For example, a role identifier may be added before each sentence or paragraph of the conversation to clarify which role the portion of text corresponds to.

[0047] Step S103, combining the initial dialogue, the role identification and the preset guidance information to obtain the input text.

[0048] The guiding information is some pre-set text or prompts used to assist the question rewriting model to better understand or rewrite the initial dialogue. For example, it can be a prompt, which is text input into the model and can be used to guide or prompt the model to perform specific tasks or generate specific outputs.

[0049] In an embodiment of the present application, the terminal device may insert or attach the role identifier to an appropriate position of the initial dialogue, and add the preset guidance information to the initial dialogue to provide additional context or prompts. By combining the initial dialogue, the role identifier and the preset guidance information, a structured input text may be obtained.

[0050] Step S104, inputting the input text into the trained question rewriting model to obtain a rewriting dialogue.

[0051] In an implementation of the present application, the terminal device may pass the input text to a trained question rewriting model. The question rewriting model may process the input text, for example, rewrite the question in the input text, thereby obtaining a rewritten dialogue.

[0052] It is understandable that the terminal device can rewrite the entire input text as a question, or it can rewrite only the last sentence of the entire input text, that is, the last sentence asked by the user. The implementation method of this application does not limit this.

[0053] Step S105, extracting rewriting questions from the rewriting dialogue.

[0054] In an implementation manner of the present application, the terminal device may analyze the rewritten dialogue and identify the question part thereof.

[0055] In some specific implementations of the present application, the above-mentioned extracting the rewriting question from the rewriting dialogue includes:

[0056] When the rewriting dialogue contains multiple sentences or paragraphs, the rewriting questions are extracted from the rewriting dialogue through a question extraction algorithm.

[0057] In an implementation manner of the present application, the terminal device may use a question extraction algorithm, such as a sentence boundary detection or keyword matching algorithm, to extract the question.

[0058] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the initial dialogue, perform dialogue role analysis on the initial dialogue, obtain the role identification, then combine the initial dialogue, the role identification and the preset guidance information to obtain the input text, and input the input text into the trained question rewriting model to obtain the rewritten dialogue, and extract the rewritten question from the rewritten dialogue. The embodiments of the present application can analyze the roles in the initial dialogue, which helps to distinguish the dialogue roles and improve the accuracy of understanding. By rewriting the input text through the trained question rewriting model, the rewritten question can be obtained, which improves the quality of the question, helps to improve the answer quality of the generative large language model, and thus improves the user experience.

[0059] It is understandable that some or all of the steps in the above method can be implemented by the GPU of the terminal device, such as the above step S104 and the corresponding sub-steps, that is, the steps related to the model.

[0060] In some implementations of the present application, before inputting the input text into the trained question rewriting model to obtain the rewriting dialogue, the method may further include the following steps:

[0061] The basic question rewriting model is trained to obtain a trained question rewriting model.

[0062] Among them, the basic question rewriting model is a pre-trained model that is pre-trained based on a large amount of text data. The basic question rewriting model learns and internalizes the basic laws and knowledge of language.

[0063] In an implementation manner of the present application, the terminal device may perform supervised learning-based model training on the basic question rewriting model using a training data set, thereby obtaining a trained question rewriting model.

[0064] In some specific implementations of the present application, the above-mentioned training of the basic question rewriting model to obtain the trained question rewriting model may specifically include step S501 and step S502.

[0065] Step S501, obtaining first training data.

[0066] In an implementation manner of the present application, the terminal device can obtain sufficient training data and reasonable test data through manual annotation or large model generation to construct a first training data set.

[0067] Step S502, using the first training data set, respectively performs context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training and reference recognition rewriting training on the basic question rewriting model to obtain a trained question rewriting model.

[0068] In an implementation manner of the present application, the terminal device may use the first training data set to train the basic question rewriting model.

[0069] Specifically, the terminal device can use specific tasks or loss functions to enable the basic question rewriting model to learn and understand the context information of the conversation and rewrite the question accordingly. The terminal device can perform multi-intent recognition and rewriting training on the basic question rewriting model through multi-label classification or sequence labeling, so that the basic question rewriting model can accurately identify multiple intents contained in a question and rewrite them separately. The terminal device can also perform duplicate recognition and rewriting training on the basic question rewriting model, so that the basic question rewriting model can recognize the same question repeatedly expressed by the user in different ways and rewrite it uniformly into a standard form. The terminal device can also perform complex reference recognition and rewriting training on the basic question rewriting model, so that the basic question rewriting model can recognize and parse the pronouns (such as "it", "this", etc.) in the initial conversation and replace them with specific entities or concepts.

[0070] It is important to understand that during the training process, the loss function can be used to measure the difference between the model prediction and the true label, and the data ratio and hyperparameters during training (such as training step size, number of training batches, number of training set traversals, etc.) can be reasonably adjusted, and the model parameters can be optimized through the back propagation algorithm. Multiple rounds of iterative training are performed until the model achieves satisfactory performance on the validation set.

[0071] Specifically, in some more specific embodiments of the present application, after using the first training data set as mentioned above to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training and reference recognition rewriting training on the basic question rewriting model, the above method may also include steps S601 to S603.

[0072] Step S601, determining whether the trained question rewriting model meets all model requirements.

[0073] Among them, the model requirements may include one or more of context understanding rewriting capability requirements, multi-intent recognition rewriting capability requirements, duplicate recognition rewriting capability requirements, and reference recognition rewriting capability requirements.

[0074] The context understanding rewriting capability requirement corresponds to the question rewriting model being able to understand and process the context information in the question, ensuring that the rewritten question can accurately reflect the contextual meaning of the original text. The multi-intent identification rewriting capability requirement corresponds to the question rewriting model being able to identify multiple intents that may exist in the question, and rewrite accordingly to better meet the user's query needs. The duplicate identification rewriting capability requirement corresponds to the question rewriting model being able to identify and process repeated or redundant information in the question, making the question more concise and clear through rewriting. The reference identification rewriting capability requirement corresponds to the question rewriting model being able to identify the reference relationship in the question, and rewrite it appropriately to ensure that the semantics of the rewritten question are clear and accurate.

[0075] In the implementation of the present application, the terminal device can use an independent verification data set and perform a performance evaluation on the rewriting ability of the question rewriting model according to preset evaluation indicators (such as accuracy, recall, F1 value, etc.), so as to determine whether the trained question rewriting model meets all model requirements. Specifically, the rewriting result output by the model can be compared and calculated with the real label.

[0076] Step S603: If any model requirement is not met, the number of samples corresponding to the unmet model requirement in the first training data set is increased to obtain a second training data set.

[0077] In the implementation of the present application, if any model requirement is not met, for the unmet model requirement, the terminal device can analyze the performance of the problem rewriting model on the verification data set to determine which types of samples need to be added to improve the corresponding model rewriting capabilities to meet the corresponding model requirements. Then, by manual annotation, data enhancement or collecting more relevant data, the number of samples of the corresponding type in the first training data set is increased, and the newly added samples are merged with the original training data set to form a second training data set.

[0078] Step S604: perform secondary training on the trained question rewriting model using the second training data set.

[0079] In an embodiment of the present application, the terminal device may use a second training data set to perform secondary training on the trained question rewriting model. This may be achieved by adjusting the model's hyperparameters, learning rate, or using a more advanced training algorithm. During the secondary training process, the performance changes of the model on the validation data set may be monitored so as to adjust the training strategy or terminate the training process in a timely manner. After the training is completed, the validation data set may be used again to evaluate the question rewriting model to ensure that the performance is improved and meets the corresponding model requirements.

[0080] The implementation mode of the present application can further train the question rewriting model, and when the question rewriting model cannot meet the requirements, increase the training set data to improve the rewriting ability of the specific model, to ensure that the question rewriting model after the second training can meet the preset model requirements.

[0081] In other more specific embodiments of the present application, the first training data set is used to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training and reference recognition rewriting training on the basic question rewriting model to obtain a trained question rewriting model, which may specifically include step S701.

[0082] Step S701, using the first training data set, sequentially performing context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training, and reference recognition rewriting training on the basic question rewriting model to obtain a trained question rewriting model.

[0083] In an embodiment of the present application, the terminal device may use relevant samples in the first training data set to train the basic question rewriting model. Specifically, the training data may be input into the basic question rewriting model, the loss may be calculated through forward propagation, and then the model parameters may be updated using the back propagation algorithm. During the training process, the terminal device may perform different capability training on the basic question rewriting model in sequence according to a preset training sequence, so that the question rewriting model is continuously injected with new capabilities while retaining the original capabilities. During the training process, appropriate optimization algorithms (such as gradient descent, Adam, etc.) may be used to accelerate the training process and improve model performance. After completing all capability training, a trained question rewriting model may be obtained.

[0084] The implementation method of the present application uses the first training data set to train the question rewriting model in sequence, so that the question rewriting model continuously injects new capabilities into the model while retaining the original capabilities, and ultimately enables the trained question rewriting model to have complex rewriting capabilities, which can effectively improve the dialogue quality of the generative large language model.

[0085] In some specific implementations of the present application, the above-mentioned inputting the input text into the trained question rewriting model to obtain the rewriting dialogue may specifically include step S801 and step S802.

[0086] Step S801, inputting the input text into the trained question rewriting model.

[0087] Step S802, using the trained question rewriting model to perform context understanding rewriting, multi-intent recognition rewriting, duplicate recognition rewriting and reference recognition rewriting on the input text to obtain a rewritten dialogue.

[0088] In an implementation manner of the present application, the terminal device may input the input text into a trained question rewriting model, and output a rewriting dialogue through the trained question rewriting model.

[0089] Specifically, the terminal device can perform contextual understanding and rewriting of the input text through the context understanding and rewriting unit in the trained question rewriting model to understand the intent and contextual information behind it. It can also perform multi-intent recognition and rewriting through the multi-intent recognition and rewriting unit to identify and process multiple possible query intents. It can also perform duplicate recognition and rewriting through the duplicate recognition and rewriting unit to identify and simplify repeated or redundant information in the text. It can also perform reference recognition and rewriting through the reference recognition and rewriting unit to clarify and resolve the reference relationship in the text. After the above rewriting steps, the trained question rewriting model can finally output the rewritten dialogue.

[0090] In some more specific implementations of the present application, the above step of contextual understanding and rewriting the input text includes:

[0091] Complete the input text, de-colloquially simplify it, and summarize the information.

[0092] In an implementation manner of the present application, the terminal device can complete the intent, de-colloquialize, simplify, and summarize the information of the input text, thereby achieving contextual understanding and rewriting of the input text.

[0093] Specifically, intent completion includes: analyzing the semantics and context of the input text, determining the possible core intent of the input text, and if the intent of the input text is unclear or missing, completing it based on the contextual information to more completely express the user's query needs. De-colloquialization includes: identifying and removing colloquial expressions, slang or idioms in the input text, and converting colloquial expressions into more formal and general expressions to improve the quality and comprehensibility of the rewritten questions. Simplification includes: simplifying the sentence structure of the input text, removing redundant words and modifiers, retaining key information and core intent, and making the rewritten questions more concise and clear. Information summarization includes: extracting and summarizing key information in the input text, and merging multiple related or similar information points into a more comprehensive expression to improve the information density and pertinence of the rewritten questions.

[0094] In some special scenarios, when there is no obvious intent in the input text, the input text is retained, that is, the intent is not completed, but it can be de-colloquialized, simplified, and summarized. When redundant content other than the intent appears in the input text (that is, the input text has a lot of redundant content besides expressing the intent, such as explaining the reason for the intent), only the user's intent is completed, de-colloquialized, simplified, and summarized, and other non-intent content is ignored.

[0095] Figure 2 A schematic diagram of the structure of a rewriting device for a question provided in an embodiment of the present application is shown. The rewriting device 2 for the question may be configured on a terminal device. Specifically, the rewriting device 2 for the question may include:

[0096] An acquisition module 201 is used to acquire an initial conversation;

[0097] An analysis module 202, configured to extract a corresponding role identifier from the initial conversation;

[0098] A combining module 203, for combining the initial dialogue, the role identification and the preset guiding information with the input text;

[0099] An input module 204 is used to input the input text into the trained question rewriting model to obtain a rewriting dialogue;

[0100] The extraction module 205 is used to extract rewriting problems from the rewriting dialogue.

[0101] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the initial dialogue, perform dialogue role analysis on the initial dialogue, obtain the role identification, then combine the initial dialogue, the role identification and the preset guidance information to obtain the input text, and input the input text into the trained question rewriting model to obtain the rewritten dialogue, and extract the rewritten question from the rewritten dialogue. The embodiments of the present application can analyze the roles in the initial dialogue, which helps to distinguish the dialogue roles and improve the accuracy of understanding. By rewriting the input text through the trained question rewriting model, the rewritten question can be obtained, which improves the quality of the question, helps to improve the answer quality of the generative large language model, and thus improves the user experience.

[0102] In some embodiments of the present application, the above-mentioned question rewriting device 2 may further include a training module, which is used to: train the basic question rewriting model to obtain the trained question rewriting model.

[0103] In some embodiments of the present application, the above-mentioned training module can also be used to: obtain a first training data set; use the first training data set to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training and reference recognition rewriting training on the basic question rewriting model to obtain the trained question rewriting model.

[0104] In some embodiments of the present application, the above-mentioned training module can also be used to: determine whether the trained question rewriting model meets all model requirements, and the model requirements include one or more of context understanding rewriting capability requirements, multi-intent recognition rewriting capability requirements, duplicate recognition rewriting capability requirements and reference recognition rewriting capability requirements; if any of the model requirements is not met, increase the number of samples corresponding to the unmet model requirements in the first training data set to obtain a second training data set; and use the second training data set to perform secondary training on the trained question rewriting model.

[0105] In some embodiments of the present application, the above-mentioned training module can also be used to: use the first training data set to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training and reference recognition rewriting training on the basic question rewriting model in sequence to obtain the trained question rewriting model.

[0106] In some embodiments of the present application, the above-mentioned input module 204 can also be used to: input the input text into the trained question rewriting model; perform context understanding rewriting, multi-intent recognition rewriting, duplicate recognition rewriting and reference recognition rewriting on the input text through the trained question rewriting model to obtain the rewriting dialogue.

[0107] In some implementations of the present application, the input module 204 may also be used to complete the input text, remove colloquial language, simplify the text, and summarize the information.

[0108] like Figure 3 FIG. 3 is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 3 may include: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301, such as a rewriting program for a question. When the processor 301 executes the computer program 303, the steps in the rewriting method embodiment of each of the above questions are implemented, such as Figure 1 Alternatively, when the processor 301 executes the computer program 303, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 2 The shown modules include an acquisition module 201 , an analysis module 202 , a combination module 203 , an input module 204 , and an extraction module 205 .

[0109] The computer program may be divided into one or more modules / units, which are stored in the memory 302 and executed by the processor 301 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0110] The terminal device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access equipment, buses, etc.

[0111] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0112] The memory 302 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 302 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 302 may also include both an internal storage unit of the terminal device and an external storage device. The memory 302 is used to store the computer program and other programs and data required by the terminal device. The memory 302 may also be used to temporarily store data that has been output or is to be output.

[0113] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.

[0114] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0115] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the rewriting method for the above-mentioned problem can be implemented.

[0116] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the steps in the rewriting method for the above problem can be implemented when the mobile terminal executes the computer program product.

[0117] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0118] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0119] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0122] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0123] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for rewriting a question, characterized in that: include: Get the initial conversation; Extracting a corresponding role identifier from the initial conversation; Combining the initial dialogue, the role identification and the preset guidance information to obtain input text; Inputting the input text into a trained question rewriting model to obtain a rewritten dialogue; Rewriting questions are extracted from the rewriting dialogue.

2. The method for rewriting a question according to claim 1, characterized in that: Before inputting the input text into the trained question rewriting model to obtain the rewritten dialogue, the method further includes: The basic question rewriting model is trained to obtain the trained question rewriting model.

3. The method for rewriting a question according to claim 2, characterized in that: The step of training the basic question rewriting model to obtain the trained question rewriting model includes: Obtain a first training data set; The first training data set is used to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training, and reference recognition rewriting training on the basic question rewriting model to obtain the trained question rewriting model.

4. The method for rewriting a question according to claim 3, characterized in that: After using the first training data set to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training, and reference recognition rewriting training on the basic question rewriting model, the method further includes: Determine whether the trained question rewriting model meets all model requirements, wherein the model requirements include one or more of context understanding rewriting capability requirements, multi-intent recognition rewriting capability requirements, duplicate recognition rewriting capability requirements, and reference recognition rewriting capability requirements; If any of the model requirements is not met, increasing the number of samples corresponding to the unmet model requirement in the first training data set to obtain a second training data set; The trained question rewriting model is trained again using the second training data set.

5. The method for rewriting a question according to claim 3, characterized in that: The first training data set is used to perform context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training, and reference recognition rewriting training on the basic question rewriting model to obtain the trained question rewriting model, including: Using the first training data set, the basic question rewriting model is sequentially trained with context understanding rewriting training, multi-intent recognition rewriting training, duplicate recognition rewriting training, and reference recognition rewriting training to obtain the trained question rewriting model.

6. The method for rewriting a question according to claim 1, characterized in that: The step of inputting the input text into a trained question rewriting model to obtain a rewriting dialogue includes: Inputting the input text into the trained question rewriting model; The trained question rewriting model is used to perform context understanding rewriting, multi-intent recognition rewriting, duplicate recognition rewriting and reference recognition rewriting on the input text to obtain the rewritten dialogue.

7. The method for rewriting a question according to claim 6, characterized in that: The step of rewriting the input text by understanding the context comprises: The input text is completed, de-colloquialized, simplified, and information summarized.

8. A question rewriting device, characterized in that: include: An acquisition module, used to acquire the initial conversation; An analysis module, used to extract corresponding role identification from the initial dialogue; A combining module, used for combining the initial dialogue, the role identification and the preset guiding information with the input text; An input module, used for inputting the input text into the trained question rewriting model to obtain a rewritten dialogue; The extraction module is used to extract the rewriting problems from the rewriting dialogue.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the rewriting method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the rewriting method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Intelligent dialogue method based on user permission separation and related device

    CN119293192A

  • Text generation method and device based on large model, intelligent agent and electronic equipment

    CN120687571A