A reply text generation method and related product

By combining a large language model with a workflow database to generate instruction text, the problem of high development difficulty and poor reusability in multiple scenarios for online customer service robots has been solved, enabling efficient answers to user questions and improving user satisfaction.

CN117076647BActive Publication Date: 2025-10-17太保科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311168160.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2025-10-17
Estimated Expiration
2043-09-11

AI Technical Summary

Technical Problem

Existing methods for building online customer service robots have the problems of high development difficulty, poor reusability in multiple scenarios, and the generated reply text is difficult to solve user questions.

Method used

By combining a large language model with a work process database, the system generates and analyzes instruction text to produce response text corresponding to the target dialogue record. This process includes obtaining the target dialogue record and the work process database, generating the first instruction text and the second instruction text, and using the large language model to understand and process these texts to generate the response text.

Benefits of technology

This method reduces the development difficulty of online customer service robots, improves their reusability in multiple scenarios, enables response texts to efficiently answer user questions, and enhances user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117076647B_ABST
    Figure CN117076647B_ABST
Patent Text Reader

Abstract

The application discloses a reply text generation method and related products, and relates to the technical field of artificial intelligence. The application splices a target dialogue record and a plurality of job process names in a job process database according to a format specification of a first instruction template to generate a first instruction text; analyzes the first instruction text by using a large language model to obtain a target job process text; splices the target dialogue record and the target job process text according to a format specification of a second instruction template to generate a second instruction text; and analyzes the second instruction text by using the large language model to generate a reply text corresponding to the target dialogue record. Finally, a method with low development difficulty and good multiplicity in multiple scenarios is used to obtain a reply text that can solve user doubts, so that the reply text can efficiently answer user doubts and improve user satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a reply text generation method and related products. BACKGROUND

[0002] The reply text of an online customer service robot is a reply text automatically given by the online customer service robot to answer the user's question. At present, the online customer service robot is generally constructed by using a "pipeline" or an "end-to-end" method, and then the reply text is obtained. The "pipeline" method is a method of constructing the online customer service robot by modeling the semantic understanding, slot extraction, dialogue flow tracking and dialogue strategy generation in the task process independently. The "end-to-end" method is a method of obtaining the online customer service robot by inputting the cleaned work records of the artificial customer service into the deep learning model and training the deep learning model.

[0003] Since the "pipeline" method has the disadvantages of high construction cost and poor process fault tolerance, the "end-to-end" method has the disadvantages of unclear service process and high quality inspection cost, and both of them can only cope with specific service tasks; therefore, the method of obtaining the reply text by constructing the online customer service robot through the traditional method has many disadvantages such as great difficulty in developing the online customer service robot, poor reusability of the online customer service robot in multiple scenarios, and the generated reply text being difficult to solve the user's question. Therefore, how to obtain the reply text that can solve the user's question by using a method with low development difficulty and good reusability in multiple scenarios has become a problem to be solved. SUMMARY

[0004] Based on the above problems, the present application provides a reply text generation method and related products; to obtain the reply text that can solve the user's question by using a method with low development difficulty and good reusability in multiple scenarios, reduce the development difficulty of the online customer service robot, improve the reusability of the online customer service robot in multiple scenarios, make the reply text be able to efficiently answer the user's question, and then improve the user's satisfaction.

[0005] The first aspect of the present application provides a reply text generation method, comprising:

[0006] obtaining a target dialogue record;

[0007] obtaining a work flow database; the work flow database comprises a plurality of work flows; each work flow has a work flow name and a work flow content; the work flow content is a plurality of steps for solving problems in different business scenarios;

[0008] splicing the target dialogue record and the plurality of job flow names in the job flow database according to a format specification of a first instruction template, to generate a first instruction text; the format specification of the first instruction template includes an arrangement order of the target dialogue record and the plurality of job flow names;

[0009] inputting the first instruction text into a large language model, and obtaining a target job flow text through analysis of the first instruction text by the large language model; the target job flow text includes job flow content of a plurality of associated job flows; the associated job flows are job flows related to the target dialogue record; and a total number of the associated job flows is less than or equal to a total number of the job flows in the job flow database;

[0010] splicing the target dialogue record and the target job flow text according to a format specification of a second instruction template, to generate a second instruction text; the format specification of the second instruction template includes an arrangement order of the dialogue record and the job flow text;

[0011] inputting the second instruction text into the large language model, and generating a reply text corresponding to the target dialogue record through analysis of the second instruction text by the large language model.

[0012] In an optional implementation, the inputting the first instruction text into a large language model, and obtaining a target job flow text through analysis of the first instruction text by the large language model, includes:

[0013] obtaining job flow content of a plurality of associated job flows through analysis of the first instruction text by the large language model;

[0014] processing the job flow content of the plurality of associated job flows by the large language model, to obtain the target job flow text.

[0015] In an optional implementation, the obtaining job flow content of a plurality of associated job flows through analysis of the first instruction text by the large language model, includes:

[0016] obtaining job flow names of a plurality of associated job flows from the job flow database through analysis of the target dialogue record and the plurality of job flow names in the first instruction text by the large language model;

[0017] obtaining job flow content of the plurality of associated job flows from the job flow database based on the job flow names of the plurality of associated job flows.

[0018] In an optional implementation, the processing of the job flow content of the plurality of associated job flows by the large language model comprises:

[0019] The job flow content of the plurality of associated job flows is spliced to generate a to-be-processed job flow text;

[0020] The same or similar job flow content included in the to-be-processed job flow text is merged by the large language model, and the mutually conflicting job flow content included in the to-be-processed job flow text is deleted to obtain the target job flow text.

[0021] In an optional implementation, the construction process of the job flow database comprises:

[0022] Obtaining a target text; the target text includes a plurality of questions and a plurality of steps for answering each question;

[0023] Obtaining a database file; the database file includes a name field and a content field;

[0024] Processing the target text according to the format specification of the job flow to generate a plurality of job flows; filling the job flow name of the generated job flow into the job flow name field in the database file, and filling the job flow content corresponding to the job flow name into the job flow content field in the same row.

[0025] The second aspect of the application provides a reply text generation device, comprising:

[0026] A dialogue record acquisition module is configured to acquire a target dialogue record.

[0027] A job flow library acquisition module is configured to acquire a job flow database; the job flow database includes a plurality of job flows; each job flow has a job flow name and a job flow content; the job flow content is a plurality of steps for solving problems in different business scenarios.

[0028] A first instruction text generation device is configured to splice the target dialogue record and the plurality of job flow names in the job flow database according to the format specification of a first instruction template to generate a first instruction text; the format specification of the first instruction template includes the arrangement order of the target dialogue record and the plurality of job flow names.

[0029] The target operation process acquisition apparatus is configured to input the first instruction text into a large language model, and obtain a target operation process text by analyzing the first instruction text using the large language model; the target operation process text comprises operation process contents of a plurality of associated operation processes; the associated operation processes are operation processes related to the target dialogue record; and a total number of the associated operation processes is less than or equal to a total number of the operation processes in the operation process database.

[0030] The second instruction text generation apparatus is configured to splice the target dialogue record and the target operation process text according to a format specification of a second instruction template, and generate a second instruction text; the format specification of the second instruction template comprises an arrangement order of the dialogue record and the operation process text.

[0031] The reply text generation apparatus is configured to input the second instruction text into the large language model, and generate a reply text corresponding to the target dialogue record by analyzing the second instruction text using the large language model.

[0032] In an optional implementation, the target operation process acquisition apparatus comprises:

[0033] The associated process content acquisition unit is configured to obtain operation process contents of a plurality of associated operation processes by analyzing the first instruction text using the large language model.

[0034] The target operation process acquisition unit is configured to obtain a target operation process text by processing the operation process contents of the plurality of associated operation processes using the large language model.

[0035] In an optional implementation, the associated process content acquisition unit comprises:

[0036] The associated process name acquisition subunit is configured to filter a plurality of operation process names of associated operation processes from the operation process database by analyzing the target dialogue record and the plurality of operation process names in the first instruction text using the large language model.

[0037] The associated process content acquisition subunit is configured to obtain operation process contents of the plurality of associated operation processes from the operation process database based on the operation process names of the plurality of associated operation processes.

[0038] The third aspect of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the steps of the method provided in the first aspect.

[0039] The fourth aspect of the present application provides an electronic device, which comprises:

[0040] a memory having stored thereon a computer program;

[0041] a processor configured to execute the computer program in the memory to implement the steps of the method provided by the first aspect.

[0042] Compared with the prior art, the present application has the following beneficial effects:

[0043] The embodiment of the present application generates first instruction text that is easy for a large language model to understand based on target dialogue records and a job flow database; inputs the first instruction text into the large language model to obtain target job flow text; generates second instruction text that is easy for the large language model to understand based on the target job flow text and the target dialogue records; and inputs the second instruction text into the large language model to obtain reply text corresponding to the target dialogue records. Since the job flow database used in the present application includes multiple steps for solving problems in different business scenarios, the large language model used has the ability to understand instruction text, and the target dialogue records used record the user's doubts and needs; and since in the present application, as long as the target dialogue records and the job flow database are obtained, the large language model can be used to generate reply text corresponding to the target dialogue records. Therefore, compared with the traditional method, the reply text generation method used in the present application has the advantages of low development difficulty, good reuse effect in multiple scenarios, and the obtained reply text can solve the user's doubts; reduces the development difficulty of online customer service robots, improves the reusability of online customer service robots in multiple scenarios, makes the reply text able to efficiently answer the user's doubts, and improves the user's satisfaction. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0045] Figure 1 A flowchart of a reply text generation method provided by an embodiment of the present application;

[0046] Figure 2 A schematic diagram of generating first instruction text provided by an embodiment of the present application;

[0047] Figure 3 A schematic diagram of obtaining associated job flow content provided by an embodiment of the present application;

[0048] Figure 4 A schematic diagram of obtaining target job flow text provided by an embodiment of the present application;

[0049] Figure 5 A schematic diagram for generating a second instruction text provided by an embodiment of the present application;

[0050] Figure 6 A schematic diagram for generating a reply text provided by an embodiment of the present application;

[0051] Figure 7 A flowchart of an online customer service robot running process provided by an embodiment of the present application;

[0052] Figure 8 A structural schematic diagram of a reply text generation device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0053] Currently, online customer service robots are generally constructed in a "pipeline" or "end-to-end" manner, and then a reply text answering user questions is obtained. Since the "pipeline" manner has the disadvantages of high construction cost and poor process fault tolerance, the "end-to-end" manner has the disadvantages of unclear service process and high quality inspection cost, and both of them can only cope with service tasks in specific scenarios; the method of obtaining a reply text by constructing an online customer service robot has many shortcomings such as great development difficulty of the online customer service robot, poor reusability of the online customer service robot in multiple scenarios, and difficulty in solving user questions by the generated reply text. Therefore, how to obtain a reply text that can solve user questions by using a method with low development difficulty and good reusability in multiple scenarios has become a problem to be solved.

[0054] Since the large language model used in the present application has the ability to understand instruction texts, it can understand the relationship between the target dialogue record and the multiple job process names in the first instruction text, efficiently and accurately generate the target job process text; it can understand the relationship between the target dialogue record and the target job process text in the second instruction text, and efficiently and accurately generate the reply text corresponding to the target dialogue record. In addition, the job process content in the job process database includes multiple steps for solving problems, and the service process is clear. Therefore, compared with the traditional method, the reply text generation method used in the present application has the advantages of low development difficulty, good reusability in multiple scenarios, and the obtained reply text can solve user questions; it reduces the development difficulty of the online customer service robot, improves the reusability of the online customer service robot in multiple scenarios, enables the reply text to efficiently answer user questions, and thus improves the user's satisfaction.

[0055] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application, so that those skilled in the art can better understand the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0056] It should be noted that the large language model (LLM) used in the present application is a cognitive intelligent large model, which has cross-domain knowledge and language understanding ability, and can understand and execute tasks based on instruction text. In other words, the large language model can understand the instruction text, and the instruction text can be used as the input of the large language model, which can help the large language model better understand the user's intention and output more accurate and meaningful content. Currently, common large language models include "Xunfei Xinghuo" and "Wenxin Yiyang".

[0057] Figure 1 A flowchart of a reply text generation method provided by an embodiment of the present application is shown in FIG. 1. According to the flowchart, the reply text generation method provided by the present application includes the following steps. Figure 1

[0058] Step 101: Obtain a target dialogue record.

[0059] The target dialogue record in this step is the dialogue record between the target user and the online customer service robot. If the target user is A, the target dialogue record is the dialogue record between the target user A and the online customer service robot.

[0060] The target dialogue record in the present application can be stored in a data table. Table 1 is a data table storing the target dialogue record. As shown in Table 1, the data table includes a number, a role, a text, and a round, and records the dialogue data between the customer service and the user in multiple rounds.

[0061] Table 1 Target dialogue record data table

[0062]

[0063] After obtaining the data table storing the target dialogue record, the target dialogue record can be obtained. Since obtaining the data table is a relatively mature technology, the specific implementation manner of obtaining the data table is not limited in the present application.

[0064] ​After obtaining the target conversation record data table, the content in the target conversation record data table can be spliced into a target conversation record text through a text splicing program. The target conversation record text starts with "Round X#", each round is cut off by a "\n" line feed symbol, and the "customer service" role and the "user" role are separated by a ";" separator.

[0065] For example, the target data record in Table 1 can be spliced into a target conversation record in the form of pure text as follows. The specific form of the target conversation record in the form of pure text is as follows:

[0066] Round 1 # Customer service: Hello, what can I do for you? User: I had an accident\n

[0067] Round 2 # Customer service: OK, is there any injury to the personnel? Can the vehicle drive normally? User: No one is injured, and it can drive normally. It is a single-vehicle accident\n

[0068] Round 3 # Customer service: OK, where is the location of your accident? User: I am near Yishan Road, Xuhui District, Shanghai\n

[0069] Round 4 # Customer service: OK, your report information has been successfully registered. A surveyor will contact you later. Please be patient\n

[0070] After obtaining the target conversation record, a first instruction text can be generated based on the target conversation record and a plurality of job flow names included in the job flow database; a target job flow text can be generated by a large language model by analyzing the job flow in the first instruction text related to the target conversation record; a second instruction text can be generated based on the target conversation record and the target job flow text; and a reply text corresponding to the target conversation record can be generated by the large language model by analyzing the second instruction text. Therefore, obtaining the target conversation record is a necessary step for generating the first instruction text and the second instruction text that can be understood by the large language model.

[0071] In step 102, a job flow database is obtained.

[0072] The job flow database in this step is a database including a plurality of job flows. To facilitate understanding of the related knowledge of the job flow database, the related content of the job flow is introduced first.

[0073] The job flow has a job flow name and a job flow content. The job flow content is a plurality of steps for solving a target problem. Taking the vehicle insurance report job flow as an example, the name of the vehicle insurance report job flow is vehicle insurance report, and the job flow content is a plurality of steps for completing the vehicle insurance report.

[0074] It should be noted that the work flow in the embodiment of the present application is in pure text format, starts with "Step X," and each step is divided by a "\n" line feed character. For example, the specific format of the vehicle insurance claim work flow is:

[0075] Step 1: Ask the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally\n

[0076] Step 2: Collect the user's license plate number\n

[0077] Step 3: Collect the user's accident location\n

[0078] Step 4: Comfort the user and remind the claim success\n

[0079] The work flow database includes a plurality of work flows. After obtaining the work flow database, the plurality of work flows in the work flow database and the work flow name and work flow content of each work flow can be obtained. Since obtaining the work flow database is a relatively mature technology, the specific implementation of obtaining the work flow database is not limited in the embodiment of the present application.

[0080] Table 2 is the work flow database. As can be seen from Table 2, the work flow database includes a work flow name field and a work flow content field.

[0081] Table 2 Work flow database

[0082]

[0083] It should be noted that Table 2 exemplarily shows the related content of the vehicle insurance claim work flow and the policy query work flow, and does not show all the work flows in the work flow database.

[0084] After obtaining the work flow database of Table 2, a plurality of work flow names such as vehicle insurance claim and policy query can be obtained, and the work flow content corresponding to each work flow name can be obtained, such as the work content of the vehicle insurance claim work flow being "Step 1: Ask the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally\nStep 2: Collect the user's license plate number\nStep 3: Collect the user's accident location\nStep 4: Comfort the user and remind the claim success\n"; and the work content of the policy query work flow being "Step 1: Ask about the policy\nStep 2: Confirm the user's identity information\nStep 3: Give the query result\nStep 4: Remind the query success\n". Therefore, after obtaining the work flow database, a plurality of work flow names and the work flow content corresponding to each work flow name can be obtained.

[0085] After acquiring the workflow database in this step, a first instruction text can be generated based on the target conversation record and the multiple workflow names included in the workflow database. The large language model analyzes the workflow related to the target conversation record in the first instruction text to generate the target workflow text. A second instruction text can be generated based on the target conversation record and the target workflow text. The large language model analyzes the second instruction text to generate a response text corresponding to the target conversation record. Therefore, acquiring the workflow database is a necessary procedure for generating the first and second instruction texts that the large language model can understand, and is a necessary step for implementing the response text generation method disclosed in this application.

[0086] Step 103: Concatenate the target conversation record and multiple job flow names in the job flow database according to the format specification of the first instruction template to generate a first instruction text.

[0087] The target conversation record in this step is the target conversation record obtained in step 101. For a detailed description of the target conversation record, please refer to step 101 and will not be repeated here.

[0088] The operation process database in this step is the operation process database obtained in step 102. For a detailed description of the operation process database, please refer to step 102 and will not be repeated here.

[0089] The format specifications of the first instruction template in this step include the order in which the target conversation record and the multiple work process names are arranged. In other words, the first instruction template specifies the order in which the target conversation record obtained in step 101 and the multiple work process names included in the work process database obtained in step 102 are arranged. Specifically, the first instruction template can be expressed as follows: In the following conversation {target conversation record}, ​​please select the service type required from the following options: {number 1} {work process name}, {number 2} {work process name}, etc.; the service type number and work process name are directly given without explanation.

[0090] Figure 2 A schematic diagram of generating a first instruction text is provided in the embodiment of the present application. Figure 2 As shown, the generation process of the first instruction text is specifically introduced.

[0091] Figure 2 The generation process of the first instruction text shown in can be summarized as follows: the target conversation record and the job process database are respectively used as input items of the first instruction template; according to the format specification requirements of the first instruction template, the job process number and the job process name corresponding to the number in the target conversation record and the job process database are filled in the corresponding positions of the first instruction template in sequence to generate the first instruction text.

[0092] Specifically, the content "First round # customer service: Hello, is there anything I can help you with?; User: My car has been in an accident\nSecond round # customer service: Good, is there any personnel injured? Can the vehicle drive normally?; User: No personnel injured, can drive normally, is a single vehicle accident\n" in the target dialogue record is filled into the {target dialogue record} position in the first instruction template. Figure 2

[0093] The job flow number and the job flow name corresponding to the number in the job flow database are sequentially filled into the corresponding positions of the first instruction template. Specifically, {1}{car insurance claim} is filled into {number 1}{job flow name} in the first instruction template; {2}{policy inquiry} is filled into {number 2}{job flow name} in the first instruction template; {3}{value-added service} is filled into {number 3}{job flow name} in the first instruction template; and so on. Finally, the first instruction text is generated.

[0094] Figure 2 The first instruction text in the embodiment has the following form: In the following dialogue, the first round # customer service: Hello, is there anything I can help you with?; User: My car has been in an accident\nSecond round # customer service: Good, is there any personnel injured? Can the vehicle drive normally?; User: No personnel injured, can drive normally, is a single vehicle accident\n; Please select the type of service the user needs in the following options: 1 car insurance claim, 2 policy inquiry, 3 value-added service, directly give the number of the service type, do not explain the reason.

[0095] In this step, the target dialogue record and the multiple job flow names in the job flow database are spliced according to the format specification of the first instruction template to generate the first instruction text. The first instruction text as input to the large language model can help the large language model better understand the relationship between the target dialogue record and the multiple job flow names in the job flow database, which is conducive to the large language model to generate more accurate target job flow text.

[0096] Step 104, input the first instruction text into the large language model, and obtain the target job flow text by analyzing the first instruction text through the large language model.

[0097] The target job flow text is a text including the contents of multiple associated job flows. The associated job flow is a job flow related to the target dialogue record selected from the job flow database by the large language model according to the target dialogue record in the first instruction text.

[0098] In the embodiment, the target dialogue record is "First round # customer service: Hello, is there anything I can help you with?; User: My car has been in an accident\nSecond round # customer service: Good, is there any personnel injured? Can the vehicle drive normally?; User: No personnel injured, can drive normally, is a single vehicle accident\n". Figure 2 ​For example, if the target dialogue record included in the first instruction text is a target dialogue record of a car insurance report, the associated job flow process filtered by the large language model may be 1 car insurance report, and the job flow content of the corresponding associated job flow process is "Step 1, ask the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally\nStep 2, collect the user's license plate number\nStep 3, collect the user's accident location\nStep 4, comfort the user and remind the successful report\n".

[0099] Further, if the associated job flow process filtered by the large language model is multiple, the job flow content of the corresponding associated job flow process is multiple, and the target job flow text includes the job flow content of multiple associated job flow processes.

[0100] It should be noted that, since the associated job flow process is the job flow process related to the target dialogue record filtered by the large language model from the job flow database according to the target dialogue record in the first instruction text, the total number of the associated job flow process is less than or equal to the total number of the job flow process in the job flow database.

[0101] In an optional implementation, inputting the first instruction text into the large language model, obtaining the target job flow text through analysis of the first instruction text by the large language model includes: obtaining the job flow content of multiple associated job flow processes through analysis of the first instruction text by the large language model; processing the job flow content of the multiple associated job flow processes by the large language model to obtain the target job flow text.

[0102] Wherein, obtaining the job flow content of multiple associated job flow processes through analysis of the first instruction text by the large language model means: filtering the job flow names of multiple associated job flow processes from the job flow database through analysis of the target dialogue record and the multiple job flow names in the first instruction text by the large language model; obtaining the job flow content of the multiple associated job flow processes from the job flow database based on the job flow names of the multiple associated job flow processes.

[0103] Specifically, inputting the first instruction text into the large language model, the large language model analyzes the target dialogue record and the multiple job flow names included in the first instruction text to obtain the job flow names of the associated job flow processes related to the target dialogue record; and then using the retrieval interface of the job flow database, the associated job flow content corresponding to the associated job flow names is called out, that is, the job flow content of the multiple associated job flow processes is obtained from the job flow database according to the job flow names of the multiple associated job flow processes.

[0104] It should be noted that the total number of associated job flow names can also be obtained while obtaining the job flow name of the associated job flow in the above steps; the total number of associated job flow contents can also be obtained while obtaining the job flow content of the associated job flow. Further, the total number of associated job flow names and the total number of associated job flow contents can be compared, if they are the same, the subsequent operation in the embodiment of the application is performed; if they are different, step 104 is returned, the reason for the difference is queried, the problem is solved, and the subsequent operation in the embodiment of the application is continued.

[0105] Figure 3 An example of obtaining associated job flow content is provided in the embodiment of the application. As shown in Figure 3 The first instruction text is: In the following dialogue, the first round of customer service: Hello, what can I do for you?; User: My car has an accident\nSecond round of customer service: Good, do you have any personnel injured? Can the vehicle drive normally?; User: No personnel injured, can drive normally, is a single vehicle accident\n; Please select the type of service the user needs in the following type, 1 car insurance report, 2 insurance policy inquiry, 3 value-added service, directly give the number of service type, do not explain the reason. Input it into the large language model, and the output associated job flow name is 1 car insurance report, and the total number of associated job flow names is 1.

[0106] Through the database retrieval interface, the job flow content corresponding to the car insurance report is called from the job flow database, and the total number of associated job flow contents is output. Therefore, the output associated job flow content is "first step, inquire about the accident situation of the user, whether there is personnel injury, and whether the vehicle can start normally\nSecond step, collect the user's license plate number\nThird step, collect the user's accident location\nFourth step, comfort the user, and remind the successful report\n", and the total number of associated job flow contents is 1.

[0107] The large language model is used to process the job flow contents of the plurality of associated job flows to obtain a target job flow text, including:

[0108] First, the job flow contents of the plurality of associated job flows are spliced to generate a to-be-processed job flow text. The specific format of the splicing template is: {number 1} {job flow content 1}, {number 2} {job flow content 2,}, {number 3} {job flow content 3}, {number 4} {job flow content 4},...., the same or similar steps are required to be merged; if there are conflicting steps, the conflicting part is deleted, and the output result is a pure text starting with "first step," and each step is divided by a "\n" line feed character.

[0109] Then, the to-be-processed job flow text is input into the large language model, the same or similar multiple job flow contents included in the to-be-processed job flow text are merged into one by the large language model, and the multiple job flow contents conflicting with each other included in the to-be-processed job flow text are deleted, to obtain a target job flow text. The format of the target job flow text starts with "first step," and each step is cut off by a "\ n" line feed character.

[0110] It should be noted that the merging of the steps with the same or similar job flow contents means that if the to-be-processed job flow text includes {number 1} {job flow content 1}; {number 2} {job flow content 2,} {number 3} {job flow content 3}, {number 4} {job flow content 4},...., but the job flow contents corresponding to {number 1} and {number 2} are the same or similar, then {job flow content 1} and {job flow content 2} are merged into one job flow, and the to-be-processed job flow text includes {number 1} {job flow content 1}; {number 2} {job flow content 2,} is modified to {number 1} {job flow content 1}.

[0111] It should be noted that the deletion of the job flow contents conflicting with each other means that if the to-be-processed job flow text includes {number 1} {job flow content 1}; {number 2} {job flow content 2,} {number 3} {job flow content 3}, {number 4} {job flow content 4}, {number 5} {job flow content 5}...., but the job flow contents corresponding to {number 3} and {number 4} are conflicting with each other, for example, the step included in the job flow content 3 is to ask the user to wait for rescue on the spot; the step included in the job flow 4 is to ask the user to move to a safe place to wait for rescue; then, since the two are conflicting, the job flow content 3 and the job flow content 4 are deleted.

[0112] Figure 4 An example of obtaining a target job flow text provided by the embodiment of the present application is shown. As shown in Figure 4 The process contents of the multiple associated job flows "first step, ask the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally\nsecond step, collect the user's license plate number\nthird step, collect the user's accident location\nfourth step, calm the user and remind the successful reporting\n" and "first step, inquire about the insurance policy\nsecond step, confirm the user's identity information\nthird step, give the query result\nfourth step, remind the successful query\n" are first spliced according to the splicing order template to generate a to-be-processed job flow text.

[0113] Then the to-be-processed text is input into the large language model, and the large language model is used to merge steps with the same or similar job flow content in the to-be-processed job flow text; conflicting job flow contents are deleted, and a target job flow text is output. The target job flow text is "first step, ask the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally\nSecond step, collect the user's license plate number\nThird step, collect the user's accident location\nFourth step, calm the user and remind the successful reporting\nFifth step, inquire about the insurance situation\nSixth step, confirm the user's identity information\nSeventh step, give the query result\nEighth step, remind the successful query\n".

[0114] From the foregoing, it can be seen that the target job flow text includes the job flow content of the job flow related to the target dialogue record, that is, the target job flow text includes the solution steps of multiple questions related to the target dialogue record. After obtaining the target job flow text in this step, the target dialogue record and the target job flow text can be converted into a second instruction text; the large language model directly outputs a reply text by analyzing the content of the second instruction text. Therefore, obtaining the target job flow text is a necessary procedure for generating a second instruction text that can be understood by the large language model. Because the target job flow text includes the solution steps of multiple questions related to the target dialogue record, the service process of the reply text generation method disclosed in the present application is also more clear.

[0115] Step 105, splicing the target dialogue record and the target job flow text according to the format specification of the second instruction template to generate a second instruction text.

[0116] The target dialogue record in this step is the target dialogue record obtained in step 101, and the detailed description of the target dialogue record is referred to step 101, which will not be repeated here.

[0117] The target job flow in this step is the target job flow text obtained in step 104, and the detailed description of the target job flow text is referred to step 104, which will not be repeated here.

[0118] The format specifications of the second instruction template in this step include the order in which the conversation record and the work flow text are arranged. In other words, the second instruction template specifies the order in which the target conversation record obtained in step 101 and the target work flow text obtained in step 104 are arranged. Specifically, the second instruction template may be expressed as follows: Assuming you are a customer service representative, please complete the conversation after {target conversation record} in the following conversation. Follow the workflow {target work flow text} and only provide the customer service representative's reply text. Do not repeat questions asked by the customer service representative in previous conversations. Please use polite language and ask or answer questions as briefly as possible. Do not ask more than two questions at a time. Determine whether the service process is complete. If so, please reply "Service Completed."

[0119] Figure 5 A schematic diagram of generating a second instruction text is provided in an embodiment of the present application. Figure 5 As shown, the generation process of the second instruction text is specifically introduced.

[0120] Figure 5 The generation process of the second instruction text described in can be summarized as follows: the target conversation record and the target work flow text are respectively used as input items of the second instruction template; according to the format specification requirements of the second instruction template, the target conversation record and the target work flow text are filled into the corresponding positions of the second instruction template in sequence to generate the second instruction text.

[0121] Specifically, Figure 5 The content of the target conversation record ("First Round #Customer Service: Hello, how can I help you?"; User: My car had an accident.\nSecond Round #Customer Service: OK, are there any injuries? Is the vehicle drivable?; User: No injuries, it's drivable. It was a single-vehicle accident.") is filled into the {target conversation record} position in the second instruction template.

[0122] Fill the target operation process text "Step 1, ask the user about the accident, whether there are any casualties, and whether the vehicle can be started normally\nStep 2, collect the user's license plate number\nStep 3, collect the user's accident location\nStep 4, reassure the user and remind them that the report is successful\nStep 5, inquire about the insurance policy\nStep 6, confirm the user's identity information\nStep 7, provide the query results\nStep 8, remind them that the query is successful\n" into the {target operation process text} position of the second instruction template to generate the second instruction text.

[0123] The specific form of the second instruction text is as follows: assuming that you are a customer service, please complete the following dialogue after {first round of customer service: Hello, what can I do for you?; user: I had an accident\nsecond round of customer service: OK, are there any casualties? Can the vehicle run normally?; user: No casualties, and the vehicle can run normally. It is a single-vehicle accident\n} according to the workflow {first step, inquire about the accident situation of the user, whether there are casualties and whether the vehicle can start normally\nsecond step, collect the license plate number of the user\nthird step, collect the location of the user\nfourth step, comfort the user and remind the user of the successful reporting\nfifth step, inquire about the insurance situation\nsixth step, confirm the user's identity information\nseventh step, give the query result\neighth step, remind the user of the successful query\n}, only the reply text of the customer service is given, and the questions of the customer service in the historical dialogue are not repeated, polite language is used, the questions or answers are as brief as possible, more than two questions are not thrown at one time, whether the service process is completed is judged, and if completed, the reply "service completed" is given.

[0124] As can be known from the foregoing, the large language model is a cognitive intelligent large model with cross-domain knowledge and language understanding capability. The large language model executes tasks based on the understanding of instruction texts. Converting information data into the form of instruction texts that can be understood by the large language model can help the large language model better understand the user's intention and output more accurate and meaningful text content. In this step, the target dialogue record and the target job flow text are converted into the second instruction text according to the format specification of the second instruction template. The second instruction text as the input of the large language model can help the large language model better understand the relationship between the target dialogue record and the target job flow text, and is conducive to the large language model to generate more accurate reply texts.

[0125] In step 106, the second instruction text is input into the large language model, and a reply text corresponding to the target dialogue record is generated through analysis of the second instruction text by the large language model.

[0126] Specifically, the second instruction text obtained in step 105 is input into the large language model, and a reply text corresponding to the target dialogue record is generated through analysis of the second instruction text by the large language model.

[0127] Figure 6 An example of generating a reply text provided by an embodiment of the present application is shown in FIG. 6. Figure 6 As shown in FIG. 6, after the second instruction text generated in step 105 is input into the large language model, the large language model outputs the reply text "OK, please provide the insurance number?".

[0128] To sum up, in the embodiment of the present application, first, the target dialogue record and the job flow database are obtained; second, the plurality of job flow names in the target dialogue record and the job flow database are spliced according to the format specification of the first instruction template to generate a first instruction text; then the first instruction text is input into the large language model, and the target job flow text is obtained through the analysis of the first instruction text by the large language model; third, the target dialogue record and the target job flow text are spliced according to the format specification of the second instruction template to generate a second instruction text; finally, the second instruction text is input into the large language model, and the reply text corresponding to the target dialogue record is generated through the analysis of the second instruction text by the large language model.

[0129] Since the large language model used in the present application has the ability to understand the instruction text, it can understand the relationship between the target dialogue record and the plurality of job flow names in the first instruction text, efficiently and accurately generate the target job flow text; it can understand the relationship between the target dialogue record and the target job flow text in the second instruction text, and efficiently and accurately generate the reply text corresponding to the target dialogue record. Also, the job flow content in the job flow database indicates a plurality of steps to solve the problem, and the service flow is clear. Therefore, compared with the traditional method, the reply text generation method used in the present application has the advantages of low development difficulty, good reuse effect in multiple scenarios, and the obtained reply text can solve the user's doubts; reduces the development difficulty of the online customer service robot, improves the reusability of the online customer service robot in multiple scenarios, and improves the user's satisfaction.

[0130] In an optional implementation, the construction process of the job flow database includes: obtaining a target text; obtaining a database file; processing the target text according to the format specification of the job flow to generate a plurality of job flows; filling the job flow name of the generated job flow into the job flow name field, and filling the job flow content corresponding to the job flow name into the job flow content field of the same row.

[0131] The target text is a pure text file, which includes a plurality of steps to answer the question. For example, the target text can include a plurality of steps to handle the car insurance reporting problem. The expression form of the car insurance reporting in the target text is: asking the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally; collecting the user's license plate number; collecting the user's accident location; calming the user and reminding the reporting success.

[0132] It should be noted that the target text in the present application file is pre-set by the staff according to historical work experience. The present application file does not limit the specific generation method of the target text, and the specific implementation method of obtaining the target text after generating the target text.

[0133] The format specification of the operation process is that each step starts with "Xth step," and ends with "\n". Therefore, assuming that the target text includes the processing steps of the car insurance claim question described above, the car insurance claim operation process generated according to the format specification of the operation process is "first step, ask the user about the accident situation, whether there is personnel casualty, and whether the vehicle can start normally\nsecond step, collect the user's license plate number\nthird step, collect the user's accident location\nfourth step, comfort the user and remind the claim success\n". If the target text includes the processing steps of multiple questions, the processing steps corresponding to each question are operated according to the above operation, and finally multiple operation processes are obtained.

[0134] Table 3 is the format of a database file. As can be seen from Table 3, the database file at least includes three fields of serial number field, operation process name field and operation process content field, which specifies the storage form of the target file in the database file. It should be noted that Table 3 exemplarily shows the format of the database file, and the specific operation process name and operation process content are not included in Table 3.

[0135] Table 3 is the format of a database file

[0136]

[0137]

[0138] Next, taking M operation process in multiple operation processes as an example, the specific process of filling the operation process name of the generated operation process into the operation process name field of the database file and filling the operation process content corresponding to the operation process name into the operation process content field of the same row is introduced.

[0139] First, the serial number N of the M operation process is determined, the operation process name and the operation process content of the M operation process are obtained, and then the operation process name of the M operation process is filled into the corresponding position of the operation process name field in the database file in the same row as the serial number N. The operation process content of the M operation process is filled into the corresponding position of the operation process content field in the database file in the same row as the serial number N. Each operation process is operated according to the operation process of the M operation process, and finally the operation process database can be generated.

[0140] Figure 7 A flowchart of an online customer service robot running process is provided for the embodiments of the present application. It should be noted that the online customer service robot in the above Figure 7 The online customer service robot in the above

[0141] Step 701, a user accesses an online customer service robot.

[0142] Step 702, the online customer service robot responds to the input information of the customer service and gives a welcome phrase "I am an online customer service robot. What can I help you with?" It should be noted that in this step, the online customer service robot sets the number of job processes to 0; and obtains the target dialogue record.

[0143] Step 703, after the user inputs the problem to be solved, the target dialogue record is updated according to the description of step 101 in the embodiments of the present application.

[0144] Step 704, the reply text is obtained by using the reply text generation method of the present application. The reply text is returned to the user, and the target dialogue record is updated.

[0145] Step 705, the online customer service robot determines whether any of the following conditions exists: "customer reply service is completed", "the number of job processes is 0 after multiple iterations", or "the user does not input any problem within a specified time".

[0146] Step 706, if the online customer service robot determines that any of the following conditions exists: "customer reply service is completed", "the number of job processes is 0 after multiple iterations", or "the user does not input any problem within a specified time", the reply text "service is completed" is output; otherwise, the process returns to step 703 to continue to provide service for the user.

[0147] Based on the method provided in the foregoing embodiments, the present application also provides a reply text generation device. The specific implementation of the device is described below in combination with embodiments and drawings.

[0148] Figure 8 A structural diagram of a reply text generation device provided in an embodiment of the present application is shown. In combination with the structural diagram, the reply text generation device 800 provided in the present application includes: Figure 8

[0149] A dialogue record obtaining module 801 for obtaining a target dialogue record;

[0150] A job process database obtaining module 802 for obtaining a job process database; the job process database includes a plurality of job processes; each job process has a job process name and a job process content; the job process content is a plurality of steps for solving problems in different business scenarios;

[0151] A first instruction text generation device 803 for splicing the target dialogue record and the plurality of job process names in the job process database according to a format specification of a first instruction template to generate a first instruction text; the format specification of the first instruction template includes an arrangement order of the target dialogue record and the plurality of job process names;

[0152] ​The target operation process acquisition apparatus 804 is configured to input the first instruction text into a large language model, and obtain a target operation process text by analyzing the first instruction text through the large language model; the target operation process text comprises operation process contents of a plurality of associated operation processes; the associated operation processes are operation processes related to the target dialogue record; and a total number of the associated operation processes is less than or equal to a total number of the operation processes in the operation process database.

[0153] The second instruction text generation apparatus 805 is configured to splice the target dialogue record and the target operation process text according to a format specification of a second instruction template, and generate a second instruction text; the format specification of the second instruction template comprises an arrangement order of the dialogue record and the operation process text.

[0154] The reply text output apparatus 806 is configured to input the second instruction text into the large language model, and generate a reply text corresponding to the target dialogue record by analyzing the second instruction text through the large language model.

[0155] In an optional implementation, the target operation process acquisition apparatus 804 comprises:

[0156] An associated process content acquisition unit is configured to obtain operation process contents of a plurality of associated operation processes by analyzing the first instruction text through the large language model.

[0157] A target operation process acquisition unit is configured to process the operation process contents of the plurality of associated operation processes by using the large language model, and obtain a target operation process text.

[0158] In an optional implementation, the associated process content acquisition unit comprises:

[0159] An associated process name acquisition subunit is configured to filter, from the operation process database, operation process names of a plurality of associated operation processes by analyzing the target dialogue record and the plurality of operation process names in the first instruction text through the large language model.

[0160] An associated process content acquisition subunit is configured to obtain operation process contents of the plurality of associated operation processes from the operation process database based on the operation process names of the plurality of associated operation processes.

[0161] In an optional implementation, the target operation process acquisition unit comprises:

[0162] A to-be-processed text generation subunit is configured to splice the operation process contents of the plurality of associated operation processes, and generate a to-be-processed operation process text.

[0163] The target operation process acquisition sub-unit is configured to use the large language model to merge multiple operation process contents that are the same or similar in the to-be-processed operation process text and delete multiple operation process contents that conflict with each other in the to-be-processed operation process text, and obtain the target operation process text.

[0164] In an optional implementation, the reply text generation apparatus 800 further includes:

[0165] The text acquisition unit is configured to acquire a target text; the target text includes multiple questions and multiple steps for answering each question;

[0166] The database acquisition unit is configured to acquire a database file; the database file includes a name field and a content field;

[0167] The operation process generation unit is configured to process the target text according to a format specification of an operation process, and generate multiple operation processes; the database filling unit is configured to write an operation process name of the generated operation process under the operation process name field in the database file, and write operation process content corresponding to the operation process name under the operation process content field in the same row.

[0168] Based on the reply text generation method and apparatus provided in the foregoing embodiments, the present application further provides a computer-readable storage medium having a computer program stored thereon, and the program is executed by a processor to implement the steps of the reply text generation method mentioned above.

[0169] Based on the reply text generation method and apparatus provided in the foregoing embodiments, the present application further provides an electronic device, which includes:

[0170] A memory having a computer program stored thereon;

[0171] A processor configured to execute the computer program in the memory to implement the steps of the reply text generation method provided in the foregoing embodiments.

[0172] It should be noted that each of the embodiments described in the specification of the present application adopts a progressive mode, and the same or similar parts between the embodiments can be mutually referred to. Each of the embodiments focuses on the differences from other embodiments. In particular, the device embodiments are described more simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments. The device embodiments described above are merely illustrative, and the units described as separate components can or can not be physically separated, and the components indicated as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. Those skilled in the art can understand and implement it without creative labor.

[0173] The above describes only one specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A reply text generation method, characterized in that: The method comprises: Get the target conversation record; Obtaining a work flow database; the work flow database includes multiple work flows; each work flow has a work flow name and work flow content; the work flow content is multiple steps to solve problems in different business scenarios; splicing the target conversation record and the multiple work flow names in the work flow database according to the format specification of a first instruction template to generate a first instruction text; the format specification of the first instruction template includes the arrangement order of the target conversation record and the multiple work flow names; Inputting the first instruction text into a large language model, and obtaining a target workflow text through analysis of the first instruction text by the large language model; the target workflow text includes workflow contents of a plurality of associated workflows; the associated workflows are workflows related to the target conversation record; and the total number of associated workflows is less than or equal to the total number of workflows in the workflow database; splicing the target conversation record and the target work flow text according to the format specification of a second instruction template to generate a second instruction text; the format specification of the second instruction template includes the arrangement order of the conversation record and the work flow text; The second instruction text is input into the large language model, and the large language model analyzes the second instruction text to generate a reply text corresponding to the target conversation record.

2. The method according to claim 1, characterized in that Inputting the first instruction text into a large language model and analyzing the first instruction text by the large language model to obtain a target operation flow text includes: Analyzing the first instruction text by the large language model to obtain the work flow contents of multiple related work flows; The large language model is used to process the work flow contents of the multiple related work flows to obtain a target work flow text.

3. The method according to claim 2, characterized in that The analyzing the first instruction text by the large language model to obtain the work flow contents of multiple related work flows includes: Analyzing the target conversation record and the multiple work flow names in the first instruction text by the large language model, and filtering out the work flow names of multiple related work flows from the work flow database; Based on the work flow names of the multiple related work flows, the work flow contents of the multiple related work flows are acquired from the work flow database.

4. The method according to claim 2, characterized in that The step of processing the work flow contents of the plurality of related work flows using the large language model to obtain a target work flow text includes: splicing the work flow contents of the multiple related work flows to generate a work flow text to be processed; The target operation flow text is obtained by merging the same or similar operation flow contents included in the operation flow text to be processed by using a large language model and deleting the conflicting operation flow contents included in the operation flow text to be processed.

5. The method according to any one of claims 1 to 4, characterized in that The process of constructing the operation process database includes: Obtaining a target text; the target text includes multiple questions and multiple steps to answer each question; Obtaining a database file; the database file includes a job flow name field and a job flow content field; Process the target text according to the format specification of the operation flow to generate multiple operation flows; The generated work flow name is filled into the work flow name field in the database file, and the work flow content corresponding to the work flow name is filled into the work flow content field in the same row.

6. A reply text generating device, characterized in that: The device comprises: A conversation record acquisition module is used to obtain target conversation records; A workflow library acquisition module is configured to acquire a workflow database, wherein the workflow database includes a plurality of workflows, each of which has a workflow name and workflow content, and the workflow content includes a plurality of steps for solving problems in different business scenarios. A first instruction text generating device is configured to concatenate the target conversation record and the multiple work flow names in the work flow database according to a format specification of a first instruction template to generate a first instruction text; the format specification of the first instruction template includes an arrangement order of the target conversation record and the multiple work flow names; a target workflow acquisition device, configured to input the first instruction text into a large language model, and obtain a target workflow text by analyzing the first instruction text with the large language model; the target workflow text includes workflow contents of a plurality of associated workflows; the associated workflows are workflows related to the target conversation record; the total number of associated workflows is less than or equal to the total number of workflows in the workflow database; A second instruction text generating device, configured to splice the target conversation record and the target work flow text according to the format specification of a second instruction template to generate a second instruction text; the format specification of the second instruction template includes the arrangement order of the conversation record and the work flow text; The reply text generating device is used to input the second instruction text into the large language model, and generate a reply text corresponding to the target conversation record by analyzing the second instruction text through the large language model.

7. The device according to claim 6, characterized in that The target operation process acquisition device includes: an associated process content acquisition unit, configured to acquire the work process contents of a plurality of associated work processes by analyzing the first instruction text using the large language model; The target operation process acquisition unit is used to process the operation process contents of the multiple related operation processes using the large language model to obtain the target operation process text.

8. The device according to claim 7, characterized in that The associated process content acquisition unit includes: an associated process name acquisition subunit, configured to analyze the target conversation record and the multiple process names in the first instruction text using the large language model, and filter out multiple process names of associated processes from the process database; The associated process content acquisition subunit is configured to acquire the process contents of the multiple associated process flows from the process database based on the process flow names of the multiple associated process flows.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Task-based dialogue method and system based on end-to-end text generation

    CN113326367A

  • Robot process automation method and device, electronic equipment and storage medium

    CN116562807A