Text processing method, electronic device and computer readable storage medium

By obtaining and analyzing the text, historical text and associated data entered by the user, and generating and verifying candidate text, the low accuracy problem caused by inaccurate text recognition in intelligent dialogue is solved, and the accuracy of reply text is improved.

CN118982031BActive Publication Date: 2025-03-14TAOBAO CHINA SOFTWARE +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411472748.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-03-14
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

In the smart conversation scenario, the accuracy of generating reply text is low due to inaccurate recognition of the text input by the user.

Method used

By obtaining the original text, determining its corresponding historical text and associated data, generating actions to be executed and guided data based on these data, performing actions in turn generate candidate text, and verifying the candidate text through the guided data to obtain the target text.

Benefits of technology

It improves the accuracy of accurate identification of user input text and the generation of reply text, and solves the problem of low accuracy caused by inaccurate text recognition in intelligent dialogue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982031B_ABST
    Figure CN118982031B_ABST
Patent Text Reader

Abstract

The present application discloses a text processing method, an electronic device and a computer-readable storage medium, which relate to the fields of large model technology, text generation and intelligent dialogue. The method comprises: in response to obtaining the original text, determining the historical text and associated data corresponding to the original text, the associated data is used to characterize the data associated with the target object contained in the original text; based on the original text, the historical text and the associated data, generating at least one action to be executed and guiding data; based on the guiding data, sequentially executing at least one action to be executed, generating at least one candidate text corresponding to the original text; using the guiding data to verify at least one candidate text, and obtaining the target text corresponding to the original text. The present application solves the technical problem that in the intelligent dialogue scenario, the accuracy of the generated reply text is low due to inaccurate recognition of the text input by the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of large model technology, text generation and intelligent dialogue, and more specifically, to a text processing method, an electronic device and a computer-readable storage medium. Background Art

[0002] The booming development of e-commerce has brought about a massive amount of consumer interaction, including the need for after-sales service. Traditional conversational robots face several challenges in customer service scenarios: limited understanding ability, difficulty in handling multiple rounds of conversations, and insufficient ability to handle complex issues.

[0003] This results in low accuracy of generated reply text in intelligent dialogue scenarios due to inaccurate recognition of user input text.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a text processing method, an electronic device, and a computer-readable storage medium to at least solve the technical problem of low accuracy in generating reply text due to inaccurate recognition of user input text in an intelligent dialogue scenario.

[0006] According to one aspect of an embodiment of the present application, a text processing method is provided, including: in response to obtaining an original text, determining historical text and associated data corresponding to the original text, wherein the historical text is used to represent the text received and the text generated within a historical time period, and the associated data is used to represent the data having an associated relationship with a target object contained in the original text; based on the original text, the historical text and the associated data, generating at least one action to be executed and guiding data; based on the guiding data, executing at least one action to be executed in sequence to generate at least one candidate text corresponding to the original text; and using the guiding data to verify the at least one candidate text to obtain the target text corresponding to the original text.

[0007] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: in response to receiving an inquiry message sent by a client, determining historical interaction information and order information corresponding to the inquiry message, wherein the historical interaction information is used to represent information generated by interacting with the client within a historical time period, and the order information is used to represent information generated by the client purchasing a target product contained in the inquiry information; based on the inquiry information, the historical interaction information and the order information, generating at least one to-be-executed action and guidance data; based on the guidance data, executing at least one to-be-executed action in sequence to generate at least one candidate reply information corresponding to the inquiry information; using the guidance data to verify at least one candidate reply information to obtain the target reply information corresponding to the inquiry information; and sending the target reply information to the client.

[0008] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: in response to an input instruction acting on an operation interface, displaying an original text on the operation interface; in response to a processing instruction acting on the operation interface, displaying a target text corresponding to the original text on the operation interface, wherein the target text is a text obtained by verifying at least one candidate text corresponding to the original text using guide data, at least one candidate text is a text generated by sequentially executing at least one action to be executed based on the guide data, at least one action to be executed and the guide data are generated based on the original text, a historical text corresponding to the original text, and associated data corresponding to the original text, the historical text is used to represent the text received and the generated text within a historical time period, and the associated data is used to represent data having an associated relationship with a target object contained in the original text.

[0009] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: obtaining original text by calling a first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the original text; determining historical text and associated data corresponding to the original text, wherein the historical text is used to represent the text received and the generated text within a historical time period, and the associated data is used to represent the data that has an association relationship with the target object contained in the original text; generating at least one action to be executed and guiding data based on the original text, the historical text and the associated data; executing at least one action to be executed in sequence based on the guiding data to generate at least one candidate text corresponding to the original text; verifying at least one candidate text using the guiding data to obtain the target text corresponding to the original text; outputting the target text by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target text.

[0010] According to another aspect of an embodiment of the present application, a text processing device is also provided, including: a determination module, used to determine, in response to obtaining an original text, a historical text and associated data corresponding to the original text, wherein the historical text is used to represent the text received and the generated text within a historical time period, and the associated data is used to represent the data that has an association relationship with the target object contained in the original text; a first generation module, used to generate at least one action to be executed and guidance data based on the original text, the historical text and the associated data; a second generation module, used to execute at least one action to be executed in sequence based on the guidance data, and generate at least one candidate text corresponding to the original text; a verification module, used to verify at least one candidate text using the guidance data to obtain a target text corresponding to the original text.

[0011] According to another aspect of an embodiment of the present application, a text processing device is also provided, including: a determination module, for determining historical interaction information and order information corresponding to the inquiry information in response to receiving inquiry information sent by a client, wherein the historical interaction information is used to represent information generated by interacting with the client within a historical time period, and the order information is used to represent information generated by the client purchasing a target product contained in the inquiry information; a first generation module, for generating at least one to-be-executed action and guidance data based on the inquiry information, the historical interaction information and the order information; a second generation module, for executing at least one to-be-executed action in sequence based on the guidance data, and generating at least one candidate reply information corresponding to the inquiry information; a verification module, for verifying at least one candidate reply information using the guidance data to obtain the target reply information corresponding to the inquiry information; and a sending module, for sending the target reply information to the client.

[0012] According to another aspect of an embodiment of the present application, a text processing device is also provided, including: a first display module, used to respond to an input instruction acting on an operation interface and display an original text on the operation interface; a second display module, used to respond to a processing instruction acting on the operation interface and display a target text corresponding to the original text on the operation interface, wherein the target text is a text obtained by verifying at least one candidate text corresponding to the original text using guide data, at least one candidate text is a text generated by sequentially executing at least one action to be executed based on the guide data, at least one action to be executed and the guide data are generated based on the original text, a historical text corresponding to the original text, and associated data corresponding to the original text, the historical text is used to represent the text received and the generated text within a historical time period, and the associated data is used to represent data having an associated relationship with a target object contained in the original text.

[0013] According to another aspect of an embodiment of the present application, a text processing device is also provided, including: an acquisition module, used to acquire original text by calling a first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the original text; a determination module, used to determine historical text and associated data corresponding to the original text, wherein the historical text is used to characterize the text received and the generated text within a historical time period, and the associated data is used to characterize the data having an associated relationship with the target object contained in the original text; a first generation module, used to generate at least one action to be executed and guidance data based on the original text, the historical text and the associated data; a second generation module, used to execute at least one action to be executed in sequence based on the guidance data, and generate at least one candidate text corresponding to the original text; a verification module, used to verify at least one candidate text using the guidance data to obtain a target text corresponding to the original text; an output module, used to output the target text by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target text.

[0014] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory storing an executable program; and a processor for running the program, wherein the method of each embodiment of the present application is executed when the program is running.

[0015] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in each embodiment of the present application.

[0016] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.

[0017] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.

[0018] According to another aspect of the embodiments of the present application, a computer program is also provided, and when the computer program is executed by a processor, the methods in the various embodiments of the present application are implemented.

[0019] In the embodiment of the present application, in response to obtaining the original text, the historical text and associated data corresponding to the original text are determined; based on the original text, the historical text and the associated data, at least one action to be executed and the guide data are generated; based on the guide data, at least one action to be executed is executed in sequence to generate at least one candidate text corresponding to the original text; and the guide data is used to verify at least one candidate text to obtain the target text corresponding to the original text. It is easy to notice that through the original text, the historical text and the associated data, the user's demands can be better understood, and the purpose of more accurately identifying the original text input by the user is achieved. Further, based on the guide data, at least one action to be executed is executed in sequence to generate at least one candidate text. By verifying at least one candidate text, the content that does not conform to the original text can be filtered to obtain a more accurate target text, and the purpose of accurately generating the reply text is achieved, thereby achieving the technical effect of improving the accuracy of generating the reply text corresponding to the original text input by the user, thereby solving the technical problem of low accuracy of generating the reply text due to inaccurate recognition of the text input by the user in the intelligent dialogue scenario.

[0020] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0022] Figure 1 is a schematic diagram of an application scenario of a text processing method according to Example 1 of the present application;

[0023] Figure 2 is a flowchart of a text processing method according to an embodiment of the present application;

[0024] Figure 3 is a system schematic diagram of an optional text processing method according to an embodiment of the present application;

[0025] Figure 4 is a flowchart of a text processing method according to an embodiment of the present application;

[0026] Figure 5 is a flowchart of a text processing method according to an embodiment of the present application;

[0027] Figure 6 is a schematic diagram of an optional operation interface according to an embodiment of the present application;

[0028] Figure 7 is a flowchart of a text processing method according to an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of a text processing device according to an embodiment of the present application;

[0030] Fig. 9 is a schematic diagram of a text processing device according to an embodiment of the present application;

[0031] Fig.10 is a schematic diagram of a text processing device according to an embodiment of the present application;

[0032] Fig.11 is a schematic diagram of a text processing device according to an embodiment of the present application;

[0033] Fig.12 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0036] The technical solution provided in this application is mainly implemented using large-scale model technology. The large model here refers to a deep learning model with large-scale model parameters, which can usually contain hundreds of millions, tens of billions, hundreds of billions, trillions or even more than 10 trillion model parameters. The large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as large-scale language model (LLM), multi-modal pre-training model, etc.

[0037] It should be noted that when the large model is actually applied, the pre-trained model can be fine-tuned through a small number of samples, so that the large model can be applied to different tasks. For example, the large model can be widely used in natural language processing (NLP), computer vision, speech processing and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), image generation, etc. It can also be widely used in natural language processing tasks such as text-based sentiment classification, text summary generation, machine translation, etc. Therefore, the main application scenarios of the large model include but are not limited to digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc. In the embodiment of the present application, data processing through a large language model in an intelligent dialogue scenario is taken as an example for explanation,

[0038] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0039] Agent: An agent is an intelligent entity that can autonomously understand, plan and make decisions, and perform complex tasks.

[0040] Service strategy: From the chat records between consumers and customer service, we summarize a number of strategies for solving consumer problems corresponding to service scenarios, which are used to guide the big model to solve consumer problems according to best practices.

[0041] Planner: The planner is deployed with a large language model and is located in the Agent. It is used to plan tasks for the overall goal.

[0042] Executor: Executor, which is deployed with a large language model and is located in the Agent. It is used to perform specific tasks to generate answers.

[0043] Critic: Evaluator, deployed with a large language model, located in the Agent, used to evaluate the generated answers.

[0044] According to an embodiment of the present application, a text processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0045] Considering the huge number of model parameters of the large model and the limited computing resources of the mobile terminal, the above text processing method provided in the embodiment of the present application can be applied to Figure 1 The application scenarios shown are not limited to these. Figure 1 is a schematic diagram of an application scenario of a text processing method according to Example 1 of the present application. Figure 1 In the application scenario shown, the large model is deployed in the server 10, and the server 10 can be connected to one or more client devices 20 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client device 20 here may include but is not limited to: a smart phone, a tablet computer, a laptop computer, a PDA, a personal computer, a smart home device, a vehicle-mounted device, etc. The client device 20 can interact with the user through a graphical user interface to implement the call of the large model, thereby implementing the method provided in the embodiment of the present application.

[0046] In an embodiment of the present application, a system composed of a client device and a server can perform the following steps: the client device performs: displaying a target text corresponding to an original text on a graphical user interface, and the server performs: in response to obtaining the original text, determining the historical text and associated data corresponding to the original text; generating at least one action to be executed and guidance data based on the original text, historical text, and associated data; sequentially executing at least one action to be executed based on the guidance data to generate at least one candidate text corresponding to the original text; verifying at least one candidate text using the guidance data to obtain the target text corresponding to the original text. It should be noted that the embodiment of the present application can be performed in the client device when the operating resources of the client device can meet the deployment and operating conditions of the large model.

[0047] Under the above operating environment, this application provides Figure 2 The text processing method shown. Figure 2 is a flowchart of a text processing method according to an embodiment of the present application. Figure 2 As shown, the method may include the following steps:

[0048] Step S202, in response to obtaining the original text, determining the historical text and associated data corresponding to the original text, wherein the historical text is used to represent the text received and generated within the historical time period, and the associated data is used to represent the data having an associated relationship with the target object contained in the original text.

[0049] The above-mentioned original text can be a text with requirements entered by the user in the dialogue interface of the online platform, for example, it can include but is not limited to: the user's current inquiry text (for example: I want to query the logistics information of the order), the text of the user's current service requirements (for example: there is a problem with the quality of the product, and a refund is required). Among them, the application scenarios of the online platform may include but are not limited to: online customer service scenarios, online education scenarios, travel planning scenarios, smart assistant scenarios, e-commerce scenarios, social interaction scenarios, and smart search scenarios. Among them, customer service scenarios can include but are not limited to the following scenario types: online customer service, self-service. Online education scenarios can include but are not limited to the following scenarios: online education platform, remote classroom. In this embodiment, the online customer service scenario in the online customer service scenario is taken as an example for explanation, but it is not limited to this, and it can also be any of the above scenarios that can provide online services.

[0050] The above-mentioned historical text may be the user's memory information (i.e., the context information of the original text) obtained in the historical time period, wherein the historical time period may be the time period before the current time period, and the specific time length is not limited in this embodiment, and the technician may set it according to actual needs. The memory information may include but is not limited to: historical chat records between the user and the merchant or the intelligent dialogue robot, the user's historical service information, etc. Among them, the memory information is obtained so that the large model can better understand the user's demands and better obtain the corresponding service strategy to solve consumer problems. Among them, the context information can reflect the environment of the original text information in the current dialogue interface (for example, the service type may include but is not limited to: product information consultation, order management, personalized recommendation, promotion and discount information, payment solution information, and product after-sales information) and background information (for example, user needs, which may include but are not limited to: return, query product information, query order information). Context information is crucial to understanding the meaning of the text fragment because the context information provides information such as the subject and purpose of the original text.

[0051] The target object may be a product purchased by a user on an online shopping platform, and the associated data may be the shopping order information of the product purchased by the user, wherein the shopping order information may include but is not limited to: order number, order status, product information, payment information, and delivery information. By obtaining the associated data associated with the target object and analyzing the associated data, the big model can better understand the user's demands.

[0052] In an optional embodiment, most of the current intelligent dialogue scenarios have inaccurate recognition of the original text input by the user, resulting in a low generation accuracy rate of the reply text generated from the original text. In order to solve the above technical problems, the embodiment disclosed in the present application recognizes the original text input by the user through an agent (Agent) containing a large language model to achieve the purpose of accurately recognizing the original text. Among them, the agent is deployed in a server, for example, it can be a local server, an edge server, or a cloud server. The specific server type can be set by the technician according to actual needs, and is not limited in this embodiment. In this case, in order to accurately recognize the original text of the user, first, the agent can obtain the original text entered by the user in the dialogue interface of the online platform of the client. For example, the agent can send a request to obtain the original text to the client through the server. After receiving the acquisition request, the client can send the received original text input by the user to the agent. When the agent receives the original text, it can recognize the original text to obtain the target object. Secondly, based on the original text and the target object, the historical text and associated data corresponding to the original text can be obtained from the database. For example, when a user enters the original text "The size of the skirt I bought is too big, how can I exchange it?" in the dialogue interface of the client's online platform, the intelligent agent can identify the content of the original text after obtaining the original text and obtain the target object as "skirt". At this time, the intelligent agent can obtain the user's memory information (i.e., historical text) corresponding to the original text and the shopping order information corresponding to "skirt" (i.e., the associated data of the target object) from the database, so that the original text can be more accurately identified based on the historical text and associated data in the future.

[0053] Step S204: generating at least one action to be executed and guiding data based on the original text, the historical text and the associated data.

[0054] The at least one action to be performed can be an action that is generated by the planner in the agent based on the original text, historical text and related data, and is recalled from the service policy library, which is in line with the service process. Among them, the service policy library can be set in advance by the technical staff, which can reflect the specific service strategy corresponding to the specific service scenario. The service strategy can be set in advance by the technical staff, which can reflect the specific service content corresponding to different service scenarios. For example, in the case where the service scenario is "complaint", the service content may include but is not limited to comforting the user and proposing solutions to the user. In the case where the service scenario is "consultation", the service content may include but is not limited to answering the user and providing the user with other products of the same type. In the case where the service scenario is "after-sales", the service content may include but is not limited to providing solutions to the user and providing compensation plans to the user.

[0055] Planner can analyze the original text, historical text and related data to obtain the current service scenario and determine the specific service strategy corresponding to the current service scenario in the service strategy library, that is, recall the service strategy library. When the specific service strategy is determined, actions that conform to the service process can be generated based on the specific service content in the specific service strategy. For example, when the service scenario is determined to be "after-sales" based on the original text, historical text and related data, the service strategy library can be recalled to determine that the specific service strategy is to provide solutions to users. At this time, the actions generated that conform to the service process may include but are not limited to: "Generate solutions for users" and "Provide compensation plans to users."

[0056] The above-mentioned guidance data can be a kind of guidance opinion of action generated by Planner after analyzing the original text, historical text and related data in a natural voice way, so as to guide the intelligent agent to generate a more reasonable reply text. For example, after analyzing the original text, historical text and related data of the service scenario of after-sales, the user's demand is "the money is refunded to the card, can you give me the merchant's phone number", at this time, based on the user's demand, the guidance data can be obtained in a natural language way as "the user's goal is a refund, and the current round is to ask for the merchant's phone number". For another example, after analyzing the original text, historical text and related data of the service scenario of consultation, the user's demand is "what are the ingredients of this product, and which group of people is it suitable for", at this time, based on the user's demand, the guidance data can be obtained in a natural language way as "the user wants to know the parameters of this product", but it is not limited to this.

[0057] In an optional embodiment, when the original text, historical text and related data are obtained, the Planner in the intelligent agent can analyze the original text, historical text and related data to obtain the current service scenario, and recall the service policy library based on the current service scenario to obtain the current service policy, and then generate at least one action to be executed based on the specific service content in the current service policy. At the same time, the Planner in the intelligent agent can also analyze the original text, historical text and related data to obtain the user's current needs, and then generate guidance data based on the user's current needs in a natural language, so that the reply text of the original text can be accurately generated based on at least one action to be executed and the guidance data.

[0058] It should be noted that, due to the limited data contained in the agent, when Planner generates at least one action to be executed, it may need to call a tool to obtain relevant content of the target object in the original text from an external database, and then obtain at least one action to be executed based on the relevant content and the current service strategy. For example, it may include but is not limited to: obtaining the estimated delivery time and logistics status query from an external database by calling a tool.

[0059] Step S206: executing at least one to-be-executed action in sequence based on the guidance data to generate at least one candidate text corresponding to the original text.

[0060] The candidate texts mentioned above may be texts that solve user problems corresponding to the original text content. For example, when the original text of the user is a question, the candidate texts may be one or more texts that answer the question; when the original text of the user is a complaint, the candidate texts may be one or more texts that comfort the user or solve the problem for the user, but are not limited thereto.

[0061] In an optional embodiment, when at least one action to be executed and guidance data are obtained, the executor in the agent can execute at least one action to be executed in sequence based on the guidance data, and then generate at least one candidate text corresponding to the original text. For example, when the guidance data is "the user's goal is a refund, and the current round is to request the merchant's phone number", and at least one action to be executed is: "provide a solution to the user", and "provide a compensation plan to the user", the candidate text corresponding to the original text generated by the Executor at this time may include but is not limited to: "Dear, we cannot directly provide the merchant's phone number. If you need a refund, it is recommended that you directly initiate a refund application. If the merchant refuses, you can apply for customer service to intervene and help you deal with it", and "Dear, we will give you a red envelope with no threshold, you can use it at any time, and hope you have a pleasant shopping experience."

[0062] It should be noted that due to the limited data contained in the agent, the Executor may need to call tools to obtain relevant content of the target object in the original text from an external database when generating at least one candidate text. For example, it may include but is not limited to: obtaining service continuity (BusinessContinuity, BC) extraction demands from an external database by calling tools, obtaining solution access pre-run from an external database by calling tools, etc. Among them, the solution access pre-run is used to describe some preliminary testing or verification work before implementing a project or plan. Then, based on the obtained relevant content and guidance data, at least one action to be executed can be executed in sequence to obtain at least one candidate text.

[0063] Step S208: Verify at least one candidate text using the guidance data to obtain a target text corresponding to the original text.

[0064] In an optional embodiment, when at least one candidate text is obtained, in order to avoid the domain model in the Executor from generating some non-factual answers, that is, answers that are irrelevant to the content of the original text, the evaluator (Critic) in the intelligent agent can verify at least one candidate text based on the guidance data to obtain the target text corresponding to the original text. For example, the Critic can filter out the candidate texts that are irrelevant to the question or suspected of hallucinations in at least one candidate text, and obtain the target text corresponding to the original text. For another example, the Critic can also filter out at least one candidate text whose semantic relevance is less than a preset threshold based on the semantic relevance between the guidance data and at least one candidate text, and obtain the target text corresponding to the original text. It should be noted that the above-mentioned preset threshold can be set in advance by the technician, and the specific value is not limited in this embodiment, and the technician can set it according to actual needs.

[0065] In the embodiment of the present application, in response to obtaining the original text, the historical text and associated data corresponding to the original text are determined; based on the original text, the historical text and the associated data, at least one action to be executed and the guide data are generated; based on the guide data, at least one action to be executed is executed in sequence to generate at least one candidate text corresponding to the original text; and the guide data is used to verify at least one candidate text to obtain the target text corresponding to the original text. It is easy to notice that through the original text, the historical text and the associated data, the user's demands can be better understood, and the purpose of more accurately identifying the original text input by the user is achieved. Further, based on the guide data, at least one action to be executed is executed in sequence to generate at least one candidate text. By verifying at least one candidate text, the content that does not conform to the original text can be filtered to obtain a more accurate target text, and the purpose of accurately generating the reply text is achieved, thereby achieving the technical effect of improving the accuracy of generating the reply text corresponding to the original text input by the user, thereby solving the technical problem of low accuracy of generating the reply text due to inaccurate recognition of the text input by the user in the intelligent dialogue scenario.

[0066] In the above embodiments of the present application, at least one action to be executed and guidance data are generated based on the original text, historical text and associated data, including: determining a target execution strategy from multiple preset execution strategies based on the historical text and associated data, wherein different preset execution strategies are used to characterize execution strategies that match different scenarios, and the target execution strategy is used to characterize execution strategies that match the target scenarios corresponding to the original text; generating at least one action to be executed and guidance data based on the original text, historical text and the target execution strategy.

[0067] The above-mentioned preset execution strategy can be set in advance by the technical staff, which can reflect the specific service content corresponding to different service scenarios. The above-mentioned target execution strategy can be the corresponding service content determined based on the specific service scenario after determining the specific service scenario based on the historical text and related data.

[0068] In an optional embodiment, when the original text, historical text and associated data are obtained, the target execution strategy can be determined from multiple preset execution strategies through the large language model in the Planner in the agent. For example, at least one candidate execution strategy that matches the order status in the associated data can be determined from multiple preset execution strategies, and then the target execution strategy can be determined from at least one candidate execution strategy based on the historical text and the status corresponding to the at least one candidate execution strategy, wherein the status of the target strategy matches the order status in the associated data. When the target strategy is obtained, at least one action to be executed and guidance data can be generated based on the original text, historical text and target execution strategy through the large language model in the Planner.

[0069] In the above embodiment of the present application, a target execution strategy is determined from multiple preset execution strategies based on historical text and associated data, including: determining at least one candidate execution strategy that matches the associated data among the multiple preset execution strategies; and determining the target execution strategy from at least one candidate execution strategy based on the status corresponding to the historical text and the at least one candidate execution strategy.

[0070] The above-mentioned status may include but is not limited to: context information in the historical text, user requirements in the original text, and the order status of the target object in the original text. The order status may include but is not limited to: unpaid, paid, shipped, received, and completed.

[0071] In an optional embodiment, when the historical text and the associated data are obtained, the order status of the target object in the associated data can be determined first, and then at least one candidate execution strategy that matches the order status of the target object in the associated data can be determined among multiple preset execution strategies, and finally, the target execution strategy can be determined from the at least one candidate execution strategy based on the status corresponding to the historical text and the at least one candidate execution strategy. For example, at least one action to be executed and guidance data can be generated according to the target execution strategy based on the historical text and the associated data through the large language model in the Planner.

[0072] In the above embodiments of the present application, at least one action to be executed and guidance data are generated based on the original text, historical text and target execution strategy, including: inputting the original text and historical text into an action generation model, and using the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0073] The above-mentioned action generation model can be a trained large language model in Planner. The large language model can combine historical text and related data to generate at least one action to be executed and guidance data according to the target execution strategy.

[0074] In an optional embodiment, when the target execution strategy is obtained, the original text and historical text can be first input into the action generation model, and then the action generation model can generate at least one action to be executed and guidance data according to the target execution strategy based on the historical text and related data.

[0075] It should be noted that since the Planner is the most important part of the entire dialogue link, this embodiment uses a large language model with a large number of parameters for training to ensure the processing accuracy and efficiency of the Planner.

[0076] In the above embodiment of the present application, the original text and the historical text are input into the action generation model, and the action generation model is used to generate at least one action to be executed and guidance data according to the target execution strategy, including: determining a first tool corresponding to the target execution strategy from a plurality of preset tools, wherein different preset tools are used to query different states corresponding to the target object; using the action generation model to call the first tool corresponding to the target execution strategy to obtain the first state corresponding to the target object; inputting the first state, the original text and the historical text into the action generation model, and using the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0077] The above-mentioned multiple preset tools can be set in advance by a technician, wherein the multiple preset tools can obtain different order statuses of the target object through external database query.

[0078] In an optional embodiment, after the original text and associated data are input into the action generation model, the action generation model can first determine the first tool corresponding to the target execution strategy from multiple preset tools, and then the action generation model can call the first tool corresponding to the target execution strategy to obtain the first state of the target object. Finally, the action generation model can generate at least one action to be executed and guidance data according to the target execution strategy based on the first state, original text data and historical text.

[0079] In the above embodiment of the present application, at least one action to be executed is executed in sequence based on the guidance data to generate at least one candidate text corresponding to the original text, including: determining at least one action execution model corresponding to different actions to be executed; using at least one action execution model in sequence to execute the corresponding actions to be executed to generate at least one candidate text, and the parameter amount of any action execution model is less than the parameter amount of the action generation model.

[0080] The above-mentioned action execution model can be a trained domain large language model in the Executor. It should be noted that the Executor contains at least one domain large language model to process at least one action to be executed. Among them, at least one domain large language model undergoes state feature transition (SFT). Since at least one domain large language model only solves problems in a specific field, in order to improve the performance of the domain large language model, a large language model with a smaller number of parameters is used in this embodiment.

[0081] It should be noted that the domain language model in Executor is located in the knowledge base, which uses RAG. RAG (Retriever-Augmented Generation) is a natural language processing (NLP) technology that combines the two components of retrieval (Retriever) and generation (Generator) to generate natural language text. This technology is mainly used in question-answering systems, summary generation, dialogue systems and other fields.

[0082] In an optional embodiment, when a to-be-executed action and guidance data are obtained, at least one action execution model corresponding to different to-be-executed actions in the Executor can be determined first, and then the corresponding to-be-executed actions can be executed in sequence using at least one action execution model to generate at least one candidate text. Among them, the parameter amount of any action execution model is less than the parameter amount of the action generation model.

[0083] In the above embodiment of the present application, at least one action execution model is used in sequence to execute the corresponding action to be executed to generate at least one candidate text, including: determining a second tool corresponding to the corresponding action to be executed from a plurality of preset tools, wherein different preset tools are used to execute different actions to be executed; using at least one action execution model in sequence to call the second tool corresponding to the corresponding action to be executed to obtain the second state corresponding to the corresponding action to be executed; inputting the second state and the corresponding action to be executed into the corresponding action execution model in sequence, and generating at least one candidate text using at least one action execution model.

[0084] In an optional embodiment, when determining at least one action execution model corresponding to different actions to be executed, first, the second tool corresponding to the corresponding action to be executed can be determined from multiple preset tools, and then the second tool corresponding to the corresponding action to be executed can be called in turn using at least one action execution model to obtain the second state corresponding to the corresponding action to be executed. Finally, the second state and the corresponding action to be executed can be input into the corresponding action execution model in turn, and at least one candidate text can be generated using at least one action execution model.

[0085] In the above embodiment of the present application, at least one candidate text is verified using guide data to obtain a target text corresponding to the original text, including: inputting the guide data and at least one candidate text into an action evaluation model, and using the action evaluation model to determine whether at least one candidate text matches the guide data to obtain the target text, wherein the target text is used to represent the text in at least one candidate text that matches the guide data.

[0086] The above-mentioned action evaluation model may be a large language model trained in Critic, wherein the large language model trained in Critic is used to filter at least one candidate text based on the guide data to obtain a target text corresponding to the original text.

[0087] In an optional embodiment, when at least one candidate text is obtained, the at least one candidate text and the guiding data can be input into the action evaluation model in Critic, and the at least one candidate text is filtered by the action evaluation model to obtain the target text. The specific filtering method has been described in step S208 and will not be repeated here.

[0088] It should be noted that different large language models are obtained by fine-tuning data from different fields.

[0089] Figure 3 is a system schematic diagram of an optional text processing method according to an embodiment of the present application, such as Figure 3 As shown, first, the user can enter the original text in the client, such as the query text, and then the Memory information may be obtained. Memory information includes the chat records between the user and the customer or robot, the user's shopping order information, the user's previous service information, etc. The purpose of obtaining this information is to enable the big model to better understand the user's demands and to better obtain the corresponding service strategy to solve consumer problems. Among them, the specific content of Memory may include but is not limited to: historical conversations, service snapshots, and order status (i.e. historical text and guide data). Among them, a service snapshot usually refers to a record and description of a service system or service status at a specific point in time.

[0090] Secondly, by Figure 3As can be seen, the planner in the agent can be used to make an overall plan for the user's demands (Planner). First, we will recall the service strategy based on the memory and the corresponding order status. Then, the large language model in the planner will select the service strategy, combining the user's current context state (i.e., memory) and the state corresponding to the service strategy, and select the service strategy that is more in line with the current scenario; next, the large language model will combine the requirements of the service strategy and the current user's demands (i.e., the original text) to generate an action that is more in line with the service process (Action). Among them, some service strategies will need to be combined with some users' specific states, such as delivery time, to perform different actions. At this time, the large language model will first call some tools (Tool) to query the delivery time, and then plan the action (Action) according to the requirements of the service strategy. In addition to outputting the action, the planner will also output an action execution guide (in natural language) to guide the large language model in the executor Executor to generate a more reasonable answer. Since the planner is the most important part of the entire dialogue link, we use a large language model with a large number of parameters here for processing. Among them, the user's demands are determined based on the context information and the current input text. Multiple preset service strategies can be recalled according to the order status to obtain the target service strategy.

[0091] Then, by Figure 3 It can be seen that after the Planner completes the planning and produces one or more Actions, it is necessary to execute a specific Action. Each Action will be processed by one or more domain large language models that have passed the SFT. For example, for the Action of "recalling knowledge answers", it can be processed by the domain large language model of the knowledge base RAG. When executing a specific Action, the large language model usually also needs to rely on some tools (Tool), such as the domain large language model of the knowledge base RAG needs to rely on the "knowledge recall" tool. After all the Actions are executed, one or more users can usually get the answer to the consumer's problem. Since the large language model in the Executor only solves problems in a specific field, in order to improve performance, a large language model with a smaller number of parameters is used in this embodiment.

[0092] Finally, by Figure 3It can be seen that after all actions are executed, several answers are obtained. In order to avoid the hallucination of the large language model and produce some non-factual answers, the large language model of the evaluator Critic can be combined with the guidance generated by the Planner to verify all the answers, filter out the answers that are irrelevant or suspected of hallucination, and finally select the answer that best solves the consumer's problem.

[0093] Taking advantage of the strong reasoning ability of large models, this embodiment designs a large model Agent system for solving consumer after-sales problems. Through the interactive collaboration between multiple large models, the user's demands are divided into three stages: planning (Planner)-execution (Executor)-evaluation (Critic), and the consumer's problems are disassembled and processed step by step, so as to better understand the consumer's demands and solve consumer problems. By introducing service strategies in the planning stage, the planning of problems is more in line with the service process, and it is easier for humans to guide and intervene in the large model.

[0094] Service strategy is a way to control the execution process of a large model using natural language. Service strategy injects plug-in service knowledge into the large model to solve the problem of insufficient reasoning ability of the large model in the customer service field. Service strategy mainly provides service knowledge with logical judgment and process, and the main way to affect the model is to use COT Prompt when the large model is reasoning. Compared with the native internalization / SFT solution of the large model, the main value of adopting service strategy is to provide an explainable and interventionable service knowledge operation method while retaining the flexibility of the large model.

[0095] The embodiment of the present application combines a big model and adopts an Agent dialogue process with three stages: planning (Planner), execution (Executor), and evaluation (Critic). The big model is used to understand the user's problem, and then the problem is broken down and processed step by step to ultimately solve the consumer's problem. Compared with the traditional DM / NLU dialogue process, the Agent dialogue process of the present application is more flexible, does not require the design of a fixed and rigid service DM process, and has better problem-solving capabilities for consumers' long-tail problems. Compared with the language model paradigm of ReAct, the Agent dialogue process of the present application combines service strategies, and services can enter service strategies in the customer service field through natural language solutions, which improves the reasoning ability of the big model in specific scenarios in the customer service field. Through the introduction of the three stages of planning (Planner), execution (Executor), and evaluation (Critic), the probability of large model hallucinations and irrelevant answers is greatly reduced.

[0096] The technical innovations of this application include: through the three-stage big model Agent dialogue process of planning (Planner)-execution (Executor)-evaluation (Critic), the problem is split and processed after overall planning, and the answers are evaluated, which improves the problem solving rate while reducing the impact of big model illusions on consumers. Through the introduction of service strategies, the problems of insufficient reasoning ability of big models and difficulty in controlling service processes in specific fields (customer service fields) are solved. The service can guide and intervene in the big model to better solve consumer problems according to the correct process by entering service strategies.

[0097] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0098] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0100] According to an embodiment of the present application, a text processing method is also provided. Figure 4 is a flowchart of a text processing method according to an embodiment of the present application. Figure 4 As shown, the method may include the following steps:

[0101] Step S402, in response to receiving the query information sent by the client, determining historical interaction information and order information corresponding to the query information, wherein the historical interaction information is used to represent information generated by the interaction with the client in a historical time period, and the order information is used to represent information generated by the client purchasing the target product included in the query information;

[0102] Step S404, generating at least one action to be executed and guidance data based on the query information, historical interaction information and order information;

[0103] Step S406, executing at least one to-be-executed action in sequence based on the guidance data, and generating at least one candidate reply information corresponding to the query information;

[0104] Step S408, verifying at least one candidate reply message using the guidance data to obtain target reply message corresponding to the inquiry message;

[0105] Step S4010, sending target reply information to the client.

[0106] In an optional embodiment, in order to improve the accuracy of generating a reply text for an original text input by a user, when it is determined that the client has received the user's inquiry information, the cloud may first send a request to the client to obtain the inquiry information, and the client may send the inquiry information to the cloud based on the request. When the cloud receives the inquiry information sent by the client, it may first determine the historical interaction information and order information corresponding to the inquiry information. Secondly, the cloud may generate at least one action to be executed and guidance data based on the inquiry information, the historical interaction information and the order information. Then, the cloud may execute at least one action to be executed in sequence based on the guidance data, generate at least one candidate reply information corresponding to the inquiry information, and use the guidance data to verify at least one candidate reply information to obtain the target reply information corresponding to the inquiry information. Finally, the cloud may send the obtained target reply information to the client. After receiving the target reply information, the client may display the target reply information in the dialogue interface with the user on the online platform.

[0107] According to an embodiment of the present application, a text processing method is also provided. Figure 5 is a flowchart of a text processing method according to an embodiment of the present application. Figure 5 As shown, the method may include the following steps:

[0108] Step S502, in response to an input instruction acting on the operation interface, displaying the original text on the operation interface;

[0109] Step S504, in response to the processing instruction acting on the operation interface, the target text corresponding to the original text is displayed on the operation interface, wherein the target text is the text obtained by verifying at least one candidate text corresponding to the original text using the guide data, the at least one candidate text is the text generated by executing at least one action to be executed in sequence based on the guide data, at least one action to be executed and the guide data are generated based on the original text, the historical text corresponding to the original text, and the associated data corresponding to the original text, the historical text is used to represent the text received and the generated text within the historical time period, and the associated data is used to represent the data having an associated relationship with the target object contained in the original text.

[0110] Figure 6 is a schematic diagram of an optional operation interface according to an embodiment of the present application. Figure 6 As shown, the operation interface includes: an input area, a processing button and a display area, wherein the input area includes an input box and an input button. In order to improve the accuracy of generating a reply text of the original text input by the user, the user can first input the original text into the input box in the input area of ​​the operation interface. After the input is completed, the user can perform an operation on the input button in the input area (for example, a click operation, a press operation or a slide operation), and an input instruction can be generated based on the operation. The operation interface can display the original text in the display area in response to the input instruction. Secondly, the user can perform an operation on the processing button (for example, a click operation, a press operation or a slide operation), and a processing instruction can be generated based on the operation. At this time, the operation interface can display the target text corresponding to the original text in the display area of ​​the operation interface in response to the processing instruction.

[0111] It should be noted that the target text is a text obtained by verifying at least one candidate text corresponding to the original text using the guidance data, the at least one candidate text is a text generated by executing at least one action to be executed in sequence based on the guidance data, and the at least one action to be executed and the guidance data are generated based on the original text, the historical text corresponding to the original text, and the associated data corresponding to the original text. The historical text is used to represent the text received and the generated text within the historical time period, and the associated data is used to represent the data that has an association relationship with the target object contained in the original text.

[0112] According to an embodiment of the present application, a text processing method is also provided. Figure 7 is a flowchart of a text processing method according to an embodiment of the present application. Figure 7 As shown, the method may include the following steps:

[0113] Step S702, obtaining the original text by calling a first interface, wherein the first interface includes a first parameter, and a parameter value of the first parameter includes the original text;

[0114] Step S704, determining the historical text and associated data corresponding to the original text, wherein the historical text is used to represent the text received and the text generated within the historical time period, and the associated data is used to represent the data associated with the target object contained in the original text;

[0115] Step S706, generating at least one action to be executed and guiding data based on the original text, the historical text and the associated data;

[0116] Step S708, executing at least one action to be executed in sequence based on the guidance data to generate at least one candidate text corresponding to the original text;

[0117] Step S7010, verifying at least one candidate text using the guide data to obtain a target text corresponding to the original text;

[0118] Step S7012: output the target text by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target text.

[0119] The first interface mentioned above may be an interface for the cloud to obtain the original text from the client. The second interface mentioned above may be an interface for the cloud to output the target text to the client.

[0120] In an optional embodiment, in order to improve the accuracy of generating a reply text for an original text input by a user, the cloud can first obtain the original text by calling a first interface, and then the cloud can determine the historical text and related data corresponding to the original text. Then the cloud can generate at least one action to be executed and guidance data based on the original text, historical text and related data, and execute at least one action to be executed in sequence based on the guidance data to generate at least one candidate text corresponding to the original text. Then the cloud can also use the guidance data to verify the at least one candidate text to obtain the target text corresponding to the original text. Finally, the cloud can call a second interface to output the target text.

[0121] It should be noted that the first interface includes a first parameter, and the parameter value of the first parameter includes the original text; the historical text is used to represent the text received and generated within the historical time period, and the associated data is used to represent the data that has an association relationship with the target object contained in the original text; the second interface includes a second parameter, and the parameter value of the second parameter includes the target text.

[0122] According to an embodiment of the present application, a text processing device for implementing the above-mentioned text processing method is also provided. Figure 8 is a schematic diagram of a text processing device according to an embodiment of the present application, such as Figure 8As shown, the device includes: a determination module 82 , a first generation module 84 , a second generation module 86 and a verification module 88 .

[0123] Among them, the determination module is used to determine the historical text and related data corresponding to the original text in response to obtaining the original text, wherein the historical text is used to represent the text received and the generated text within the historical time period, and the related data is used to represent the data that has an association relationship with the target object contained in the original text; the first generation module is used to generate at least one action to be executed and guidance data based on the original text, the historical text and the related data; the second generation module is used to execute at least one action to be executed in sequence based on the guidance data to generate at least one candidate text corresponding to the original text; the verification module is used to use the guidance data to verify at least one candidate text to obtain the target text corresponding to the original text.

[0124] It should be noted that the above-mentioned determination module 82, first generation module 84, second generation module 86 and verification module 88. Corresponding to steps S202 to S208 in the above-mentioned embodiment, the four modules and the corresponding steps have the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned embodiment. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules can also be run in the server 10 provided in the above-mentioned embodiment as part of the device.

[0125] In the above embodiment of the present application, the first generating module includes: a first determining unit and a first generating unit.

[0126] Among them, the first determination unit is used to determine the target execution strategy from multiple preset execution strategies based on historical text and related data, wherein different preset execution strategies are used to characterize execution strategies matching different scenarios, and the target execution strategy is used to characterize execution strategies matching the target scenarios corresponding to the original text; the first generation unit is used to generate at least one action to be executed and guidance data based on the original text, historical text and target execution strategy.

[0127] In the above embodiments of the present application, the first determining unit includes: a first determining subunit and a second determining subunit.

[0128] Among them, the first determination subunit is used to determine at least one candidate execution strategy that matches the associated data among multiple preset execution strategies; the second determination subunit is used to determine the target execution strategy from at least one candidate execution strategy based on the historical text and the state corresponding to the at least one candidate execution strategy.

[0129] In the above embodiments of the present application, the first generating unit includes: a first processing subunit.

[0130] The first processing subunit is used to input the original text and the historical text into the action generation model, and use the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0131] In the above embodiments of the present application, the first processing sub-unit is also used to: determine the first tool corresponding to the target execution strategy from multiple preset tools, wherein different preset tools are used to query different states corresponding to the target object; use the action generation model to call the first tool corresponding to the target execution strategy to obtain the first state corresponding to the target object; input the first state, original text and historical text into the action generation model, and use the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0132] In the above embodiment of the present application, the second generating module includes: a second determining unit and a second generating unit.

[0133] Among them, the second determination unit is used to determine at least one action execution model corresponding to different actions to be executed; the second generation unit is used to use at least one action execution model in turn to execute the corresponding actions to be executed and generate at least one candidate text, and the parameter amount of any action execution model is smaller than the parameter amount of the action generation model.

[0134] In the above embodiment of the present application, the second generating unit includes: a third determining subunit, an acquiring subunit and a second processing subunit.

[0135] Among them, the third determination subunit is used to determine the second tool corresponding to the corresponding action to be executed from multiple preset tools, wherein different preset tools are used to execute different actions to be executed; the acquisition subunit is used to call the second tool corresponding to the corresponding action to be executed in turn using at least one action execution model to obtain the second state corresponding to the corresponding action to be executed; the second processing subunit is used to input the second state and the corresponding action to be executed into the corresponding action execution model in turn, and generate at least one candidate text using at least one action execution model.

[0136] In the above embodiments of the present application, the verification module includes: a processing unit.

[0137] The processing unit is used to input the guidance data and at least one candidate text into the action evaluation model, and use the action evaluation model to determine whether the at least one candidate text matches the guidance data to obtain the target text, wherein the target text is used to represent the text in at least one candidate text that matches the guidance data.

[0138] According to an embodiment of the present application, a text processing device for implementing the above-mentioned text processing method is also provided. Fig. 9is a schematic diagram of a text processing device according to an embodiment of the present application, such as Fig. 9 As shown, the device includes: a determination module 92 , a first generation module 94 , a second generation module 96 , a verification module 98 and a sending module 910 .

[0139] Among them, the determination module is used to determine the historical interaction information and order information corresponding to the inquiry information in response to receiving the inquiry information sent by the client, wherein the historical interaction information is used to represent the information generated by the interaction with the client within the historical time period, and the order information is used to represent the information generated by the client purchasing the target product contained in the inquiry information; the first generation module is used to generate at least one to-be-executed action and guidance data based on the inquiry information, historical interaction information and order information; the second generation module is used to execute at least one to-be-executed action in sequence based on the guidance data, and generate at least one candidate reply information corresponding to the inquiry information; the verification module is used to verify at least one candidate reply information using the guidance data to obtain the target reply information corresponding to the inquiry information; the sending module is used to send the target reply information to the client.

[0140] It should be noted that the above-mentioned determination module 92, first generation module 94, second generation module 96, verification module 98 and sending module 910 correspond to steps S402 to S4010 in the above-mentioned embodiment, and the five modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned embodiment. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules can also be run in the server 10 provided in the above-mentioned embodiment as part of the device.

[0141] According to an embodiment of the present application, a text processing device for implementing the above-mentioned text processing method is also provided. Fig.10 is a schematic diagram of a text processing device according to an embodiment of the present application, such as Fig.10 As shown, the device includes: a first display module 1002 and a second display module 1004 .

[0142] Among them, the first display module is used to respond to the input instructions acting on the operation interface and display the original text on the operation interface; the second display module is used to respond to the processing instructions acting on the operation interface and display the target text corresponding to the original text on the operation interface, wherein the target text is a text obtained by verifying at least one candidate text corresponding to the original text using the guide data, and the at least one candidate text is a text generated by executing at least one to-be-executed action in sequence based on the guide data, and at least one to-be-executed action and the guide data are generated based on the original text, the historical text corresponding to the original text, and the associated data corresponding to the original text, the historical text is used to represent the text received and the generated text within the historical time period, and the associated data is used to represent the data that has an association relationship with the target object contained in the original text.

[0143] It should be noted that the first display module 1002 and the second display module 1004 correspond to steps S502 to S504 in the above embodiment, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules or units can be hardware components or software components stored in a memory and processed by one or more processors, and the above modules can also be run in the server 10 provided in the above embodiment as part of the device.

[0144] According to an embodiment of the present application, a text processing device for implementing the above-mentioned text processing method is also provided. Fig.11 is a schematic diagram of a text processing device according to an embodiment of the present application, such as Fig.11 As shown, the device includes: an acquisition module 1102 , a determination module 1104 , a first generation module 1106 , a second generation module 1108 , a verification module 11010 and an output module 11012 .

[0145] Among them, the acquisition module is used to obtain the original text by calling the first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the original text; the determination module is used to determine the historical text and related data corresponding to the original text, wherein the historical text is used to represent the text received and the generated text within the historical time period, and the related data is used to represent the data that has an association relationship with the target object contained in the original text; the first generation module is used to generate at least one action to be executed and guidance data based on the original text, the historical text and the related data; the second generation module is used to execute at least one action to be executed in sequence based on the guidance data to generate at least one candidate text corresponding to the original text; the verification module is used to verify at least one candidate text using the guidance data to obtain the target text corresponding to the original text; the output module is used to output the target text by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target text.

[0146] It should be noted that the acquisition module 1102, the determination module 1104, the first generation module 1106, the second generation module 1108, the verification module 11010 and the output module 11012 correspond to steps S702 to S7012 in the above embodiment, and the six modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules or units can be hardware components or software components stored in a memory and processed by one or more processors, and the above modules can also be run in the server 10 provided in the above embodiment as part of the device.

[0147] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in the above embodiments, as well as the application scenario and implementation process, but is not limited to the scheme provided in the above embodiments.

[0148] The embodiment of the present application may provide an electronic device, which may be any electronic device in a group of electronic devices. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.

[0149] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0150] In this embodiment, the electronic device can execute the program code in the method.

[0151] Optionally, Fig.12 is a structural block diagram of an electronic device according to an embodiment of the present application. Fig.12 As shown, the electronic device A may include: one or more (only one is shown in the figure) processors 1202, a memory 1204, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.

[0152] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the methods in the above embodiments. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0153] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: in response to obtaining the original text, determine the historical text and related data corresponding to the original text; based on the original text, the historical text and the related data, generate at least one action to be executed and guidance data; based on the guidance data, execute at least one action to be executed in sequence to generate at least one candidate text corresponding to the original text; use the guidance data to verify at least one candidate text to obtain the target text corresponding to the original text.

[0154] Optionally, the processor may also execute program code of the following steps: determining a target execution strategy from a plurality of preset execution strategies based on historical text and associated data; generating at least one action to be executed and guidance data based on the original text, historical text and target execution strategy.

[0155] Optionally, the processor may also execute program code for the following steps: determining at least one candidate execution strategy that matches the associated data among multiple preset execution strategies; and determining a target execution strategy from at least one candidate execution strategy based on a state corresponding to the historical text and at least one candidate execution strategy.

[0156] Optionally, the processor may also execute the program code of the following steps: inputting the original text and the historical text into the action generation model, and using the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0157] Optionally, the processor may also execute the program code of the following steps: determining the first tool corresponding to the target execution strategy from a plurality of preset tools; using the action generation model to call the first tool corresponding to the target execution strategy to obtain the first state corresponding to the target object; inputting the first state, the original text and the historical text into the action generation model, and using the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0158] Optionally, the processor may also execute the program code of the following steps: determining at least one action execution model corresponding to different actions to be executed; sequentially executing corresponding actions to be executed using at least one action execution model to generate at least one candidate text, wherein the parameter amount of any action execution model is less than the parameter amount of the action generation model.

[0159] Optionally, the processor may also execute the program code of the following steps: determining a second tool corresponding to a corresponding action to be executed from a plurality of preset tools; calling the second tool corresponding to the corresponding action to be executed using at least one action execution model in sequence to obtain a second state corresponding to the corresponding action to be executed; inputting the second state and the corresponding action to be executed into the corresponding action execution model in sequence, and generating at least one candidate text using at least one action execution model.

[0160] Optionally, the processor may also execute the following program code: inputting the guidance data and at least one candidate text into the action evaluation model, and using the action evaluation model to determine whether the at least one candidate text matches the guidance data to obtain the target text.

[0161] The embodiment of the present application provides a method for determining the historical text and associated data corresponding to the original text in response to obtaining the original text; generating at least one action to be executed and guiding data based on the original text, the historical text and the associated data; executing at least one action to be executed in sequence based on the guiding data to generate at least one candidate text corresponding to the original text; and verifying at least one candidate text using the guiding data to obtain a target text corresponding to the original text. It is easy to notice that through the original text, the historical text and the associated data, the user's demands can be better understood, and the purpose of more accurately identifying the original text input by the user can be achieved. Further, at least one action to be executed in sequence based on the guiding data can generate at least one candidate text. By verifying at least one candidate text, the content that does not conform to the original text can be filtered to obtain a more accurate target text, and the purpose of accurately generating a reply text can be achieved, thereby achieving the technical effect of improving the accuracy of generating the reply text corresponding to the original text input by the user, and thus solving the technical problem of low accuracy of generating the reply text due to inaccurate recognition of the text input by the user in the intelligent dialogue scenario.

[0162] It is understood by those skilled in the art that the structure shown in the figure is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. The figure does not limit the structure of the above-mentioned electronic device. For example, the electronic device A may also include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a configuration different from that shown in the figure.

[0163] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0164] The embodiment of the present application further provides a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the method provided in the above embodiment.

[0165] Optionally, in this embodiment, the storage medium may be located in any electronic device in a group of electronic devices in a computer network, or in any mobile terminal in a group of mobile terminals.

[0166] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: in response to obtaining an original text, determining historical text and associated data corresponding to the original text; generating at least one action to be executed and guidance data based on the original text, the historical text and the associated data; executing at least one action to be executed in sequence based on the guidance data to generate at least one candidate text corresponding to the original text; and verifying at least one candidate text using the guidance data to obtain a target text corresponding to the original text.

[0167] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: determining a target execution strategy from multiple preset execution strategies based on historical text and associated data; generating at least one action to be executed and guidance data based on the original text, historical text and target execution strategy.

[0168] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: determining at least one candidate execution strategy that matches the associated data among multiple preset execution strategies; and determining a target execution strategy from at least one candidate execution strategy based on the historical text and the state corresponding to the at least one candidate execution strategy.

[0169] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: inputting the original text and the historical text into the action generation model, and using the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0170] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: determining a first tool corresponding to the target execution strategy from a plurality of preset tools; using an action generation model to call the first tool corresponding to the target execution strategy to obtain a first state corresponding to the target object; inputting the first state, original text, and historical text into the action generation model, and using the action generation model to generate at least one action to be executed and guidance data according to the target execution strategy.

[0171] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: determining at least one action execution model corresponding to different actions to be executed; sequentially executing corresponding actions to be executed using at least one action execution model to generate at least one candidate text, wherein the parameter amount of any action execution model is less than the parameter amount of the action generation model.

[0172] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: determining a second tool corresponding to a corresponding action to be executed from a plurality of preset tools; sequentially calling the second tool corresponding to the corresponding action to be executed using at least one action execution model to obtain a second state corresponding to the corresponding action to be executed; sequentially inputting the second state and the corresponding action to be executed into the corresponding action execution model, and generating at least one candidate text using at least one action execution model.

[0173] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: inputting guidance data and at least one candidate text into an action evaluation model, and using the action evaluation model to determine whether at least one candidate text matches the guidance data to obtain a target text.

[0174] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.

[0175] The embodiments of the present application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented.

[0176] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.

[0177] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0178] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0179] 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 solution of this embodiment.

[0180] 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.

[0181] 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, 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 for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.

[0182] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A text processing method, characterized in that: include: In response to acquiring the original text, determining the historical text and associated data corresponding to the original text, wherein the historical text is used to represent the text received and the text generated within the historical time period, and the associated data is used to represent the data associated with the target object contained in the original text; Based on the original text, the historical text and the associated data, at least one action to be performed and guidance data are generated, wherein the guidance data is obtained in a natural language manner based on the current needs of the user, and the current needs of the user are obtained by analyzing the original text, the historical text and the associated data; Execute the at least one to-be-executed action in sequence based on the guidance data to generate at least one candidate text corresponding to the original text; The at least one candidate text is verified by using the guide data through semantic relevance to obtain a target text corresponding to the original text, wherein the semantic relevance is the semantic relevance between the guide data and the at least one candidate text.

2. The method according to claim 1, characterized in that The generating at least one action to be executed and guidance data based on the original text, the historical text and the associated data includes: Based on the historical text and the associated data, determining a target execution strategy from a plurality of preset execution strategies, wherein different preset execution strategies are used to represent execution strategies matching different scenarios, and the target execution strategy is used to represent an execution strategy matching a target scenario corresponding to the original text; Based on the original text, the historical text and the target execution strategy, the at least one action to be executed and the guidance data are generated.

3. The method according to claim 2, characterized in that The step of determining a target execution strategy from a plurality of preset execution strategies based on the historical text and the associated data includes: Determine at least one candidate execution strategy among the plurality of preset execution strategies that matches the associated data; Based on the historical text and the state corresponding to the at least one candidate execution strategy, the target execution strategy is determined from the at least one candidate execution strategy.

4. The method according to claim 2, characterized in that: The generating the at least one action to be executed and the guiding data based on the original text, the historical text and the target execution strategy includes: The original text and the historical text are input into an action generation model, and the action generation model is used to generate the at least one action to be executed and the guidance data according to the target execution strategy.

5. The method according to claim 4, characterized in that The step of inputting the original text and the historical text into an action generation model, and using the action generation model to generate the at least one action to be executed and the guidance data according to the target execution strategy includes: Determining a first tool corresponding to the target execution strategy from a plurality of preset tools, wherein different preset tools are used to query different states corresponding to the target object; Using the action generation model, calling a first tool corresponding to the target execution strategy to obtain a first state corresponding to the target object; The first state, the original text and the historical text are input into the action generation model, and the at least one action to be executed and the guidance data are generated according to the target execution strategy by using the action generation model.

6. The method according to claim 1, characterized in that The step of sequentially executing the at least one action to be executed based on the guidance data to generate at least one candidate text corresponding to the original text includes: Determining at least one action execution model corresponding to different actions to be performed; The corresponding to-be-executed actions are executed in sequence using the at least one action execution model to generate the at least one candidate text, and the parameter amount of any action execution model is smaller than the parameter amount of the action generation model.

7. The method according to claim 6, characterized in that The step of sequentially using the at least one action execution model to execute corresponding actions to be executed to generate the at least one candidate text includes: Determining a second tool corresponding to the corresponding action to be performed from a plurality of preset tools, wherein different preset tools are used to perform different actions to be performed; sequentially calling the second tool corresponding to the corresponding action to be executed by using the at least one action execution model to obtain the second state corresponding to the corresponding action to be executed; The second state and the corresponding action to be executed are sequentially input into the corresponding action execution model, and the at least one candidate text is generated using the at least one action execution model.

8. The method according to claim 1, characterized in that The step of verifying the at least one candidate text by using the guide data to obtain a target text corresponding to the original text includes: The guiding data and the at least one candidate text are input into an action evaluation model, and the action evaluation model is used to determine whether the at least one candidate text matches the guiding data, so as to obtain the target text, wherein the target text is used to represent the text in the at least one candidate text that matches the guiding data.

9. A text processing method, characterized in that: include: In response to receiving the query information sent by the client, determine the historical interaction information and order information corresponding to the query information, wherein the historical interaction information is used to represent the information generated by the interaction with the client in the historical time period, and the order information is used to represent the information generated by the client purchasing the target product contained in the query information; Based on the query information, the historical interaction information and the order information, at least one to-be-performed action and guidance data are generated, wherein the guidance data is obtained in a natural language manner based on the current needs of the user, and the current needs of the user are obtained by analyzing the query information, the historical interaction information and the order information; Execute the at least one to-be-executed action in sequence based on the guidance data, and generate at least one candidate reply information corresponding to the inquiry information; Using the guide data to verify the at least one candidate reply information through semantic relevance to obtain target reply information corresponding to the inquiry information, wherein the semantic relevance is the semantic relevance between the guide data and the inquiry information; The target reply information is sent to the client.

10. A text processing method, characterized in that: include: In response to an input instruction acting on the operation interface, displaying the original text on the operation interface; In response to a processing instruction acting on the operation interface, a target text corresponding to the original text is displayed on the operation interface, wherein the target text is a text obtained by verifying at least one candidate text corresponding to the original text through semantic relevance using guide data, the at least one candidate text is a text generated by sequentially executing at least one action to be executed based on the guide data, the semantic relevance is the semantic relevance between the guide data and the at least one candidate text, the at least one action to be executed is generated based on the original text, a historical text corresponding to the original text, and associated data corresponding to the original text, the guide data is obtained in a natural language based on the current needs of the user, the current needs of the user are obtained by analyzing the original text, the historical text and the associated data, the historical text is used to represent the text received and the generated text within a historical time period, and the associated data is used to represent data having an associated relationship with the target object contained in the original text.

11. A text processing method, characterized in that: include: Acquire the original text by calling a first interface, wherein the first interface includes a first parameter, and a parameter value of the first parameter includes the original text; Determine historical text and associated data corresponding to the original text, wherein the historical text is used to represent texts received and generated within a historical time period, and the associated data is used to represent data associated with a target object contained in the original text; Based on the original text, the historical text and the associated data, at least one action to be performed and guidance data are generated, wherein the guidance data is obtained in a natural language manner based on the current needs of the user, and the current needs of the user are obtained by analyzing the original text, the historical text and the associated data; Execute the at least one to-be-executed action in sequence based on the guidance data to generate at least one candidate text corresponding to the original text; Using the guide data to verify the at least one candidate text through semantic relevance to obtain a target text corresponding to the original text, wherein the semantic relevance is the semantic relevance between the guide data and the at least one candidate text; The target text is output by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter includes the target text.

12. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 11 when running.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 11.

14. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Intelligent response method and device

    CN114970559A

  • Image generation method and device, electronic equipment and storage medium

    CN116843795A