Replay processing method and device based on large language model, equipment and medium
Through the reply processing method based on the large language model, traditional intelligent customer service has solved the problems of high processing costs, poor flexibility and low accuracy in reply processing, and achieved more flexible and accurate reply processing, reducing costs and adapting to complex scenarios need.
Patent Information
- Application Number
- CN202411353937.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-31
AI Technical Summary
The traditional intelligent customer service implementation method has problems such as high processing costs, poor flexibility and low response accuracy when processing reply.
The reply processing method based on the large language model is adopted, and the question text input by receiving the customer is analyzed and skill matching processed, the preset skill library is called, the input sequence is constructed, and the answer text is generated using the large language model for reply processing.
It improves the flexibility and accuracy of reply processing, reduces processing costs, enhances the ability of large language models to handle complex reasoning problems, adapts to various real scenarios, and provides more accurate and efficient reply services.
Smart Images

Figure CN119226475A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence development technology and financial technology, and in particular to a reply processing method, apparatus, computer equipment and storage medium based on a large language model. Background Art
[0002] In today's digital age, with the rapid development of artificial intelligence technology, intelligent customer service systems have become an important tool for enterprises to improve customer service quality and reduce operating costs. Intelligent customer service can automatically analyze user input and provide instant feedback and solutions through natural language processing technology (NLP) and machine learning algorithms, greatly improving user experience and satisfaction. However, when dealing with complex reasoning questions raised by users, traditional intelligent customer service implementation methods (i.e. traditional ICL methods, Integrated Conversational Logic) face many challenges and limitations.
[0003] Traditional ICL methods mainly rely on preset rule bases and a large number of predefined dialogue scenario templates to guide the dialogue process. In order to cover as many user needs and question types as possible, developers need to consider and encode various possible situations in advance, and write detailed examples and dialogue scripts as trigger conditions or prompts before the user query to guide the system to make the correct response. Although this method improves the system's responsiveness to a certain extent, its inherent defects are also becoming increasingly prominent:
[0004] High maintenance costs: With the continuous expansion of business scenarios and the increasing diversification of user needs, it is necessary to continuously update and maintain the huge rule base and dialogue templates, which is not only time-consuming and labor-intensive, but also increases the complexity and error rate of the system.
[0005] Poor flexibility: When faced with new problems or variations that have not been defined in the rule base, traditional ICL methods are often unable to respond effectively, resulting in a decline in user experience and even failure to meet basic customer needs.
[0006] Low accuracy: Traditional ICL methods have limitations in providing personalized and precise services, and it is difficult to meet the growing expectations and needs of users.
[0007] Therefore, existing intelligent customer service implementation methods have technical problems such as high processing cost, poor flexibility and low response accuracy when processing responses. Summary of the invention
[0008] The purpose of the embodiments of the present application is to propose a reply processing method, apparatus, computer equipment and storage medium based on a large language model to solve the technical problems of high processing cost, poor flexibility and low reply accuracy in existing intelligent customer service implementation methods when performing reply processing.
[0009] In order to solve the above technical problems, the embodiment of the present application provides a reply processing method based on a large language model, which adopts the following technical solution:
[0010] Receive the question text entered by the customer;
[0011] Parsing the question text to obtain corresponding key information points;
[0012] Performing skill matching processing on the key information points to obtain corresponding skill matching results;
[0013] Based on the skill matching result, calling the corresponding target skill from a preset skill library;
[0014] Constructing a corresponding input sequence based on the target skill and the question text;
[0015] Processing the input sequence based on a preset target large language model to obtain a corresponding answer text;
[0016] A reply is performed to the customer based on the answer text.
[0017] Furthermore, the step of parsing the question text to obtain corresponding key information points specifically includes:
[0018] Performing word segmentation processing on the question text to obtain corresponding target vocabulary;
[0019] Performing part-of-speech tagging on the target vocabulary to obtain corresponding part-of-speech tagging results;
[0020] Performing named entity recognition processing on the question text to obtain a corresponding entity recognition result;
[0021] Extracting relevant information corresponding to the target business from the question text based on the part-of-speech tagging result and the entity recognition result;
[0022] The relevant information is used as the key information point.
[0023] Furthermore, the step of calling out the corresponding target skill from a preset skill library based on the skill matching result specifically includes:
[0024] Building an ordered skill calling sequence based on the skill matching results;
[0025] calling the skill library;
[0026] According to the skill calling sequence, the corresponding designated skills are called out in sequence from the skill library;
[0027] The designated skill is used as the target skill.
[0028] Furthermore, the step of constructing a corresponding input sequence based on the target skill and the question text specifically includes:
[0029] Obtain the skill name of the target skill;
[0030] Get the preset description instruction;
[0031] The question text, the skill name and the description instruction are spliced to obtain a corresponding spliced sequence;
[0032] The spliced sequence is used as the input sequence.
[0033] Furthermore, the step of splicing the question text, the skill name and the description instruction to obtain a corresponding splicing sequence specifically includes:
[0034] Calling a preset string template; wherein the string template includes a command placeholder, a skill placeholder, and a question placeholder;
[0035] The instruction placeholder is replaced by the description instruction, the skill placeholder is replaced by the skill name, and the question placeholder is replaced by the question text to obtain a replaced string template;
[0036] The replaced character string template is used as the concatenated sequence.
[0037] Furthermore, the step of replying to the customer based on the answer text specifically includes:
[0038] Get the preset formatting strategy and validation rules;
[0039] Formatting the answer text based on the formatting strategy to obtain a corresponding target answer text;
[0040] Verifying the target answer text based on the verification rules;
[0041] If the target answer text passes the verification, obtaining the preset designated communication method;
[0042] Based on the designated communication method, the target answer text is returned to the client.
[0043] Furthermore, before the step of calling the corresponding target skill from a preset skill library based on the skill matching result, the method further includes:
[0044] Get multiple predefined skills;
[0045] Obtaining skill descriptions corresponding to each of the skills;
[0046] Call the preset initial database;
[0047] The skill description of each skill is stored in the initial database to obtain the skill library.
[0048] In order to solve the above technical problems, the embodiment of the present application further provides a reply processing device based on a large language model, which adopts the following technical solution:
[0049] A receiving module is used to receive the question text input by the customer;
[0050] A parsing module, used to parse the question text to obtain corresponding key information points;
[0051] A matching module, used to perform skill matching processing on the key information points to obtain corresponding skill matching results;
[0052] A first calling module, configured to call out a corresponding target skill from a preset skill library based on the skill matching result;
[0053] A construction module, used for constructing a corresponding input sequence based on the target skill and the question text;
[0054] A processing module, used for processing the input sequence based on a preset target large language model to obtain a corresponding answer text;
[0055] A reply module is used to reply to the customer based on the answer text.
[0056] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0057] Receive the question text entered by the customer;
[0058] Parsing the question text to obtain corresponding key information points;
[0059] Performing skill matching processing on the key information points to obtain corresponding skill matching results;
[0060] Based on the skill matching result, calling the corresponding target skill from a preset skill library;
[0061] Constructing a corresponding input sequence based on the target skill and the question text;
[0062] Processing the input sequence based on a preset target large language model to obtain a corresponding answer text;
[0063] A reply is performed to the customer based on the answer text.
[0064] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0065] Receive the question text entered by the customer;
[0066] Parsing the question text to obtain corresponding key information points;
[0067] Performing skill matching processing on the key information points to obtain corresponding skill matching results;
[0068] Based on the skill matching result, calling the corresponding target skill from a preset skill library;
[0069] Constructing a corresponding input sequence based on the target skill and the question text;
[0070] Processing the input sequence based on a preset target large language model to obtain a corresponding answer text;
[0071] A reply is performed to the customer based on the answer text.
[0072] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0073] The present application first receives the question text input by the customer, and parses the question text to obtain the corresponding key information points; then performs skill matching processing on the key information points to obtain the corresponding skill matching results; then based on the skill matching results, the corresponding target skills are called out from the preset skill library; subsequently, a corresponding input sequence is constructed based on the target skills and the question text; the input sequence is further processed based on the preset target large language model to obtain the corresponding answer text; and finally, the customer is replied based on the answer text. The present application parses the question text received from the customer to obtain the key information points, and performs skill matching processing on the key information points to obtain the skill matching results, then based on the use of the skill library, the target skills corresponding to the skill matching results are called out, subsequently a corresponding input sequence is constructed based on the target skills and the question text, and the input sequence is processed based on the preset target large language model to obtain the corresponding answer text. This application is based on the use of skill libraries to teach the model different basic task skills, providing the large language model with the ability to handle complex reasoning problems, and this improvement does not rely on the availability of a large number of examples, thereby enhancing the ability of the large language model to handle new tasks, effectively increasing the robustness of example-based learning, enabling the large language model to better adapt to various real-world scenarios, improving the flexibility of reply processing, and effectively reducing the processing cost of reply processing. In addition, this application achieves the goal of giving a specific calibration color to the large language model by constructing a corresponding input sequence based on the target skills called from the skill library and the question text. This role-playing method helps to stimulate the potential performance of the model and improves its reasoning ability in the tasks that need to be processed, so that the large language model can understand the problem more comprehensively, and then can provide more accurate and efficient reply services, effectively improving the accuracy of reply processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0075] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0076] Figure 2 A flowchart of an embodiment of a reply processing method based on a large language model according to the present application;
[0077] Figure 3 is a structural diagram of an embodiment of a reply processing device based on a large language model according to the present application;
[0078] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0080] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0081] 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 accompanying drawings.
[0082] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0083] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0084] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0085] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0086] It should be noted that the reply processing method based on the large language model provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the reply processing device based on the large language model is generally arranged in the server / terminal device.
[0087] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0088] Continue to refer Figure 2 , showing a flowchart of an embodiment of a reply processing method based on a large language model according to the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The reply processing method based on a large language model provided in the embodiment of the present application can be applied to any scenario where reply processing is required, and the reply processing method based on a large language model can be applied to products in these scenarios, for example, reply processing in the financial insurance field. The reply processing method based on a large language model comprises the following steps:
[0089] Step S201, receiving a question text input by a customer.
[0090] In this embodiment, the reply processing method based on the large language model is executed on the electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain the question text through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future. The executor of the present application may be a reply processing system, or simply referred to as the system. The above-mentioned question texts are various complex reasoning questions raised by customers in the process of interacting with the reply processing system. These problems may be encountered by users in different situations, and may involve different fields. The reasoning method of each problem may be different, such as interest calculation and premium calculation in different situations, or business process query.
[0091] Step S202: parse the question text to obtain corresponding key information points.
[0092] In the present embodiment, the above-mentioned specific implementation process of parsing the question text to obtain the corresponding key information points will be further described in detail in the subsequent specific embodiments of the present application, and will not be elaborated in detail here.
[0093] Step S203, performing skill matching processing on the key information points to obtain corresponding skill matching results.
[0094] In this embodiment, the corresponding skill matching results can be obtained by performing skill matching processing on the above key information points. For example, if the extracted key information points include insurance type (life insurance), insured amount (1 million), term (20 years), etc., then by performing skill matching on the key information points, the insurance type name "life insurance" is first identified, so it is determined that the "insurance type judgment" skill needs to be called, and then the insured amount (1 million) and term (20 years) are identified, and it is determined that the "premium calculation" skill needs to be called, thereby obtaining the corresponding skill matching results.
[0095] Step S204: based on the skill matching result, call out the corresponding target skill from a preset skill library.
[0096] In this embodiment, the specific implementation process of calling out the corresponding target skill from the preset skill library based on the skill matching result will be described in further detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0097] Step S205: construct a corresponding input sequence based on the target skill and the question text.
[0098] In this embodiment, the specific implementation process of constructing the corresponding input sequence based on the target skill and the question text will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0099] Step S206: Process the input sequence based on a preset target large language model to obtain a corresponding answer text.
[0100] In this embodiment, the target large language model can be any large language model (LLM). By inputting the input sequence into the target large language model, the target large language model will internally perform reasoning on the input sequence and generate a corresponding answer text. The answer text is the predicted answer generated by the target large language model based on the input sequence.
[0101] Step S207: reply to the customer based on the answer text.
[0102] In this embodiment, the specific implementation process of replying to the customer based on the answer text will be described in further detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0103] This application first receives the question text input by the customer, parses and processes the question text to obtain the corresponding key information points; then performs skill matching processing on the key information points to obtain the corresponding skill matching results; then, based on the skill matching results, calls the corresponding target skills from the preset skill library; subsequently, constructs the corresponding input sequence based on the target skills and the question text; further processes the input sequence based on the preset target large language model to obtain the corresponding answer text; finally, performs a reply process on the customer based on the answer text. This application obtains key information points by parsing and processing the received question text input by the customer, performs skill matching processing on the key information points to obtain skill matching results, then calls the target skills corresponding to the skill matching results based on the use of the skill library, subsequently constructs the corresponding input sequence based on the target skills and the question text, and processes the input sequence based on the preset target large language model to obtain the corresponding answer text. Based on the use of the skill library, this application can teach the model different basic task skills, provide the large language model with the ability to handle complex reasoning problems, and this improvement does not depend on the availability of a large number of examples, thereby enhancing the ability of the large language model to handle new tasks, effectively increasing the robustness of example-based learning, enabling the large language model to better adapt to various real-world scenarios, improving the flexibility of the reply process, and effectively reducing the processing cost of the reply process. Moreover, this application constructs the corresponding input sequence based on the target skills called from the skill library and the question text, thereby endowing the large language model with a specific color correction. This role-playing method helps to stimulate the potential performance of the model and improves its reasoning ability in the tasks that need to be processed, enabling the large language model to more comprehensively understand the problem, and then being able to provide more accurate and efficient reply services, effectively improving the accuracy of the reply process.
[0104] In some alternative implementation manners, step S202 includes the following steps:
[0105] Perform word segmentation processing on the question text to obtain the corresponding target vocabulary.
[0106] In this embodiment, the above question text can be segmented by using a general NLP library to decompose the sentence into vocabulary. Among them, any one of the general word segmentation tools can be used for the above NLP library. In addition, the stop words in the question text can also be removed to remove the common but meaningless words in the question text, such as "de", "le", "wo", etc.
[0107] Perform part-of-speech tagging processing on the target vocabulary to obtain the corresponding part-of-speech tagging results.
[0108] In this embodiment, the above-mentioned part-of-speech tagging process refers to tagging the part of speech for each word after word segmentation, such as noun, verb, adjective, etc., which helps to understand the role of the word in the sentence.
[0109] Perform named entity recognition processing on the question text to obtain a corresponding entity recognition result.
[0110] In this embodiment, the named entity recognition process refers to identifying named entities in the question text, such as names of people, places, organizations, insurance types, numbers (insurance amount, term), etc. Named entity recognition can be performed by using NER, which is a technology in NLP that can identify entities with specific meanings in text.
[0111] Based on the part-of-speech tagging result and the entity recognition result, relevant information corresponding to the target business is extracted from the question text.
[0112] In this embodiment, the target business may specifically be an insurance purchase business. According to the obtained part-of-speech tagging results and entity recognition results, relevant information corresponding to the insurance purchase may be extracted, such as the type of insurance (life insurance), the insured amount (1 million), the term (20 years), etc. This information may be saved in a structured form for subsequent processing.
[0113] The relevant information is used as the key information point.
[0114] The present application obtains corresponding vocabulary by performing word segmentation processing on the question text; then performs part-of-speech tagging processing on the vocabulary to obtain corresponding part-of-speech tagging results; then performs named entity recognition processing on the question text to obtain corresponding entity recognition results; subsequently, based on the part-of-speech tagging results and the entity recognition results, relevant information corresponding to the target business is extracted from the question text, and the relevant information is used as the key information points. The present application obtains vocabulary by performing word segmentation processing on the question text, and performs named entity recognition processing on the question text to obtain entity recognition results, and performs part-of-speech tagging processing on the vocabulary to obtain part-of-speech tagging results, and then based on the obtained part-of-speech tagging results and entity recognition results, it is possible to quickly and accurately extract relevant information corresponding to the target business from the question text to obtain the required key information points, effectively ensuring the data accuracy of the obtained key information points.
[0115] In some optional implementations of this embodiment, step S204 includes the following steps:
[0116] An ordered skill calling sequence is constructed based on the skill matching results.
[0117] In this embodiment, the corresponding skill matching results can be obtained by performing skill matching processing on the above-mentioned key information points, and then an ordered skill calling sequence can be constructed based on the skill matching results. Exemplarily, if the extracted key information points include insurance type (life insurance), insured amount (1 million), term (20 years), etc. Then, by performing skill matching on the key information points, the insurance type name "life insurance" is first identified, so it is determined that the "insurance type judgment" skill needs to be called, and then the insured amount (1 million) and term (20 years) are identified, and it is determined that the "premium calculation" skill needs to be called, thereby obtaining the corresponding skill matching results. Subsequently, according to the above-mentioned skill matching results, the corresponding skill calling sequence is constructed in accordance with the order of skill matching: "[insurance type judgment]->[premium calculation]".
[0118] The skill library is called.
[0119] In this embodiment, a skill library and a text input structure for role playing are pre-built. The skills that need to be learned by the large language model and the corresponding role information matching the skills are edited into text as the skill library that the large language model needs to learn. The specific construction process of the above skill library will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0120] Exemplarily, the skills stored in the skill library may include at least:
[0121] Skill <Health Judgment>: You are a doctor who can make a basic judgment on the patient's health status based on the age, height and weight information provided by the patient, and give a number from 0 to 1 to indicate the health level. For example: age 21, height 170cm, weight 58kg. The patient's health level is 0.9.
[0122] Skill<Insurance type judgment>: You are an insurance salesperson who can judge the insurance type based on the customer's description. Currently, the insurance types that can be selected are: 1. Life insurance 2. Medical insurance.
[0123] Skill <Premium Calculation>: You are a math teacher who can calculate the required premium based on the customer's health level, selected insurance type, insured amount and insurance period. For example: The customer's health level is 0.9, the insurance type selected is life insurance, the insured amount is 100,000, and the insurance period is 20 years. The required premium is equal to: ((1-health level 0.9) x insured amount 100,000) / (insurance period 20 x 2) = 250 yuan.
[0124] In practice, more types of insurance are involved and more variables need to be calculated, so more skills are required, which are not listed here.
[0125] According to the skill calling sequence, corresponding designated skills are called out in sequence from the skill library.
[0126] In this embodiment, the skills matching the skill calling sequence are called out from the skill library in sequence according to the skill calling sequence to obtain the designated skills.
[0127] The designated skill is used as the target skill.
[0128] The present application constructs an orderly skill call sequence based on the skill matching result; then calls the skill library; then, according to the skill call sequence, calls out the corresponding designated skills from the skill library in sequence; and subsequently uses the designated skills as the target skills. The present application constructs an orderly skill call sequence based on the skill matching result; then, according to the skill call sequence, calls out the corresponding designated skills from the skill library in sequence and uses them as the final target skills, thereby improving the calling efficiency of the target skills and ensuring the accuracy of the called target skills.
[0129] In some optional implementations, step S205 includes the following steps:
[0130] Get the skill name of the target skill.
[0131] In this embodiment, the skill name of the target skill can be obtained by extracting the name information of the target skill.
[0132] Gets the description directive for a preset.
[0133] In this embodiment, the description instruction is a pre-built description instruction, which is used to allow the large language model to better use skills to complete the question. Specifically, the content of the description instruction includes: "Instruction: Use the following skills to answer the question in question."
[0134] The question text, the skill name and the description instruction are spliced to obtain a corresponding splicing sequence.
[0135] In this embodiment, the above-mentioned splicing processing of the question text, the skill name and the description instruction to obtain the specific implementation process of the corresponding splicing sequence will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated in detail here.
[0136] The spliced sequence is used as the input sequence.
[0137] The present application obtains the skill name of the target skill, obtains a preset description instruction, and then splices the question text, the skill name, and the description instruction to obtain a corresponding spliced sequence; and then uses the spliced sequence as the input sequence. The present application obtains the skill name of the target skill, obtains a preset description instruction, and then splices the question text, the skill name, and the description instruction to obtain a corresponding spliced sequence, so that an input sequence with a format suitable for large language model processing can be quickly and accurately constructed, ensuring the accuracy and standardization of the input sequence obtained.
[0138] In some optional implementations, the step of splicing the question text, the skill name, and the description instruction to obtain a corresponding splicing sequence includes the following steps:
[0139] Calls a preset string template.
[0140] In this embodiment, the string template includes a command placeholder, a skill placeholder, and a question placeholder. Specifically, the string template may include: "[command placeholder]\n[skill placeholder]\n question:[question placeholder]". Wherein, \n is a line break character.
[0141] The instruction placeholder is replaced using the description instruction, the skill placeholder is replaced using the skill name, and the question placeholder is replaced using the question text to obtain a replaced string template.
[0142] In this embodiment, exemplarily, if the content of the above-mentioned description instruction is: "Instruction: Use the following skills to answer the questions in question." The above-mentioned target skills include insurance type judgment and premium calculation. The above-mentioned question text includes: "I want to buy a life insurance for myself, with a coverage of 1 million and a term of 20 years." Correspondingly, after replacing the instruction placeholder with the description instruction, replacing the skill placeholder with the skill name, and replacing the question placeholder with the question text, the replaced string template obtained includes: "Instruction: Use the following skills to answer the questions in question.\nSkill<Insurance type judgment>\nSkill<Premium calculation>\n question: I want to buy a life insurance for myself, with a coverage of 1 million and a term of 20 years."
[0143] The replaced character string template is used as the concatenated sequence.
[0144] The present application calls a preset string template; wherein the string template includes an instruction placeholder, a skill placeholder and a question placeholder; then the description instruction is used to replace the instruction placeholder, the skill name is used to replace the skill placeholder, and the question text is used to replace the question placeholder to obtain a replaced string template; subsequently, the replaced string template is used as the splicing sequence. The present application utilizes a string template, uses the description instruction to replace the instruction placeholder, uses the skill name to replace the skill placeholder, and uses the question text to replace the question placeholder, so as to quickly and accurately complete the splicing of the question text, the skill name and the description instruction, and obtain a splicing sequence with a format suitable for large language model processing, which effectively ensures the accuracy and standardization of the obtained splicing sequence.
[0145] In some optional implementations of this embodiment, step S207 includes the following steps:
[0146] Get the preset formatting strategy and validation rules.
[0147] In this embodiment, the policy content of the above formatting policy includes text processing, information filtering processing and format optimization processing. Among them, text processing includes basic text processing of the answer, such as removing unnecessary spaces and line breaks, and correcting spelling errors. Information filtering processing includes deleting parts that are not directly related to the question, or summarizing the answer as needed. Format optimization processing includes formatting the answer in a way that is easy for the user to understand, such as using lists, tables or paragraphs to organize information.
[0148] The validation rules include fact checking, logical consistency checking, and information supplementation. Fact checking includes ensuring that the factual information in the answer is accurate, especially for questions that require precise data. Logical consistency checking includes checking whether the logic within the answer is coherent and there are no contradictions. Information supplementation includes adding additional explanations or context as needed if the answer is incomplete or ambiguous.
[0149] The answer text is formatted based on the formatting strategy to obtain a corresponding target answer text.
[0150] In this embodiment, the answer text may be formatted according to the policy content corresponding to the above formatting policy, so as to obtain the corresponding target answer text.
[0151] The target answer text is verified based on the verification rules.
[0152] In this embodiment, the target answer text may be verified according to the rule content of the above-mentioned verification rules.
[0153] If the target answer text passes the verification, the preset designated communication method is obtained.
[0154] In this embodiment, there is no specific limitation on the above-mentioned target communication method, which can be selected according to actual usage requirements, for example, a chat interface, email, text message or other communication methods desired by the customer can be used.
[0155] Based on the designated communication method, the target answer text is returned to the client.
[0156] In this embodiment, the target answer text can be returned to the client by using the above-mentioned designated communication method to complete the reply processing for the question text input by the user.
[0157] The present application obtains a preset formatting strategy and verification rules; then formats the answer text based on the formatting strategy to obtain a corresponding target answer text; then verifies the target answer text based on the verification rules; if the target answer text passes the verification, a preset designated communication method is obtained; and subsequently, based on the designated communication method, the target answer text is returned to the customer. After the present application processes the input sequence based on the target large language model to obtain the corresponding answer text, it will also intelligently format and verify the answer text based on the preset formatting strategy and verification rules to obtain the corresponding target answer text, effectively improving the accuracy and readability of the target answer text, thereby better meeting the needs and expectations of the customer, so that the target answer text is subsequently returned to the customer by using the designated communication method, which is conducive to improving the quality and satisfaction of the reply processing, thereby improving the customer's user experience.
[0158] In some optional implementations of this embodiment, before step S204, the electronic device may further perform the following steps:
[0159] Get multiple predefined skills.
[0160] In this embodiment, multiple corresponding skills may be pre-defined according to actual insurance processing requirements. Specifically, the skills may include: Health judgment: input age, height, weight, and output health level (0-1). Insurance type judgment: input customer description, and output insurance type (such as life insurance, medical insurance). Premium calculation: input health level, insurance type, insured amount, insurance period, and output premium amount.
[0161] Obtain skill descriptions corresponding to each of the skills.
[0162] In this embodiment, after completing the definition of the skill, a detailed text description can be further written for each skill, including input parameters, processing logic and output format. For example, for the skill "Health Judgment", the corresponding skill description includes: Skill <Health Judgment>: You are a doctor who can make a basic judgment on the patient's health status based on the age, height and weight information provided by the patient, and give a number from 0 to 1 to indicate the health level. For example: age 21, height 170cm, weight 58kg. The patient's health level is 0.9. For the skill "Insurance Type Judgment", the corresponding skill description includes: Skill <Insurance Type Judgment>: You are an insurance salesperson who can judge the insurance type based on the customer's relevant description. The insurance types that can be selected are: 1. Life insurance 2. Medical insurance. For the skill "Premium Calculation", the corresponding skill description includes: You are a math teacher who can calculate the required premium based on the customer's health level, the selected insurance type, the insured amount and the insurance period. For example: The customer's health level is 0.9, and the selected insurance type is life insurance, with an insured amount of 100,000 and an insurance period of 20 years. The required premium is equal to: ((1-health level 0.9) x insured amount 100,000) / (insurance period 20x2) = 250 yuan.
[0163] Call the preset initial database.
[0164] In this embodiment, the initial database is a pre-built database for storing skill data.
[0165] The skill description of each skill is stored in the initial database to obtain the skill library.
[0166] In this embodiment, the skill description of each skill can be stored as a record in the above-mentioned initial database to facilitate program reading and calling.
[0167] Furthermore, a role-playing framework corresponding to the skills is built at the same time. First, define the role: define the role class in the code, and each class contains a series of skills related to the role. For example, define the Doctor class to contain health judgment skills, and the InsuranceAgent class to contain insurance type judgment and premium calculation skills. Associate roles with skills: Instantiate skill objects or reference skill functions in the role class to ensure that the role can execute its associated skills.
[0168] In the cultivation of each skill, by giving the large language model a specific role, this role-playing approach helps to stimulate the model's potential performance and improve its reasoning ability in the tasks that need to be handled. By giving the model different roles, it allows the model to understand the problem more comprehensively and respond to various challenges more flexibly, especially when there is limited example data. This approach is particularly effective.
[0169] The present application obtains the skill library by obtaining a plurality of predefined skills; then obtains the skill descriptions corresponding to each of the skills; then calls a preset initial database; and subsequently stores the skill descriptions of each of the skills in the initial database. The present application obtains a plurality of predefined skills, and obtains the skill descriptions corresponding to each of the skills, and then stores the skill descriptions of each of the skills in the initial database, so that the construction of the skill library can be completed quickly and intelligently, thereby improving the construction efficiency and intelligence of the skill library. It is beneficial to be able to teach different basic task skills of a large language model based on the subsequent use of the skill library, providing it with the ability to handle complex reasoning problems, and this improvement does not depend on the availability of a large number of examples, thereby enhancing the ability of a large language model to handle new tasks.
[0170] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.
[0171] In addition, the reply processing method of this application gives the large language model (LLM) more practical characteristics and basic skills, thereby enhancing LLM's in-depth understanding of the task. This improvement provides more accurate and efficient services in the field of intelligent customer service. By giving LLM a simulated actual identity, it can better adapt to different scenarios and situations, including unseen tasks, so as to better meet user needs. This innovative method not only enriches the application field of LLM, but also improves the performance and user experience of the intelligent customer service system. This can not only enhance the targeted services of intelligent customer service, but also improve the user experience, thereby increasing user stickiness.
[0172] In addition, this application not only significantly improves the performance of the model in a variety of applications, but also reduces the reliance on fine-tuning in specific fields. This improvement means that emerging natural language processing challenges can be addressed more efficiently without the need for tedious fine-tuning operations for each new task. This innovative approach not only improves economic efficiency, but also increases the versatility of the model, enabling it to achieve excellent performance in a wide range of application areas.
[0173] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0174] It should be emphasized that in order to further ensure the privacy and security of the above answer text, the above answer text can also be stored in a blockchain node.
[0175] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0176] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0177] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0179] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0180] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a reply processing device based on a large language model, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0181] like Figure 3 As shown, the reply processing device 300 based on the large language model described in this embodiment includes: a receiving module 301, a parsing module 302, a matching module 303, a first calling module 304, a building module 305, a processing module 306 and a reply module 307. Among them:
[0182] Receiving module 301, used to receive the question text input by the customer;
[0183] The parsing module 302 is used to parse the question text to obtain corresponding key information points;
[0184] A matching module 303 is used to perform skill matching processing on the key information points to obtain corresponding skill matching results;
[0185] A first calling module 304 is used to call a corresponding target skill from a preset skill library based on the skill matching result;
[0186] A construction module 305 is used to construct a corresponding input sequence based on the target skill and the question text;
[0187] A processing module 306 is used to process the input sequence based on a preset target large language model to obtain a corresponding answer text;
[0188] The reply module 307 is used to reply to the customer based on the answer text.
[0189] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0190] In some optional implementations of this embodiment, the parsing module 302 includes:
[0191] A word segmentation submodule, used to perform word segmentation processing on the question text to obtain corresponding target vocabulary;
[0192] The tagging submodule is used to perform part-of-speech tagging on the target vocabulary to obtain corresponding part-of-speech tagging results;
[0193] The recognition submodule is used to perform named entity recognition processing on the question text to obtain corresponding entity recognition results;
[0194] An extraction submodule, configured to extract relevant information corresponding to a target business from the question text based on the part-of-speech tagging result and the entity recognition result;
[0195] The first determining submodule is configured to use the relevant information as the key information point.
[0196] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0197] In some optional implementations of this embodiment, the first calling module 304 includes:
[0198] A construction submodule, used to construct an ordered skill calling sequence based on the skill matching result;
[0199] A first calling submodule, used for calling the skill library;
[0200] A second calling submodule is used to call out corresponding designated skills from the skill library in sequence according to the skill calling sequence;
[0201] The second determination submodule is used to take the designated skill as the target skill.
[0202] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0203] In some optional implementations of this embodiment, the construction module 305 includes:
[0204] A first acquisition submodule is used to acquire the skill name of the target skill;
[0205] The second acquisition submodule is used to acquire a preset description instruction;
[0206] A splicing submodule, used for splicing the question text, the skill name and the description instruction to obtain a corresponding splicing sequence;
[0207] The third determining submodule is used to use the spliced sequence as the input sequence.
[0208] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0209] In some optional implementations of this embodiment, the splicing submodule includes:
[0210] A calling unit, used to call a preset string template; wherein the string template includes a command placeholder, a skill placeholder, and a question placeholder;
[0211] A replacement unit, used to replace the instruction placeholder with the description instruction, replace the skill placeholder with the skill name, and replace the question placeholder with the question text to obtain a replaced string template;
[0212] A determination unit is used to use the replaced character string template as the concatenated sequence.
[0213] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0214] In some optional implementations of this embodiment, the reply module 307 includes:
[0215] The third acquisition submodule is used to obtain preset formatting strategies and validation rules;
[0216] A formatting submodule, used for formatting the answer text based on the formatting strategy to obtain a corresponding target answer text;
[0217] A verification submodule, used for verifying the target answer text based on the verification rules;
[0218] A fourth acquisition submodule, configured to acquire a preset designated communication method if the target answer text passes the verification;
[0219] The return submodule is used to return the target answer text to the client based on the specified communication method.
[0220] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0221] In some optional implementations of this embodiment, the reply processing device based on the large language model further includes:
[0222] A first acquisition module, used to acquire a plurality of predefined skills;
[0223] A second acquisition module is used to acquire skill descriptions corresponding to each of the skills;
[0224] The second calling module is used to call a preset initial database;
[0225] A storage module is used to store the skill description of each skill in the initial database to obtain the skill library.
[0226] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the reply processing method based on the large language model in the aforementioned implementation mode, and are not described in detail here.
[0227] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0228] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0229] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0230] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the reply processing method based on a large language model, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0231] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the reply processing method based on the large language model.
[0232] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0233] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the reply processing method based on the large language model as described above.
[0234] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an 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, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0235] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A reply processing method based on a large language model, characterized in that: The steps include: Receive the question text entered by the customer; Parsing the question text to obtain corresponding key information points; Performing skill matching processing on the key information points to obtain corresponding skill matching results; Based on the skill matching result, calling the corresponding target skill from a preset skill library; Constructing a corresponding input sequence based on the target skill and the question text; Processing the input sequence based on a preset target large language model to obtain a corresponding answer text; A reply is performed to the customer based on the answer text.
2. The reply processing method based on a large language model according to claim 1, characterized in that: The step of parsing the question text to obtain corresponding key information points specifically includes: Performing word segmentation processing on the question text to obtain corresponding target vocabulary; Performing part-of-speech tagging on the target vocabulary to obtain corresponding part-of-speech tagging results; Performing named entity recognition processing on the question text to obtain a corresponding entity recognition result; Extracting relevant information corresponding to the target business from the question text based on the part-of-speech tagging result and the entity recognition result; The relevant information is used as the key information point.
3. The reply processing method based on a large language model according to claim 1, characterized in that: The step of calling the corresponding target skill from a preset skill library based on the skill matching result specifically includes: Building an ordered skill calling sequence based on the skill matching results; calling the skill library; According to the skill calling sequence, the corresponding designated skills are called out in sequence from the skill library; The designated skill is used as the target skill.
4. The reply processing method based on a large language model according to claim 1, characterized in that: The step of constructing a corresponding input sequence based on the target skill and the question text specifically includes: Obtain the skill name of the target skill; Get the preset description instruction; The question text, the skill name and the description instruction are spliced to obtain a corresponding spliced sequence; The spliced sequence is used as the input sequence.
5. The reply processing method based on a large language model according to claim 4, characterized in that: The step of splicing the question text, the skill name and the description instruction to obtain a corresponding splicing sequence specifically includes: Calling a preset string template; wherein the string template includes a command placeholder, a skill placeholder, and a question placeholder; The instruction placeholder is replaced by the description instruction, the skill placeholder is replaced by the skill name, and the question placeholder is replaced by the question text to obtain a replaced string template; The replaced character string template is used as the concatenated sequence.
6. The reply processing method based on a large language model according to claim 1, characterized in that: The step of replying to the customer based on the answer text specifically includes: Get the preset formatting strategy and validation rules; Formatting the answer text based on the formatting strategy to obtain a corresponding target answer text; Verifying the target answer text based on the verification rules; If the target answer text passes the verification, obtaining the preset designated communication method; Based on the designated communication method, the target answer text is returned to the client.
7. The reply processing method based on a large language model according to claim 1, characterized in that: Before the step of calling the corresponding target skill from a preset skill library based on the skill matching result, the method further includes: Get multiple predefined skills; Obtaining skill descriptions corresponding to each of the skills; Call the preset initial database; The skill description of each skill is stored in the initial database to obtain the skill library.
8. A reply processing device based on a large language model, characterized in that: include: A receiving module is used to receive the question text input by the customer; A parsing module, used to parse the question text to obtain corresponding key information points; A matching module, used to perform skill matching processing on the key information points to obtain corresponding skill matching results; A first calling module, configured to call out a corresponding target skill from a preset skill library based on the skill matching result; A construction module, used for constructing a corresponding input sequence based on the target skill and the question text; A processing module, used for processing the input sequence based on a preset target large language model to obtain a corresponding answer text; A reply module is used to reply to the customer based on the answer text.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the reply processing method based on a large language model as described in any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the reply processing method based on a large language model as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Response text generation method and device, communication equipment and storage medium
CN116644170A
Emergency information query method and device based on large model thinking chain
CN117076649A
Problem data processing method and device based on artificial intelligence, equipment and medium
CN117312535A
Problem processing method, device and equipment based on artificial intelligence and storage medium
CN118070072A
Prompt word generation method and device, equipment, medium and program product
CN118296119A
