Generation method and device, electronic equipment and storage medium
By processing the first information based on the optimization strategy of business scenario type in the generative large model, the high audit failure rate caused by the complexity of the audit strategy is solved, and the success rate and user experience of generated content are improved.
Patent Information
- Application Number
- CN202510368161.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-08-12
AI Technical Summary
The complexity and rigorousness of the audit strategy of existing generative large models leads to an excessively high audit failure rate, affecting the efficiency of generated content and user experience.
By obtaining the input and output audit results of the first information, the first information is optimized based on the optimization strategy of the business scenario type, including desensitization processing, downgrade and retry, skipping and abandoning, skipping and occupying strategies, reducing the audit failure rate.
It reduces the situation of false triggering of audit strategies, improves the probability of generation of generative models, and optimizes the user experience.
Smart Images

Figure CN120470513A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a generation method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of natural language processing technology, generative large models have been widely used in tasks such as dialogue systems, content creation, translation, and information summarization.
[0003] To ensure the security and compliance of content generated by large generative models, audit policies for generated content are also incorporated into the content generation process. These audit policies cover content filtering, sensitive word detection, and contextual consistency checks, playing a crucial role in ensuring the quality and security of generated content. However, due to the complexity and stringency of these policies, generated content may frequently be judged as failing audits, resulting in delays in user access and a negative impact on the user experience. Summary of the Invention
[0004] The present invention provides a generation method, device, electronic device and storage medium to solve the defect in related technologies that the audit strategy for generated content is complex and strict, resulting in an excessively high audit failure rate.
[0005] The present invention provides a generation method, comprising: Obtaining first information, as well as an input review result and a business scenario type for the first information; If the input review result is a successful review, input the first information into a generative model based on the business scenario type to obtain second information output by the generative model; Obtaining an output audit result for the second information; When the input audit result is audit failure or the output audit result is audit failure, the first information is optimized based on the optimization strategy corresponding to the business scenario type to obtain new first information, and the new first information is input into the generative model based on the business scenario type.
[0006] According to a generation method provided by the present invention, the optimizing the first information based on the optimization strategy corresponding to the business scenario type includes: Optimizing the first information based on an optimization strategy corresponding to the scenario combination; The scenario combination is a combination of the business scenario type and the information type that failed the audit.
[0007] According to a generation method provided by the present invention, the optimization strategy corresponding to the scenario combination is based on which the first information is optimized, and the method further includes: Based on a selection operation or a policy priority, the optimization policy is determined from a plurality of candidate policies corresponding to the scenario combination.
[0008] According to a generation method provided by the present invention, when the optimization strategy is downgrade and retry, optimizing the first information includes: Determining reverse prompt information corresponding to the audit information of the output audit result; The reverse prompt information is added to the first information.
[0009] According to a generation method provided by the present invention, when the optimization strategy is skip, optimizing the first information includes: Determine the target segment corresponding to the part that failed the review in the first information, skip the processing process of the generative model for the target segment, and discard or perform placeholder processing on the target segment in the first information based on the business scenario type.
[0010] According to a generation method provided by the present invention, the business scenario type is determined based on the information length of the first information and the correlation between each segment in the first information.
[0011] The present invention also provides a generating device, comprising: An input review unit, configured to obtain first information, and an input review result and a business scenario type for the first information; a generating unit configured to input the first information into a generative model based on the business scenario type when the input review result is a successful review, and obtain second information output by the generative model; an output review unit, configured to obtain an output review result for the second information; An optimization unit is used to optimize the first information based on the optimization strategy corresponding to the business scenario type when the input audit result is audit failure or the output audit result is audit failure, to obtain new first information, and input the new first information into the generative model based on the business scenario type.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the above-described generating methods is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-mentioned generation methods when executed by a processor.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned generation methods.
[0015] The generation method, device, electronic device and storage medium provided by the present invention optimize the first information based on the optimization strategy corresponding to the business scenario type of the first information when the input audit fails and the output audit fails, thereby reducing the situation of false triggering of the audit strategy, reducing the audit failure rate, and further improving the generation probability of the generative model and optimizing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 This is one of the flow charts of the generation method provided by the present invention.
[0018] Figure 2 It is a schematic diagram of the generation process of the Refine scene provided by the present invention.
[0019] Figure 3 It is a schematic diagram of the generation process of the Map Reduce scenario provided by the present invention.
[0020] Figure 4 This is the second flow chart of the generation method provided by the present invention.
[0021] Figure 5 This is the third flow chart of the generation method provided by the present invention.
[0022] Figure 6 It is a structural schematic diagram of the generating device provided by the present invention.
[0023] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0025] In recent years, generative large-scale models have made remarkable progress in the field of natural language processing. These models, trained on massive amounts of text data, can generate high-quality text content. Consequently, they have been widely used in a variety of tasks, including dialogue systems, content creation, translation, and information summarization. These generative large-scale models not only mimic human language style but also understand and respond to complex contextual demands to a certain extent, significantly advancing the development of natural language processing technology.
[0026] To ensure the security and compliance of generated content, various audit strategies are introduced and applied to the output of large generative models. These audit strategies cover multiple aspects, including content filtering, sensitive word detection, and contextual consistency checks. Content filtering primarily identifies and removes text containing harmful content; sensitive word detection identifies and replaces or removes sensitive words within text; and contextual consistency checks ensure that generated content is logically and contextually consistent with the surrounding context, avoiding abrupt or illogical text. These audit strategies play a crucial role in ensuring the quality and security of generated content, effectively reducing the risk of the spread of harmful content.
[0027] For example, in related technologies, sensitive word detection can be achieved by establishing a sensitive word library and matching sensitive words against input and output text based on the sensitive word library. Here, sensitive word matching can specifically include matching a single sensitive word or matching multiple sensitive words simultaneously. In an audit strategy based on sensitive word detection, if unreasonable audit results are found, the sensitive word library can be optimized, for example, by adding a blacklist or whitelist.
[0028] However, existing audit strategies have also exposed some issues during implementation. For one thing, due to the complexity and strictness of audit strategies, some content that originally met expectations might be mistakenly deemed unqualified simply because it slightly violated a certain audit rule, leading to frequent blocking of generated content. This not only affects the efficiency of large generative models but can also significantly degrade user experience.
[0029] For example, the audit strategy based on sensitive word detection has a high probability of false triggering during implementation. In addition, a large number of sensitive words are difficult to match various generation scenarios, which makes the rules based on sensitive word detection very complex, which further affects the efficiency of using large generative models.
[0030] In order to solve the above problems, an embodiment of the present invention provides a generation method. Figure 1 This is one of the flow charts of the generation method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110: Obtain first information, as well as input review results and business scenario types for the first information.
[0031] Specifically, the first information, i.e., the input data for the generative model, can be information in a modality such as text, image, voice, or video, or can be multimodal information combining at least two of these modalities. The first information can be directly input by the user, collected through an audio acquisition device such as a microphone or voice recorder, or collected through an image acquisition device such as a scanner, mobile phone, or camera, or downloaded from the internet, although this is not specifically limited in the present embodiment.
[0032] After obtaining the first information, an input review can be performed on the first information, thereby obtaining an input review result for the first information. Here, the input review for the first information can specifically be to review whether the first information contains content that is not suitable for input into the generative model, for example, whether the first information contains sensitive words. The input review result obtained can be a successful review or a failed review. In the case of a successful review, the first information can be used as input data for the generative model. In the case of a failed review, the first information needs to be optimized to form a new first information, and then the input review needs to be performed again until the review is successful.
[0033] In addition, after obtaining the first information, the business scenario type of the first information can also be obtained. The business scenario type here specifically refers to the type of input scenario when the first information is input as input data to the generative model. The business scenario type can be a normal scenario, a Refine scenario, a Map Reduce scenario, etc. The generative model can be a large generative model or another type of generative model.
[0034] Among them, the normal scenario refers to a scenario in which the first information is input into the generative model at one time. The normal scenario is usually applied when the length of the first information is within the maximum input length that the generative model can accept at one time.
[0035] Refine scenarios involve dividing first information into multiple segments, with the generative model processing each segment individually, and with the processing of each segment dependent on the results of the previous segment. Refine scenarios are typically used when the length of the first information exceeds the maximum input length that the generative model can accept at one time, and when there is strong correlation between the segments generated by the segmentation of the first information.
[0036] Map Reduce scenarios involve splitting first information into multiple independent, non-dependent segments. A generative model processes each segment separately, then combines the results from all segments as the final result. Map Reduce scenarios are typically used when the length of the first information exceeds the maximum input length the generative model can accept at one time, and when the segments formed by the first information are unrelated.
[0037] Step 120 , when the input audit result is successful, input the first information into a generative model based on the business scenario type to obtain second information output by the generative model.
[0038] Specifically, if the input review result is a successful review, the first information can be used as the input of the generative model. Based on the input form corresponding to the business scenario type of the first information, the first information is input into the generative model, thereby enabling the generative model to perform the generation task based on the first information and output the second information. It will be understood that the output form of the second information here also corresponds to the business scenario type of the first information.
[0039] For example, when the business scenario type is a common scenario, the first information can be input into the generative model at one time, and the second information output by the generative model can be obtained as a generation result.
[0040] For example, Figure 2 This is a schematic diagram of the generation process of the Refine scene provided by the present invention, such as Figure 2 As shown, for the case where the business scenario type is a Refine scenario, the first information can be divided into multiple segments, which can be Figure 2For fragments 1 to N in the example, an initial prompt, i.e., an initial prompt, can be generated based on fragment 1. The initial prompt is then input into the generative model to obtain the second information output by the generative model as a response to fragment 1, which is recorded as response 1 here. Next, the initial prompt is iterated in combination with fragment 2 and response 1 to obtain an iterative prompt, and the iterative prompt is input into the generative model to obtain the second information output by the generative model as a response to fragment 2, which is recorded as response 2 here. This process is deduced by analogy until a response to fragment N is obtained, i.e., response N is obtained. A post-processing prompt is generated based on response N and input into the generative model, and the second information output by the generative model is used as the generation result.
[0041] For example, Figure 3 This is a schematic diagram of the generation process of the Map Reduce scenario provided by the present invention, such as Figure 3 As shown, for the case where the business scenario type is a Map Reduce scenario, the first information can be divided into multiple segments, which can be Figure 3 For fragments 1 to N in the example, each fragment can be input into the generative model separately, thereby obtaining the second information output by the generative model for each fragment as the generation result of each fragment, which is recorded as result 1 to result N. Subsequently, results 1 to result N can be summed up to obtain the final generation result.
[0042] Step 130: Obtain an output audit result for the second information.
[0043] Specifically, after obtaining the second information, an output audit can be performed on the second information, thereby obtaining an output audit result for the second information. Here, the output audit is performed on the second information, and specifically it can be to audit whether the second information contains bad information, for example, whether the second information contains sensitive words. The output audit result obtained can be a successful audit or a failed audit. In the case of a successful audit, if the business scenario type is a normal scenario, the second information can be displayed to the user as a generation result; if the business scenario type is a Refine scenario, a new prompt can be generated based on the second information to achieve a new round of generation, until the reply corresponding to the last fragment in the first information is generated; if the business scenario type is a Map Reduce scenario, the second information can be aggregated with the second information of other fragments in the first information to obtain the final generation result for display to the user.
[0044] Step 140, when the input audit result is audit failure or the output audit result is audit failure, optimize the first information based on the optimization strategy corresponding to the business scenario type to obtain new first information, and input the new first information into the generative model based on the business scenario type.
[0045] Specifically, for the case where the input audit result is an audit failure, and for the case where the output audit result is an audit failure, the first information used as input can be optimized to obtain a new first and return the second information generated based on the first information, thereby reducing the probability of not being able to output the generated result due to audit failure.
[0046] Here, the optimization strategy for optimizing the first information can be adapted to the business scenario type. That is, feasible optimization strategies for various business scenario types can be pre-set. When optimization of the first information is required, the optimization strategy for the business scenario type of the first information is selected for optimization. This ensures that the optimization of the first information is consistent with the actual business scenario type, thereby specifically improving the probability of successful review in complex generation scenarios.
[0047] It is understood that the optimization strategies set for different business scenarios can be the same or different, and each business type has a corresponding optimization strategy that can be used to improve the review success rate. The optimization strategies here can include desensitization, downgrade and retry, skip and discard, skip and occupy, etc., which are not specifically limited in the embodiments of the present invention.
[0048] In the method provided in an embodiment of the present invention, when the input audit fails and the output audit fails, the first information is optimized based on the optimization strategy corresponding to the business scenario type of the first information, thereby reducing the situation of false triggering of the audit strategy, reducing the audit failure rate, and further improving the generation probability of the generative model and optimizing the user experience.
[0049] Based on the above embodiment, in step 140, optimizing the first information based on the optimization strategy corresponding to the business scenario type includes: Optimizing the first information based on an optimization strategy corresponding to the scenario combination; The scenario combination is a combination of the business scenario type and the information type that failed the audit.
[0050] Specifically, when optimizing the first information, not only the business scenario type of the first information can be considered, but also the type of information that failed the review during the generation process, that is, whether the input review of the first information failed or the output review of the second information failed.
[0051] Business scenario types and audit failure information types can be combined in pairs to form a scenario combination. For example, the business scenario type can be one of the common scenario, refine scenario, and map reduce scenario, and the audit failure information type can be the first information or the second information. This results in six scenario combinations: [common scenario, first information], [common scenario, second information], [refine scenario, first information], [refine scenario, second information], [map reduce scenario, first information], and [map reduce scenario, second information].
[0052] For each type of scene combination, an optimization strategy corresponding to the scene combination can be pre-set. Therefore, when it is necessary to optimize the first information, the optimization strategy corresponding to the scene combination can be selected to achieve optimization of the first information.
[0053] Based on any of the above embodiments, in step 140, the first information is optimized based on the optimization strategy corresponding to the scenario combination, and the following steps may be performed before the optimization is performed: Based on a selection operation or a policy priority, the optimization policy is determined from a plurality of candidate policies corresponding to the scenario combination.
[0054] Specifically, for each scenario combination, multiple optional optimization strategies that are suitable for the scenario combination can be pre-set, which are referred to as candidate strategies. For example, for different scenario combinations, the optional candidate strategies can be expressed in the form shown in the following table:
[0055] That is, the candidate strategies corresponding to the scenario combination [normal scenario, first information] include desensitization processing and failure; the candidate strategies corresponding to the scenario combination [normal scenario, second information] include downgrade retry and failure.
[0056] During the generation process, if the audit fails, the candidate strategy corresponding to the current scenario combination can be determined. In addition, if the current scenario combination corresponds to multiple candidate strategies, it is necessary to select a candidate strategy that needs to be executed currently from the multiple candidate strategies as the optimization strategy.
[0057] Here, the selection of the preferred strategy may be implemented based on a selection operation or based on strategy priority.
[0058] The selection operation can be an operation in which the user selects a candidate strategy. Specifically, the user can click on the candidate strategy, long-press the candidate strategy, or drag the candidate strategy to a designated area. This is not specifically limited in the present embodiment. Upon receiving a selection operation, the candidate strategy selected by the selection operation can be used as the optimization strategy. For example, in the [Refine scenario, first information], if the candidate strategy selected by the selection operation is desensitization processing, desensitization processing can be performed on the first information. Alternatively, the policy priorities of multiple candidate policies under each scenario combination can be pre-set. That is, under a scenario combination, multiple candidate policies each have a policy priority, and the policy priority is used to indicate the priority of optimizing the first information based on the candidate policy under the scenario combination. From multiple candidate policies, the candidate policy with the highest policy priority can be selected as the optimization policy. If the review is still unsuccessful after optimizing the first information based on the optimization policy, the candidate policy with the second highest policy priority can be selected from multiple candidate policies as the priority policy, and so on, until the review is successful. For example, under [Refine scenario, second information], the three types of candidate policies are sorted from high to low according to policy priority: downgrade and retry, skip and discard, and fail. Then, downgrade and retry can be used as the optimization strategy first, and downgrade and retry can be performed on the first information. If the second information obtained in this way still fails to be reviewed, the fragments in the first information can be skipped and discarded.
[0059] In the method provided in the embodiment of the present invention, an optimization strategy is selected from candidate strategies by selecting an operation or a strategy priority, which helps to ensure the reliability of optimizing the first information based on the optimization strategy, thereby effectively reducing the audit failure rate of the generative model.
[0060] Based on any of the above embodiments, the candidate strategies for each scenario combination may include at least one of desensitization, skip and discard, skip and placeholder, downgrade and retry, and failure.
[0061] Among them, desensitization processing is usually performed when the input review fails. Desensitization processing refers to processing the sensitive information in the first information, which can be replaced, deleted, etc. The desensitization processing can be to prompt the user that there is sensitive information in the first information, and the user can choose to manually desensitize the sensitive content in the first information, or it can be to apply a preset sensitive word library to filter sensitive words for the first information. For example, when filtering sensitive words, the sensitive words in the sensitive word library can be matched with the first information by string matching, and the character strings hit in the first information can be desensitized to pre-set symbol identifiers, such as "*".
[0062] Skip and discard is typically executed in Refine scenarios when input review fails or output review fails. This means discarding the segment currently being processed by the generative model in the first message. After discarding this segment, the generative model is applied directly to the next segment without interrupting the entire processing flow.
[0063] Skip and placeholder is typically performed in Map Reduce scenarios when input and output audits fail. This skips the failed segments in the first message and replaces them with placeholders. The successfully audited segments in the first message are processed and outputted normally using the generative model.
[0064] Downgrade retry is typically performed when an output audit fails. Based on the reason for the failure, downgrade retry adds a reverse prompt related to the reason in the first message to instruct the generative model not to return relevant content, thereby improving the success rate of the output audit.
[0065] Failure can occur in a variety of scenarios. This can happen when the user refuses to retry or desensitize the process, resulting in the generation failing immediately. The unfinished process will not be processed.
[0066] Based on any of the above embodiments, when the optimization strategy is downgrade and retry, in step 140, optimizing the first information includes: Determining reverse prompt information corresponding to the audit information of the output audit result; The reverse prompt information is added to the first information.
[0067] Specifically, in the case where the output audit of the second information fails, downgrade and retry can be used as an optimization strategy.
[0068] During the optimization of the first information based on downgrade retry, specific audit information can be obtained from the output audit result. The audit information thus obtained includes relevant explanations for the failure of the output audit, which may specifically be the reason for the failure, such as the second information containing sensitive content or the second information being incoherent.
[0069] Corresponding reverse prompt information can be pre-set for different audit information. The reverse prompt information here is used to prompt the generative model to avoid outputting the content referred to by the audit information when outputting the second information. Therefore, after obtaining the audit information of the output audit result, the corresponding reverse prompt information can be obtained and added to the first information, thereby obtaining a new first information containing the reverse prompt information. The new first information is then used to regenerate the second information, so that the newly generated second information no longer contains the audit information that caused the previous output audit to fail, thereby improving the output audit pass rate.
[0070] Based on any of the foregoing embodiments, when the optimization strategy is skip, optimizing the first information includes: Determine the target segment corresponding to the part that failed the review in the first information, skip the processing process of the generative model for the target segment, and discard or perform placeholder processing on the target segment in the first information based on the business scenario type.
[0071] Specifically, the optimization strategy of skipping can further include the optimization strategy of skipping and discarding, and the optimization strategy of skipping and occupying a placeholder. It is understood that the optimization strategy of skipping and discarding is applicable to the Refine scenario, specifically when input audit fails in the Refine scenario and when output audit fails in the Refine scenario. The optimization strategy of skipping and occupying a placeholder is applicable to the Map Reduce scenario, specifically when input audit fails in the MapReduce scenario and when output audit fails in the Map Reduce scenario.
[0072] During the optimization of the first information based on the skip optimization strategy, the target segment corresponding to the portion of the first information that failed the review can be first determined. It is understood that, in the case of input review failure, the portion that failed the review is a segment of the first information, denoted herein as the target segment; in the case of output review failure, the portion that failed the review is the second information, which is the output of a segment of the first information obtained through the generative model. Therefore, the segment of the first information used to generate the second information can be regarded as the segment corresponding to the second information, denoted herein as the target segment.
[0073] After obtaining the target segment, the target segment can be processed. Specifically, the processing process of the generative model for the target segment is skipped, that is, the target segment is not input into the generative model, and the second information output by the generative model for the target segment is not obtained.
[0074] Moreover, in the Refine scenario, the target segment needs to be discarded. After discarding the segment, the entire processing flow is not interrupted, and the generative model is directly applied to process the next segment.
[0075] In addition, in the Map Reduce scenario, it is also necessary to perform placeholder processing on the target segment, that is, to replace the target segment with a placeholder, while other segments in the first information are processed and output normally through the generative model.
[0076] Based on any of the above embodiments, the business scenario type is determined based on the information length of the first information and the correlation between each segment in the first information.
[0077] Specifically, the business scenario type corresponding to the first information is determined by the information length of the first information. That is, if the information length of the first information is less than or equal to the maximum input length that the generative model can accept at one time, the business scenario type of the first information can be directly determined to be a normal scenario. In the case where the information length of the first information is greater than the maximum input length that the generative model can receive at one time, it is necessary to divide the first information into segments and determine the business scenario type of the first information based on the correlation between the segments obtained by the division.
[0078] Furthermore, if there is a correlation between the fragments obtained by division, that is, in each fragment, the processing of the next fragment depends on the processing result of the previous fragment, then the business scenario type of the first information is determined to be a Refine scenario; if there is no correlation between the fragments obtained by division, that is, the fragments are independent of each other and there is no dependency between the fragments when processing each fragment, then the business scenario type of the first information is determined to be a Map Reduce scenario.
[0079] Based on any of the above embodiments, Figure 4 This is the second flow chart of the generation method provided by the present invention, such as Figure 4 As shown, the generation method may include the following steps: First, first information is obtained. When it is determined that the business scenario type of the first information is a Refine scenario, the first information is divided into N segments, namely segment 1 to segment N.
[0080] An initial prompt, i.e., an initial prompt, can be generated based on fragment 1, and then the initial prompt is input into the generative model to obtain the second information output by the generative model as a response to fragment 1, which is recorded here as response 1; then, the initial prompt is iterated in combination with fragment 2 and response 1 to obtain an iterative prompt, and the iterative prompt is input into the generative model. Assuming that the second information output by the generative model fails to be reviewed, it is necessary to downgrade and retry the iterative prompt, thereby obtaining a new iterative prompt and inputting it into the generative model. Assuming that the second information output by the generative model is successfully reviewed, it can be determined that the downgrade retry is successful, and the second information is used as a response to fragment 2, which is recorded here as response 2.
[0081] And so on, until the iterative prompt is updated based on fragment 4 and reply 3, and the new iterative prompt is input into the generative model. Assuming that the second information output by the generative model fails the review, it is necessary to downgrade and retry the iterative prompt, thereby obtaining a new iterative prompt and inputting it into the generative model. Assuming that the second information output by the generative model fails the review, it can be determined that the downgrade retry has failed. At this time, it is not possible to downgrade and retry again. Instead, it can be skipped and discarded, that is, no longer processing fragment 4 and directly discarding fragment 4.
[0082] From then on, the iterative prompt can be updated based on fragment 5 and reply 3, and the new iterative prompt can be input into the generative model. The first information output by the generative model is used as the reply to fragment 5, that is, reply 5, and so on, until the reply to fragment N is obtained, that is, reply N is obtained. Based on reply N, a post-processing prompt is generated and input into the generative model, and the second information output by the generative model is used as the generation result.
[0083] Based on any of the above embodiments, Figure 5 This is the third flow chart of the generation method provided by the present invention, such as Figure 5 As shown, the generation method may include the following steps: First, first information is obtained. When it is determined that the business scenario type of the first information is a Map Reduce scenario, the first information is divided into N segments, namely segment 1 to segment N.
[0084] Each fragment can be input into the generative model separately, thereby obtaining the second information output by the generative model for each fragment as the generation result of each fragment. Assuming that the second information output audit of fragment 1 fails, it is necessary to downgrade and retry fragment 1, and input the new fragment 1 into the generative model. Assuming that the second information output audit of the generative model fails, it is determined that the downgrade retry has failed. At this time, it is impossible to downgrade and retry again. Instead, skip and placeholder can be executed, that is, no longer process fragment 1, and directly apply the placeholder to replace the result 1 corresponding to fragment 1.
[0085] Subsequently, the results corresponding to the placeholders and other fragments can be aggregated to obtain the final generated result.
[0086] The generation device provided by the present invention is described below. The generation device described below and the generation method described above can be referenced to each other.
[0087] Figure 6 It is a structural diagram of the generating device provided by the present invention, such as Figure 6 As shown, the device includes: An input review unit 610 is configured to obtain first information, an input review result for the first information, and a business scenario type; A generating unit 620 is configured to input the first information into a generative model based on the business scenario type when the input review result is a successful review, to obtain second information output by the generative model; An output review unit 630, configured to obtain an output review result for the second information; The optimization unit 640 is used to optimize the first information based on the optimization strategy corresponding to the business scenario type when the input audit result is audit failure or the output audit result is audit failure, to obtain new first information, and input the new first information into the generative model based on the business scenario type.
[0088] In the device provided by an embodiment of the present invention, when the input audit fails and the output audit fails, the first information is optimized based on the optimization strategy corresponding to the business scenario type of the first information, thereby reducing the situation of false triggering of the audit strategy, reducing the audit failure rate, and further increasing the generation probability of the generative model and optimizing the user experience.
[0089] Based on any of the above embodiments, the optimization unit is specifically configured to: Optimizing the first information based on an optimization strategy corresponding to the scenario combination; The scenario combination is a combination of the business scenario type and the information type that failed the audit.
[0090] Based on any of the above embodiments, the optimization unit is further configured to: Based on a selection operation or a policy priority, the optimization policy is determined from a plurality of candidate policies corresponding to the scenario combination.
[0091] Based on any of the above embodiments, when the optimization strategy is downgrade and retry, the optimization unit is specifically configured to: Determining reverse prompt information corresponding to the audit information of the output audit result; The reverse prompt information is added to the first information.
[0092] Based on any of the foregoing embodiments, when the optimization strategy is skip, the optimization unit is specifically configured to: Determine the target segment corresponding to the part that failed the review in the first information, skip the processing process of the generative model for the target segment, and discard or perform placeholder processing on the target segment in the first information based on the business scenario type.
[0093] Based on any of the above embodiments, the business scenario type is determined based on the information length of the first information and the correlation between each segment in the first information.
[0094] Figure 7 An example of a physical structure diagram of an electronic device is shown below. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the generation method, which includes: Obtaining first information, as well as an input review result and a business scenario type for the first information; If the input review result is a successful review, input the first information into a generative model based on the business scenario type to obtain second information output by the generative model; Obtaining an output audit result for the second information; When the input audit result is audit failure or the output audit result is audit failure, the first information is optimized based on the optimization strategy corresponding to the business scenario type to obtain new first information, and the new first information is input into the generative model based on the business scenario type.
[0095] Furthermore, the logic instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the relevant art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0096] On the other hand, the present invention further provides a computer program product, comprising a computer program. The computer program may be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the generation method provided by each of the above methods, the method comprising: Obtaining first information, as well as an input review result and a business scenario type for the first information; If the input review result is a successful review, input the first information into a generative model based on the business scenario type to obtain second information output by the generative model; Obtaining an output audit result for the second information; When the input audit result is audit failure or the output audit result is audit failure, the first information is optimized based on the optimization strategy corresponding to the business scenario type to obtain new first information, and the new first information is input into the generative model based on the business scenario type.
[0097] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the generation method provided by the above methods, the method comprising: Obtaining first information, as well as an input review result and a business scenario type for the first information; If the input review result is a successful review, input the first information into a generative model based on the business scenario type to obtain second information output by the generative model; Obtaining an output audit result for the second information; When the input audit result is audit failure or the output audit result is audit failure, the first information is optimized based on the optimization strategy corresponding to the business scenario type to obtain new first information, and the new first information is input into the generative model based on the business scenario type.
[0098] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0099] Through the description of the above embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A generation method, characterized in that: include: Obtaining first information, as well as an input review result and a business scenario type for the first information; If the input review result is a successful review, input the first information into a generative model based on the business scenario type to obtain second information output by the generative model; Obtaining an output audit result for the second information; When the input audit result is audit failure or the output audit result is audit failure, the first information is optimized based on the optimization strategy corresponding to the business scenario type to obtain new first information, and the new first information is input into the generative model based on the business scenario type.
2. The generation method according to claim 1, characterized in that The optimizing the first information based on the optimization strategy corresponding to the business scenario type includes: Optimizing the first information based on an optimization strategy corresponding to the scenario combination; The scenario combination is a combination of the business scenario type and the information type that failed the audit.
3. The generation method according to claim 2, characterized in that The optimizing strategy corresponding to the scenario combination is based on optimizing the first information, and the optimization strategy further includes: Based on a selection operation or a policy priority, the optimization policy is determined from a plurality of candidate policies corresponding to the scenario combination.
4. The generation method according to any one of claims 1 to 3, characterized in that When the optimization strategy is downgrade and retry, the optimizing the first information includes: Determining reverse prompt information corresponding to the audit information of the output audit result; The reverse prompt information is added to the first information.
5. The generation method according to any one of claims 1 to 3, characterized in that When the optimization strategy is skip, the optimizing the first information includes: Determine the target segment corresponding to the part that failed the review in the first information, skip the processing process of the generative model for the target segment, and discard or perform placeholder processing on the target segment in the first information based on the business scenario type.
6. The generation method according to any one of claims 1 to 3, characterized in that The business scenario type is determined based on the information length of the first information and the correlation between each segment in the first information.
7. A generating device, characterized in that: include: An input review unit, configured to obtain first information, and an input review result and a business scenario type for the first information; a generating unit configured to input the first information into a generative model based on the business scenario type when the input review result is a successful review, and obtain second information output by the generative model; an output review unit, configured to obtain an output review result for the second information; An optimization unit is used to optimize the first information based on the optimization strategy corresponding to the business scenario type when the input audit result is audit failure or the output audit result is audit failure, to obtain new first information, and input the new first information into the generative model based on the business scenario type.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the generating method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the generating method according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the generating method according to any one of claims 1 to 6 is implemented.