Answer text generation method and device, equipment and medium

By using the target number prediction model and the target answer prediction model, different number of answer texts are generated based on the user input content, the problem of the same number of answer texts and waste of resources in the prior art is solved, and the accuracy of answer text generation is improved.

CN119691131APending Publication Date: 2025-03-25INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411853080.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When generating answer texts, the number of answer texts generated for different users is the same, resulting in waste of resources, and only a small number of answer texts meet user requirements.

Method used

By obtaining the user input content, the target quantity prediction model and the target answer prediction model, the user input content is input into the target quantity prediction model for processing, output the number of predicted answers, and generate the corresponding number of answer text based on the number of predicted answers.

Benefits of technology

It realizes the generation of different number of answer texts for different user input content, improves the accuracy of answer text generation and avoids waste of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691131A_ABST
    Figure CN119691131A_ABST
Patent Text Reader

Abstract

The invention discloses an answer text generation method and device, equipment and a medium. The method comprises the steps of obtaining user input content, a target quantity prediction model and a target answer prediction model; inputting the user input content into the target quantity prediction model for processing, and outputting the quantity of predicted answers; the user input content is processed, at least one answer text is output, and the number of the answer texts is the predicted number of answers. According to the embodiment of the invention, the accuracy of answer text generation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and medium for generating an answer text. Background Art

[0002] With the rapid development of science and technology, big models are gradually being applied in all aspects of people's lives. Users can input data content into the big model through a variety of input methods, and the big model generates corresponding answer text based on the user input content.

[0003] Currently, the large model generates the same amount of answer text for different user inputs.

[0004] However, different user input contents correspond to the same number of answer texts, but there may be only a small number of answers in each answer text that meet the user's requirements, resulting in a waste of resources. Summary of the invention

[0005] The present invention provides a method, device, equipment and medium for generating an answer text, so as to improve the accuracy of generating the answer text.

[0006] In a first aspect, an embodiment of the present invention provides a method for generating an answer text, the method comprising:

[0007] Obtain user input content, target quantity prediction model and target answer prediction model;

[0008] Inputting the user input content into the target quantity prediction model for processing, and outputting the predicted answer quantity;

[0009] The user input content is processed and at least one answer text is output, and the number of the answer texts is the number of predicted answers.

[0010] In a second aspect, an embodiment of the present invention further provides an answer text generating device, the device comprising:

[0011] A data acquisition module is used to obtain user input content, target quantity prediction model and target answer prediction model;

[0012] A quantity prediction module, used for inputting the user input content into the target quantity prediction model for processing, and outputting the predicted answer quantity;

[0013] The text acquisition module is used to process the user input content and output at least one answer text, and the number of the answer texts is the number of predicted answers.

[0014] In a third aspect, an embodiment of the present invention further provides an answer text generating device, the answer text generating device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the answer text generation method of any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the answer text generation method of any embodiment of the present invention when executed by a processor.

[0019] The technical solution of the embodiment of the present invention obtains user input content, a target quantity prediction model and a target answer prediction model; inputs the user input content into the target quantity prediction model for processing, and outputs the predicted answer quantity; processes the user input content, and outputs at least one answer text, the number of answer texts being the predicted answer number, and generates different numbers of answer texts for different user input content, thereby refining the answer text generation operation and improving the accuracy of answer text generation.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flow chart of a method for generating an answer text according to Embodiment 1 of the present invention;

[0023] Figure 2 is a flow chart of a method for generating an answer text according to Embodiment 2 of the present invention;

[0024] Figure 3 is a structural diagram of an answer text generating device provided according to an embodiment of the present invention;

[0025] Figure 4 It is a structural schematic diagram of an answer text generation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of user input content, etc. are all in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0029] The information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0030] Embodiment 1

[0031] Figure 1 The flowchart of a method for generating an answer text provided in the first embodiment of the present invention is shown in FIG. The embodiment of the present invention is applicable to the case of generating an answer text, and the method can be executed by an answer text generating device, and the answer text generating device can be implemented in the form of hardware and / or software.

[0032] See also Figure 1 The answer text generation method shown includes:

[0033] S101, obtaining user input content, target quantity prediction model and target answer prediction model.

[0034] The user input content may be data content that the user is preparing to input. The user input content is used to describe the user's intention of what kind of feedback the model expects. According to the user input content, the restriction conditions for the model to generate answers can be clarified, and the model can be guided to generate answers that meet the user's expectations according to the user input content. The target quantity prediction model may be a model that predicts the number of answers generated according to the user input content. The target answer prediction model may be a model that generates the answer expected by the user according to the user input content.

[0035] Specifically, text can more accurately express abstract concepts, logical relationships, and detailed descriptions. Obtain at least one of the text and / or voice input by the user. If the user input is text, for example, question text, such as "Why is the sky blue"; description text, such as "Describe the ecosystem of the rainforest". The user input content can also be a single or multiple keywords, allowing the model to generate corresponding content around these keywords. For example, enter "environmental protection" and "new energy vehicles". If the user input is voice, the voice is converted into text through a voice-to-text conversion algorithm. Obtaining user input content can facilitate the model to understand the user's intentions and generate answers that meet the user's intentions. Obtain the target quantity prediction model and the target answer prediction model, and the acquisition method can be obtained by connecting to the model interface.

[0036] S102: Input the user input content into the target quantity prediction model for processing, and output the predicted answer quantity.

[0037] Specifically, the user input content can be segmented, and the word segmentation methods include but are not limited to: forward maximum matching method, reverse maximum matching method, two-way maximum matching method, N-gram model, decision tree and support vector machine (SVM), etc., which are not limited in the embodiments of the present disclosure.

[0038] The words after word segmentation processing can be marked, replaced or expanded, and the marked, replaced and expanded words are input into the target quantity prediction model to obtain the predicted number of answers corresponding to the user input content output by the target quantity prediction model. A user vocabulary library can be preset, and the words after word segmentation processing and the words in the user vocabulary library are similarly identified to obtain the similarity value between the words after word segmentation processing and the keywords in the user vocabulary library. The similarity identification method includes but is not limited to: a synonym dictionary method, a cosine similarity algorithm, an Euclidean distance algorithm or a Manhattan distance algorithm, which is not limited in the embodiment of the present invention. A similarity threshold can be preset, and each similarity value can be compared with the similarity threshold to obtain a similarity identification result.

[0039] If there are similar words in the user's input content in the user's vocabulary, it means that the two words have the same attributes. For example, the attributes can be the grouping of words or the field to which the words belong. According to the similarity recognition results, the attribute information corresponding to similar keywords in the user's vocabulary is obtained, and the words that meet the preset similarity conditions in the user's input content are annotated according to the attribute information. It can help the target quantity prediction model to more accurately predict the number of answers. For example, if there is a word "roujiamo" in the user's input content, and the similar keyword matched in the user's knowledge base is "lean roujiamo", and the attributes corresponding to "lean roujiamo" are "Shaanxi" and "local snacks", then "roujiamo" will be annotated as "Shaanxi" and "local snacks". The target quantity prediction model can analyze the annotated content to predict the number of answers more specifically.

[0040] Based on the similarity recognition results, the original words in the user input content that meet the preset similarity conditions can also be replaced with words that meet the preset similarity conditions. Different words may have similar meanings, but the frequency of use and expression effects in different contexts may be different. By replacing similar words, various possible semantic expressions can be more comprehensively covered, so that the target quantity prediction model can more accurately understand the intention of the user input and avoid misunderstandings caused by the limited understanding of specific words. Furthermore, different users have different language expression habits. Using similar word replacement can make the prompt words closer to the user's natural language style, making it easier for the target quantity prediction model to understand the user's input, thereby generating a predicted answer quantity that is more in line with the user's input content.

[0041] According to the similarity recognition results, the original words in the user input content that meet the preset similarity conditions can also be expanded. The user input content may be relatively concise or the expression may not be accurate. Through similar word expansion, richer semantic information can be provided to the target quantity prediction model to help the model understand the user's intentions and needs more comprehensively and accurately. For example, when the user inputs "beautiful flowers" and expands to similar words such as "pretty flowers" and "good-looking flowers", the model can more clearly understand that the user is describing the appearance attributes of the flower. There are many cases of polysemous words in natural language. Similar word expansion can help the target quantity prediction model to determine the specific meaning of the words used by the user to a certain extent and reduce ambiguity. For example, the word "apple" can refer to both fruit and Apple. When similar expressions such as "fruit apple" or "Apple" are expanded, the target quantity prediction model can more accurately understand what the user means and predict the number of answers more accurately.

[0042] S103: Process the user input content and output at least one answer text, where the number of answer texts is the number of predicted answers.

[0043] The answer text may be text data generated according to user input content.

[0044] Specifically, the target quantity prediction model is input after processing the user input content, and the number of answer texts generated by the target quantity prediction model for the user input question is obtained. The target answer prediction model is input according to the predicted answer number generated by the target quantity prediction model and the user input content, and the predicted answer number answer texts are generated by the target answer prediction model. Different predicted answer numbers can be generated for different user input content. It can avoid generating the same number of answer texts for different user input content, and only a few answer texts in the answer texts meet the user expected content corresponding to the user input content, thereby avoiding waste of resources.

[0045] The technical solution of the embodiment of the present invention obtains user input content, a target quantity prediction model and a target answer prediction model; inputs the user input content into the target quantity prediction model for processing, and outputs the predicted number of answers; processes the user input content, outputs at least one answer text, and the number of answer texts is the predicted number of answers, and generates different numbers of answer texts for different user input content, thereby refining the answer text generation operation and improving the accuracy of answer text generation.

[0046] Embodiment 2

[0047] Figure 2 This is a flow chart of a method for generating an answer text provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment of the present invention optimizes and improves the operation of generating an answer text.

[0048] Furthermore, "process the user input content and output at least one answer text, where the number of answer texts is the predicted number of answers" is refined into "adjust the answer number parameter of the target answer prediction model using the predicted number of answers; based on the target answer prediction model with the adjusted answer number parameter, process the user input content and output at least one answer text" to improve the operation of answer text generation.

[0049] It should be noted that for the parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.

[0050] See also Figure 2 The answer text generation method shown includes:

[0051] S201. Obtain user input content, target quantity prediction model and target answer prediction model.

[0052] S202: Input the user input content into the target quantity prediction model for processing, and output the predicted answer quantity.

[0053] S203: Using the predicted answer quantity, adjust the answer quantity parameter of the target answer prediction model.

[0054] Among them, the answer quantity parameter can be a parameter in the target answer prediction model that controls the number of generated answer texts.

[0055] Specifically, the answer quantity parameter of the target answer prediction model is used to control the number of answer texts generated by the target answer prediction model. The target quantity prediction model can predict the number of predicted answers corresponding to the user input content according to the user input content. The initial value of the answer quantity parameter of the target answer prediction model is adjusted according to the predicted answer quantity, so that the value of the answer quantity parameter of the target answer prediction model is equal to the predicted answer quantity.

[0056] S204: Based on the target answer prediction model after adjusting the answer quantity parameter, process the user input content and output at least one answer text.

[0057] Specifically, the target answer prediction model can perform word segmentation processing on the user input question according to the user input question to obtain at least one keyword. There is a user vocabulary library, and the user vocabulary library contains at least one word, the annotation content corresponding to each word, and the weight corresponding to each word. Each keyword is identified, and the identification content can be the annotation content of each keyword or the weight corresponding to each keyword. The target answer prediction model generates at least one candidate answer text according to the user input content. The target answer prediction model sorts each candidate answer text according to the sum of the weights or the length of the annotation content. According to the length of the annotation content of each keyword or the total value of the weight, the target answer prediction model selects the predicted answer number answer texts from each candidate answer text.

[0058] The embodiment of the present invention adjusts the answer quantity parameter of the target answer prediction model by adopting the predicted answer quantity; based on the target answer prediction model after the adjusted answer quantity parameter, the user input content is processed and at least one answer text is output, and a different number of answer texts are generated for different user input questions, thereby saving space resources, reducing the amount of data to be processed, and improving the efficiency of answer text generation.

[0059] Optionally, both the target quantity prediction model and the target answer prediction model are large models, and the target quantity prediction model and the target answer prediction model correspond to different prompt word templates; the user input content is input into the target quantity prediction model for processing, including: the user input content is fused with the prompt word template corresponding to the target quantity prediction model and then input into the target quantity prediction model; the user input content is processed to output at least one answer text, including: at least one answer text is obtained by fusing the predicted answer quantity with the user input content and then inputting into the target answer prediction model.

[0060] Specifically, a large model refers to a model with a large number of parameters that is trained using large-scale data and powerful computing power. The model is pre-trained through a large amount of training data to build a basic language model so that it has the ability to generate language. A prompt word template can be preset. The prompt word template can be a pre-defined text structure or format, which is used to guide the target quantity prediction model and the target answer prediction model to generate a specific type of answer. The prompt word template can contain slots. By reserving a specific position in the template, the corresponding slot information can be filled according to the specific user input content, thereby generating a more targeted and accurate answer. For example, in a travel consultation template, there can be a question template such as "What are the famous attractions in [destination]", where "[destination]" is a slot. The target quantity prediction model and the target answer prediction model can fill the slot according to the specific destination entered by the user to generate specific questions such as "What are the famous attractions in Beijing". According to the rule template, user intent is extracted, and the predicted answer quantity or at least one answer text is generated according to the user intent. The user input content is fused with the prompt word template corresponding to the target quantity prediction model and then input into the target quantity prediction model to generate the predicted answer quantity corresponding to the user input content; at least one answer text is obtained by fusing the predicted answer quantity with the user input content and then inputting into the target answer prediction model.

[0061] By fusing the user input content with the prompt word template corresponding to the target quantity prediction model and then inputting it into the target quantity prediction model; by fusing the predicted answer quantity with the user input content and then inputting it into the target answer prediction model, at least one answer text is obtained. The preset prompt word template provides a clear framework and guidance for the target quantity prediction model and the target answer prediction model, so that it can generate content that meets specific formats and requirements in a short time, saving a lot of time and energy and improving the efficiency of answer text generation.

[0062] Optionally, the target quantity prediction model is trained in the following manner: obtaining an initial quantity prediction model; obtaining at least one historical input content and a similar quantity corresponding to each historical input content; training the initial quantity prediction model based on each historical input content and a similar quantity corresponding to each historical input content to obtain a target quantity prediction model.

[0063] Specifically, at least one historical input content is obtained. According to each historical input content, the historical answer text corresponding to each historical input content is obtained, and the number of historical answer texts corresponding to each historical input content is the same. Valid answers corresponding to the historical input content are screened in the historical answer text, and the number of valid answers corresponding to each historical input content is counted to obtain the similar number corresponding to each historical input content. The initial quantity prediction model is trained for each historical input content and the similar number corresponding to each historical input content until the training end condition is reached to obtain the target quantity prediction model. The training end condition may be that the accuracy of the target quantity prediction model for the verification set is greater than a preset accuracy threshold, for example, the accuracy threshold may be 95%. In addition, the training end condition may also be that the difference is minimal or the difference converges, or the number of training times is greater than or equal to a preset number threshold, etc.

[0064] By obtaining an initial quantity prediction model; obtaining at least one historical input content and the similar quantity corresponding to each historical input content; training the initial quantity prediction model according to each historical input content and the similar quantity corresponding to each historical input content, a target quantity prediction model is obtained, and the initial quantity prediction model is trained by obtaining the similar quantity corresponding to the features of different input contents through historical data, so that the target quantity prediction model obtained after training can predict the quantity result more accurately.

[0065] Optionally, obtaining at least one historical input content and the similarity number corresponding to each historical input content includes: obtaining at least one historical input content and the answer truth value text corresponding to each historical input content; obtaining a preset number of answers; for each historical input content, matching in the user knowledge base according to the historical input content, to obtain at least one initial answer text corresponding to the historical input content, the number of initial answer texts being the preset number of answers; calculating the similarity between each initial answer text corresponding to the historical input content and the answer truth value text, to obtain at least one similarity value corresponding to the historical input content, and determining the similarity number corresponding to the historical input content according to each similarity value corresponding to the historical input content.

[0066] Specifically, obtain at least one historical input content and the answer truth text corresponding to each historical input content. The answer truth text is used to describe the accurate text of the answer to the historical input content. Obtain the preset number of answers, which is used to describe the value of the preset number of answer texts in the large model to be input. For each historical input content, match it in the user knowledge base according to the historical input content to obtain at least one initial answer text corresponding to the historical input content, and the number of initial answer texts is the preset number of answers. The user knowledge base is used to store user-related text data. Calculate the similarity between each initial answer text corresponding to the historical input content and the answer truth text to obtain at least one similarity value corresponding to the historical input content. The similarity calculation method includes but is not limited to: edit distance algorithm, cosine similarity algorithm, Jaccard algorithm, minimum edit distance algorithm or word embedding model method, which is not limited in the embodiment of the present invention. According to each similarity value corresponding to the historical input content, count the similarity number corresponding to the historical input content.

[0067] By obtaining at least one historical input content and the answer truth text corresponding to each historical input content; obtaining a preset number of answers; for each historical input content, matching in the user knowledge base according to the historical input content, obtaining at least one initial answer text corresponding to the historical input content, and the number of initial answer texts is the preset number of answers; calculating the similarity between each initial answer text corresponding to the historical input content and the answer truth text, obtaining at least one similarity value corresponding to the historical input content, determining the similarity number corresponding to the historical input content according to each similarity value corresponding to the historical input content, obtaining the similarity number corresponding to different historical input questions, and determining the number of valid answers to different questions, so as to facilitate the model to learn the corresponding relationship characteristics between the historical input questions and the similarity number, and improve the accuracy of the model in predicting the number of answers.

[0068] Optionally, based on each similarity value corresponding to the historical input content, the number of similarities corresponding to the historical input content is determined, including: obtaining a similarity threshold; for each historical input content, comparing each similarity value corresponding to the historical input content with the similarity threshold to obtain a similarity comparison result of each similarity value corresponding to the historical input content; and obtaining the number of similarities corresponding to the historical input content based on statistics of the similarity comparison results of each similarity value corresponding to the historical input content.

[0069] The similarity threshold may be a preset threshold of the number of similarities corresponding to the historical input content. The similarity comparison result may be a result of comparing the similarity value corresponding to the historical input content with the similarity threshold.

[0070] Specifically, a similarity threshold is obtained, and the obtaining method includes but is not limited to: mouse selection, keyboard input or voice input, etc. For each historical input content, each similarity value corresponding to the historical input content is compared with the similarity threshold to obtain a similarity comparison result of each similarity value corresponding to the historical input content, and the similarity comparison result can be similar or dissimilar. According to the similarity comparison results of each similarity value corresponding to the historical input content, the number of similarities corresponding to each historical input content is counted as similar.

[0071] By obtaining a similarity threshold; for each historical input content, comparing each similarity value corresponding to the historical input content with the similarity threshold, obtaining a similarity comparison result of each similarity value corresponding to the historical input content; and obtaining the number of similarities corresponding to the historical input content based on the similarity comparison results of each similarity value corresponding to the historical input content, so as to facilitate, according to preset conditions, counting the number of similarities corresponding to different historical input contents, and determining the number of valid answers corresponding to the characteristics of different input contents.

[0072] Optionally, the target answer prediction model is trained in the following manner: obtaining an initial answer prediction model; obtaining at least one text to be processed; for each text to be processed, identifying the text to be processed, and obtaining document identification data corresponding to the text to be processed, the document identification data including: document field, document title, document chapter name and at least one document keyword; based on the document identification data corresponding to the text to be processed, generating a question feature vector corresponding to the text to be processed; training the initial answer prediction model based on the question feature vectors corresponding to each text to be processed, and obtaining the target answer prediction model.

[0073] The text to be processed is used to describe text related to the user. The text to be processed can be language text input by the user in a historical period related to the user's language habits, operation log text related to the user's behavior habits, or industry-related text preset by the user. Each text to be processed has its corresponding document identification data when it is obtained.

[0074] For each text to be processed, the text to be processed is identified to obtain document identification data corresponding to the text to be processed. The document identification data includes: document field, document title, document chapter name and at least one document keyword. According to the document identification data corresponding to the text to be processed, a question feature vector corresponding to the text to be processed is generated. The question feature vector is used to describe the document identification data information corresponding to the text to be processed. The question feature vector acquisition method includes but is not limited to: bag of words model, word embedding model, TF-IDF (Term Frequency-Inverse Document Frequency) model or N-gram model, etc., which is not limited in the embodiment of the present invention. The initial answer prediction model is trained according to the question feature vector corresponding to each text to be processed to obtain the target answer prediction model.

[0075] By obtaining an initial answer prediction model; obtaining at least one text to be processed; for each text to be processed, identifying the text to be processed, obtaining document identification data corresponding to the text to be processed, and generating a question feature vector corresponding to the text to be processed based on the document identification data corresponding to the text to be processed; training the initial answer prediction model based on the question feature vector corresponding to each text to be processed to obtain a target answer prediction model, which can identify the corresponding question feature vector for different user input content, so that the target answer prediction model can determine the user's intention of inputting the question and generate the corresponding answer text, thereby improving the accuracy of answer text generation.

[0076] Embodiment 3

[0077] Figure 3 This is a schematic diagram of the structure of an answer text generation device provided in Embodiment 3 of the present invention. The embodiment of the present invention is applicable to the situation of answer text generation, the device can execute the answer text generation method, and the device can be implemented in the form of hardware and / or software.

[0078] See also Figure 3 The answer text generating device shown includes: a data acquisition module 301, a quantity prediction module 302 and a text acquisition module 303, wherein:

[0079] Data acquisition module 301, used to acquire user input content, target quantity prediction model and target answer prediction model;

[0080] The quantity prediction module 302 is used to input the user input content into the target quantity prediction model for processing and output the predicted answer quantity;

[0081] The text acquisition module 303 is used to process the user input content and output at least one answer text, and the number of answer texts is the number of predicted answers.

[0082] The technical solution of the embodiment of the present invention obtains user input content, a target quantity prediction model and a target answer prediction model; inputs the user input content into the target quantity prediction model for processing, and outputs the predicted number of answers; processes the user input content, outputs at least one answer text, and the number of answer texts is the predicted number of answers, and generates different numbers of answer texts for different user input content, thereby refining the answer text generation operation and improving the accuracy of answer text generation.

[0083] Optionally, the text acquisition module 303 includes:

[0084] A parameter adjustment unit, used to adjust the answer quantity parameter of the target answer prediction model using the predicted answer quantity;

[0085] The question processing unit is used to process the user input content based on the target answer prediction model after adjusting the answer quantity parameter, and output at least one answer text.

[0086] Optionally, both the target quantity prediction model and the target answer prediction model are large models, and the target quantity prediction model and the target answer prediction model correspond to different prompt word templates.

[0087] Optionally, the quantity prediction module 302 is specifically used for:

[0088] The user input content is fused with the prompt word template corresponding to the target quantity prediction model and then input into the target quantity prediction model.

[0089] Optionally, the text acquisition module 303 is specifically used for:

[0090] At least one answer text is obtained by fusing the predicted answer quantity with the user input content and inputting the resultant into a target answer prediction model.

[0091] Optionally, the target quantity prediction model is trained in the following way:

[0092] An initial model acquisition module is used to obtain an initial quantity prediction model;

[0093] A similarity number acquisition module, used to acquire at least one historical input content and the similarity number corresponding to each historical input content;

[0094] The prediction model training module is used to train the initial quantity prediction model according to each historical input content and the similar quantity corresponding to each historical input content to obtain the target quantity prediction model.

[0095] Optional, similar quantity acquisition module, including:

[0096] A truth value data acquisition unit, used to acquire at least one historical input content and a truth value text of an answer corresponding to each historical input content;

[0097] A preset number obtaining unit, used to obtain the preset number of answers;

[0098] An initial answer acquisition unit is used to match each historical input content in the user knowledge base according to the historical input content to obtain at least one initial answer text corresponding to the historical input content, and the number of initial answer texts is the preset number of answers;

[0099] A similarity calculation unit is used to calculate the similarity between each initial answer text corresponding to the historical input content and the answer true value text to obtain at least one similarity value corresponding to the historical input content,

[0100] The similarity number determining unit is used to determine the similarity number corresponding to the historical input content according to each similarity value corresponding to the historical input content.

[0101] Optionally, a similar quantity determination unit is specifically used to:

[0102] Get the similarity threshold;

[0103] For each historical input content, each similarity value corresponding to the historical input content is compared with a similarity threshold to obtain a similarity comparison result of each similarity value corresponding to the historical input content;

[0104] The similarity number corresponding to the historical input content is obtained by counting the similarity comparison results of the similarity values ​​corresponding to the historical input content.

[0105] Optionally, the target answer prediction model is trained by:

[0106] Obtain an initial answer prediction model;

[0107] Get at least one text to be processed;

[0108] For each text to be processed, the text to be processed is identified to obtain document identification data corresponding to the text to be processed, the document identification data including: document field, document title, document chapter name and at least one document keyword;

[0109] Generate a problem feature vector corresponding to the text to be processed according to the document identification data corresponding to the text to be processed;

[0110] The initial answer prediction model is trained according to the question feature vectors corresponding to each text to be processed to obtain the target answer prediction model.

[0111] The answer text generation device provided in the embodiment of the present invention can execute the answer text generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the answer text generation method.

[0112] Embodiment 4

[0113] Figure 4 A schematic structural diagram of an answer text generating device 400 that can be used to implement an embodiment of the present invention is shown.

[0114] like Figure 4 As shown, the answer text generating device 400 includes at least one processor 401, and a memory connected to the at least one processor 401 in communication, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 401 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 to the random access memory (RAM) 403. In RAM403, various programs and data required for the operation of the answer text generating device 400 can also be stored. The processor 401, ROM402 and RAM403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0115] A number of components in the answer text generating device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the answer text generating device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0116] Processor 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 501 executes the various methods and processes described above, such as the answer text generation method.

[0117] In some embodiments, the answer text generation method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the answer text generation device 400 via ROM402 and / or communication unit 409. When the computer program is loaded into RAM403 and executed by processor 401, one or more steps of the answer text generation method described above can be performed. Alternatively, in other embodiments, processor 401 can be configured to perform the answer text generation method by any other appropriate means (e.g., by means of firmware).

[0118] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0119] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0120] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0121] To provide interaction with a user, the systems and techniques described herein may be implemented on an answer text generating device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the answer text generating device. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0122] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0123] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS (Virtual Private Server) services.

[0124] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0125] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for generating an answer text, characterized in that: The method comprises: Obtain user input content, target quantity prediction model and target answer prediction model; Inputting the user input content into the target quantity prediction model for processing, and outputting the predicted answer quantity; The user input content is processed and at least one answer text is output, and the number of the answer texts is the number of predicted answers.

2. The method according to claim 1, characterized in that The processing of the user input content and outputting at least one answer text, wherein the number of the answer texts is the number of predicted answers, includes: Using the predicted number of answers, adjusting the answer quantity parameter of the target answer prediction model; Based on the target answer prediction model after adjusting the answer quantity parameter, the user input content is processed to output at least one answer text.

3. The method according to claim 1, characterized in that The target quantity prediction model and the target answer prediction model are both large models, and the target quantity prediction model and the target answer prediction model correspond to different prompt word templates; The inputting the user input content into the target quantity prediction model for processing includes: The user input content is merged with the prompt word template corresponding to the target quantity prediction model and then input into the target quantity prediction model; The step of processing the user input content and outputting at least one answer text comprises: At least one answer text is obtained by fusing the predicted answer quantity with the user input content and inputting the resultant content into the target answer prediction model.

4. The method according to claim 1, characterized in that: The target quantity prediction model is trained in the following way: Obtaining an initial quantity forecasting model; Obtain at least one historical input content and a similarity number corresponding to each of the historical input contents; The initial quantity prediction model is trained according to each of the historical input contents and the similar quantities corresponding to each of the historical input contents to obtain a target quantity prediction model.

5. The method according to claim 4, characterized in that The obtaining of at least one historical input content and the number of similarities corresponding to each of the historical input contents includes: Obtain at least one historical input content and a true value text of an answer corresponding to each of the historical input contents; Get the number of preset answers; For each of the historical input contents, matching is performed in the user knowledge base according to the historical input contents to obtain at least one initial answer text corresponding to the historical input contents, and the number of the initial answer texts is the number of preset answers; Calculate the similarity between each of the initial answer texts corresponding to the historical input content and the answer true value text to obtain at least one similarity value corresponding to the historical input content, According to the similarity values ​​corresponding to the historical input contents, the similarity quantity corresponding to the historical input contents is determined.

6. The method according to claim 5, characterized in that The determining, according to each similarity value corresponding to the historical input content, the number of similarities corresponding to the historical input content includes: Get the similarity threshold; For each of the historical input contents, comparing each similarity value corresponding to the historical input content with the similarity threshold, to obtain a similarity comparison result of each of the similarity values ​​corresponding to the historical input content; The similarity quantity corresponding to the historical input content is obtained by counting the similarity comparison results of the similarity values ​​corresponding to the historical input content.

7. The method according to claim 1, characterized in that The target answer prediction model is trained in the following way: Obtain an initial answer prediction model; Get at least one text to be processed; For each of the to-be-processed texts, the to-be-processed texts are identified to obtain document identification data corresponding to the to-be-processed texts, wherein the document identification data includes: a document field, a document title, a document chapter name, and at least one document keyword; Generating a problem feature vector corresponding to the text to be processed according to the document identification data corresponding to the text to be processed; The initial answer prediction model is trained according to the question feature vectors corresponding to each of the texts to be processed to obtain a target answer prediction model.

8. An answer text generating device, characterized in that: The device comprises: A data acquisition module is used to obtain user input content, target quantity prediction model and target answer prediction model; A quantity prediction module, used for inputting the user input content into the target quantity prediction model for processing, and outputting the predicted answer quantity; The text acquisition module is used to process the user input content and output at least one answer text, and the number of the answer texts is the number of predicted answers.

9. An answer text generating device, characterized in that: The answer text generating device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the answer text generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the answer text generation method according to any one of claims 1 to 7 when executed.