Intelligent customer service question and answer method and system based on large language model
Patent Information
- Application Number
- CN202311622314.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-11-30
AI Technical Summary
Existing AI customer service solutions rely on n-gram matching and predefined script libraries, resulting in poor matching performance, a poor user experience, and cumbersome maintenance.
We employ a large language model for intelligent customer service Q&A. By acquiring the user's input question text, we perform intent classification, use a question vector library to identify the most similar questions, and generate prompt words to guide the large language model in answering. We also combine SFT+Reward training with Chinese corpus data to improve the model's overfitting problem.
It improves the accuracy and efficiency of responses from large language models, achieves simulated customer service effects through multi-turn dialogues, and enhances the user experience.
Smart Images

Figure CN117648420B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information interaction technology, and in particular to an intelligent customer service question-and-answer method and system based on a large language model, a computing device, and a computer-readable storage medium. Background Technology
[0002] With the continuous development of artificial intelligence (AI) technology, an increasing number of customer service tasks are being replaced by AI-powered customer service solutions. These solutions automatically answer user questions, freeing up human customer service staff from dealing with numerous repetitive questions and answers. However, users ask questions in a wide variety of ways and with diverse content, lacking fixed templates. Furthermore, traditional AI solutions, often based on techniques such as n-gram matching and predefined script libraries, are not only cumbersome to maintain but also produce poor matching results, limiting their practicality and leading to a less than ideal user experience. Summary of the Invention
[0003] In view of this, embodiments of this application provide an intelligent customer service question-and-answer method and system based on a large language model, a computing device, and a computer-readable storage medium to address the technical deficiencies existing in the prior art.
[0004] According to a first aspect of the embodiments of this application, an intelligent customer service question-and-answer method based on a large language model is provided, the method comprising:
[0005] Obtain the user's input question text and classify its intent to obtain at least one intent label;
[0006] Based on the at least one intent tag and the question text input by the user, identify the most similar question in the question vector library, and the first intent tag corresponding to the most similar question;
[0007] Generate a first prompt word or a second consecutive prompt word based on the first intent tag and the most similar question;
[0008] Submit the first prompt word or the second consecutive prompt word to the large language model to obtain the response from the large language model.
[0009] According to a second aspect of the embodiments of this application, an intelligent customer service question-and-answer system based on a large language model is provided, comprising:
[0010] The large language model is a large language model trained with SFT+Reward based on product information data and historical customer service dialogue data.
[0011] The classification module is used to obtain the user's input question text and classify the intent to obtain at least one intent label.
[0012] The matching module is used to identify the most similar question in the question vector library based on the at least one intent tag and the question text input by the user, as well as the first intent tag corresponding to the most similar question;
[0013] The generation module is used to generate a first prompt word or a second consecutive prompt word based on the first intent tag and the most similar question;
[0014] The acquisition unit is used to submit the first prompt word or the second consecutive prompt word to the large language model to obtain the answer result of the large language model.
[0015] According to a third aspect of the embodiments of this application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the instructions to implement the steps of the intelligent customer service question-and-answer method based on a large language model described above.
[0016] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer instructions, which, when executed by a processor, implement the steps of the intelligent customer service question-and-answer method based on a large language model described above.
[0017] This application implements an intelligent customer service system based on a large language model, solving the problems of poor matching efficiency and inaccurate answers in existing technologies. Firstly, this application uses pre-processing NLP technology to optimize traditional text matching techniques, specifically using vector processing to match user input text. This addresses the stringent requirements of traditional n-gram techniques. Then, the generated prompts are adjusted based on the matching results, generating different types of prompts to guide the output of the large language model, thereby improving its answer performance. For the establishment of the large language model, it is trained using target game information data and historical customer service dialogues. Various fine-tuning methods and Chinese corpus data are also incorporated to improve the overfitting problem of the large language model, successfully enabling its application in commercial customer service dialogue scenarios. Attached Figure Description
[0018] Figure 1 This is a structural block diagram of the computing device provided in the embodiments of this application;
[0019] Figure 2 This is a flowchart illustrating an intelligent customer service question-and-answer method based on a large language model provided in an embodiment of this application;
[0020] Figure 3 This is a schematic diagram of the structure of an intelligent customer service question-and-answer system based on a large language model, provided in an embodiment of this application. Detailed Implementation
[0021] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0022] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.
[0023] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "in response to a determination".
[0024] This application provides an intelligent customer service question-and-answer method and system based on a large language model, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0025] Figure 1 A structural block diagram of a computing device 100 according to an embodiment of this application is shown. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and a database 150 is used to store data.
[0026] The computing device 100 also includes an access device 140, which enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0027] In one embodiment of this application, the aforementioned components of the computing device 100 and Figure 1 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 1 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.
[0028] The computing device 100 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 100 can also be a mobile or stationary server.
[0029] Among them, processor 120 can execute Figure 2 The steps in an intelligent customer service question-and-answer method based on a large language model are shown, including steps 202 to 208.
[0030] Step 202: Obtain the question text input by the user and classify the intent to obtain at least one intent label.
[0031] Currently, intelligent customer service typically relies on Natural Language Processing (NLP) technology to analyze user questions as a whole. NLP technology uses trained text classification models, such as the BERT model, to identify and classify the intent of the input natural language.
[0032] In this step, the user-input question text is preprocessed and then processed by a text classification model to obtain at least one intent classification result. Furthermore, intent labels are assigned to each of the intent classification results.
[0033] For example, when a user enters "My account has been stolen, I need to recover it and I want to know how to prevent it from being stolen again," the text classification model could assign the intent labels "account recovery" and "security protection advice." When a user enters "I plan to buy game currency through Alipay, but I don't know how?", the assigned intent label could be "payment operation."
[0034] Step 204: Based on at least one intent tag and the question text entered by the user, identify the most similar question in the question vector library, and the first intent tag corresponding to the most similar question.
[0035] Among them, the issue vector library is a vector database obtained from historical customer complaint issue data. That is, after creating a text vector space based on the text of all historical customer complaint issues, it is stored in the vector database. Furthermore, one or more intent tags are assigned to each issue according to the different historical customer complaint issues.
[0036] Specifically, a pre-trained neural network model based on Transformer is used to transform the text of historical customer complaints into a vector space. This model converts the input text into a high-dimensional vector form, commonly known as embeddings. Such vectors can effectively capture the semantic information of the text, where each segment of text can be represented as a point in the vector space. When a segment of text needs to be converted into a vector, it is used as input to the pre-trained Transformer model, and the model's output is extracted as the vector representation, thus generating the representation of the text in the vector space. Each segment of text is represented in the vector space by an n-dimensional array of real numbers, where each element corresponds to the coordinates of the point in a certain dimension of the vector space. In other words, the problem text expressed in natural language is transformed into an n-dimensional array, preferably 1500 ≤ n ≤ 1600.
[0037] In step 204, the corresponding target intent tag is first searched in the question vector library based on the intent tag obtained in step 202, and then the degree of matching between the user's input question and the historical questions in the question vector library under the same intent tag is calculated.
[0038] Specifically, the user-inputted question text is input into the aforementioned neural network model built on Transformer. After being vectorized, it is matched with historical question vectors with the same intent label in the question vector library using cosine similarity. Based on the degree of matching, the most similar question and the first intent label corresponding to the most similar question are determined.
[0039] Step 206: Generate a first prompt word or a second consecutive prompt word based on the first intent tag and the most similar question.
[0040] In the embodiments of this application, the first intent tag has a first attribute. In one feasible implementation, the first attribute can be a timeliness attribute. For example, when a user enters the question "I want to check my game spending records. It seems that the skin A I bought yesterday has not been credited to my account," the final matched first intent tag may be "spending record query," that is, the user's intent is to query recent spending records, such as spending records from the past week. Such a user intent is time-sensitive.
[0041] For example, if a user enters the question "I can't log in to my account, it says my account is frozen?", the first intent tag that might match is "account security". Such user intent is not time-sensitive because the content of the answer is basically fixed.
[0042] Those skilled in the art should know that the aforementioned first attribute is not limited to timeliness, but may also be other attributes, which will not be elaborated here.
[0043] Therefore, in one feasible implementation, it is first determined whether the first intent tag has a first attribute, such as a timeliness attribute, and then the first prompt word or the second consecutive prompt word is selected to be generated.
[0044] Specifically, when the first intent label is not time-sensitive, a first prompt is generated based on the most similar question determined in step 204. This first prompt is used to provide subsequent prompts to the large language model. For example, if the user inputs the question "I can't log in to my account, it says my account is frozen?", the most similar question is "What should I do if my account is frozen?". A first prompt is then generated based on this most similar question to obtain relevant answers from the large language model. For example, the generated prompt could be "Please provide common reasons for account freezing and methods to unfreeze it."
[0045] When the primary intent tag is time-sensitive, relevant external information is obtained based on the most similar question.
[0046] For example, when the most similar question is "Was skin A successfully purchased?", the system retrieves the user's recent week's spending records from an external database, such as a transaction database. This includes information like the date, time, transaction amount, transaction method, user ID, and purchased goods or services for each transaction.
[0047]
[0048] Furthermore, by combining the aforementioned external information with the most similar questions, continuous prompts are generated, where the most similar questions include relevant keywords input by the user.
[0049] Continuous prompts:
[0050]
[0051] Furthermore, more than one example can be entered in the consecutive prompts:
[0052]
[0053]
[0054] By learning from multiple examples within a series of prompts, the large language model can respond according to the system's defined requirements. Those skilled in the art will understand that various types and numbers of examples can be implemented within the series of prompts to meet specific needs, thereby enabling the large language model to learn and output the expected results after a simple learning process. These will not be listed exhaustively here.
[0055] Step 208: Submit the first prompt word or the second consecutive prompt word to the large language model to obtain the response from the large language model.
[0056] In this step, the first prompt word or the second consecutive prompt word generated in step 206 is used to obtain the answer result of the large language model and then fed back to the user.
[0057] In one feasible implementation, the aforementioned large language model is a large language model trained using SFT+Reward based on game information data and historical customer service dialogue data.
[0058] SFT+Reward is a joint training method that mainly includes two steps: Supervised Fine-Tuning (SFT) and Reward Model Fine-Tuning.
[0059] (1) Supervised Fine-Tuning (SFT): This step draws on traditional supervised learning methods, requiring the model to be trained on a large-scale manually labeled dataset. This process helps the model understand language rules and the internal structure of the data, giving it preliminary generative and comprehension capabilities.
[0060] (2) Reward Model Fine-Tuning: Based on SFT, some custom reward mechanisms can be introduced to guide the model for further training. This is also a manifestation of reinforcement learning. The goal of the model is to find the generation strategy that maximizes the total reward. Therefore, when generating text with specific attributes, the model can be specially processed and tuned according to the requirements.
[0061] In the training process of the large language model in this application, to address the overfitting problem—that is, the large language model's over-reliance on training data leading to poor performance on new data—random noise was added during training to improve the model's generalization ability. Simultaneously, considering the model's practical application environment, a large amount of Chinese corpus was used for training to enhance the model's Chinese processing capabilities. Through this series of meticulous designs and training, the final large language model possesses excellent dialogue capabilities, generating reasonable answers even without prior knowledge of certain questions. This enables the large language model to perform well in handling users' daily questions about games, generating multi-turn dialogue-like responses that simulate customer service language styles based on past customer service responses. For example, when a user enters the question: "I want to check my game spending records; it seems that the skin A I purchased yesterday hasn't arrived," the large language model returns the following result:
[0062] "This is your spending record for the past week: [Detailed spending record]"
[0063] Sorry, you did not purchase skin B on October 4, 2022. If you have any questions, please contact XXX.
[0064] In the above embodiments of this application, in order to realize an intelligent customer service system based on a large language model and solve the problems of poor matching efficiency and inaccurate answers in the prior art, firstly, pre-processing NLP technology is used to optimize the traditional text matching technology, that is, the matching process of user input text is processed using vectors, which solves the problem of the stringent requirements of traditional n-gram technology; then, the generated prompt words are adjusted according to the matching results, generating different types of prompt words to guide the output of the large language model, thereby improving the answering effect of the large language model. For the establishment of the large language model, target game information data and historical customer service dialogues are used for training, and various fine-tuning methods and Chinese corpus data are added to improve the overfitting problem of the large language model, successfully realizing the application of the large language model in the dialogue scenario of commercial customer service.
[0065] Corresponding to the above-described embodiments of the identification method for simulated devices, this application also provides an embodiment of an intelligent customer service question-and-answer system based on a large language model, such as... Figure 3 As shown, the system includes:
[0066] The large language model is a large language model trained with SFT+Reward based on product information data and historical customer service dialogue data.
[0067] The text classification module is used to acquire the user's input question text and classify the intent to obtain at least one intent label;
[0068] The matching module is used to identify the most similar question in the question vector library based on the at least one intent tag and the question text input by the user, as well as the first intent tag corresponding to the most similar question;
[0069] The generation module is used to generate a first prompt word or a second consecutive prompt word based on the first intent tag and the most similar question;
[0070] The acquisition module is used to submit the first prompt word or the second consecutive prompt word to the large language model and obtain the answer result of the large language model.
[0071] The above is an illustrative scheme of an intelligent customer service question-and-answer system based on a large language model according to this embodiment. It should be noted that the technical solution of this intelligent customer service question-and-answer system based on a large language model and the technical solution of the intelligent customer service question-and-answer method based on a large language model described above belong to the same concept. For details not described in detail in the technical solution of the intelligent customer service question-and-answer system based on a large language model, please refer to the description of the technical solution of the intelligent customer service question-and-answer method based on a large language model described above.
[0072] In one embodiment of this application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the instructions to implement the steps of the method described above.
[0073] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the method described above.
[0074] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the method as described above.
[0075] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solution of the intelligent customer service question-and-answer method based on a large language model described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the intelligent customer service question-and-answer method based on a large language model described above.
[0076] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0077] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0078] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0079] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0080] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. An intelligent customer service question-and-answer method based on a large language model, characterized in that, include: Obtain the user's input question text and classify its intent to obtain at least one intent label; Based on the at least one intent tag and the question text input by the user, identify the most similar question in the question vector library, and the first intent tag corresponding to the most similar question; Determine whether the first intent tag has a first attribute, the first attribute including timeliness; If the first intent tag does not possess the first attribute, then a first prompt word is generated based on the first intent tag and the most similar question; If the first intent tag has the first attribute, then external information related to the most similar question is obtained, and a second consecutive prompt word is generated based on the external information. The second consecutive prompt word includes multiple examples of questions and answers related to the external information. The most similar question includes relevant keywords entered by the user; The first prompt word or the second consecutive prompt word is submitted to the large language model to obtain the response from the large language model.
2. The method according to claim 1, wherein, Before identifying the most similar question in the question vector library based on the at least one intent tag and the question text input by the user, the method further includes: After creating a text vector space based on all historical customer complaints, the text is stored in a vector database. The text of the historical customer complaints is transformed into the vector space through a neural network model based on Transformer.
3. The method according to claim 1, wherein, Based on the at least one intent tag and the user-inputted question text, the most similar questions identified in the question vector library include: Based on the at least one intent tag, the system searches for the corresponding target intent tag in the question vector library, and further calculates the matching degree between the user-inputted question under the same intent tag and the historical questions in the vector database, where the question with the highest matching degree is the most similar question.
4. The method according to claim 3, wherein, The calculation of the degree of matching between the user-input question under the same intent label and historical questions in the vector database includes: The user-input question text is vectorized and then matched with historical question vectors with the same intent label in the question vector library using cosine similarity. The most similar question is determined based on the degree of matching. Each text is vectorized into an n-dimensional array, where 1500 ≤ n ≤ 1600.
5. An intelligent customer service question-and-answer system based on a large language model, characterized in that, include: The large language model is a large language model trained with SFT+Reward based on product information data and historical customer service dialogue data. The text classification module is used to acquire the user's input question text and classify the intent to obtain at least one intent label; The matching module is used to identify the most similar question in the question vector library based on the at least one intent tag and the question text input by the user, as well as the first intent tag corresponding to the most similar question; The generation module is used to determine whether the first intent tag has a first attribute; If the first intent tag does not possess the first attribute, then a first prompt word is generated based on the first intent tag and the most similar question; If the first intent tag has the first attribute, then external information related to the most similar question is obtained, and a second consecutive prompt word is generated based on the external information. The second consecutive prompt word includes multiple examples of questions and answers related to the external information, wherein the most similar question contains relevant keywords input by the user; the first attribute includes timeliness. The submission module is used to submit the first prompt word or the second consecutive prompt word to the large language model to obtain the response result of the large language model.
6. A computing device, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the instructions, it implements the steps of the method according to any one of claims 1-4.
7. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the method according to any one of claims 1-4.
Citation Information
Patent Citations
Method for improving response speed of large-scale language model based on similarity retrieval
CN116910221A
Dialogue generation method and device based on knowledge base, electronic equipment and storage medium
CN117093698A
