Dialogue optimization method, related device, equipment and storage medium
Patent Information
- Application Number
- CN202411153434.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-31
AI Technical Summary
The output results of existing dialogue agents during the intermediate thinking process are prone to deviations or errors, which affects the accuracy and usability of the final output.
By obtaining the definition information of the sentence to be replied to and several replies perspectives in the target application scenario, replies the replies statements separately, and optimize the second statement based on the first statement of each replies perspective, using different routes from multiple replies perspectives to make up for the single and single perspectives and Accumulated error.
It improves the accuracy and usability of intelligent dialogue, and makes up for the shortcomings of intermediate results as much as possible through multi-perspective optimization, improving the comprehensiveness and accuracy of the final output.
Smart Images

Figure CN119226456A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a dialogue optimization method and related devices, equipment and storage media. Background Art
[0002] With the rapid development of artificial intelligence technology, conversational agents have been increasingly widely used in many scenarios such as customer service, finance, medical care, and education.
[0003] At present, the final output of the dialogue agent is subject to the output results of its intermediate thinking process. Once the intermediate results are biased or wrong, the subsequent results will also be wrong, which will affect the final output. In view of this, how to improve the accuracy and usability of intelligent dialogue has become an urgent problem to be solved. Summary of the invention
[0004] The main technical problem solved by this application is to provide a dialogue optimization method and related devices, equipment and storage media, which can improve the accuracy and usability of intelligent dialogue.
[0005] In order to solve the above-mentioned technical problems, the first aspect of the present application provides a dialogue optimization method, including: obtaining sentences to be replied in a target application scenario, and obtaining definition information of several reply perspectives in the target application scenario; replying to the sentences to be replied respectively based on the definition information of each reply perspective, obtaining a first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtaining a second sentence that the dialogue agent replies to the sentence to be replied; optimizing the second sentence based on the first sentence of each reply perspective, and obtaining a reply sentence of the sentence to be replied.
[0006] In order to solve the above-mentioned technical problems, the second aspect of the present application provides a dialogue optimization device, including: an acquisition module, a reply module and an optimization module, the acquisition module is used to obtain the sentences to be replied in the target application scenario, and obtain the definition information of several reply perspectives in the target application scenario; the reply module is used to reply to the sentences to be replied based on the definition information of each reply perspective, obtain a first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtain a second sentence of the dialogue agent replying to the sentence to be replied; the optimization module is used to optimize the second sentence based on the first sentence of each reply perspective, and obtain a reply sentence of the sentence to be replied.
[0007] In order to solve the above technical problems, the third aspect of the present application provides an electronic device, which at least includes a memory and a processor coupled to each other, the memory at least stores program instructions, and the processor is used to execute the program instructions to implement the dialogue optimization method in the above first aspect.
[0008] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium storing program instructions that can be executed by a processor, and the program instructions are used to implement the dialogue optimization method of the first aspect.
[0009] The above scheme obtains the sentence to be replied in the target application scenario, and obtains the definition information of several reply perspectives in the target application scenario, and then replies to the sentence to be replied based on the definition information of each reply perspective, obtains the first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtains the second sentence of the dialogue agent replying to the sentence to be replied. On this basis, the second sentence is optimized based on the first sentence of each reply perspective to obtain the reply sentence of the sentence to be replied. Therefore, on the one hand, the dialogue agent replies to the sentence to be replied normally to obtain the second sentence, and on the other hand, the sentence to be replied is replied from several reply perspectives defined in the target application scenario to obtain the first sentence that replies to the sentence to be replied from each reply perspective, that is, in the process of replying the sentence to be replied, two different routes of the dialogue agent and the multiple reply perspectives are executed, so as to optimize the second sentence of the dialogue agent using the first sentences of the multiple reply perspectives to obtain the reply sentence of the sentence to be replied, which helps to make up for the reply defects of the dialogue agent such as single perspective and accumulated errors as much as possible by using the first sentences of the multiple reply perspectives, thereby improving the correctness and usability of the intelligent dialogue. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a flow chart of an embodiment of the dialogue optimization method of the present application; Figure 2 It is a schematic diagram of an embodiment of a response reflection of multiple response perspectives; Figure 3 This is a schematic diagram of the framework of an embodiment of the conversation optimization device of the present application; Figure 4 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application; Figure 5 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0011] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0012] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0013] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the fragment " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0014] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the conversation optimization method of the present application. Specifically, it may include the following steps: Step S11: Obtain the sentence to be replied in the target application scenario, and obtain definition information of several reply perspectives in the target application scenario.
[0015] In an implementation scenario, the target application scenario can be set according to actual application needs. For example, in the medical industry, the target application scenario is the medical scenario, and accordingly, the statements to be replied in this scenario are also related to the medical industry, and the reply perspective in this scenario is also related to the medical industry, such as complying with relevant regulations of the medical industry, etc.; or, in the customer service industry, the target application scenario is the customer service scenario, and accordingly, the statements to be replied in this scenario are also related to the customer service industry, and the reply perspective in this scenario is also related to the customer service industry, such as complying with relevant words and phrases of the customer service industry, etc. Of course, the above examples are only possible examples when the target application scenario is a medical scenario or a customer service scenario, and other situations can be deduced by analogy, and no examples are given here one by one.
[0016] In an implementation scenario, the statement to be replied can be input by the user through text input, voice input, etc., and the input method of the statement to be replied is not limited. For example, taking the target application scenario as a customer service scenario, the statement to be replied may include but is not limited to: "Why is the phone bill so high this month? I don't remember any extra usage", etc., and the specific content of the statement to be replied is not limited.
[0017] In an implementation scenario, the multiple reply perspectives may include at least two of the user perspective, the financial perspective, and the service perspective. For example, the multiple reply perspectives may include the user perspective and the financial perspective; or, the multiple reply perspectives may include the user perspective and the service perspective; or, the multiple reply perspectives may include the service perspective and the financial perspective; or, the multiple reply perspectives may include the user perspective, the financial perspective, and the service perspective. Of course, the above examples are only possible examples of the multiple reply perspectives, and do not limit the possible situations in which the multiple reply perspectives may also include other perspectives, and will not be given one by one here.
[0018] In an implementation scenario, the definition information of the reply perspective may include at least one of an evaluation index and an expected output of the reply perspective. That is, the definition information of the reply perspective may include an evaluation index, or the definition information of the reply perspective may include an expected output, or the definition information of the reply perspective may include an evaluation index and an expected output, which is not limited here.
[0019] In a specific implementation scenario, taking the reply perspective as the user perspective as an example, the definition information of the reply perspective may include but is not limited to the following evaluation indicators: "service fee", "service value", etc., and the definition information of the reply perspective may include but is not limited to the following expected outputs: "Analysis results of service fees", "Related words of service value", etc. As a possible example, the definition information of the user perspective may include but is not limited to: "Pay attention to user-perceived fees and service value". Of course, the above example is only a possible example of the definition information of the user perspective, and does not limit the specific content of the definition information of the user perspective, and will not be given one by one here.
[0020] In a specific implementation scenario, taking the financial perspective as an example, the definition information of the reply perspective may include but is not limited to the following evaluation indicators: "bill structure", etc. The definition information of the reply perspective may include but is not limited to the following expected outputs: "specific content of the basic package", "specific content of additional services", "specific content of discounts", etc. As a possible example, the definition information from the financial perspective may include but is not limited to: "Analyze the bill structure, including the basic package, additional services and discounts". Of course, the above example is only a possible example of the definition information from the financial perspective, and does not limit the specific content of the definition information from the financial perspective, so it will not be given one by one here.
[0021] In a specific implementation scenario, taking the reply perspective as the service perspective as an example, the definition information of the reply perspective may include but is not limited to the following evaluation indicators: "service usage", "user satisfaction", etc. The definition information of the reply perspective may include but is not limited to the following expected outputs: "specific content of service usage", "relevant words of user satisfaction", etc. As a possible example, the definition information of the service perspective may include but is not limited to: "Evaluation of service usage and user satisfaction". Of course, the above example is only a possible example of the definition information of the service perspective, and does not limit the specific content of the definition information of the service perspective, and will not be given one by one here.
[0022] Step S12: Reply to the sentences to be replied respectively based on the definition information of each reply perspective, obtain the first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtain the second sentence that the dialogue agent replies to the sentence to be replied.
[0023] In an implementation scenario, a prompt command for the corresponding reply perspective can be generated based on the definition information of each reply perspective and the sentence to be replied, and the prompt command of the reply perspective is at least used to instruct the large language model to reply to the sentence to be replied under the corresponding reply perspective, and then at least the prompt command of the reply perspective is sent to the large language model, and the output sentence of the large language model is obtained as the first sentence in the corresponding reply perspective. Taking the example that several reply perspectives include the aforementioned user perspective, financial perspective, and service perspective, a prompt command from the user perspective can be generated based on the definition information of the user perspective and the sentence to be replied, and the prompt command from the user perspective is used to at least instruct the large language model to reply to the sentence to be replied from the user perspective, and then at least send the prompt command from the user perspective to the large language model, and obtain the output sentence of the large language model as the first sentence to reply to the sentence to be replied from the user perspective; similarly, a prompt command from the financial perspective can be generated based on the definition information of the financial perspective and the sentence to be replied, and the prompt command from the financial perspective is used to at least instruct the large language model to reply to the sentence to be replied from the financial perspective, and then at least send the prompt command from the financial perspective to the large language model, and obtain the output sentence of the large language model as the first sentence to reply to the sentence to be replied from the financial perspective; similarly, a prompt command from the service perspective can be generated based on the definition information of the service perspective and the sentence to be replied, and the prompt command from the service perspective is used to at least instruct the large language model to reply to the sentence to be replied from the service perspective, and then at least send the prompt command from the service perspective to the large language model, and obtain the output sentence of the large language model as the first sentence to reply to the sentence to be replied from the service perspective. That is to say, the process steps such as prompt command generation and large language model processing can be executed in parallel for different reply perspectives to obtain the first sentence of the reply to the sentence to be replied under each reply perspective; or, different reply perspectives can also execute the process steps such as prompt command generation and large language model processing in sequence, which is not limited here. The above method generates the prompt command of the corresponding reply perspective based on the definition information and the sentence to be replied of each reply perspective, and the prompt command of the reply perspective is at least used to instruct the large language model to reply the sentence to be replied under the corresponding reply perspective, and then at least send the prompt command of the reply perspective to the large language model, and obtain the output sentence of the large language model as the first sentence in the corresponding reply perspective, so that the general understanding ability of the large language model can be used to realize multi-role playing, so as to reply to the reply sentences of different reply perspectives respectively.
[0024] In a specific implementation scenario, the big language model may include but is not limited to open source models such as LLAMA and Bloom; alternatively, the big language model may be obtained by fine-tuning the parameters of an open source big model based on a specific training corpus; alternatively, the big language model may also be a custom big model, and the specific source of the big language model is not limited herein.
[0025] In a specific implementation scenario, before at least sending the prompt command of the reply perspective to the large language model, it is also possible to search based on the sentence to be restored to obtain the target information for assisting the reply, and then send the target information and the prompt command of the reply perspective to the large language model, and in this case, the prompt command of the reply perspective is specifically used to instruct the large language model to refer to the target information to reply to the sentence to be replied under the corresponding reply perspective. As a possible example, still taking the aforementioned sentence to be replied "Why is the phone bill so high this month? I don't remember any additional usage" as an example, the user's phone usage record can be retrieved as the target information, such as but not limited to: call duration, data usage, subscription services, etc. As a possible example, the target information may include but is not limited to the following: Observation: {'result': [ {'month': '2024-03', 'total_bill': '310.00 yuan', 'actual_pay': '116.80 yuan', 'save_bill': '193.00 yuan', 'business_bill':{'Group V network personalized package-3 yuan 3000 minutes in the whole area': '3.00 yuan', 'Important Group unit directional traffic package_1 yuan 300GB': '1.00 yuan', 'Important group unit voice package-1 yuan 3000 minutes': ' 1.00 yuan', '5G Smart Package (Personal Edition) 158 yuan': '158.00 yuan', 'National general data traffic for important group units Package_1 yuan 40GB': '1.00 yuan'}, 'outplan_bill': {}, 'added_bill': {'Mobile HD--Basic Package (Future TV, Local)': '15.00 yuan', 'XXX additional Monthly service package 60 yuan': '60.00 yuan', 'Data sharing group package': '20.00 yuan', 'and multiple number function fee (5 yuan / Card)': '5.00 yuan'} }, {'month': '2024-04', 'total_bill': '325.00 yuan', 'actual_pay': '132.00 yuan', 'save_bill': '193.00 yuan', 'business_bill': {'Group V network personalized package - 3 yuan 3000 minutes in the whole area': '3.00 yuan', ' Group unit directional traffic package_1 yuan 300GB': '1.00 yuan', 'Important group unit voice package-1 yuan 3000 minutes': ' 1.00 yuan', '5G Smart Package (Personal Edition) 158 yuan': '158.00 yuan', 'National general data traffic for important group units Package_1 yuan 40GB': '1.00 yuan'}, 'outplan_bill': {}, 'added_bill': {'Privilege Supermarket Platinum Member': '15.00 yuan', 'Mobile HD--Basic Package (Future TV, local)': '15.00 yuan', 'XXX additional service monthly package 60 yuan': '60.00 yuan', 'Data sharing group rate Package': '20.00 yuan', 'Multiple number function fee (5 yuan / card)': '5.00 yuan'} } ] } It should be noted that in the above example, month represents the month of use, total_bill represents the total bill, actual_bill represents the bill payable, save_bill represents the preferential bill, business_bill represents the basic package, outplan_bill represents the unplanned service bill, and added_bill represents the subscription service bill. Of course, the above example is only a possible example of target information in related scenarios such as phone bill consultation. Other situations can be deduced by analogy, and no examples are given here one by one. In the above method, before at least sending the prompt command of the reply perspective to the large language model, a search is first performed based on the sentence to be replied to obtain the target information for assisting the reply, and then the target information and the prompt command of the reply perspective are sent to the large language model, and the prompt command of the reply perspective is specifically used to instruct the large language model to reply to the sentence to be replied in the corresponding reply perspective with reference to the target information, and the target information can be used to assist the large language model in replying to the sentence to be replied in each reply perspective. In addition, in order to retrieve the target information, as a possible implementation method, the target intent of the sentence to be replied can be obtained (such as call fee inquiry, abnormal call fee inquiry, etc.), and then the target intent can be retrieved to obtain the target information adapted to the target intent (such as call fee usage record, etc.). The above method analyzes the sentence to be replied to obtain the target intent of the sentence to be replied, and then retrieves the target information adapted to the target intent based on the target intent, which can retrieve the target information for auxiliary reply as accurately as possible.
[0026] In a specific implementation scenario, taking the user perspective as an example of a reply perspective, as mentioned above, the definition information of the user perspective may include "pay attention to the user's perceived fees and service value". When the sentence to be replied is "Why is the phone bill so high this month? I don't remember any additional usage", the prompt command from the user perspective may include but is not limited to: "Does the user think that certain service fees are unreasonable or unauthorized?", "How does the user perceive the value of the service?", etc. In this case, the prompt command from the user perspective may be input into the large language model to obtain the output content of the large language model, such as but not limited to "Dear user, thank you for your inquiry. We noticed that you have questions about this month's bill. Upon investigation, your bill contains several additional services, such as 'XXX additional service monthly package of 60 yuan', etc., which are the main reasons for the higher bill amount this month. If you do not remember subscribing to these services or think there is an error, please contact us in time for verification and adjustment. We are always committed to providing you with transparent fee explanations and a satisfactory service experience", as the first sentence to reply to the sentence to be replied from the user perspective.
[0027] In a specific implementation scenario, taking the financial perspective as an example, as mentioned above, the definition information of the financial perspective may include "analyzing the bill structure, including basic packages, additional services and discounts". When the statement to be replied is "Why is the phone bill so high this month? I don't remember any additional usage", the prompt command from the financial perspective may include but is not limited to: "Are all services in the bill correctly charged?", "Are discounts and offers correctly applied?", etc. In this case, the prompt command from the financial perspective may be input into the large language model to obtain the output content of the large language model, such as including but not limited to "Dear user, after a detailed bill review, we confirm that all expense items in your bill are correctly charged according to the established packages and services. Your actual payment amount already includes applicable discounts. Please review the additional service items and contact customer service if you need to cancel or change the service. We provide detailed bill explanations to ensure that you understand every expense clearly", as the first sentence of the reply to the statement to be replied from the financial perspective.
[0028] In a specific implementation scenario, taking the service perspective as an example of the reply perspective, as mentioned above, the definition information of the service perspective may include "evaluating service usage and user satisfaction". When the sentence to be replied is "Why is the phone bill so high this month? I don't remember any additional usage", the prompt command of the service perspective may include but is not limited to: "Are all billed services actually used?", "What is the service quality and user feedback?", etc. In this case, the prompt command of the service perspective can be input into the large language model to obtain the output content of the large language model, such as but not limited to "Dear user, we understand that you are surprised by this month's bill. Please confirm whether the various services in the bill are actually used by you, especially some high-cost entertainment or value-added services. We recommend that you check whether there are any automatically renewed services that have not been canceled in time. If you need help adjusting service settings or solving other related problems, please feel free to contact our customer support team", as the first sentence to reply to the sentence to be replied from the service perspective.
[0029] In another implementation scenario, different from the aforementioned implementation method of using a large language model to reply to the sentence to be replied, as another possible example, the intelligent dialogue model can also be pre-trained in each reply perspective, so that after obtaining the sentence to be replied, the sentence to be replied can be directly input into the intelligent dialogue model in each reply perspective to obtain the first sentence that replies to the sentence to be replied in the corresponding reply perspective. As a possible example, for each reply perspective, sample sentences to be replied can be collected in advance, and the sample sentences to be replied can be annotated with sample reply sentences that reply to the sample sentences to be replied in the corresponding reply perspective, and then the sample sentences to be replied are processed based on the intelligent dialogue model of the corresponding reply perspective to obtain the predicted reply sentence that replies to the sample sentences to be replied in the corresponding reply perspective, so that the network parameters of the intelligent dialogue model of the corresponding reply perspective can be adjusted based on the difference between the sample reply sentence and the predicted reply sentence until the training converges, so as to finally train the intelligent dialogue model of the corresponding reply perspective. It should be noted that the intelligent dialogue model can be implemented based on the network architecture of the encoder-decoder, and the network structure of the intelligent dialogue model is not limited here.
[0030] In addition, as a possible example, for a dialogue agent, after receiving a sentence to be replied, it can first generate the first round of thinking process, determine which tool to use, then extract key information from the sentence to be replied to construct the tool input, and then output the next round of thinking process in combination with the tool return result, and repeat this cycle, and finally summarize the output sentences of each round of thinking process in the middle to form the second sentence to reply to the sentence to be replied. Of course, the above example is only one possible implementation method for the dialogue agent to reply to the sentence to be replied, and it does not limit the dialogue agent to reply to the sentence to be replied using other implementation methods, and no examples are given here.
[0031] Step S13: Optimize the second sentence based on the first sentence of each reply perspective to obtain a reply sentence for the sentence to be replied.
[0032] In an implementation scenario, the first statement and the second statement of each reply perspective may be integrated to obtain a reply statement of the statement to be replied.
[0033] In another implementation scenario, different from the aforementioned implementation, as another possible implementation, the reply comparison results of different reply perspectives can be obtained based on the first sentences of different reply perspectives, and the reply comparison results can include at least one of the conflict description and the consistent description between the first sentences of different reply perspectives. On this basis, the second sentence can be optimized based on the reply comparison results to obtain the reply sentence. The above method optimizes the second sentence by combining the reply comparison results between the first sentences of different reply perspectives, and can further improve the accuracy and usability of the reply sentence by comparing the sentences under each reply perspective.
[0034] In a specific implementation scenario, please refer to Figure 2 , Figure 2 Schematic diagram of an embodiment of a response reflection with multiple response perspectives. Figure 2 As shown, after constructing prompt commands for each reply perspective (such as Prompt1, Prompt2, ..., PromptN) according to the sentence to be replied, they can be respectively input into the large language model to obtain the first sentence of replying to the sentence to be replied under each reply perspective (such as Result1, Result2, ..., ResultN). On this basis, the first sentences of any two different reply perspectives can be enumerated and combined into a sentence subset. For example, in the case where several reply perspectives include user perspective, financial perspective and service perspective, the first sentences of both the user perspective and the financial perspective can be enumerated and combined into a sentence subset, and the first sentences of both the financial perspective and the service perspective can be enumerated and combined into a sentence subset, and the first sentences of both the user perspective and the service perspective can be enumerated and combined into a sentence subset. Then, the first sentence in the sentence subset can be compared to obtain a comparison sub-result. For example, the first statement Result1 is compared with the first statement Result2 to obtain the comparison sub-result Difference1, the first statement Result1 is compared with the first statement ResultN to obtain the comparison sub-result Difference2, the first statement Result2 is compared with the first statement ResultN to obtain the comparison sub-result DifferenceN, and so on, and no examples are given one by one here. Finally, the comparison result can be obtained based on the comparison sub-results of each statement subset. It should be noted that for any group of statement subsets, its comparison sub-results may include: at least one of the conflict description and consistent description between the first statements in the statement subset. In addition, the conflict description represents the description text with semantic conflicts between different first statements, and the consistent description represents the description text with semantic consistency between different first statements. The comparison sub-result may also include: complementary descriptions between the first statements in the statement subset, that is, description texts with semantic irrelevant (that is, there is neither conflict nor consistency) between different first statements. The above method enumerates the first sentences of any two different response perspectives, combines them into sentence subsets, and then compares them based on the first sentences in the sentence subsets to obtain comparison sub-results. Based on the comparison sub-results of each sentence subset, a comparison result is obtained. This can compare the first sentences of different response perspectives as much as possible, fully discover the differences between different response perspectives, and help improve the accuracy and usability of the second sentence after optimization.
[0035] In a specific implementation scenario, after obtaining the response comparison result, a response reflection result can be generated, and when the response comparison result includes a conflict description, the response reflection result at least includes a correction description of the conflict description. It should be noted that from the user perspective, the focus is on user perception and satisfaction, emphasizing the personalization of services and the user's direct experience, while from a financial perspective, the focus is on the correctness and transparency of bills, explaining the structure of fees, and ensuring that users understand the discounts and billing standards, and from a service perspective, focusing on how users use services, and providing practical suggestions to manage or optimize these services to prevent unexpected costs. As a possible example, conflict descriptions can be identified and corrected through a large language model, etc., to obtain a corrected description of the conflict description. Still taking the above-mentioned sentences to be replied as an example, if the first sentence from the user's perspective contains relevant descriptions such as "no relatively high-priced additional services have been checked", and the first sentence from the service perspective contains such as "please confirm whether to open additional services, especially some high-cost entertainment or value-added services", it can be confirmed that the two are conflicting descriptions, and then the conflicting descriptions can be identified and corrected by using technical means such as large language models combined with the above-mentioned target information, so as to correct the "no relatively high-priced additional services have been checked" in the first sentence from the user's perspective to "several relatively high-priced additional services have been checked". Of course, the above example is only a possible example of the conflict description and its correction description when taking the above-mentioned sentences to be replied as an example, and other situations can be deduced by analogy, and no examples are given one by one here. In addition, when the reply comparison result includes a consistent description, the reply reflection result can also include a consistent description; and when the reply comparison result includes a complementary description, the reply reflection result can also include a complementary description. On this basis, the second sentence can be optimized based on the reply reflection result to obtain a reply sentence. As a possible implementation method, the reply sentence can be obtained by integrating each description in the reply reflection result with the second sentence. For example, still taking the aforementioned statement to be replied as an example, the reply statement may include but is not limited to: "Dear user, according to your bill details, we found that this month's bill includes multiple additional services, such as "XXX additional service monthly package of 60 yuan" and "Mobile HD-Basic Package", which may be one of the reasons for the higher bill. We have checked your bill and confirmed that all charges are correctly calculated based on your package and additional services. If you have any questions about these services or think they are unauthorized, please contact our customer service in time, we will be happy to investigate and adjust them for you further. At the same time, we recommend that you check your service subscriptions regularly to ensure that all services meet your current needs. Thank you for your feedback, we will continue to optimize our services and communication transparency." Of course, the above example is only a possible example of a reply statement when taking the aforementioned statement to be replied as an example, and other situations can be deduced by analogy, and no examples are given here one by one.The above method generates a reply reflection result based on the reply comparison result, and when the reply comparison result includes a conflict description, the reply reflection result at least includes a correction description of the conflict description, and then optimizes the second sentence based on the reply reflection result to obtain a reply sentence. Therefore, through multi-perspective reflection, not only can the intermediate results be reflected and compared to ensure the correctness of the intermediate results as much as possible, but different results can be integrated to improve the comprehensiveness of the final reply.
[0036] The above scheme obtains the sentence to be replied in the target application scenario, and obtains the definition information of several reply perspectives in the target application scenario, and then replies to the sentence to be replied based on the definition information of each reply perspective, obtains the first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtains the second sentence of the dialogue agent replying to the sentence to be replied. On this basis, the second sentence is optimized based on the first sentence of each reply perspective to obtain the reply sentence of the sentence to be replied. Therefore, on the one hand, the dialogue agent replies to the sentence to be replied normally to obtain the second sentence, and on the other hand, the sentence to be replied is replied from several reply perspectives defined in the target application scenario to obtain the first sentence that replies to the sentence to be replied from each reply perspective, that is, in the process of replying the sentence to be replied, two different routes of the dialogue agent and multiple reply perspectives are executed, so as to optimize the second sentence of the dialogue agent using the first sentences of the multiple reply perspectives to obtain the reply sentence of the sentence to be replied, which helps to make up for the reply defects of the dialogue agent such as single perspective and accumulated errors as much as possible by using the first sentences of the multiple reply perspectives, thereby improving the correctness and usability of intelligent dialogue.
[0037] See also Figure 3 , Figure 3 It is a schematic diagram of the framework of an embodiment of the dialogue optimization device of the present application. The dialogue optimization device 30 includes: an acquisition module 31, a reply module 32 and an optimization module 33. The acquisition module 31 is used to obtain the sentence to be replied in the target application scenario, and obtain the definition information of several reply perspectives in the target application scenario; the reply module 32 is used to reply to the sentence to be replied respectively based on the definition information of each reply perspective, obtain the first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtain the second sentence of the dialogue agent replying to the sentence to be replied; the optimization module 33 is used to optimize the second sentence based on the first sentence of each reply perspective, and obtain the reply sentence of the sentence to be replied.
[0038] In the above scheme, the dialogue optimization device 30 obtains the sentence to be replied in the target application scenario, and obtains the definition information of several reply perspectives in the target application scenario, and then replies to the sentence to be replied based on the definition information of each reply perspective, obtains the first sentence that replies to the sentence to be replied in the corresponding reply perspective, and obtains the second sentence of the dialogue agent replying to the sentence to be replied. On this basis, the second sentence is optimized based on the first sentence of each reply perspective to obtain the reply sentence of the sentence to be replied. Therefore, on the one hand, the dialogue agent replies to the sentence to be replied normally to obtain the second sentence, and on the other hand, the sentence to be replied is replied from several reply perspectives defined in the target application scenario to obtain the first sentence that replies to the sentence to be replied from each reply perspective, that is, in the process of replying the sentence to be replied, two different routes of the dialogue agent and the multiple reply perspectives are executed, so as to optimize the second sentence of the dialogue agent using the first sentences of the multiple reply perspectives to obtain the reply sentence of the sentence to be replied, which helps to make up for the reply defects of the dialogue agent such as the single perspective and accumulated errors as much as possible by using the first sentences of the multiple reply perspectives, thereby improving the correctness and usability of the intelligent dialogue.
[0039] In some disclosed embodiments, the reply module 32 includes a prompt generation submodule, which is used to generate a prompt command of the corresponding reply perspective based on the definition information of each reply perspective and the sentence to be replied, respectively; wherein the prompt command of the reply perspective is at least used to instruct the large language model to reply to the sentence to be replied under the corresponding reply perspective; the reply module 32 includes a model processing submodule, which is used to at least send the prompt command of the reply perspective to the large language model, and obtain the output sentence of the large language model as the first sentence in the corresponding reply perspective.
[0040] In some disclosed embodiments, the reply module 32 includes an information retrieval submodule for searching based on the sentence to be replied to, and obtaining target information for assisting the reply; the model processing submodule is also specifically used to send the target information and a prompt command of the reply perspective to the large language model; wherein the prompt command of the reply perspective is specifically used to instruct the large language model to reply to the sentence to be replied under the corresponding reply perspective with reference to the target information.
[0041] In some disclosed embodiments, the information retrieval submodule includes an analysis unit for analyzing the sentence to be replied to and obtaining the target intent of the sentence to be replied to. The information retrieval submodule includes a retrieval unit for searching based on the target intent and obtaining target information adapted to the target intent.
[0042] In some disclosed embodiments, the optimization module 33 includes a comparison submodule, which is used to obtain a reply comparison result of different reply perspectives based on the first sentence of different reply perspectives; wherein the reply comparison result includes at least one of a conflict description and a consistent description between the first sentences of different reply perspectives; the optimization module 33 includes an optimization submodule, which is used to optimize the second sentence based on the reply comparison result to obtain a reply sentence.
[0043] In some disclosed embodiments, the optimization submodule includes a reflection unit, which is used to generate a reply reflection result based on the reply comparison result; wherein, when the reply comparison result includes a conflict description, the reply reflection result at least includes a correction description of the conflict description; the optimization submodule includes an optimization unit, which is used to optimize the second statement based on the reply reflection result to obtain a reply statement.
[0044] In some disclosed embodiments, when the reply comparison result includes a consistent description, the reply reflection result includes at least the consistent description.
[0045] In some disclosed embodiments, the optimization unit is specifically configured to obtain a reply statement based on integrating each description in the reply reflection result with the second statement.
[0046] In some disclosed embodiments, the comparison submodule includes an enumeration unit for enumerating the first sentences of any two different response perspectives and combining them into a sentence subset; the comparison submodule includes a comparison unit for performing a comparison based on the first sentence in the sentence subset to obtain a comparison subresult; the comparison submodule includes a combination unit for obtaining a comparison result based on the comparison subresults of each sentence subset.
[0047] In some disclosed embodiments, the definition information of the response perspective includes at least one of the evaluation indicators and expected output of the response perspective; and / or, the several response perspectives include at least two of the user perspective, the financial perspective, and the service perspective.
[0048] See also Figure 3 , Figure 3 : is a schematic diagram of the framework of an embodiment of an electronic device 40 of the present application. The electronic device 40 includes a memory 41 and a processor 42 coupled to each other, the memory 41 at least stores program instructions, and the processor 42 is used to execute the program instructions to implement the steps in any of the above-mentioned dialogue optimization method embodiments. For details, please refer to the aforementioned disclosed embodiments, which will not be repeated here. As a possible example, the electronic device 40 may include but is not limited to: smart phones, tablet computers, learning machines, office books and other devices, and the specific type of the electronic device 40 is not limited here.
[0049] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps in any of the above-mentioned dialogue optimization method embodiments. The processor 42 can also be called a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 42 can be implemented by an integrated circuit chip.
[0050] In the above scheme, the electronic device 40 implements the steps in any of the above dialogue optimization method embodiments. On the one hand, the dialogue agent responds normally to the statement to be replied to so as to obtain the second statement. On the other hand, the statement to be replied to is replied from several reply perspectives defined in the target application scenario to obtain the first statement of the statement to be replied from each reply perspective. That is, in the process of replying the statement to be replied, two different routes of the dialogue agent and multiple reply perspectives are executed, so as to optimize the second statement of the dialogue agent by using the first statements of the multiple reply perspectives to obtain the reply statement of the statement to be replied. This helps to make up for the reply defects of the dialogue agent such as single perspective and accumulated errors as much as possible by using the first statements of the multiple reply perspectives, thereby improving the correctness and usability of the intelligent dialogue.
[0051] See also Figure 5 , Figure 5 1 is a schematic diagram of a framework of an embodiment of a computer-readable storage medium 50 of the present application. The computer-readable storage medium 50 stores program instructions 51 that can be executed by a processor, and the program instructions 51 are used to implement the steps in any of the above-mentioned dialogue optimization method embodiments.
[0052] In the above scheme, the computer-readable storage medium 50 implements the steps in any of the above dialogue optimization method embodiments. On the one hand, the dialogue agent responds normally to the statement to be replied to so as to obtain the second statement. On the other hand, the statement to be replied to is replied from several reply perspectives defined in the target application scenario to obtain the first statement of the statement to be replied from each reply perspective. That is, in the process of replying the statement to be replied, two different routes of the dialogue agent and multiple reply perspectives are executed, so as to optimize the second statement of the dialogue agent by using the first statements of the multiple reply perspectives to obtain the reply statement of the statement to be replied. This helps to make up for the reply defects of the dialogue agent such as single perspective and accumulated errors as much as possible by using the first statements of the multiple reply perspectives, thereby improving the correctness and usability of the intelligent dialogue.
[0053] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0054] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0055] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0056] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0057] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0058] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0059] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. A method for optimizing a conversation, characterized in that: include: Obtaining a sentence to be replied in a target application scenario, and obtaining definition information of several reply perspectives in the target application scenario; Reply to the sentences to be replied to respectively based on the definition information of each reply perspective, obtain a first sentence replying to the sentence to be replied to in the corresponding reply perspective, and obtain a second sentence of the dialogue agent replying to the sentence to be replied; The second statement is optimized based on the first statement of each of the reply perspectives to obtain a reply statement of the statement to be replied.
2. The method according to claim 1, characterized in that The step of replying to the sentences to be replied to based on the definition information of each reply perspective to obtain a first sentence replying to the sentences to be replied to in the corresponding reply perspective includes: Based on the definition information of each reply perspective and the sentence to be replied, respectively, a prompt command corresponding to the reply perspective is generated; wherein the prompt command of the reply perspective is at least used to instruct the large language model to reply to the sentence to be replied under the corresponding reply perspective; At least a prompt command of the reply perspective is sent to the large language model, and an output sentence of the large language model is obtained as a first sentence corresponding to the reply perspective.
3. The method according to claim 2, characterized in that Before at least sending the prompt command of the reply perspective to the large language model, the method further includes: Retrieve based on the sentence to be replied to, and obtain target information for assisting reply; The at least sending the prompt command of the reply perspective to the large language model includes: The target information and the prompt command of the reply perspective are sent to the large language model; wherein the prompt command of the reply perspective is specifically used to instruct the large language model to reply to the sentence to be replied under the corresponding reply perspective with reference to the target information.
4. The method according to claim 3, characterized in that The step of searching based on the sentence to be replied to obtain target information for assisting the reply includes: Analyze the sentence to be replied to, and obtain the target intention of the sentence to be replied to; A search is performed based on the target intent to obtain target information adapted to the target intent.
5. The method according to claim 1, characterized in that The optimizing the second statement based on the first statement of each reply perspective to obtain a reply statement of the statement to be replied includes: Based on the first sentences of the different reply perspectives, obtaining reply comparison results of the different reply perspectives; wherein the reply comparison results include at least one of conflicting descriptions and consistent descriptions between the first sentences of the different reply perspectives; The second statement is optimized based on the reply comparison result to obtain the reply statement.
6. The method according to claim 5, characterized in that The optimizing the second statement based on the reply comparison result to obtain the reply statement includes: Based on the reply comparison result, generating a reply reflection result; wherein, when the reply comparison result includes the conflict description, the reply reflection result at least includes a correction description of the conflict description; The second statement is optimized based on the reply reflection result to obtain the reply statement.
7. The method according to claim 6, characterized in that In the case where the response comparison result includes the consistent description, the response reflection result includes at least the consistent description; And / or, optimizing the second statement based on the reply reflection result to obtain the reply statement includes: The reply statement is obtained by integrating each description in the reply reflection result with the second statement.
8. The method according to claim 5, characterized in that The first sentence based on the different reply perspectives obtains reply comparison results of the different reply perspectives, including: Enumerate the first sentences of any two different response perspectives and combine them into a sentence subset; Performing a comparison based on the first sentence in the sentence subset to obtain a comparison sub-result; The comparison result is obtained based on the comparison sub-results of each of the sentence subsets.
9. The method according to claim 1, characterized in that: The definition information of the reply perspective includes at least one of an evaluation index and an expected output of the reply perspective; And / or, the several response perspectives include at least two of a user perspective, a financial perspective, and a service perspective.
10. A conversation optimization device, characterized in that: include: An acquisition module, used to acquire a sentence to be replied in a target application scenario, and to acquire definition information of several reply perspectives in the target application scenario; A reply module, used to reply to the sentences to be replied respectively based on the definition information of each reply perspective, obtain a first sentence replying to the sentence to be replied in the corresponding reply perspective, and obtain a second sentence replying to the sentence to be replied by the dialogue agent; The optimization module is used to optimize the second statement based on the first statement of each reply perspective to obtain a reply statement of the statement to be replied.
11. An electronic device, characterized in that: The device at least comprises a memory and a processor coupled to each other, wherein the memory at least stores program instructions, and the processor is used to execute the program instructions to implement the dialogue optimization method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the dialogue optimization method described in any one of claims 1 to 9.
