Training method and device of automatic prompt system, equipment and storage medium
Through the combined and loop training of the evaluator and optimizer, the problem of poor automatic prompt engineering training is solved, which improves the accuracy of prompt prediction and the overall performance of the system.
Patent Information
- Application Number
- CN202311239706.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-03-28
AI Technical Summary
Due to poor training results in automatic prompt engineering, the performance and prompt prediction accuracy are low.
By obtaining the first training data, the quality evaluation is performed using the evaluator and the optimizer is trained, and the second training data is then obtained using the optimizer, and the evaluator is trained in turn, forming a joint and cyclic training process of the evaluator and the optimizer until the training is completed.
The training effect and efficiency of the automatic prompt system are improved, and the use effect during use is improved, that is, the accuracy of prompt prediction.
Smart Images

Figure CN119721282A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of prompting engineering technology, and in particular to a training method, device, electronic equipment and storage medium for an automatic prompting system. Background Art
[0002] With the rise of large-scale pre-trained language models (PLM), such as GPT-3, generative AI has made great progress. Based on technologies such as attention mechanisms and transformers, these models can generate very realistic and semantically coherent text. However, PLM still has problems such as dependence on huge training data, lack of controllability, and poor task adaptability. To improve these defects, prompt engineer (PE) technology came into being and is constantly developing. An automatic prompt engineer (APE) is proposed.
[0003] However, as an emerging AI technology, the automatic prompt project still has some problems in its use. For example, the existing search and optimization algorithms are inefficient due to the large prompt search space, resulting in a long evaluation iteration cycle. Another example is that the independent training of each module in the automatic prompt project results in low performance of the automatic prompt system.
[0004] Therefore, in response to the above problems, there is an urgent need for a method to improve the performance of automatic prompt engineering and the accuracy of prompt prediction. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a training method, device, electronic device and storage medium for an automatic prompt system to solve the technical problem in the related art that the automatic prompt project has low performance and prompt prediction accuracy due to poor training effect.
[0006] In a first aspect, an embodiment of the present application provides a training method for an automatic prompting system, comprising:
[0007] Acquire first training data for training an automatic prompt system to be trained, wherein the automatic prompt system includes at least an evaluator and an optimizer;
[0008] Performing a quality assessment on the first training data according to the evaluator to obtain a first assessment result;
[0009] Training the optimizer according to the first evaluation result, and acquiring second training data corresponding to the original keyword in the prompt search space according to the trained optimizer;
[0010] Training the evaluator according to the second training data, and evaluating the second training data according to the trained evaluator, so as to train the optimizer according to the obtained second evaluation result and obtain third training data for training the evaluator in the prompt search space;
[0011] When it is determined that the training of the evaluator and the optimizer is completed, a trained automatic prompt system is obtained.
[0012] In a second aspect, an embodiment of the present application provides a training device for an automatic prompting system, comprising:
[0013] A data acquisition module, used to acquire first training data for training an automatic prompt system to be trained, wherein the automatic prompt system at least includes an evaluator and an optimizer;
[0014] A quality assessment module, configured to perform a quality assessment on the first training data according to the evaluator to obtain a first assessment result;
[0015] A first training module, configured to train the optimizer according to the first evaluation result, and to obtain second training data corresponding to the original keyword in the prompt search space according to the trained optimizer;
[0016] A second training module, used for training the evaluator according to the second training data, and evaluating the second training data according to the trained evaluator, so as to train the optimizer according to the obtained second evaluation result and obtain third training data for training the evaluator in the prompt search space;
[0017] The training judgment module is used to obtain a trained automatic prompt system when it is determined that the training of the evaluator and the optimizer is completed.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the training method of the automatic prompt system described in any one of the above items when executing the computer program.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the training method of the automatic prompt system described in any one of the above items are implemented.
[0020] The embodiments of the present application provide a training method, device, electronic device and storage medium for an automatic prompt system. During the training process of the automatic prompt system, the automatic prompt system to be trained is first determined according to current needs, and prompt search is performed in the prompt search space according to the input original keywords to determine the prompts corresponding to the original keywords, and the prompts are combined to obtain the first training data. Then, in the determined automatic prompt system to be trained, the first training data is evaluated for quality using an evaluator to obtain a first evaluation result, and then the optimizer is trained using the first evaluation result to determine the training data again according to the trained optimizer to obtain the second training data. The second training data will be used to train and optimize the evaluator, and the trained evaluator will again perform quality evaluation on the second training data, and the second evaluation result will be used to train the optimizer. The training and optimization of the automatic prompt system to be trained are completed through joint and cyclic training. Finally, when it is determined that the training is completed, a trained automatic prompt system is obtained. It is achieved that, during the training process, different automatic prompt systems are defined according to needs, and then during the training process, the evaluator and optimizer are combined to perform cyclic training, and interact and restrict each other to improve the effect and efficiency of system training, so as to improve the effect of use during use, that is, the accuracy of prompt prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flow chart of a training method of an automatic prompting system provided in an embodiment of the present application;
[0022] Figure 2 It is a structural diagram of an adaptive framework of an automatic prompt system provided in an embodiment of the present application;
[0023] Figure 3 It is a flowchart of the steps of processing demand information and original keywords provided in an embodiment of the present application;
[0024] Figure 4 is a flowchart of the steps of performing training processing according to the first evaluation result provided in an embodiment of the present application;
[0025] Figure 5 It is a flowchart of the steps of applying the automatic prompt system provided in the embodiment of the present application;
[0026] Figure 6 It is a schematic block diagram of training an evaluator and an optimizer provided in an embodiment of the present application;
[0027] Figure 7 This is a schematic diagram of a scenario for prompting custom input provided in an embodiment of the present application;
[0028] Figure 8This is a schematic diagram of a scene showing prompt words provided in an embodiment of the present application;
[0029] Fig. 9 It is a schematic diagram of the use framework of the automatic prompt system provided in the embodiment of the present application;
[0030] Fig.10 It is a structural schematic diagram of a training device for the automatic prompting system provided in an embodiment of the present application;
[0031] Fig.11 is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0032] Fig.12 This is another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] 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.
[0034] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0035] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0036] In related technologies, the automatic prompt project will cause the existing search and optimization algorithms to be inefficient due to the large prompt search space, resulting in a long evaluation iteration cycle. During training, the independent training of each module, such as the evaluator and the optimizer, will result in the automatic prompt system obtained through training having low performance due to the lack of learning integration and function restriction.
[0037] In order to solve the technical problems existing in the related art, the present application embodiment provides a training method for an automatic prompt system, see Figure 1 , Figure 1It is a flow chart of a training method of an automatic prompt system provided in an embodiment of the present application, and the method includes steps 101 to 10,5.
[0038] Step 101: Acquire first training data for training an automatic prompt system to be trained, wherein the automatic prompt system at least includes an evaluator and an optimizer.
[0039] In one embodiment, when training the automatic prompt system, firstly, the automatic prompt system to be trained that is currently being trained is determined according to actual needs, and the training data for training is determined at the same time. Specifically, before training, input demand information and original keywords are received, wherein the demand information is used to determine the automatic prompt system to be trained that is currently being trained, and the original keywords are used to determine the training data for training. Therefore, after obtaining the demand information and the original keywords, the corresponding automatic prompt system to be trained is obtained according to the demand information, and the training data for training is obtained according to the original keywords.
[0040] For example, in order to improve the scalability and applicability of the automatic prompt system, an adaptive framework is set for the automatic prompt system, and modules and functions can be added according to actual needs. That is, for the automatic prompt system, different automatic prompt systems can be formed according to different needs. For example, if the automatic prompt system needs to have the ability of online learning, an online learning function module can be added to the automatic prompt system. For example, if the automatic prompt system needs to be able to perform self-supervised learning, a self-supervised learning module can be added to the automatic prompt system, and then the corresponding training process is performed. The automatic prompt system thus formed includes at least an evaluator and an optimizer. The training of the automatic prompt system is completed by training and optimizing the evaluator and the optimizer.
[0041] Among them, for the constructed adaptive framework, it can be as follows Figure 2 As shown, in Figure 2 In the figure, the parts framed by solid lines (evaluator and optimizer) are necessary modules for the automatic prompt system, while the parts framed by dashed lines (such as representation learning and online learning) are adaptively selected modules for the automatic prompt system. By training the entire adaptive framework (i.e., the automatic prompt system), it can be used for downstream devices to predict and feedback prompt information.
[0042] Further, after obtaining the demand information and the original keywords, the automatic prompt system to be trained and the first training data for training will be determined. The specific steps of obtaining the automatic prompt system to be trained can be referred to in Figure 3 , Figure 3It is a flowchart of the steps for processing demand information and original keywords provided in an embodiment of the present application, wherein the steps include steps 301 to 303.
[0043] Step 301, receiving input demand information and original keywords, and performing feature extraction on the demand information and the original keywords to obtain corresponding demand labels and text features;
[0044] Step 302, configuring the automatic prompt system according to the required label to obtain the automatic prompt system to be trained;
[0045] Step 303: perform a prompt search in the prompt search space according to the text feature to obtain a first prompt set associated with the text feature, and combine the text feature with each prompt in the first prompt set to obtain first training data.
[0046] In one embodiment, during processing, demand information and original keywords uploaded by relevant staff are received, and feature information of the demand information and original keywords is extracted to obtain corresponding demand labels and text features, wherein the original keyword can be a language text or a word set consisting of several words, the demand label can be a combination of numbers and / or letters, and the text feature is a feature vector. The automatic prompt system is then configured and processed according to the demand label to obtain an automatic prompt system to be trained, and a prompt search is performed in the prompt search space according to the text features to obtain an associated first prompt set. Finally, each prompt in the first prompt set is combined with the text feature (original keyword) to obtain the first training data.
[0047] For example, due to different requirements, the modules included in the corresponding automatic prompt system are different, so when determining the automatic prompt system to be trained, the system is configured according to the obtained requirement label. In fact, when configuring, when it is determined that there is an automatic prompt system corresponding to the requirement label, the corresponding stored automatic prompt system can be directly pulled, and then training is performed based on the obtained first training data. At this time, since there is an automatic prompt system corresponding to the requirement information, the training process will be relatively simple and convenient, and may only require some fine-tuning.
[0048] When there is no corresponding automatic prompt system, the system can be configured according to actual needs, such as adding the required modules / functions to obtain the current corresponding automatic prompt system to be trained. That is, when obtaining the automatic prompt system to be trained, it includes: performing query matching according to the requirement tag to determine whether the requirement tag is recorded; when it is determined that the requirement tag is recorded, obtaining the automatic prompt system corresponding to the requirement tag as the automatic prompt system to be trained; when it is determined that the requirement tag is not recorded, receiving the input configuration information, and performing system configuration according to the configuration information to obtain the automatic prompt system to be trained.
[0049] That is, when querying according to the required label, if there is a corresponding automatic prompt system, it will be directly pulled, and if there is no corresponding automatic prompt system, the system will be configured to obtain the automatic prompt system to be trained that is currently required.
[0050] At the same time, the prompt search space used to obtain the first training data is obtained based on the existing large database. Synonym thesaurus, knowledge graph and pre-trained language model can be used for anticipated collection to obtain the prompt search space. At the same time, multimodal visual and voice prompts can be added to enrich the prompt search space.
[0051] When obtaining prompts associated with text features (original keywords) in the prompt search space based on text features, a pre-trained language model can be used for processing. For example, the size of the correlation between the text features and the prompts can be used to determine, and prompts with a correlation greater than a set threshold are extracted and combined with the text features respectively to generate the first training data.
[0052] That is, when obtaining the first training data, it includes: matching in the prompt search space according to the text features, and selecting several prompts associated with the text features in the prompt search space according to the degree of matching; matching the text features with the prompts one-to-one to obtain several text prompt pairs, and using several times the text prompt pairs as the first training data, wherein the text prompt pair contains the text feature and one prompt.
[0053] That is, when processing, when determining prompts, by determining the degree of match between text features and each prompt in the prompt search space, prompts with a matching degree greater than a preset threshold are used as prompts associated with the text features, and then the obtained prompts are associated with the text features respectively to form a training data, and after completing the association combination of all prompts, the first training data is obtained.
[0054] Step 102: Perform quality assessment on the first training data according to the evaluator to obtain a first assessment result.
[0055] In one embodiment, after obtaining the automatic prompt system to be trained and the first training data, the automatic prompt system to be trained will be trained based on the first training data. When performing specific training, the evaluator and optimizer in the automatic prompt system to be trained are trained through joint training, and then a trained automatic prompt system is obtained when the training is completed.
[0056] Exemplarily, during training, the evaluator in the automatic prompt system to be trained is used to perform quality evaluation on the first training data, and the evaluation combination of each training data is obtained, and the first evaluation result is obtained by summarizing.
[0057] It should be noted that the joint training of the evaluator and the optimizer is a cyclic training process. One training includes one training of the evaluator and one training of the optimizer. The beginning of one training is to input the obtained training data into the evaluator for training and evaluation, and the end of one training is that the optimizer completes the optimization and obtains the training data for retraining the evaluator. At the beginning of the training, before the evaluator performs the first quality evaluation, the evaluator can be pre-trained, or a pre-trained large model can be pulled for evaluation processing, without specific restrictions.
[0058] In the actual processing, for a training data consisting of original keywords and prompts, the quality of each training data can be obtained through quality assessment, such as quality score, and the higher the quality score, the better the prompt quality, and vice versa. At this time, by scoring the quality of the obtained training data and then acting on the optimizer, the optimizer can effectively improve the recognition of high-quality prompts and the filtering of low-quality prompts.
[0059] Step 103: train the optimizer according to the first evaluation result, and obtain second training data corresponding to the original keyword in the prompt search space according to the trained optimizer.
[0060] In one embodiment, after obtaining a first evaluation result corresponding to the first training data using an evaluator, the first evaluation result is used to train an optimizer in an automatic prompt system to be trained, and training data is acquired in the prompt search space according to the trained optimizer to obtain second training data corresponding to the original keyword.
[0061] Exemplarily, when the first evaluation result is obtained, the quality of each prompt in the first training data can be determined based on the first evaluation result, wherein a higher quality indicates a more accurate prompt. Therefore, when the first evaluation result is obtained, the first training data can be screened based on the first evaluation result, and the training data with lower quality in the first training data can be removed. The optimizer can then be trained based on the first training data after the removal, so that the trained optimizer can search for prompts that better match the original keywords in the prompt search space.
[0062] Specifically, when the optimizer is trained based on the first evaluation result and the second training data is obtained, reference can be made to Figure 4 , Figure 4 It is a flowchart of the steps of performing training processing according to the first evaluation result provided in an embodiment of the present application, wherein the steps include steps 401 to 403.
[0063] Step 401, screening first training data according to a first evaluation result to obtain first intermediate data;
[0064] Step 402, training the optimizer according to the first intermediate data to obtain a trained optimizer;
[0065] Step 403: perform a prompt search in the prompt search space according to the trained optimizer to obtain a second prompt set associated with the original keyword, and combine the original keyword with each prompt in the second prompt set to obtain second training data.
[0066] Exemplarily, when a first evaluation result is obtained, the first evaluation result is used to perform data screening on the first training data to obtain first intermediate data, and then the optimizer is trained based on the first intermediate data to obtain a trained optimizer, and then a prompt search is performed in the prompt search space based on the trained optimizer to obtain a second prompt set associated with the original keywords, and finally the prompts are combined with the original keywords to obtain second training data.
[0067] From the above description, it can be known that the first evaluation result can be a reflection of the quality score, that is, each training data in the first training data corresponds to a quality score, and the quality score indicates the degree of matching between the prompt and the text in the corresponding training data. The higher the quality score, the higher the matching degree between the text and the prompt in the training data, that is, the prompt is a good prompt, otherwise the prompt in the training data is not a good prompt. At the same time, good prompts will be retained, while bad prompts need to be filtered. Therefore, after obtaining the first evaluation result, the first training data will be screened and filtered to obtain the first intermediate data with higher quality.
[0068] Therefore, when processing the first training data according to the first evaluation result, it includes: obtaining a preset score threshold, and comparing the evaluation score corresponding to each evaluation result in the first evaluation result with the preset score threshold; filtering the evaluation results whose evaluation scores are less than the preset score threshold, and obtaining the first intermediate data composed of the evaluation results whose evaluation scores are greater than the preset score threshold.
[0069] Furthermore, after obtaining the first intermediate data, the optimizer will be trained using the first intermediate data, so that the optimizer can more accurately obtain training data that matches the current evaluator, wherein the matching training data is data composed of prompts with higher quality scores and original keywords. By using the first intermediate data as the training data for the optimizer, the trained optimizer can obtain data that is relatively consistent with the current evaluator when performing prompt search again in the prompt search space.
[0070] Although the second training data obtained at this time is obtained by the optimizer trained based on the first intermediate data, it does not guarantee that when the evaluator performs quality evaluation on the second training data, the evaluation results of each training data can meet the evaluation conditions. Therefore, after obtaining the second training data, the second training data will be used to train the evaluator again, that is, the next training will be carried out.
[0071] Step 104, training the evaluator according to the second training data, and evaluating the second training data according to the trained evaluator, so as to train the optimizer according to the obtained second evaluation result and obtain third training data for training the evaluator in the prompt search space.
[0072] In one embodiment, it can be seen from the above description that after obtaining the second training data, in order to ensure the stability of the automatic prompt system and the prediction accuracy of the prompt information, the second training data will be used again to train the evaluator, and the second training data will be quality evaluated according to the trained evaluator. Similarly, after completing the evaluation process, the evaluation results of each training data in the second training data will also be obtained, and the obtained second evaluation results will still act on the optimizer for training and optimization until both the evaluator and the optimizer complete the training and optimization process.
[0073] Exemplarily, when the evaluator and the optimizer are trained based on the second training data, the evaluator is first trained and optimized using the second training data, and the trained evaluator performs a quality assessment on each training data in the second training data, and the second evaluation result obtained by the quality assessment will again be used as a condition for whether or not to train the optimizer.
[0074] It should be noted that in order to determine whether the training is completed, the corresponding loss function can be set in the evaluator and optimizer to determine whether the training is completed according to the loss function value of the evaluator and optimizer during the training and optimization process. Therefore, during the training process, for each training in the cycle process, a judgment can be made to determine whether the training is completed, and then when the training is completed, the training is ended and a trained automatic prompt system is obtained.
[0075] When determining whether the training is completed, it includes: in a training process of the automatic prompt system to be trained, obtaining a first loss function value of the evaluator and a second loss function value of the optimizer; adding the first loss function value and the second loss function value to obtain a total loss value, and determining whether the training of the evaluator and the optimizer is completed according to the total loss value; if the total loss value is greater than or equal to a preset loss threshold, determining that the training is not completed; if the total loss value is less than the preset loss threshold, determining that the training is completed.
[0076] Specifically, during a training process of the automatic prompt system to be trained, the first loss function value generated by the evaluator during the current training and the second loss function value generated by the optimizer during the current training are obtained according to the set loss function, and then the first loss function value and the second loss function value are added to obtain the total loss value of one training, and then based on the total loss value, it is determined whether the training is completed. If the total loss value is greater than or equal to the preset loss threshold, it is determined that the training is not completed and the next training is required. Otherwise, the training is determined to be completed.
[0077] It should be pointed out that during the first training, since the quality assessment of the first training data can be performed by the evaluator or by the pulled related large model, for the first training, it can be directly determined that a second training is needed, that is, when the loss value is used to determine whether the training is completed, it is applicable to the second and subsequent training processes.
[0078] Furthermore, the training of the automatic prompt system to be trained is a process of jointly training an evaluator and an optimizer, and the entire training process is a cyclic training process. Therefore, after completing the training of the evaluator according to the second training data and completing the quality evaluation of the second training data according to the trained evaluator, it will be determined whether the training is completed based on the loss function generated by the evaluator and the optimizer during the current training process. When it is determined that the training is not completed, the training data will be acquired again based on the optimizer obtained from the current training, specifically including: screening the second training data according to the obtained second evaluation result to obtain second intermediate data, and training the optimizer according to the second intermediate data; performing a prompt search in the prompt search space according to the trained optimizer to obtain a third prompt set related to the original keyword, and combining the original keyword with each prompt in the third prompt set to obtain third training data.
[0079] Specifically, when subsequent processing is performed according to the second evaluation result, the specific processing process is the same as the processing according to the first evaluation result, mainly including: screening the second training data according to the second evaluation result to obtain the second intermediate data, retraining the optimizer using the second intermediate data, and obtaining the third prompt set in the prompt search space according to the retrained optimizer to generate the third training data. The specific processing process can refer to the description of the embodiment corresponding to step 401 to step 403.
[0080] Step 105, when it is determined that the training of the evaluator and the optimizer is completed, a trained automatic prompt system is obtained.
[0081] In one embodiment, when it is determined that the training of the evaluator and the optimizer is completed, a trained automatic prompt system is also obtained. That is, when the conditions for completing the training are determined to be met based on the loss function values obtained by the evaluator and the optimizer, the training is terminated. At this time, the automatic prompt system corresponding to the current demand information will be obtained. Furthermore, during use, if the actual demand is the current demand information, the corresponding automatic prompt system is directly obtained for use.
[0082] For example, for the automatic prompt system, the corresponding automatic prompt system can be configured according to different needs for training, and stored when the training is completed, so that when the downstream needs to use it, the corresponding automatic prompt system can be pulled for use according to actual needs.
[0083] For details on how to use the automatic prompt system, please refer to Figure 5 , Figure 5 It is a flowchart diagram of the steps of applying the automatic prompt system provided in an embodiment of the present application, wherein the steps include steps 501 to 503.
[0084] Step 501, in the case of prompt prediction, receiving an input target demand, and querying in a combination template library according to the target demand to determine whether there is a target template corresponding to the target demand;
[0085] Step 502: if it is determined that there is a corresponding target template, generate a first automatic prompt system according to the target template, and perform prompt prediction and output according to the first automatic prompt system;
[0086] Step 503: if it is determined that there is no corresponding target template, generate second prompt information.
[0087] Among them, the combined template library records the automatic prompt systems that have been trained to correspond to different needs, and the automatic prompt systems corresponding to different needs are different.
[0088] That is, when the downstream is in use, it inputs the target requirements and queries the combined template library according to the target requirements to determine whether there is a target template corresponding to the target requirements. When it is determined that there is a corresponding target template, a first automatic prompt system is generated according to the target template for subsequent use. When it is determined that there is no corresponding target template, a corresponding prompt message can be issued, such as prompting that there is no automatic prompt system corresponding to the target requirements at this time.
[0089] Furthermore, when it is determined that a corresponding target template exists, the corresponding first automatic prompt system can be pulled for subsequent use. Specifically, when it is determined that a corresponding target template exists, the first automatic prompt system is generated according to the target template, and a first prompt message is generated; the target text uploaded in response to the first prompt message is received, and the target text is input into the first automatic prompt system, and a prompt result corresponding to the target text is output.
[0090] Exemplarily, when it is determined that there is a target template corresponding to the target requirement, a first automatic prompt system is generated according to the target template, and a first prompt message can be generated and issued to inform the user that a prompt prediction can be made. At this time, the corresponding target text will be input, and then processed by the first automatic prompt system to output a prompt result corresponding to the target text.
[0091] In addition, when it is determined that there is no corresponding target template, the current requirements can be uploaded at this time so that the automatic prompt system can be trained according to the current requirements for subsequent use. Specifically, when it is determined that there is no corresponding target template, after generating the second prompt information, it also includes: configuring the system according to the target requirements, and obtaining a second automatic prompt system according to the configuration; generating system training instructions according to the target requirements and the second automatic prompt system, and uploading the system training instructions to train and store the second automatic prompt system.
[0092] For example, when it is determined that there is no corresponding target template, the system can be configured according to the target requirements at this time to obtain a second automatic prompt system, and then system training instructions are generated according to the target requirements and the second automatic prompt system, and the system training instructions are uploaded, etc., so that the upstream can complete the training and storage of the second automatic prompt system, so that when the same requirements are met in the future, the automatic prompt system can be directly pulled and used.
[0093] Furthermore, in the above embodiments, when the automatic prompt system is trained, the training of the evaluator and the optimizer in the automatic prompt system is interactive and restricted, and when the evaluator and the optimizer are trained, the training process can refer to Figure 6 , Figure 6 It is a block diagram schematic diagram of training an evaluator and an optimizer provided in an embodiment of the present application.
[0094] Specifically, the training process of the evaluator and the optimizer can be the same, that is, the same training method is used for training to obtain the evaluator and the optimizer, and the main difference in training the two lies in the difference in training data. For example, when the evaluator is trained using the second training data, the training data for training the optimizer is the second intermediate data obtained based on the second training data, but the model framework and training method are the same.
[0095] Taking the training of the evaluator using the second training data as an example, the second training data is first vectorized to obtain the vectorized features of the training data, and then the vectorized features are processed using the multiple self-attention mechanism, and the processed results are convolved with the vectorized features and input to the first generalization layer for processing to obtain the first processing result, and then the first processing result is processed using the reverse feedback module and the mutual feedback module, and the processing result obtained at this time is convolved with the first processing result again and input to the second generalization layer for processing. Through continuous optimization based on the second training data, an evaluator trained and optimized based on the second training data is obtained.
[0096] Furthermore, in the actual application process, the prompts corresponding to the original keywords under different needs can be customized through human-computer interaction. In order to achieve human-computer interaction, an interactive module can be added to the automatic prompt system. Through the function of the interactive module, the prompts corresponding to different texts, such as prompt words, can be customized.
[0097] For example, when performing a specific operation, a custom prompt input box may be displayed on the system interface, such as Figure 7 As shown in Figure 7 Enter the custom prompt corresponding to the text in the box shown to submit it to the system for actual training. At the same time, the prompts that already exist in the system can be modified and deleted. For example, when training data is obtained in the prompt search space, prompts can be displayed selectively, such as Figure 8 As shown, the displayed prompt words can be modified and deleted through corresponding operations, such as editing.
[0098] In addition, in the process of customizing prompt words or modifying and deleting prompt words, the displayed prompt words can be actively evaluated, and after the active evaluation, the corresponding evaluation score can be determined according to the result of the active evaluation. For prompts that are actively evaluated, when performing quality evaluation processing, it is not necessary to perform evaluation processing on them, but directly use the evaluation results entered by the user.
[0099] Furthermore, after the training is completed, the user can select the appropriate combination to obtain the automatic prompt system according to their own needs during the downstream use process. At this time, the current required combination form is mainly determined according to the actual needs of the user, and then the corresponding automatic prompt system is obtained. Fig. 9 ,exist Fig. 9 In the application process shown, the requirements are first extracted to obtain the actual requirements currently in use, and then the template library is searched according to the obtained requirements to generate a relevant plan, in which the required modules are recorded in the plan, and then the module is selected according to the calculation, that is, the automatic prompt system currently required is determined, and finally during use, the text entered by the user is processed to generate the corresponding prompt words for output.
[0100] It should be noted that for Fig. 9The modules described in the previous section can provide better assistance for the training of the evaluator and optimizer during the training of the automatic prompt system. For example, the online learning module can continuously learn from user feedback and adapt to specific usage scenarios; the self-supervised learning module can provide the optimal configuration for the automatic exploration of the automatic prompt system; the representation learning module can obtain the semantic feature representation of prompts and texts through self-supervised pre-training learning, providing richer optimization signals for the evaluator and optimizer. At the same time, the matching of prompts and texts can also be modeled as the similarity calculation of two vector spaces.
[0101] In summary, the present application discloses a training method for an automatic prompt system. In the training process of the automatic prompt system, the automatic prompt system to be trained is first determined according to the current demand, and the prompt search is performed in the prompt search space according to the input original keyword, and the prompt corresponding to the original keyword is determined and combined to obtain the first training data. Then, in the determined automatic prompt system to be trained, the first training data is evaluated by the evaluator to obtain the first evaluation result, and then the optimizer is trained by the first evaluation result, so as to determine the training data again according to the trained optimizer to obtain the second training data, and the second training data will be used to train and optimize the evaluator, and the trained evaluator will again perform the quality evaluation on the second training data, and the obtained second evaluation result will train the optimizer, and the training and optimization of the automatic prompt system to be trained are completed through joint and cyclic training, and finally when it is determined that the training is completed, the trained automatic prompt system is obtained. It is realized that in the training process, different automatic prompt systems are defined according to the demand, and then in the training process, the evaluator and the optimizer are jointly trained in a cyclic manner, and interact and restrict each other to improve the effect and efficiency of system training, so as to improve the use effect during use, that is, the accuracy of prompt prediction.
[0102] According to the method described in the above embodiment, this embodiment will be further described from the perspective of a training device for an automatic prompt system. The training device for the automatic prompt system can be implemented as an independent entity or integrated into an electronic device such as a terminal. The terminal may include a mobile phone, a tablet computer, etc.
[0103] See also Fig.10 , Fig.10 is a structural diagram of a training device for the automatic prompting system provided in an embodiment of the present application, such as Fig.10 As shown, the training device 1000 of the automatic prompt system provided in the embodiment of the present application includes:
[0104] A data acquisition module 1001 is used to acquire first training data for training an automatic prompt system to be trained, wherein the automatic prompt system at least includes an evaluator and an optimizer;
[0105] The quality assessment module 1002 is used to perform quality assessment on the first training data according to the evaluator to obtain a first assessment result;
[0106] A first training module 1003 is used to train the optimizer according to the first evaluation result, and obtain second training data corresponding to the original keyword in the prompt search space according to the trained optimizer;
[0107] A second training module 1004 is used to train the evaluator according to the second training data, and evaluate the second training data according to the trained evaluator, so as to train the optimizer according to the obtained second evaluation result and obtain third training data for training the evaluator in the prompt search space;
[0108] The training judgment module 1005 is used to obtain a trained automatic prompt system when it is determined that the training of the evaluator and the optimizer is completed.
[0109] In one embodiment, the data acquisition module 1001 is further used for:
[0110] Receive input demand information and original keywords, and perform feature extraction on the demand information and original keywords to obtain corresponding demand labels and text features;
[0111] The automatic prompt system is configured according to the required labels to obtain the automatic prompt system to be trained;
[0112] Prompt search is performed in the prompt search space according to the text feature to obtain a first prompt set associated with the text feature, and the text feature is combined with each prompt in the first prompt set to obtain first training data.
[0113] In one embodiment, the data acquisition module 1001 is further used for:
[0114] Perform query matching based on the requirement tag to determine whether the requirement tag is recorded;
[0115] When it is determined that the requirement tag is recorded, an automatic prompt system corresponding to the requirement tag is obtained as the automatic prompt system to be trained;
[0116] When it is determined that the required tag is not recorded, input configuration information is received, and the system is configured according to the configuration information to obtain an automatic prompt system to be trained.
[0117] In one embodiment, the data acquisition module 1001 is further used for:
[0118] Matching is performed in a prompt search space according to the text feature, and a number of prompts associated with the text feature are selected in the prompt search space according to the matching degree;
[0119] The text features are matched one-to-one with the prompts to obtain a plurality of text prompt pairs, and the plurality of text prompt pairs are used as the first training data, wherein the text prompt pair includes a text feature and a prompt.
[0120] In one embodiment, the first training module 1003 is further used for:
[0121] Screening the first training data according to the first evaluation result to obtain first intermediate data;
[0122] Training the optimizer according to the first intermediate data to obtain a trained optimizer;
[0123] A prompt search is performed in the prompt search space according to the trained optimizer to obtain a second prompt set associated with the original keyword, and the original keyword is combined with each prompt in the second prompt set to obtain second training data.
[0124] In one embodiment, the first training module 1003 is further used for:
[0125] Obtaining a preset score threshold, and comparing the evaluation score corresponding to each evaluation result in the first evaluation result with the preset score threshold;
[0126] The evaluation results whose evaluation scores are less than a preset score threshold are filtered to obtain first intermediate data consisting of the evaluation results whose evaluation scores are greater than the preset score threshold.
[0127] In one embodiment, the second training module 1004 is further configured to:
[0128] Screening the second training data according to the obtained second evaluation result to obtain second intermediate data, and training the optimizer according to the second intermediate data;
[0129] A prompt search is performed in the prompt search space according to the trained optimizer to obtain a third prompt set related to the original keyword, and the original keyword is combined with each prompt in the third prompt set to obtain third training data.
[0130] In one embodiment, the training determination module 1005 is further used to:
[0131] During a training process of the automatic prompt system to be trained, obtaining a first loss function value of the evaluator and a second loss function value of the optimizer;
[0132] Add the first loss function value and the second loss function value to obtain a total loss value, and determine whether the estimator and optimizer are trained according to the total loss value;
[0133] If the total loss value is greater than or equal to the preset loss threshold, it is determined that the training is not completed;
[0134] If the total loss value is less than the preset loss threshold, the training is determined to be complete.
[0135] In one embodiment, the training device 1000 of the automatic prompt system further includes a prompt prediction module for:
[0136] When performing prompt prediction, receiving the input target demand, and searching in the combination template library according to the target demand to determine whether there is a target template corresponding to the target demand;
[0137] When it is determined that there is a corresponding target template, a first automatic prompt system is generated according to the target template, and prompt prediction and output are performed according to the first automatic prompt system;
[0138] When it is determined that there is no corresponding target template, second prompt information is generated.
[0139] In one embodiment, the prompt prediction module is further used to:
[0140] When it is determined that there is a corresponding target template, a first automatic prompt system is generated according to the target template, and first prompt information is generated;
[0141] The target text uploaded in response to the first prompt information is received, and the target text is input into the first automatic prompt system, and a prompt result corresponding to the target text is output.
[0142] In one embodiment, the training device 600 of the automatic prompt system further includes an upward feedback module for:
[0143] Configure the system according to the target requirements, and provide a second automatic prompt system based on the configuration;
[0144] Generate system training instructions based on target requirements and the second automatic prompt system, and upload the system training instructions to train and store the second automatic prompt system.
[0145] Also, see Fig.11 , Fig.11 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device may be a mobile terminal such as a smart phone, a tablet computer, or the like. Fig.11 As shown, the electronic device 1100 includes a processor 1101 and a memory 1102. The processor 1101 and the memory 1102 are electrically connected.
[0146] Processor 1101 is the control center of electronic device 1100. It uses various interfaces and lines to connect various parts of the entire electronic device, executes various functions of electronic device 1100 and processes data by running or loading applications stored in memory 1102 and calling data stored in memory 1102, thereby monitoring electronic device 1100 as a whole.
[0147] In this embodiment, the processor 1101 in the electronic device 1100 will load the instructions corresponding to the processes of one or more applications into the memory 1102 according to the following steps, and the processor 1101 will run the application stored in the memory 1102, thereby implementing any step in the training method of the automatic prompt system provided in the above embodiment.
[0148] The electronic device 1100 can implement the steps in any embodiment of the training method of the automatic prompt system provided in the embodiments of the present application. Therefore, it can achieve the beneficial effects that can be achieved by any automatic prompt system training method provided in the embodiments of the present application. Please refer to the previous embodiments for details and will not be repeated here.
[0149] See also Fig.12 , Fig.12 is another structural schematic diagram of an electronic device provided in an embodiment of the present application, such as Fig.12 As shown, Fig.12 The specific structural block diagram of the electronic device provided in the embodiment of the present application is shown, and the electronic device can be used to implement the training method of the automatic prompt system provided in the above embodiment. The electronic device 1200 can be a mobile terminal such as a smart phone or a laptop computer.
[0150] The RF circuit 1210 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 1210 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 1210 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.
[0151] The memory 1220 can be used to store software programs and modules, such as the program instructions / modules corresponding to the training method of the automatic prompt system in the above-mentioned embodiment. The processor 1280 executes various functional applications and the training method of the automatic prompt system by running the software programs and modules stored in the memory 1220.
[0152] The memory 1220 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1220 may further include a memory remotely arranged relative to the processor 1280, and these remote memories may be connected to the electronic device 800 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0153] The input unit 1230 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 1230 may include a touch-sensitive surface 1231 and other input devices 1232. The touch-sensitive surface 1231, also known as a touch display screen or a touch pad, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch-sensitive surface 1231), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1231 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1280, and can receive and execute commands sent by the processor 1280. In addition, the touch-sensitive surface 1231 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1231, the input unit 1230 may further include other input devices 1232. Specifically, the other input devices 1232 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0154] The display unit 1240 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device 1200, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 1240 may include a display panel 1241. Optionally, the display panel 1241 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 1231 may cover the display panel 1241. When the touch-sensitive surface 1231 detects a touch operation on or near it, it is transmitted to the processor 1280 to determine the type of the touch event, and then the processor 1280 provides a corresponding visual output on the display panel 1241 according to the type of the touch event. Although in the figure, the touch-sensitive surface 1231 and the display panel 1241 are implemented as two independent components to implement input and output functions, in some embodiments, the touch-sensitive surface 1231 and the display panel 1241 can be integrated to implement input and output functions.
[0155] The electronic device 1200 may also include at least one sensor 1250, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1241 according to the brightness of the ambient light, and the proximity sensor may generate an interrupt when the flip cover is closed or closed. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the electronic device 1200, they will not be repeated here.
[0156] The audio circuit 1260, the speaker 1261, and the microphone 1262 can provide an audio interface between the user and the electronic device 1200. The audio circuit 1260 can transmit the received audio data to the speaker 1261 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1262 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1260 and converted into audio data, and then the audio data is processed by the output processor 1280 and sent to another terminal through the RF circuit 1210, or the audio data is output to the memory 1220 for further processing. The audio circuit 1260 may also include an earplug jack to provide communication between an external headset and the electronic device 1200.
[0157] The electronic device 1200 can help the user receive requests, send information, etc. through the transmission module 1270 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the transmission module 1270 is shown in the figure, it is understandable that it is not a necessary component of the electronic device 1200 and can be omitted as needed without changing the essence of the invention.
[0158] The processor 1280 is the control center of the electronic device 1200. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 1220, and calling data stored in the memory 1220, it executes various functions of the electronic device 1200 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 1280 may include one or more processing cores; in some embodiments, the processor 1280 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1280.
[0159] The electronic device 1200 also includes a power supply 1290 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 1280 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 1290 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0160] Although not shown, the electronic device 1200 also includes a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors to implement any step in the training method of the automatic prompt system provided in the above embodiment.
[0161] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.
[0162] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium, which stores a plurality of instructions, which can be executed by a processor to implement any step in the training method of the automatic prompt system provided in the above embodiments.
[0163] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0164] Since the instructions stored in the storage medium can execute the steps in any embodiment of the training method for the automatic prompt system provided in the embodiments of the present application, the beneficial effects that can be achieved by any automatic prompt system training method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0165] The training method, device, electronic device and storage medium of an automatic prompt system provided by the embodiment of the present application are introduced in detail above. The principle and implementation mode of the present application are described in detail using specific examples herein. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present application. Moreover, for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and modifications can be made, and these improvements and modifications are also regarded as the protection scope of the present application.
Claims
1. A training method for an automatic prompting system, characterized in that: include: Acquire first training data for training an automatic prompt system to be trained, wherein the automatic prompt system includes at least an evaluator and an optimizer; Performing a quality assessment on the first training data according to the evaluator to obtain a first assessment result; Training the optimizer according to the first evaluation result, and acquiring second training data corresponding to the original keyword in the prompt search space according to the trained optimizer; Training the evaluator according to the second training data, and evaluating the second training data according to the trained evaluator, so as to train the optimizer according to the obtained second evaluation result and obtain third training data for training the evaluator in the prompt search space; When it is determined that the training of the evaluator and the optimizer is completed, a trained automatic prompt system is obtained.
2. The method according to claim 1, characterized in that The step of obtaining first training data for training the automatic prompting system to be trained includes: Receive input demand information and original keywords, and perform feature extraction on the demand information and the original keywords to obtain corresponding demand labels and text features; The automatic prompt system is configured according to the requirement label to obtain the automatic prompt system to be trained; A prompt search is performed in a prompt search space according to the text feature to obtain a first prompt set associated with the text feature, and the text feature is combined with each prompt in the first prompt set to obtain first training data.
3. The method according to claim 2, characterized in that The automatic prompting system is configured according to the requirement label to obtain the automatic prompting system to be trained, including: Perform query matching according to the demand tag to determine whether the demand tag is recorded; When it is determined that the requirement tag is recorded, obtaining an automatic prompt system corresponding to the requirement tag as an automatic prompt system to be trained; When it is determined that the requirement tag has not been recorded, input configuration information is received, and system configuration is performed according to the configuration information to obtain an automatic prompt system to be trained.
4. The method according to claim 2, characterized in that The step of performing a prompt search in a prompt search space according to the text feature to obtain a plurality of prompts associated with the text feature, and combining the text feature with the prompt to obtain first training data includes: Matching is performed in a prompt search space according to the text feature, and a plurality of prompts associated with the text feature are selected in the prompt search space according to the matching degree; The text features are matched one-to-one with the prompts to obtain a plurality of text prompt pairs, and the plurality of text prompt pairs are used as first training data, wherein the text prompt pair includes the text features and a prompt.
5. The method according to claim 1, characterized in that The step of training the optimizer according to the first evaluation result, and acquiring second training data corresponding to the original keyword in the prompt search space according to the trained optimizer, comprises: Screening the first training data according to the first evaluation result to obtain first intermediate data; Training the optimizer according to the first intermediate data to obtain a trained optimizer; A prompt search is performed in the prompt search space according to the trained optimizer to obtain a second prompt set associated with the original keyword, and the original keyword is combined with each prompt in the second prompt set to obtain second training data.
6. The method according to claim 5, characterized in that The step of screening the first training data according to the first evaluation result to obtain first intermediate data includes: Obtaining a preset score threshold, and comparing the evaluation score corresponding to each evaluation result in the first evaluation result with the preset score threshold; The evaluation results whose evaluation scores are less than the preset score threshold are filtered to obtain first intermediate data consisting of the evaluation results whose evaluation scores are greater than the preset score threshold.
7. The method according to claim 1, characterized in that The step of training the optimizer according to the obtained second evaluation result and acquiring third training data for training the evaluator in the prompt search space includes: Screening the second training data according to the obtained second evaluation result to obtain second intermediate data, and training the optimizer according to the second intermediate data; A prompt search is performed in the prompt search space according to the trained optimizer to obtain a third prompt set related to the original keyword, and the original keyword is combined with each prompt in the third prompt set to obtain third training data.
8. The method according to claim 1, characterized in that The method further comprises: In a training process of the automatic prompt system to be trained, obtaining a first loss function value of the evaluator and a second loss function value of the optimizer; Adding the first loss function value and the second loss function value to obtain a total loss value, and determining whether the evaluator and the optimizer are trained according to the total loss value; If the total loss value is greater than or equal to the preset loss threshold, it is determined that the training is not completed; If the total loss value is less than the preset loss threshold, it is determined that the training is completed.
9. The method according to claim 1, characterized in that In the case where it is determined that the training of the evaluator and the optimizer is completed, after obtaining the trained automatic prompt system, the method further includes: When performing prompt prediction, receiving an input target demand, and querying in a combination template library according to the target demand to determine whether there is a target template corresponding to the target demand; When it is determined that there is a corresponding target template, generating a first automatic prompt system according to the target template, and performing prompt prediction and output according to the first automatic prompt system; When it is determined that there is no corresponding target template, second prompt information is generated.
10. The method according to claim 9, characterized in that When it is determined that there is a corresponding target template, generating a first automatic prompt system according to the target template, and performing prompt prediction and output according to the first automatic prompt system, including: When it is determined that there is a corresponding target template, a first automatic prompt system is generated according to the target template, and first prompt information is generated; Receive the target text uploaded in response to the first prompt information, input the target text into the first automatic prompt system, and output a prompt result corresponding to the target text.
11. The method according to claim 9, characterized in that After the second prompt information is generated when it is determined that there is no corresponding target template, the method further includes: Performing system configuration according to the target requirements, and obtaining a second automatic prompt system according to the configuration; Generate a system training instruction according to the target requirement and the second automatic prompt system, and upload the system training instruction to train and store the second automatic prompt system.
12. A training device for an automatic prompting system, characterized in that: include: A data acquisition module, used to acquire first training data for training an automatic prompt system to be trained, wherein the automatic prompt system at least includes an evaluator and an optimizer; A quality assessment module, configured to perform a quality assessment on the first training data according to the evaluator to obtain a first assessment result; A first training module, configured to train the optimizer according to the first evaluation result, and to obtain second training data corresponding to the original keyword in the prompt search space according to the trained optimizer; A second training module, used for training the evaluator according to the second training data, and evaluating the second training data according to the trained evaluator, so as to train the optimizer according to the obtained second evaluation result and obtain third training data for training the evaluator in the prompt search space; The training judgment module is used to obtain a trained automatic prompt system when it is determined that the training of the evaluator and the optimizer is completed.
13. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 11 are implemented.