Intelligent customer service question and answer method and device, electronic equipment, storage medium and product

By inputting the current question text and historical dialogue text into the pre-trained large language model, generating query words and conducting information query, the problem of intelligent customer service ignoring the conversation content in long conversation processing is solved, and the quality and relevance of answers are improved.

CN119513240APending Publication Date: 2025-02-25INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411318197.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Existing intelligent customer service Q&A technology is prone to ignore earlier conversation content when handling long conversations, resulting in lower quality and relevance of answers.

Method used

By obtaining the current question text and historical dialogue text, inputting a pre-trained large language model to generate query words, and querying information based on these query words, and finally integrating the query results into the answer text.

Benefits of technology

It improves the quality and relevance of intelligent customer service answers, avoids limitations in long conversation processing scenarios, and improves the user's intelligent customer service experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513240A_ABST
    Figure CN119513240A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent customer service question answering method and device, electronic equipment, a storage medium and a product. The method comprises the steps of obtaining a current question text; inputting the current question text and the historical dialogue text into a pre-trained large language model to obtain a query word; performing information query based on the query word to obtain a query result text; inputting the current question text, the historical dialogue text, the query word and the query result text into the pre-trained large language model to obtain an answer text; and returning the answer text. According to the method, early dialogue content is considered, intelligent customer service questions and answers are carried out in combination with a retrieval enhancement generation technology, the limitation in a long dialogue processing scene can be avoided, the quality and relevance of answers can be improved, and therefore the intelligent customer service use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an intelligent customer service question and answer method, device, electronic device, storage medium and product. Background Art

[0002] In order to cope with the challenge of too many manual customer service work orders, intelligent customer service technology is developing rapidly. The intelligent customer service question-and-answer system can improve service efficiency and quality through artificial intelligence technology and has a wide range of applications.

[0003] However, existing intelligent customer service question-and-answer technologies have limitations in handling long conversations and often ignore earlier conversation content, resulting in lower quality and relevance of answers. Summary of the invention

[0004] The present invention provides an intelligent customer service question and answer method, device, electronic device, storage medium and product, which are used to solve the limitations of the intelligent customer service question and answer technology in the prior art in processing long conversations, usually ignoring earlier conversation content, resulting in low answer quality and relevance, and to improve the quality and relevance of the intelligent customer service answer text.

[0005] The present invention provides an intelligent customer service question and answer method, comprising: Get the current question text; Inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; Performing information query based on the query word to obtain a query result text; Inputting the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; Returns the answer text.

[0006] According to an intelligent customer service question-and-answer method provided by the present invention, the query words include product document query words, user information query words and public real-time information query words; the information query is performed based on the query words to obtain the query result text, including: In the inverted index library, based on the segmentation phrase of the product document query term, searching for product documents corresponding to the segmentation phrase; Calling a predetermined interface to query the user information corresponding to the user information query term; Invoking a search engine to search for public real-time information corresponding to the public real-time information query term; A query result text is obtained based on the queried product document, the user information and the public real-time information.

[0007] According to an intelligent customer service question-answering method provided by the present invention, after inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word, the method further includes: For each query word, calculate the longest common subsequence value between the query word and each standard word; wherein the query word and the standard word are both in uppercase or lowercase form; The query word is spell-corrected based on the standard word with the largest longest common subsequence value, so as to perform information query based on the query word after spell-correction.

[0008] According to an intelligent customer service question-and-answer method provided by the present invention, after returning the answer text, the method further includes: Returns a document link and information input prompt for the product documentation; receiving application information input by a user based on the information input prompt for applying to perform a system-level operation; Based on the application information, generating system instructions to be executed; When the user's information confirmation operation is detected, the system instruction is executed, and the system-level operation corresponding to the application information is performed through the interface; When the user's transfer operation is detected, the call is transferred to manual customer service.

[0009] According to an intelligent customer service question-answering method provided by the present invention, the large language model is pre-trained in the following manner: Get sample product documentation and sample question text; Converting the sample product document into a sample question-answer pair to obtain first training sample data; Annotating the sample question text with corresponding sample product document query words, sample user information query words, and sample public real-time information query words to obtain second training sample data; Obtaining training data based on the first training sample data and the second training sample data; Based on the training data, the large language model to be trained is trained to obtain a pre-trained large language model.

[0010] According to an intelligent customer service question-and-answer method provided by the present invention, the model parameters of the large language model to be trained include original parameters, first low-rank adaptation parameters, and second low-rank adaptation parameters; based on the training data, the large language model to be trained is trained to obtain a pre-trained large language model, including: Based on the training data, training the large language model to be trained and calculating the loss function; Based on the loss function, updating a first low-rank adaptation parameter and a second low-rank adaptation parameter of the large language model to be trained; After the training is completed, the updated first low-rank adaptation parameters and the second low-rank adaptation parameters are merged with the original parameters of the large language model to be trained to obtain a pre-trained large language model.

[0011] The present invention also provides an intelligent customer service question-and-answer device, comprising: The acquisition module is used to obtain the current question text; A first input module, used for inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; A query module, used to perform information query based on the query word to obtain a query result text; A second input module is used to input the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; The return module is used to return the answer text.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the intelligent customer service question and answer method as described above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the intelligent customer service question and answer methods described above.

[0014] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned intelligent customer service question and answer methods.

[0015] The intelligent customer service question and answer method, device, electronic device, storage medium and product provided by the present invention obtain query words by inputting the current question text and the historical conversation text into a pre-trained large language model, perform information query based on the query words to obtain the query result text, input the current question text, the historical conversation text, the query words and the query result text into the pre-trained large language model, obtain the answer text and return the answer text, take into account the earlier conversation content, and combine the retrieval enhancement generation technology to perform intelligent customer service question and answer, which can avoid the limitations in the long conversation processing scenario, is conducive to improving the quality and relevance of the answer, thereby improving the user's intelligent customer service experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 This is one of the flow charts of the intelligent customer service question and answer method provided in an embodiment of the present invention.

[0018] Figure 2 It is a schematic diagram of model fine-tuning provided by an embodiment of the present invention.

[0019] Figure 3 This is the second flow chart of the intelligent customer service question and answer method provided in an embodiment of the present invention.

[0020] Figure 4 It is a structural diagram of an intelligent customer service question and answer device provided in an embodiment of the present invention.

[0021] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] Figure 1 This is one of the flow charts of the intelligent customer service question and answer method provided by the embodiment of the present invention. Figure 1 The embodiment of the present invention provides an intelligent customer service question and answer method, which may specifically include the following steps: Step 101, obtaining the current question text.

[0024] It should be noted that the execution subject of the intelligent customer service question-and-answer method provided in the embodiment of the present invention may be an electronic device, a component in an electronic device, an integrated circuit or a chip. The electronic device may be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present invention. The following embodiment of the present invention is described with the intelligent customer service product assistant as the execution subject.

[0025] It should be noted that the embodiments of the present invention may involve the use of user data. In actual applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).

[0026] The embodiments of the present invention can be applied to intelligent customer service question and answer scenarios, in which users can have multiple rounds of conversations with intelligent customer service. In the current conversation, the user can enter a question text, and the intelligent customer service product assistant can input the current question text and the historical conversation text (including the historical user question text and the historical answer text returned by the intelligent customer service product assistant) into the pre-trained large language model, thereby generating a question and answer text related to the current question text, taking into account the earlier conversation content, which is conducive to improving the quality and relevance of the answer.

[0027] Step 102: input the current question text and the historical conversation text into a pre-trained large language model to obtain a query word.

[0028] In the embodiment of the present invention, for tasks involving real-time information retrieval, the retrieval-augmented generation (RAG) technology can be combined to perform information retrieval. The pre-trained large language model can generate query words based on the current question text and context (i.e., historical conversation text), and then the corresponding query result text is retrieved based on these query words.

[0029] In an embodiment of the present invention, the large language model may adopt Llama3. Llama3 is a model pre-trained on a 15T dataset, and the pre-training scale is 7 times that of the previous most advanced open source model Llama2. Llama3 has been specially optimized to adapt to conversation scenarios, and outperforms most existing open source chat models in multiple industry benchmarks; especially when processing long conversations, Llama3's powerful fine-tuning capabilities and generalization can make it suitable for the specific field of intelligent customer service product services. Therefore, the Llama3 model has 8K context processing capabilities and is close to GPT4 (Generative Pre-trained Transformer 4, natural language processing model) in reasoning performance, so that it can more accurately understand and process complex user interactions and provide a more efficient and personalized customer service experience.

[0030] Specifically, the current question text and the historical conversation text may be input into a pre-trained Llama3 model, and the pre-trained Llama3 model may generate the required query words according to the current question text and the historical conversation text.

[0031] Step 103: perform information search based on the query word to obtain a query result text.

[0032] In the embodiment of the present invention, information query may include query of product documents, query of user information and query of public real-time information. After information query is performed based on query words, various query results may be obtained and recorded as query result text.

[0033] The user information may include user account, order status, etc. Public real-time information refers to non-sensitive information that can be accessed through a public API (Application Programming Interface), such as user public comments, likes, etc.

[0034] Step 104, input the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text.

[0035] In an embodiment of the present invention, the pre-trained large language model can integrate the query result text into the original context (i.e., the current question text, historical conversation text, and query terms), and use this extended context to generate the final answer text.

[0036] Since the number of search results related to product documents is usually small, which is different from the large number of query results that can be obtained through search engine queries, in the embodiments of the present invention, there is no need to reorder the query result text, and all retrieved query results can be directly attached to the context, so that the large language model can access all relevant information more quickly, improve the accuracy and information richness of the generated answer text, thereby improving the quality and relevance of the answer, which is conducive to improving the efficiency and accuracy when processing professional field information.

[0037] Step 105, returning the answer text.

[0038] In an embodiment of the present invention, after the pre-trained large language model outputs the answer text, the answer text can be returned to the user to complete the current round of dialogue.

[0039] The embodiment of the present invention obtains query words by inputting the current question text and the historical conversation text into a pre-trained large language model, performs information query based on the query words to obtain query result text, inputs the current question text, the historical conversation text, the query words and the query result text into the pre-trained large language model, obtains answer text and returns the answer text, takes into account the earlier conversation content, and combines the retrieval enhancement generation technology for intelligent customer service question and answer, which can avoid the limitations in long conversation processing scenarios, is conducive to improving the quality and relevance of answers, thereby improving the user's intelligent customer service experience.

[0040] Based on any of the above embodiments, the query words include product document query words, user information query words and public real-time information query words; performing information query based on the query words to obtain query result text may specifically include: Step S11, in an inverted index library, based on the segmentation phrase of the product document query term, searching for product documents corresponding to the segmentation phrase; Step S12, calling a predetermined interface to query the user information corresponding to the user information query term; Step S13, calling a search engine to search for public real-time information corresponding to the public real-time information query term; Step S14, obtaining a query result text based on the queried product document, the user information and the public real-time information.

[0041] In an embodiment of the present invention, the query words output by the pre-trained large language model may include three categories: product document query words, user information query words and public real-time information query words. Different identifiers may be used to identify and mark the product document query words, user information query words and public real-time information query words, respectively, so as to facilitate clear identification and processing of different types of query requirements when performing information retrieval.

[0042] Specifically, product document query terms can be used <document>< / document> Marking, user information query words can be used <personal>< / personal> To mark, public real-time information query words can be used <common>< / common> Mark it.

[0043] For example, assuming that the current question text is the initial question text, and the current question text is "I want to apply for a reimbursement voucher for order xxx", the pre-trained large language model can output: [INST]I would like to apply for a reimbursement voucher for order xxx[ / INST]

[0044] <document> Reimbursement voucher< / document>

[0045] <personal> order(xxx)< / personal>

[0046] Among them, [INST] can be used as a segmentation mark between instructions and answers in the Llama series models.

[0047] For product document queries, the product document query words can be segmented to obtain the segmented phrases of the product document query words, and the product documents corresponding to each segmented phrase can be queried in the inverted index knowledge base. For example, taking "reimbursement voucher" as an example, the query word can be decomposed into "reimbursement" and "voucher", and these words can be used to search for product documents, thereby retrieving relevant documents, such as documents related to reimbursement vouchers and documents containing voucher application links (which can be recorded as document A).

[0048] For the query of user personal information, the user information corresponding to the user information query term can be queried by calling the predetermined interface. For example, the predetermined interface can be the interface "order" for querying the order status, and the user's order details can be obtained by calling the order interface. The order details information returned by the interface may include the order number, amount and order time, which can be recorded as document B.

[0049] For the query of public real-time information, a search engine may be called to perform a real-time query based on a public real-time information query term, and the public real-time information (which may be recorded as document C) may be obtained through the query.

[0050] In an embodiment of the present invention, after the query is completed, the information retrieved from different sources (document A, document B, and document C) can be merged into the input text to provide complete background information for the pre-trained large language model, thereby facilitating the generation of more accurate answer text and subsequent operation instructions.

[0051] For example, for a query request of "I want to apply for a reimbursement voucher for order xxx", the merged text may be: [INST]I would like to apply for a reimbursement voucher for order xxx[ / INST]

[0052] <document> Reimbursement voucher< / document>

[0053] <result> Document A< / result>

[0054] <result> Document B< / result>

[0055] <personal> order(xxx)< / personal>

[0056] <result> Document C< / result>

[0057] in, <result>< / result> Can be used to mark query results. Each tag can contain one query result.

[0058] It should be noted that in order to improve security and protect user privacy, the permissions of the order interface are strictly limited and are only allowed to be used to query the order information of the currently logged-in user, thereby avoiding potential privacy and security risks caused by the unpredictability of large language models when processing data.

[0059] Compared with the prior art, the embodiments of the present invention can greatly expand the processing scope of the intelligent customer service product assistant by comprehensively utilizing multi-source information, including not only product documents but also user personal information and public information queried in real time, thereby being able to take over more tasks that originally required manual customer service intervention.

[0060] Based on any of the above embodiments, after inputting the current question text and the historical conversation text into the pre-trained large language model to obtain the query words, the following may also be included: Step S21, for each query word, calculating the longest common subsequence value between the query word and each standard word; wherein the query word and the standard word are both in uppercase or lowercase form; Step S22, performing spelling correction on the query word based on the standard word with the largest longest common subsequence value, so as to perform information query based on the query word after spelling correction.

[0061] When processing queries and interface calls, large language models may have spelling errors. Therefore, the embodiments of the present invention use the Longest Common Subsequence (LCS) algorithm and combine it with case-insensitive matching to correct spelling errors, which is conducive to improving the fault tolerance of the system and ensuring that even if there are minor errors in the query words output by the large language model, the system can correctly identify and execute the user's query command, which is conducive to increasing the robustness of the customer service system and improving the user experience.

[0062] Specifically, multiple standard words in the standard word library can be obtained, and the query word character string and the standard word character string are uniformly converted into uppercase or lowercase forms, and then for each query word, the LCS value between the query word and each standard word is calculated respectively. The larger the LCS value, the higher the similarity between the query word and the standard word, and the query word can be spelled corrected based on the standard word with the largest LCS value, so as to perform information query based on the query word after spelling correction.

[0063] Based on any of the above embodiments, after returning the answer text, the following may also be included: Step S31, returning the document link and information input prompt of the product document; Step S32, receiving application information input by the user based on the information input prompt for applying to perform a system-level operation; Step S33, generating a system instruction to be executed based on the application information; Step S34, when the user's information confirmation operation is detected, the system instruction is executed, and the system-level operation corresponding to the application information is performed through the interface; Step S35: When a user's transfer operation is detected, the call is transferred to manual customer service.

[0064] In the embodiment of the present invention, after the queried product documents, user information and public real-time information are merged, the query result text can be obtained, and the current question text, historical conversation text, query words and query result text are further input into the pre-trained large language model, and the large model continues to generate and obtain the answer text. After providing the answer, the system can evaluate the required system-level operation and execute it after confirmation by the user, thereby ensuring the security of the process and the protection of user privacy.

[0065] Among them, the Llama3 model can be used to integrate all information and give a text answer that meets the user's requirements. System-level operations can include canceling orders, unblocking accounts, applying for reimbursement vouchers, etc.

[0066] For example, a large language model may return the following text: [INST]I would like to apply for a reimbursement voucher for order xxx[ / INST]

[0067] <document> Reimbursement voucher< / document>

[0068] <result> Document A< / result>

[0069] <result> Document B< / result>

[0070] <personal> order(xxx)< / personal>

[0071] <result> Document C< / result>

[0072] It is found that you purchased a laptop on xx / xx / xx. You can apply for a reimbursement voucher by referring to the following documents: Document link of document A, document link of document B, document link of document C; You can also send the title and number of the reimbursement voucher, and the system can automatically apply for the reimbursement voucher.

[0073] <sys>< / sys>

[0074] In the embodiment of the present invention, after returning the answer text output by the large language model, the intelligent customer service product assistant can also <document>The query results are accompanied by a link to the product documentation of the large language model reference for further reference by customers.

[0075] In the above example, the intelligent customer service product assistant can also return an information input prompt, that is, the instructions for applying for a reimbursement voucher "You can also send the title and number of the reimbursement voucher, and the system can automatically apply for the reimbursement voucher." <sys>The tag is empty and no system operation is required.

[0076] If the user still has questions, the user can enter the application information (including invoice header and taxpayer number) for applying for system-level operations based on the information input prompt, and then enter the next round of dialogue. The intelligent customer service product assistant can generate system instructions to be executed based on the application information to complete the next round of dialogue.

[0077] Suppose that after the next round of dialogue, the following text is obtained: [INST]I would like to apply for a reimbursement voucher for order xxx[ / INST]

[0078] <document> Reimbursement voucher< / document>

[0079] <result> Document A< / result>

[0080] <result> Document B< / result>

[0081] <personal> order(xxx)< / personal>

[0082] <result> Document C< / result>

[0083] It is found that you purchased a laptop on xx / xx / xx. You can apply for a reimbursement voucher by referring to the following documents: Document link of document A, document link of document B, document link of document C; You can also send the title and number of the reimbursement voucher, and the system can automatically apply for the reimbursement voucher.

[0084] <sys>< / sys>

[0085] [INST]Invoice title: yyy, taxpayer number: zzz, please help me apply for a reimbursement voucher. [ / INST]

[0086] OK, the robot will apply for the reimbursement voucher for you.

[0087] <sys> invoice(xxx,yyy,zzz)< / sys>

[0088] in, <sys> invoice(xxx,yyy,zzz)< / sys> For system instructions to be executed, you can <sys>The invoice interface in the tag performs system-level operations for applying for reimbursement vouchers. The system can generate an information confirmation pop-up window, and the user can confirm the voucher information and click the confirmation button to perform the information confirmation operation. After the user confirms, the system can detect the user's information confirmation operation and execute system instructions to perform the operation of applying for reimbursement vouchers through the invoice interface.

[0089] If the intelligent customer service product assistant cannot meet the user's requirements, the user can perform a transfer operation to <sys>Tag opens manual customer service.

[0090] Compared with the prior art, the embodiment of the present invention has the ability to perform system-level operations under the premise of ensuring safety, such as canceling orders, unblocking accounts, applying for reimbursement vouchers, etc. In addition, the embodiment of the present invention also has the function of seamless connection with manual customer service. When the intelligent customer service product assistant cannot handle user problems independently, it can automatically transfer to manual customer service, thereby further ensuring user service satisfaction.

[0091] Based on any of the above embodiments, the large language model can be pre-trained in the following manner: Step S41, obtaining sample product documents and sample question texts; Step S42, converting the sample product document into a sample question-answer pair to obtain first training sample data; Step S43, annotating the sample question text with corresponding sample product document query words, sample user information query words, and sample public real-time information query words to obtain second training sample data; Step S44, obtaining training data based on the first training sample data and the second training sample data; Step S45: training the large language model to be trained based on the training data to obtain a pre-trained large language model.

[0092] As a general conversation model, the Llama3 pre-trained model can handle common problems in daily life or professional fields and provide accurate answers. However, in the face of specific technical fields, the model may lack the necessary expertise in product document processing, real-time query and system operation. Therefore, the embodiment of the present invention uses domain adaptation technology to perform targeted fine-tuning on Llama3 to adapt to specific product service fields.

[0093] During the fine-tuning process, the key step is to convert the required knowledge and information into question-answer pairs. For product documents, tools such as ChatGPT4 can be used to intelligently generate question-answer pairs; for more specific tasks such as real-time search, the model can be trained by manually annotating several example question-answer pairs. Since large models usually have strong generalization capabilities, even with relatively small training data sets, efficient training results can be achieved, thereby ensuring the performance and accuracy of the model in specific application scenarios.

[0094] In the embodiment of the present invention, the training data may come from existing product documents and manually constructed retrieval enhancement generation data sets. The embodiment of the present invention collects existing product documents as sample product documents for training, so that the large language model can have basic industry knowledge.

[0095] Specifically, the sample product document may be converted into a question-answer pair format, and the sample question-answer pair may be used as the first training sample data. The sample product document may be converted into the question-answer pair format manually or automatically.

[0096] In some embodiments, the ChatGPT4 model can be used to automatically convert sample product documents into question-answer pairs. By inputting the sample product document content into the ChatGPT4 model, 15-20 questions can be generated for each document; for shorter documents, 2-10 questions can be generated, and it is ensured that the answers to these questions can fully cover all the contents of the document.

[0097] In some embodiments, scripts can be written through the API to automatically convert sample product document content into question-answer pairs, thereby not only improving efficiency but also ensuring accuracy and consistency in data processing.

[0098] Specifically, the second training sample data can be obtained by collecting users' difficult questions as sample question texts, and manually writing and annotating sample query words including document query words, user information query words, and public real-time information query words for the sample question texts. During model training, the performance of the large language model after obtaining the sample query results can be simulated based on the sample query results provided by these sample query words, such as answering questions and performing system-level operations.

[0099] Data evaluation plays a vital role in the entire process from data acquisition to data processing. The quality of data evaluation and the rigor of the process can affect the quality of data, thereby indirectly determining the performance of the model. In some embodiments, after the training data set is constructed, especially for manually constructed data sets, the correctness of the training data set can be checked to ensure that each question is answered accurately and comprehensively, which is conducive to improving the accuracy of the data, thereby ensuring the effectiveness of the large language model training and the final performance.

[0100] Based on any of the above embodiments, the model parameters of the large language model to be trained include original parameters, first low-rank adaptation parameters and second low-rank adaptation parameters; based on the training data, training the large language model to be trained to obtain a pre-trained large language model may specifically include: Step S451, training the large language model to be trained based on the training data, and calculating the loss function; Step S452: updating the first low-rank adaptation parameter and the second low-rank adaptation parameter of the large language model to be trained based on the loss function; Step S453, after the training is completed, the updated first low-rank adaptation parameter and the second low-rank adaptation parameter are merged with the original parameters of the large language model to be trained to obtain a pre-trained large language model.

[0101] Fine-tuning technology can greatly simplify the adaptation process of large language models for specific tasks. In an embodiment of the present invention, the LoRA (Low-Rank Adaptation) technology can be used to perform supervised fine-tuning (SFT) on the large language model. By using the low-rank adaptation method, when adapting the large model to downstream tasks, only a small number of parameters need to be trained to achieve excellent results.

[0102] Among them, the original parameters of the large language model may refer to the weight matrix of the model, the first low-rank adaptation parameter may refer to the first low-rank adaptation matrix, and the second low-rank adaptation parameter may refer to the second low-rank adaptation matrix.

[0103] Reference Figure 2 , Figure 2 It is a schematic diagram of model fine-tuning provided by an embodiment of the present invention. During the model training process, only the first low-rank adaptation parameter A and the second low-rank adaptation parameter B of the large language model can be updated based on the loss function, while the original parameter W of the large language model remains unchanged. After the model training is completed, the updated A, B and W can be merged using the reparameterization technology to avoid introducing additional computational overhead during model inference, thereby effectively improving efficiency and providing an efficient adaptation solution for the practical application of large-scale models.

[0104] During fine-tuning, the dataset in the question-answer format (i.e., the first training sample data) can be directly put into LoRA. On a single A100, the Llama3 model can be fully fine-tuned. Compared with the normal training process, LoRA can reduce the amount of training parameters to about 0.01%.

[0105] In the embodiment of the present invention, the implementation of LoRA technology is to train a small number of new parameters for downstream tasks instead of adjusting the original parameters of the pre-trained model. Once these new parameters are trained, the newly trained parameters are combined with the original model parameters through re-parameterization technology to achieve model optimization, so as to not only maintain the effect similar to full fine-tuning on the new task, but also will not increase the computational burden during inference.

[0106] The embodiment of the present invention adopts the Llama3 model as the basic large language model, and through domain adaptation fine-tuning and retrieval enhancement generation technology, it can be effectively applied to the field of intelligent customer service question and answer, thereby not only improving the model's ability to understand specific problems, but also enhancing the application efficiency of the model in actual operations.

[0107] Reference Figure 3 , Figure 3 This is the second flow chart of the intelligent customer service question-and-answer method provided by an embodiment of the present invention. The intelligent customer service product assistant can obtain the question text A input by the user (if there is a previous conversation text, the historical conversation text is also obtained at the same time), input it into the pre-trained large language model, and generate the query word B. The query word B may include product document query words B1, user information query words B2, and public real-time information query words B3, so as to perform product document query, user information query, and public real-time information query through a public API, respectively, and obtain the relevant query result text C. The question text A+query word B+query result text C can be input into the pre-trained large language model for further generation to obtain the completed answer text. At the same time, the intelligent customer service product assistant can generate a system-level operation and determine whether the system-level operation is empty. If the system-level operation is not empty, the user is asked, and the system-level operation is performed after the user confirms; if the system-level operation is empty, the operation is terminated.

[0108] Existing intelligent customer service technology has limitations in handling long conversations. It usually ignores earlier conversation content and is unable to combine users' personal information and real-time data from product systems to diagnose problems. Moreover, it can only provide answers based on fixed product documents, which makes it difficult to meet special needs that require specific explanations (such as account bans), and it is also unable to automatically execute users' specific operational requirements. Therefore, manual intervention is still required to handle a large number of replaceable tasks.

[0109] In response to the above problems, an embodiment of the present invention proposes an intelligent customer service question and answer method based on deep learning and natural language processing technology. By integrating advanced context understanding algorithms and real-time data processing capabilities, the performance of the intelligent customer service product service system in processing long dialogue scenarios can be improved, and user operations can be completed safely and efficiently, thereby optimizing user experience. By utilizing the Llama3 model with a dialogue context memory capability of up to 8K, product documents can be understood and applied more deeply. By combining retrieval enhancement generation technology, relevant information can be automatically retrieved when users raise personalized needs, and responses based on query results can be provided in real time. After providing answers, the required system-level operations are evaluated and performed after confirmation with the user, thereby ensuring the security of the process and user privacy protection.

[0110] The embodiments of the present invention have the following advantages: (1) the context processing capability of the intelligent customer service product service system when dealing with long conversations is enhanced, ensuring that the system can effectively track and understand the continuity of the conversation; (2) the system's ability to accurately answer user questions through natural language is improved, avoiding the need for users to ask multiple questions or provide invalid answers, and when the existing knowledge base cannot solve the problem, it can actively guide users to transfer to manual customer service, thereby improving user satisfaction; (3) diagnosis can be performed based on real-time information such as customer accounts or orders to solve customer problems in a targeted manner; (4) basic operations such as returns and exchanges can be automatically completed under the premise of ensuring safety, thereby improving operational efficiency and reducing manual intervention.

[0111] The intelligent customer service question and answer device provided by the present invention is described below. The intelligent customer service question and answer device described below and the intelligent customer service question and answer method described above can be referenced to each other.

[0112] Figure 4 Schematic diagram of the structure of the intelligent customer service question-answering device provided by an embodiment of the present invention. Figure 4 The embodiment of the present invention provides an intelligent customer service question and answer device, which may specifically include the following modules: The acquisition module 401 is used to acquire the current question text; A first input module 402 is used to input the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; A query module 403 is used to perform information query based on the query word to obtain a query result text; A second input module 404 is used to input the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; The return module 405 is used to return the answer text.

[0113] The embodiment of the present invention obtains query words by inputting the current question text and the historical conversation text into a pre-trained large language model, performs information query based on the query words to obtain query result text, inputs the current question text, the historical conversation text, the query words and the query result text into the pre-trained large language model, obtains answer text and returns the answer text, takes into account the earlier conversation content, and combines the retrieval enhancement generation technology for intelligent customer service question and answer, which can avoid the limitations in long conversation processing scenarios, is conducive to improving the quality and relevance of answers, thereby improving the user's intelligent customer service experience.

[0114] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the intelligent customer service question and answer method, which includes: obtaining the current question text; inputting the current question text and the historical conversation text into the pre-trained large language model to obtain the query word; performing information query based on the query word to obtain the query result text; inputting the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain the answer text; and returning the answer text.

[0115] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0116] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the intelligent customer service question and answer method provided by the above methods, and the method includes: obtaining a current question text; inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; performing information query based on the query word to obtain a query result text; inputting the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; and returning the answer text.

[0117] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the intelligent customer service question and answer method provided by the above-mentioned methods, the method comprising: obtaining a current question text; inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; performing an information query based on the query word to obtain a query result text; inputting the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; and returning the answer text.

[0118] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / sys> < / sys> < / sys> < / document>

Claims

1. An intelligent customer service question and answer method, characterized in that: include: Get the current question text; Inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; Performing information query based on the query word to obtain a query result text; Inputting the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; Returns the answer text.

2. The method according to claim 1, characterized in that The query words include product document query words, user information query words and public real-time information query words; the information query is performed based on the query words to obtain the query result text, including: In the inverted index library, based on the segmentation phrase of the product document query term, searching for product documents corresponding to the segmentation phrase; Calling a predetermined interface to query the user information corresponding to the user information query term; Invoking a search engine to search for public real-time information corresponding to the public real-time information query term; A query result text is obtained based on the queried product document, the user information and the public real-time information.

3. The method according to claim 1, characterized in that After inputting the current question text and the historical conversation text into the pre-trained large language model to obtain the query words, the method further includes: For each query word, calculate the longest common subsequence value between the query word and each standard word; wherein the query word and the standard word are both in uppercase or lowercase form; The query word is spell-corrected based on the standard word with the largest longest common subsequence value, so as to perform information query based on the query word after spell-correction.

4. The method according to claim 2, characterized in that: After returning the answer text, it also includes: Returns a document link and information input prompt for the product documentation; receiving application information input by a user based on the information input prompt for applying to perform a system-level operation; Based on the application information, generating system instructions to be executed; When the user's information confirmation operation is detected, the system instruction is executed, and the system-level operation corresponding to the application information is performed through the interface; When the user's transfer operation is detected, the call is transferred to manual customer service.

5. The method according to claim 1, characterized in that The large language model is pre-trained in the following way: Get sample product documentation and sample question text; Converting the sample product document into a sample question-answer pair to obtain first training sample data; Annotating the sample question text with corresponding sample product document query words, sample user information query words, and sample public real-time information query words to obtain second training sample data; Obtaining training data based on the first training sample data and the second training sample data; Based on the training data, the large language model to be trained is trained to obtain a pre-trained large language model.

6. The method according to claim 5, characterized in that The model parameters of the large language model to be trained include original parameters, first low-rank adaptation parameters and second low-rank adaptation parameters; the training of the large language model to be trained based on the training data to obtain a pre-trained large language model includes: Based on the training data, training the large language model to be trained and calculating the loss function; Based on the loss function, updating a first low-rank adaptation parameter and a second low-rank adaptation parameter of the large language model to be trained; After the training is completed, the updated first low-rank adaptation parameters and the second low-rank adaptation parameters are merged with the original parameters of the large language model to be trained to obtain a pre-trained large language model.

7. An intelligent customer service question and answer device, characterized in that: include: The acquisition module is used to obtain the current question text; A first input module, used for inputting the current question text and the historical conversation text into a pre-trained large language model to obtain a query word; A query module, used to perform information query based on the query word to obtain a query result text; A second input module is used to input the current question text, the historical conversation text, the query word and the query result text into the pre-trained large language model to obtain an answer text; The return module is used to return the answer text.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the intelligent customer service question and answer method as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the intelligent customer service question and answer method as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the intelligent customer service question and answer method as described in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Intelligent customer service session processing method and device and program product

    CN119719315A

  • Answer text generation method and device, storage medium and electronic equipment

    CN120705285A

  • Large-model multi-path retrieval question and answer parameter and data source tuning method under multi-round question and answer

    CN121146095A

  • Multi-round question and answer under large model multi-path retrieval question and answer parameter and data source optimization method

    CN121146095B

  • Automobile channel intelligent question and answer method and system based on large language model

    CN121524196A