Method and device for generating prompt information
By analyzing user input information and generating target prompt information, the problem of inaccurate large model output caused by inaccurate prompt information is solved, and the accuracy of output and user experience are improved.
Patent Information
- Application Number
- CN202411547227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
In application scenarios such as intelligent question and answer, intelligent search, if the prompt information is inaccurate, the results of the pre-trained large model will also have inaccurate problems.
By analyzing the user input information, determining the target task information of the corresponding subtasks to be processed, and generating target prompt information based on the target task information and initial prompt information to guide the big model to output more accurate information.
It improves the accuracy of the output of the big model, enhances the user experience effect, and ensures a better match between the model output and the user input intention.
Smart Images

Figure CN119474309A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and more specifically to a method and device for generating prompt information. Background Art
[0002] With the development of artificial intelligence technology, in application scenarios such as intelligent question answering, intelligent retrieval, and intelligent recognition, user input information can be processed based on large models to obtain matching output information. With the development of pre-trained large model technology, it has become a common method to use large models to infer the model based on prompt information to obtain model output. If the prompt information is inaccurate, the output of the large model will also be inaccurate. Summary of the invention
[0003] In view of this, this application provides the following technical solutions:
[0004] A method for generating prompt information, comprising:
[0005] Get the user input information to be processed;
[0006] Analyze the user input information to determine target task information of at least one to-be-processed subtask corresponding to the user input information;
[0007] generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information;
[0008] The target prompt information is used to guide the first target model to output target output information corresponding to the user input information when the first target model processes the user input information.
[0009] Optionally, the initial prompt information is obtained in at least one of the following ways:
[0010] Obtaining initial prompt information in an initial prompt information set corresponding to the second target model;
[0011] Determine the initial prompt information corresponding to the intention of the user input information in the initial prompt information set corresponding to the second target model;
[0012] Determine the initial prompt information corresponding to the intention of the subtask to be processed in the initial prompt information set corresponding to the second target model;
[0013] The first target model is the same as or different from the second target model, and the second target model is a model for generating the target prompt information.
[0014] Optionally, analyzing the user input information to determine target task information of at least one to-be-processed subtask corresponding to the user input information includes:
[0015] Parsing the user input information to determine at least one to-be-processed subtask corresponding to the user input information;
[0016] The target task information is determined based on the subtask contents of each of the subtasks to be processed and the association relationship between each of the subtasks to be processed.
[0017] Optionally, the subtask to be processed includes a first subtask and a second subtask having an associated relationship, and generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information includes:
[0018] If the first subtask is executed before the second subtask, obtaining result information obtained by the first target model processing the first subtask based on the first subtarget prompt information; the first subtarget prompt information is obtained based on the first subtask and the first subinitial prompt information corresponding to the first subtask;
[0019] The target prompt information is generated based on the result information, the second subtask, and second sub-prompt information corresponding to the second subtask.
[0020] Optionally, the subtask to be processed includes at least two subtasks having an associated relationship, and generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information includes:
[0021] If the at least two subtasks have no execution order, obtaining result information obtained by the first target model processing the corresponding subtasks based on the subtarget prompt information; the subtarget prompt information is obtained based on the subtask and the subinitial prompt information corresponding to the subtask;
[0022] Fill the result information into the slot of the corresponding subtask to generate target prompt information.
[0023] Optionally, generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information includes:
[0024] determining user characteristics associated with the user input information;
[0025] Based on the user characteristics, the target task information and the initial prompt information, target prompt information corresponding to the user input information is generated.
[0026] Optionally, generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information includes:
[0027] generating process prompt information based at least on the target task information and the initial prompt information;
[0028] Inputting the user input information into the first target model, so that the first target model processes the user input information based on the process prompt information to obtain process output information output by the first target model;
[0029] Feedback the process output information to the user corresponding to the user input information to obtain feedback information from the user regarding the process output information;
[0030] The process prompt information is adjusted based on the feedback information to obtain the target prompt information.
[0031] Optionally, the method further comprises:
[0032] Determining a similarity parameter between the target prompt information and the initial prompt information;
[0033] Based on the similarity parameter, an initial prompt information set corresponding to the first target model is updated.
[0034] Optionally, the method further comprises:
[0035] Obtaining a target data set, the target data set including intent information and task data corresponding to the intent information;
[0036] Processing the intention information and the task data based on the initial model to obtain at least one prompt information;
[0037] Screening the prompt information to obtain screened prompt information;
[0038] The initial model is adjusted based on the filtered prompt information to obtain a second target model.
[0039] A device for generating prompt information, comprising:
[0040] An acquisition unit, used for acquiring user input information to be processed;
[0041] a determination unit, configured to analyze the user input information and determine target task information of at least one to-be-processed subtask corresponding to the user input information;
[0042] A generating unit, configured to generate target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information;
[0043] The target prompt information is used to guide the first target model to output target output information corresponding to the user input information when the first target model processes the user input information. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0045] Figure 1 A flowchart of a method for generating prompt information provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a template for prompt information provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of an information processing flow provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of a prompt information generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] The terms "first" and "second" in this application are used to distinguish different objects, rather than to describe a specific order. 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 limited to the listed steps or units, but may include steps or units that are not listed.
[0051] The embodiment of the present application provides a method for generating prompt information, which can be applied to the scenario of model processing data, and the generated prompt information can guide the corresponding large model to output more accurate information. Among them, the large model can be determined based on the actual application scenario, and the types of large models corresponding to different application scenarios can be different. For example, when the large model is a large language model, the large language model can be used to process the information input by the user, and generate reply information that matches the information input by the user to meet the needs of the user. The generated prompt information can guide the large language model to output more accurate reply information, thereby improving the user experience.
[0052] See also Figure 1 , is a flow chart of a method for generating prompt information provided in an embodiment of the present application, the method may include the following steps:
[0053] S101: Obtain user input information to be processed.
[0054] The user input information can be obtained based on the input interface of the application of the electronic device currently used by the user. For example, the user can enter the corresponding search statement in the search application and use the search statement as the user input information. In the embodiment of the present application, the format of the user input information is not limited. The specific user input information can be text information, that is, receiving the text information input by the user based on the sections such as text boxes and dialog boxes; the user input information can also be voice input, that is, receiving the voice information input by the user through the audio input component (such as a microphone, etc.) of the electronic device. In order to facilitate subsequent processing, the voice information input by the user can be converted into text information through a voice recognition processing mode. Further, in order to accurately perform subsequent processing based on the user input information, the user input information can also be pre-processed, such as when the user inputs voice information, the interference of background audio can be removed, so that the obtained user input information is more accurate. If the user input information is text information, the text information can also be pre-processed by correcting typos and deleting duplicate words to make the text information more accurate.
[0055] S102: Analyze the user input information to determine target task information of at least one to-be-processed subtask corresponding to the user input information.
[0056] Since there are no specific restrictions on the format and method of user input information, in order to more accurately understand the user input intention, it is necessary to analyze the user input information to determine the user's intention information. In an embodiment of the present application, by performing task decomposition on the user input information to obtain at least one subtask to be processed, specifically, the user input information can be first segmented according to the text keywords in the user input information, and then the intention is identified according to the segmented text after the segmentation process to obtain at least one subtask, and then the association relationship between each subtask is determined, wherein the association relationship may include the execution order relationship of the subtask when processing, and may also include the logical relationship between the subtasks, etc. Therefore, in an embodiment of the present application, the target task information includes each subtask to be processed, and the association relationship between each subtask. For example, if the user input information is "Please plan a travel plan for the weekend, and the travel method", it can be divided into at least two subtasks according to the input information, one is travel planning, and the other is transportation method. There is a relationship between these two subtasks, such as different travel plans corresponding to different transportation methods. Therefore, it is necessary to first determine the travel route corresponding to the travel plan, and then determine the transportation method corresponding to the travel route. In the embodiment of the present application, the user input information is analyzed to realize the decomposition of the intended task corresponding to the user input information, and at least one subtask to be processed is obtained, so that the user's intention is obtained more accurately and in more detail. In addition, the association between each subtask to be processed can be determined, and the association between different subtasks can be more accurately determined when analyzing the user input intention, and the execution order or logic between each subtask is fully considered, so that the user's intention can be more accurately identified.
[0057] S103: Generate target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information.
[0058] In an embodiment of the present application, the user input information may be processed based on the first target model to obtain target output information that matches the user input intention. The first target model may be a large model that matches the user input scenario. For example, if the user inputs information in a search application, the first target model may be a search recognition model called by the search application, that is, the search recognition model may output search results corresponding to the user input information. For another example, if the user inputs information in an intelligent question-and-answer application, the first target model may be a large language model that can output corresponding reply information based on the user input information.
[0059] Usually, in order to enable the large model to output more accurate information, it will be configured with corresponding prompt information so that the model can understand the user's input intention based on the prompt information. However, since the prompt information configured by it is quite different from the user input information in some scenarios, the model cannot accurately understand the user's input intention. Therefore, in the embodiment of the present application, it is necessary to adjust and optimize the initial prompt information corresponding to the first target model so as to obtain the target prompt information, so that in the process of the first target model processing the user input information, the target prompt information can guide the first target model to output more accurate target output information corresponding to the user input information.
[0060] Among them, the initial prompt information may be the prompt information configured in the first target model. If multiple prompt information is configured in the first target model, the initial prompt information may be any of the prompt information, or the initial prompt information may be determined from multiple prompt information according to the type of the current user input information. For example, the first target model may be an intelligent question-answering model, and the initial prompt information may be determined in the prompt information corresponding to the intelligent question-answering model according to the type of question corresponding to the user input information. For example, if the question corresponding to the user input information is about learning, the initial prompt information may select prompt information of the learning category. If the question is about diet, the initial prompt information may select prompt information of the life category, etc. The initial prompt information may also be prompt information generated by a model for prompt information generation corresponding to the first target model, etc.
[0061] Then, the initial prompt information is processed according to the target task information corresponding to the user input information, wherein the target task information includes the task information of the subtasks to be processed corresponding to the user input information and the association relationship between the subtasks, and the user's input intention can be more accurately determined through the target task information. The initial prompt information is processed by the target task information, and the generated target prompt information can also better match the user's current input intention, thereby guiding the first target model to understand the user's intention information and output more accurate target output information. In an embodiment of the present application, the target prompt information can be a guide information that only includes the first target model, such as "This is a question about obtaining a mathematical learning method"; correspondingly, the target prompt information can also be a combination of the guide information of the first target model generated according to the target task information and the initial prompt information and the user input information, such as, the generated guide information is "This is a question about obtaining a mathematical learning method", and the user input information is "How to improve calculation efficiency", then the corresponding target prompt information can be "How to improve mathematical calculation efficiency". Specifically, the information format of the target prompt information can be determined based on the actual application scenario and the processing mode of the first target model, and this application does not limit this.
[0062] In an embodiment of the present application, a method for generating prompt information is provided, in which the user input information can be parsed to determine the target task information of at least one to-be-processed subtask corresponding to the user input information, and the input intention corresponding to the user input information can be disassembled and the subtasks can be planned, so that prompt information can be generated more specifically based on the obtained target task information. In addition, the first target model can be guided to output output information that better meets the needs of the user.
[0063] The following describes a method for generating prompt information provided by an embodiment of the present application in conjunction with relevant application scenarios.
[0064] In one implementation of the embodiment of the present application, the initial prompt information is obtained by at least one of the following methods:
[0065] Method 1: obtaining initial prompt information in an initial prompt information set corresponding to the second target model.
[0066] Method 2: Determine the initial prompt information corresponding to the user's intention of inputting information in the initial prompt information set corresponding to the second target model.
[0067] Method three: determine the initial prompt information corresponding to the intention of the subtask to be processed in the initial prompt information set corresponding to the second target model.
[0068] Among them, the first target model is the same as or different from the second target model, and the second target model is a model for generating target prompt information. If the first target model and the second target model are the same, that is, they are the same model, it has the function of generating target prompt information and processing user input information based on the target prompt information. If the first target model and the second target model are different, the first target model can be a model that only processes input information, and the second target model can be a prompt information generation model for generating target prompt information. In method one, when the first target model and the second target model are the same, the initial prompt information can be determined in the initial prompt information set configured by the first target model. For example, information in an initial prompt information set can be randomly selected as the initial prompt information. It can also be the prompt information with the most uses as the initial prompt information. When the first target model and the second target model are different, the initial prompt information can be determined based on the initial prompt information set corresponding to the first target model configured by the second target model.
[0069] In the second method, the second target model may be to first perform preliminary identification on the user input information to determine the approximate intention of the user input, and then determine the prompt information that matches the approximate intention of the user input in the initial prompt information set as the initial prompt information. In the third method, the user input information may be first analyzed to obtain at least one subtask to be processed, and the intention corresponding to each subtask to be processed is obtained, and then the prompt information closest to the intention of each subtask is determined in the initial prompt information as the initial prompt information. For example, the initial prompt information may be determined based on the matching degree between each prompt information and the subtask, or the initial prompt information may be determined based on the number of subtasks when each prompt information and the subtask meet the corresponding matching conditions. If the first prompt information matches the intention of two subtasks, and the second prompt information matches the intention of three subtasks, the second prompt information is determined as the target prompt information. In the case where the second target model is configured with multiple initial prompt information, the corresponding initial prompt information may be determined by preliminary screening, so that it is more accurate in subsequent processing.
[0070] Correspondingly, when the second target model is a prompt information generation model, a second target model generation method is also provided in an embodiment of the present application, the method including: obtaining a target data set; processing the intention information and task data based on the initial model to obtain at least one prompt information; filtering the prompt information to obtain filtered prompt information; adjusting the initial model based on the filtered prompt information to obtain the second target model.
[0071] Among them, the target data set includes intent information and task data corresponding to the intent information. The task data includes input data and corresponding output data. Then, the target data set is learned through the initial model, that is, the initial model is trained through the target data set so that the initial model can output prompt information. Specifically, the initial model learns the intent information, input information and output information so that the satisfied prompt information can be determined, that is, the corresponding output information can be obtained based on the prompt information and the input information. Then, the prompt information can be screened according to the matching degree between the prompt information obtained by the initial model and the intent information in the target data set to obtain the screened prompt information, and then the model parameters of the initial model are adjusted using the screened prompt information. When the adjusted initial model can output the screened prompt information, the adjustment process is stopped to obtain the second target model. If the adjusted initial model still cannot output the screened prompt information, the relevant model parameters of the initial model will continue to be adjusted to obtain the second target model. Correspondingly, in the process of screening the prompt information output by the initial model, a separate information screening model can also be used to screen the prompt information. For example, the information screening model can be a model using a larger number of parameters, which can be a 72B model, which is a large language model with a parameter scale of 72 billion. The prompt information output by the initial model is scored for quality by the information screening model, and the prompt information is sorted according to the scoring index. The prompt information with the highest sorting is selected as the screened prompt information to participate in the subsequent adjustment of the initial model. It can also be that after the initial model outputs the prompt information, the first target model is guided to process the input information in the task data based on the prompt information to obtain the output information. If the output information matches the output information corresponding to the input information in the task data, it means that the prompt information is more accurate and will be used as the screened prompt information. Thus, the initial model is adjusted based on the screened prompt information to obtain the second target model. By generating the second target model and then generating the target prompt information by the second target model, the information processing efficiency can be made higher and the real-time processing requirements of the model can be met.
[0072] In one implementation of an embodiment of the present application, the user input information is analyzed to determine the target task information of at least one subtask to be processed corresponding to the user input information, including: parsing the user input information to determine at least one subtask to be processed corresponding to the user input information; determining the target task information based on the subtask content of each subtask to be processed and the association relationship between each subtask to be processed.
[0073] In the process of parsing the user input information, the user input information can be preprocessed first to eliminate words that are meaningless to the understanding of the intent and avoid these words interfering with the understanding of the intent. Then, the user input information is decomposed into intents, and the intent understanding model can be used to identify and decompose the intent. For example, the user input information is input into the intent understanding model, and the intent understanding model will output at least one subtask to be processed, and each subtask to be processed corresponds to a sub-intention of the user input information. And according to the task content and logical relationship corresponding to each subtask, the association relationship between each subtask to be processed is determined, so as to generate the target task information, that is, the target task information can include the subtask content of each subtask to be processed and the association relationship between each subtask to be processed.
[0074] For example, the user input information is "Please make a travel plan in the city this week. What's the weather like?". By analyzing the user input information, it can be obtained that the user input information includes at least two pending subtasks, one of which is the subtask of making a travel plan, corresponding to the travel planning intention; the other is the subtask of outputting the weather conditions, corresponding to the intention of knowing the weather conditions. Since the user input is about traveling in the city, the weather changes in the city are relatively small, so these two subtasks can be identified as independent subtasks, so that according to the task content of the two subtasks and their independent characteristics, the target task information is generated, and the initial prompt information about itinerary making is optimized through the target task information to obtain the target prompt information, such as the target prompt information can be "This is a processing task about making a travel plan and knowing the weather". For another example, the user input information is "Is there any place suitable for short-term travel nearby, how to get there". By analyzing the user input information, the pending subtasks obtained include obtaining nearby travel places, generating travel routes, and the corresponding transportation methods for each travel route. It can be obtained that these three subtasks have a sequential execution order, and at least the travel route must be determined first before the corresponding transportation method can be determined. Therefore, the target task information includes the task content of the above subtasks and the execution order of each subtask. Then, the initial travel plan prompt information is adjusted according to the target task information to obtain the target prompt information. For example, the target prompt information may be "each nearby travel route and the corresponding transportation mode need to be generated". In this way, the first target model can more accurately output the target output information corresponding to the user input information based on the target prompt information, thereby improving the accuracy of information output and the user experience effect.
[0075] Specifically, in one implementation of the embodiment of the present application, the subtask to be processed includes a first subtask and a second subtask having an associated relationship, and based on at least the target task information and the initial prompt information, generating target prompt information corresponding to the user input information, including: if the first subtask is executed before the second subtask, obtaining the result information obtained by the first target model processing the first subtask based on the first subtarget prompt information. Based on the result information, the second subtask and the second subprompt information corresponding to the second subtask, generating the target prompt information.
[0076] Among them, the first sub-target prompt information is obtained based on the first sub-task and the first sub-initial prompt information corresponding to the first sub-task. In this embodiment, the first sub-task and the second sub-task are sub-tasks with a sequential execution order. That is, the different execution results of the first sub-task will affect the execution results of the second sub-task. Therefore, in order to generate more accurate target prompt information, it is also necessary to generate it according to the result information of the first sub-task in the process of generating the target prompt information. For example, first, based on the second target model based on the task content of the first sub-task and the first sub-initial prompt information, the first sub-target prompt information is generated, and then the first target model is called to process the first sub-task based on the first sub-target prompt information to obtain the result information. Then, the result information corresponding to the first sub-task, the second sub-task and the initial prompt information of the second sub-task are processed again based on the second target model to generate the target prompt information. Then, the first target model is called again based on the target prompt information to output the target output information corresponding to the user input information. In this way, the target prompt information not only includes the relevant intention information of the first sub-task, but also includes the relevant intention information of the second sub-task, so that the target prompt information can meet the input intention of the current user input information, and improve the accuracy of subsequent information processing.
[0077] In another implementation of the embodiment of the present application, the subtask to be processed includes at least two subtasks with an associated relationship, wherein, based at least on the target task information and the initial prompt information, each row of target prompt information corresponding to the user input information is reviewed, including: if at least two subtasks have no execution order, obtaining the result information obtained by processing the corresponding subtasks based on the sub-target prompt information by the first target model; filling the result information into the slot of the corresponding subtask to generate the target prompt information.
[0078] The sub-target prompt information is obtained based on the sub-task and the sub-initial prompt information corresponding to the sub-task. In this implementation, since there is no execution order between the sub-tasks, the execution results of each sub-task will not affect the execution process of other sub-tasks. Therefore, the first target model can be called only once, and the target prompt information can be generated by reserving slots. This can reduce the number of calls to the first target model and improve information processing efficiency. Figure 2, is a schematic diagram of a prompt information template provided in an embodiment of the present application, in which there are multiple reserved slots. After parsing the user input information to obtain multiple subtasks to be processed, if the subtasks to be processed have no execution order, the first target model can be used to generate result information corresponding to the subtask based on the subtarget prompt information of each subtask. For example, if the user input information corresponds to three subtasks, the first subtask is a subtask for determining a means of transportation, the second subtask is a subtask for determining a travel time, and the third subtask is a subtask for determining a travel destination. If the subtarget prompt information of the first subtask is to prompt the first target model to generate result information corresponding to the subtask based on the user's previous travel selection model The information of the means of transportation is determined by the formula. The result information corresponding to the first subtask can be a private car, and the result information corresponding to the second subtask can be summer. The result information corresponding to the third subtask can be a southern city. Then, the result information of these three subtasks is respectively filled into the corresponding reserved slots in the prompt information template, and the target prompt information is generated based on the second target model. The target prompt information obtained can be "it is necessary to make a self-driving travel plan to the south in summer". In this way, the first target model can output target output information that better matches the user's intention based on the target prompt information, reduce the number of model calls, and improve the efficiency of information processing.
[0079] Furthermore, in order to accurately understand the user's input intention and generate more accurate target prompt information, in the embodiment of the present application, the target prompt information can also be determined according to the relevant characteristics of the user. Wherein, generating the target prompt information corresponding to the user input information based on at least the target task information and the initial prompt information includes: determining the user characteristics related to the user input information; generating the target prompt information corresponding to the user input information based on the user characteristics, the target task information and the initial prompt information.
[0080] Specifically, if the user currently inputs a lot of input information, the user input information can be analyzed, and information related to the user's attribute characteristics can be extracted from the user input information, and the user characteristics can be determined based on this information. Correspondingly, the user characteristics can also be determined based on the user's historical input information and / or the historical output information that matches the user, or based on the user's public attribute information of the user dimension, such as age, occupation, interests and hobbies. In this way, when generating target prompt information, the prompt information that is more in line with the user's input intention can be determined in combination with the user's user characteristics. For example, if the prompt information generated by the target task information and the initial prompt information includes prompt information that prompts the first target model to output information about recent news information, and it is determined through the user characteristic information that the user is interested in sports news, then the final target prompt information can be prompting the first target model to output information about recent sports news, so that the generated target prompt information can match the user characteristics, improve the accuracy of prompt information generation, and further improve the accuracy of the first target model in processing user input information.
[0081] In another embodiment of the present application, the intermediate information in the process of generating the target prompt information can also be adjusted through the user's feedback information, so that the target prompt information with better user recognition is finally generated. Specifically, the target prompt information corresponding to the user input information is generated at least based on the target task information and the initial prompt information, including: generating process prompt information at least based on the target task information and the initial prompt information; inputting the user input information into the first target model so that the first target model processes the user input information based on the process prompt information to obtain the process output information output by the first target model; feeding back the process output information to the user corresponding to the user input information, obtaining the user's feedback information on the process output information, adjusting the process prompt information based on the feedback information, and obtaining the target prompt information.
[0082] In this embodiment, in the process of generating the target prompt information, the generated process prompt information can be adjusted in real time through the user's feedback information to obtain the target prompt information that meets the user's needs. For example, after the process prompt information is generated according to the target task information and the initial prompt information, the process prompt information is then used to guide the first target model to process the user input information to obtain the process output information. If the user is relatively satisfied with the process output information, the user can end the input, or when the user inputs other questions that are not related to the current input information, it can be determined that the current process output information meets the user's input intention, and the process output information can be determined as the target prompt information. Correspondingly, if the user is not satisfied with the process output information output by the first target model, it can be specifically reflected in that the user inputs further information based on the original input information, or selects corresponding information within the information range of the process output information. At this time, the process prompt information can be adjusted according to the user's feedback information on the process output information, so as to obtain the target prompt information. For example, when the first target model outputs three travel routes based on the process prompt information, and the user continues to input descriptive information about self-driving, the prompt information about the means of transportation in the process prompt information will be modified to a car, so that the means of transportation in the target prompt information is a car, and the travel route output by the first target model based on the target prompt information is a self-driving route, which meets the user's intention and improves the user experience.
[0083] After generating the target prompt information corresponding to the user input information, the original initial prompt information can be updated based on the target prompt information, so that the first target model does not need to repeat the process of generating prompt information when processing the user's input information in the subsequent process, thereby improving the information processing efficiency. Specifically, the method also includes: determining a similarity parameter between the target prompt information and the initial prompt information; and updating the initial prompt information set corresponding to the first target model based on the similarity parameter.
[0084] Among them, the vector similarity value between the first information vector corresponding to the target prompt information and the second information vector corresponding to the initial prompt information can be calculated, such as by expressing it through cosine similarity, to obtain a similarity parameter. If the difference between the two is small, the initial prompt information may not be updated. If the difference between the two exceeds the similarity threshold, it means that the difference between the two is large, and the initial prompt information can be updated. Correspondingly, other prompt information associated with the initial prompt information can also be updated synchronously, so as to achieve the purpose of updating the initial prompt information set corresponding to the first target model to meet subsequent applications.
[0085] See also Figure 3, is a flowchart of an information processing provided by an embodiment of the present application. In this application scenario, the prompt information generator is used to generate prompt information for guiding the information processing model. First, the user input information is obtained through the user information input interface, and then the user input information is disassembled through the task disassembly module to obtain at least one subtask corresponding to the user input information, and then according to the task content of each subtask and the corresponding processing intention, the association relationship between each subtask can be obtained, thereby obtaining the target task information. For example, different fields can be used to represent the characteristics of the task and the relationship between the tasks. For example, when each subtask is disassembled to obtain each subtask, it can be marked with "priority execution", "the current subtask is related to the previous subtask", "the current subtask and the previous subtask have a sequential relationship and need to wait for the result of the previous subtask", "the current subtask is independent of other tasks and can be executed independently", etc., so that when determining the target task information, the user's current input intention can be more accurately determined according to these fields.
[0086] At the same time, the user input information can also be processed by the user feature determination module to extract the attributes of the user input, such as language, specified format, answer preference, etc., so as to obtain the user feature information. Then the user feature information and the target task information are input to the prompt information generator, so that the prompt information generator outputs the target prompt information based on its preset initial prompt information and user feature information and target task information. In this application scenario, the target prompt information includes the guide information of the guide information processing model and the user's input information. Therefore, the target prompt information can be directly input into the information processing model so that the information processing model outputs the target output information. Further, the initial prompt information can be updated according to the user's feedback on the target output information, or the initial prompt information can be updated according to the target prompt information, so as to achieve the purpose of automatically iterating and optimizing the prompt information, so that the quality of the prompt information is continuously improved. Therefore, when the information processing in the same field is applied in the subsequent application, the updated prompt information can be directly called, which improves the processing efficiency of the information processing model.
[0087] In another embodiment of the present application, a prompt information generating device is also provided. Figure 4 ,include:
[0088] An acquisition unit 401 is used to obtain user input information to be processed;
[0089] A determination unit 402 is used to analyze the user input information and determine target task information of at least one to-be-processed subtask corresponding to the user input information;
[0090] A generating unit 403, configured to generate target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information;
[0091] The target prompt information is used to guide the first target model to output target output information corresponding to the user input information when the first target model processes the user input information.
[0092] Optionally, the device further includes an initial information acquisition unit, and the initial information acquisition unit includes at least one of the following subunits:
[0093] A first acquisition subunit is used to obtain initial prompt information in an initial prompt information set corresponding to a second target model;
[0094] A first determining subunit is used to determine the initial prompt information corresponding to the intention of the user input information in the initial prompt information set corresponding to the second target model;
[0095] A second determining subunit is used to determine the initial prompt information corresponding to the intention of the subtask to be processed in the initial prompt information set corresponding to the second target model;
[0096] The first target model is the same as or different from the second target model, and the second target model is a model for generating the target prompt information.
[0097] Optionally, the determining unit includes:
[0098] A parsing subunit, configured to parse the user input information and determine at least one to-be-processed subtask corresponding to the user input information;
[0099] The third determining subunit is used to determine the target task information based on the subtask content of each of the subtasks to be processed and the association relationship between each of the subtasks to be processed.
[0100] Optionally, the subtask to be processed includes a first subtask and a second subtask having an associated relationship, and the generating unit includes:
[0101] A second acquisition subunit is used for obtaining result information obtained by the first target model processing the first subtask based on the first subtarget prompt information if the first subtask is executed before the second subtask; the first subtarget prompt information is obtained based on the first subtask and the first subinitial prompt information corresponding to the first subtask;
[0102] The first generating subunit is used to generate the target prompt information based on the result information, the second subtask, and the second sub-initial prompt information corresponding to the second subtask.
[0103] Optionally, the subtask to be processed includes at least two subtasks having an associated relationship, and the generating unit includes:
[0104] A third acquisition subunit is used for obtaining result information obtained by the first target model processing the corresponding subtasks based on the subtarget prompt information respectively if the at least two subtasks have no execution order; the subtarget prompt information is obtained based on the subtask and the subinitial prompt information corresponding to the subtask respectively;
[0105] The second generating sub-unit is used to fill the result information into the slot of the corresponding sub-task and generate target prompt information.
[0106] Optionally, the generating unit includes:
[0107] A user feature determination subunit, used to determine user features related to the user input information;
[0108] The third generating subunit is used to generate target prompt information corresponding to the user input information based on the user characteristics, the target task information and the initial prompt information.
[0109] Optionally, the generating unit includes:
[0110] a fourth generating subunit, configured to generate process prompt information based at least on the target task information and the initial prompt information;
[0111] a model processing subunit, configured to input the user input information into the first target model, so that the first target model processes the user input information based on the process prompt information to obtain process output information output by the first target model;
[0112] A fourth acquisition subunit is used to feed back the process output information to the user corresponding to the user input information, and obtain feedback information of the user for the process output information;
[0113] The adjustment subunit is used to adjust the process prompt information based on the feedback information to obtain the target prompt information.
[0114] Optionally, the device further comprises:
[0115] A similarity determination unit, used to determine a similarity parameter between the target prompt information and the initial prompt information;
[0116] An updating unit is used to update an initial prompt information set corresponding to the first target model based on the similarity parameter.
[0117] Optionally, the device further comprises: a model creation unit, configured to:
[0118] Obtaining a target data set, the target data set including intent information and task data corresponding to the intent information;
[0119] Processing the intention information and the task data based on the initial model to obtain at least one prompt information;
[0120] Screening the prompt information to obtain screened prompt information;
[0121] The initial model is adjusted based on the filtered prompt information to obtain a second target model.
[0122] It should be noted that the specific implementation of each unit and sub-unit in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0123] In another embodiment of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating prompt information as described in any one of the above items is implemented.
[0124] In another embodiment of the present application, an electronic device is further provided, and the electronic device may include:
[0125] A memory, used to store applications and data generated by the operation of the applications;
[0126] The processor is used to execute the application program to implement the method for generating prompt information as described in any one of the above items.
[0127] It should be noted that the specific implementation of the processor in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0128] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0129] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0130] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0131] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating prompt information, comprising: Get the user input information to be processed; Analyze the user input information to determine target task information of at least one to-be-processed subtask corresponding to the user input information; generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information; The target prompt information is used to guide the first target model to output target output information corresponding to the user input information when the first target model processes the user input information.
2. According to the method of claim 1, the initial prompt information is obtained by at least one of the following methods: Obtaining initial prompt information in an initial prompt information set corresponding to the second target model; Determine the initial prompt information corresponding to the intention of the user input information in the initial prompt information set corresponding to the second target model; Determine the initial prompt information corresponding to the intention of the subtask to be processed in the initial prompt information set corresponding to the second target model; in, The first target model is the same as or different from the second target model, and the second target model is a model for generating the target prompt information.
3. The method according to claim 1, wherein analyzing the user input information to determine target task information of at least one to-be-processed subtask corresponding to the user input information comprises: Parsing the user input information to determine at least one to-be-processed subtask corresponding to the user input information; The target task information is determined based on the subtask contents of each of the subtasks to be processed and the association relationship between each of the subtasks to be processed.
4. The method according to claim 3, wherein the subtask to be processed comprises a first subtask and a second subtask having an associated relationship, and the generating of target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information comprises: If the first subtask is executed before the second subtask, obtaining result information obtained by the first target model processing the first subtask based on the first subtarget prompt information; The first sub-target prompt information is obtained based on the first sub-task and the first sub-initial prompt information corresponding to the first sub-task; The target prompt information is generated based on the result information, the second subtask, and the second sub-initial prompt information corresponding to the second subtask.
5. The method according to claim 3, wherein the subtask to be processed includes at least two subtasks having an associated relationship, and the step of generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information comprises: If the at least two subtasks have no execution order, obtaining result information obtained by the first target model processing the corresponding subtasks respectively based on the subtarget prompt information; The sub-goal prompt information is obtained based on the sub-task and the sub-initial prompt information corresponding to the sub-task; Fill the result information into the slot of the corresponding subtask to generate target prompt information.
6. The method according to claim 1, wherein generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information comprises: determining user characteristics associated with the user input information; Based on the user characteristics, the target task information and the initial prompt information, target prompt information corresponding to the user input information is generated.
7. The method according to claim 1, wherein generating target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information comprises: generating process prompt information based at least on the target task information and the initial prompt information; Inputting the user input information into the first target model, so that the first target model processes the user input information based on the process prompt information to obtain process output information output by the first target model; Feedback the process output information to the user corresponding to the user input information to obtain feedback information from the user regarding the process output information; The process prompt information is adjusted based on the feedback information to obtain the target prompt information.
8. The method according to claim 1, further comprising: Determining a similarity parameter between the target prompt information and the initial prompt information; Based on the similarity parameter, an initial prompt information set corresponding to the first target model is updated.
9. The method according to claim 2, further comprising: Obtaining a target data set, the target data set including intent information and task data corresponding to the intent information; Processing the intention information and the task data based on the initial model to obtain at least one prompt information; Screening the prompt information to obtain screened prompt information; The initial model is adjusted based on the filtered prompt information to obtain a second target model.
10. A device for generating prompt information, comprising: An acquisition unit, used for acquiring user input information to be processed; a determination unit, configured to analyze the user input information and determine target task information of at least one to-be-processed subtask corresponding to the user input information; A generating unit, configured to generate target prompt information corresponding to the user input information based at least on the target task information and the initial prompt information; The target prompt information is used to guide the first target model to output target output information corresponding to the user input information when the first target model processes the user input information.