Intelligent customer service knowledge question answering method based on RAG
By performing hierarchical structure recognition and domain classification on historical question texts, generating structured text blocks and performing weighted sorting, the problems of semantic structure destruction and low retrieval accuracy in the RAG system are solved, achieving more accurate and efficient intelligent customer service knowledge Q&A.
Patent Information
- Application Number
- CN202511303208.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-10-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing RAG-based intelligent customer service knowledge Q&A systems disrupt the semantic structure of the original text during text segmentation, resulting in reduced information integrity and relevance, insufficient retrieval accuracy, and difficulty in correctly sorting text blocks, thus affecting the performance of the Q&A system and user satisfaction.
By dynamically recognizing the hierarchical structure of historical question texts, text blocks with hierarchical structure labels are generated and quantitatively stored in the RAG knowledge base. A domain classification model is constructed using a neural network to calculate the similarity between the text blocks and the questions and the domain weights, and then weighted and sorted to output candidate text blocks.
It improves the accuracy and relevance of the question-and-answer system, ensuring that the most relevant text blocks are listed first, thereby enhancing the accuracy and efficiency of the intelligent customer service knowledge question-and-answer system.
Smart Images

Figure CN120804274A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, in particular to an intelligent customer service knowledge question and answer method based on RAG. BACKGROUND
[0002] At present, the intelligent customer service knowledge question and answer system based on Retrieval-Augmented Generation (RAG) is a relatively common technical means. The RAG model retrieves relevant text blocks from the knowledge base through the retrieval module, and inputs them as context into the generation module to generate answers. The existing intelligent customer service knowledge question and answer system based on RAG has the following problems: Traditional blocking destroys the semantic structure of the original text. When a document is divided into small blocks, the originally coherent information and context relationship may be lost. This semantic break not only affects the integrity of the text content, but also may cause difficulties for the intelligent customer service system in understanding user queries and providing accurate answers, thereby reducing the overall performance of the question and answer system and user satisfaction.
[0003] Too many reference documents in actual application scenarios affect the accuracy of retrieval. In the face of a large number of documents, the system may have difficulty quickly and accurately identifying the most relevant information to the user's question. Too many documents may also increase the redundancy and irrelevance of the retrieval results, making the text block containing the answer be submerged in irrelevant or secondary information, thereby increasing the difficulty of the system in extracting useful information from massive data.
[0004] The correct text block sorting is too late to input the large model for answering. Due to the fact that the retrieval algorithm may not fully consider the relevance and importance of the text blocks, the correct text block may be ranked lower in the retrieval results.
[0005] In the Chinese invention patent with patent number "CN119848222A", a question and answer method, device, storage medium and electronic equipment based on a large model are disclosed, which predicts a question according to a text block, associates the text block with the predicted question, and retrieves a relevant text block as an answer according to the matching between the target question and the predicted question.
[0006] In the prior art, only a simple connection between the text block and the question is constructed, and the connection between the text blocks is not constructed, which cannot improve the efficiency of retrieval. At the same time, when classifying the text blocks, the connection between the text blocks is not considered, which will cause the semantic of the original text to be destroyed during segmentation, reducing the relevance of the answer results. Meanwhile, the sorting of the index result text blocks is not involved, and the correct text block may be missed. SUMMARY
[0007] In order to solve the problems existing in the prior art, the present application proposes an intelligent customer service knowledge question and answer method based on RAG.
[0008] The technical scheme of the present application is as follows: In one aspect, the present application proposes an intelligent customer service knowledge question and answer method based on RAG, and the specific steps include: Performing dynamic identification of the hierarchical structure of historical question texts, generating text blocks with hierarchical structure labels, and vectorizing and storing them in the RAG knowledge base of the intelligent customer service; Extracting the features of each text block in the historical question text based on a text classification algorithm, dividing the domains of each text block, and storing the domain labels in the corresponding text blocks in the RAG knowledge base; Building a domain classification model based on a neural network and pre-training, inputting the current question text into the pre-trained domain classification model, outputting the domain classification and domain weight of the current question text, and retrieving candidate text blocks in the RAG knowledge base based on the domain and domain weight of the current question text; Calculating the similarity of the candidate text blocks and the question text in the vector space, calculating the weighted relevance value by combining the similarity with the domain weight of the question text, sorting the candidate text blocks according to the relevance value of each candidate text block, and outputting the candidate text blocks in order as the answer to the question text.
[0009] As a preferred embodiment, the step of dynamically identifying the hierarchical structure of historical question texts is specifically: Extracting hierarchical titles and body content from historical question texts, performing semantic segmentation based on the semantic boundaries of the body content to generate basic text blocks, and concatenating the basic text blocks with the hierarchical titles to generate text blocks with hierarchical structure labels.
[0010] As a preferred embodiment, the step of extracting hierarchical titles is specifically: Identifying the parent-child relationship between hierarchical titles and building a hierarchical tree; then associating the basic text blocks to the end nodes of the hierarchical tree.
[0011] As a preferred embodiment, the segmentation rule of the step of generating basic text blocks by performing semantic segmentation based on the semantic boundaries of the body content is specifically: Taking the paragraph end symbol as the segmentation point, and when the paragraph length exceeds the length threshold, performing secondary segmentation according to the sentence boundaries.
[0012] As a preferred embodiment, the step of calculating the similarity of the candidate text blocks and the question text in the vector space is calculated by the cosine similarity algorithm.
[0013] As a preferred embodiment, the method further includes removing redundant text blocks when sorting the candidate text blocks according to the relevance value of each candidate text block, specifically: merge the candidate text blocks that are homologous and have a semantic overlap degree higher than a threshold value; delete the candidate text blocks that have a weighted correlation value lower than a correlation threshold value.
[0014] As a preferred embodiment, the step of constructing a field classification model based on a neural network and pre-training, outputting a field classification and a field weight according to a question text specifically comprises: The output layer of the field classification model contains at least one neuron, each neuron corresponds to one of the field types to which the input text question belongs, and the output value of each neuron is regarded as the score of the field type to which it belongs. The score is converted into a probability value by a softmax function, which is the field weight of each field type.
[0015] As a preferred embodiment, the step of retrieving candidate text blocks in the RAG knowledge base based on the field to which the question text belongs and the field weight specifically comprises: Based on the field label of the question text, text blocks in the same field in the RAG knowledge base are filtered, and the filtering results are sorted based on the field weight, and text blocks in high-weight fields are preferentially returned as candidate text blocks.
[0016] On the other hand, the present application proposes an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the RAG-based intelligent customer service knowledge question and answer method according to any one of the embodiments of the present application when executing the program.
[0017] On the other hand, the present application proposes a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the RAG-based intelligent customer service knowledge question and answer method according to any one of the embodiments of the present application.
[0018] The present application has the following beneficial effects: 1. The present application preserves the hierarchical structure and semantic integrity of the original text in the text preprocessing stage through dynamic hierarchical segmentation, not only extracts the hierarchical titles and content of the text, but also generates structured text blocks through hierarchical matching and semantic segmentation. These text blocks carry the hierarchical information and semantic boundaries of the original text, so that more accurate and complete information can be provided in the subsequent retrieval and question answering process, improving the accuracy and relevance of the question answering system.
[0019] 2. The present application addresses the problem of too many reference documents affecting the accuracy of retrieval in actual application scenarios, and realizes an efficient and accurate retrieval process through field classification combined with field weight.
[0020] 3、The application aims at the problem that correct text block cannot be inputted to large model for answering, calculates the correlation value between the retrieved text block and the user question, and realizes accurate sorting of the text block by combining with the field weight for weighting, which ensures that the most relevant text block is arranged in front, thereby improving the adoption rate of the large model for the correct text block and significantly improving the answering accuracy of the intelligent customer service knowledge question and answer system. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is a step flowchart of the application; Figure 2 is a simplified flowchart of the weighting and checking step for the candidate text block; Figure 3 is a simplified flowchart of the dynamic identification step of the hierarchical structure of the historical question text. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the application will be clearly and completely described in combination with the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.
[0023] It should be understood that the step numbers used herein are only for the convenience of description, and are not limited to the execution sequence of the steps.
[0024] It should be understood that the terms used in the specification of the application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification and the appended claims of the application, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0025] The terms "comprise" and "include" indicate the presence of described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or sets thereof.
[0026] The term "and / or" means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0027] Embodiment one: Referring to Figure 1 An intelligent customer service knowledge question and answer method based on RAG, the specific steps include: The historical problem text is dynamically identified in a hierarchical structure, a text block with hierarchical structure labels is generated, and is vectorized and stored in the RAG knowledge base of the intelligent customer service. Features of each text block in the historical problem text are extracted based on a text classification algorithm, and each text block is divided into a domain and stored as a domain label on the corresponding text block in the RAG knowledge base. In this embodiment, the text features of common questions are also extracted to divide the domain, so that the domain of similar questions can be quickly given when a user raises a question, and the domain weight of the user's question and the candidate text block retrieval can be more quickly confirmed.
[0028] A domain classification model is constructed based on a neural network and pre-trained, the current problem text is input into the pre-trained domain classification model, and the domain classification and domain weight of the current problem text are output; and candidate text blocks are retrieved in the RAG knowledge base based on the domain and domain weight of the current problem text. The similarity of the candidate text blocks and the problem text in the vector space is calculated, the similarity is combined with the domain weight of the problem text to calculate a weighted relevance value, the candidate text blocks are sorted according to the relevance value of each candidate text block, and the candidate text blocks are output in order as the answer result of the problem text.
[0029] In this embodiment, the weighting verification step of the candidate text blocks based on the above steps can be simplified as the flowchart shown in Figure 2 .
[0030] As a preferred embodiment of the present embodiment, the step of dynamically identifying the hierarchical structure of the historical problem text is specifically: The hierarchical title and the body content are extracted from the historical problem text, the semantic segmentation is performed according to the semantic boundary of the body content to generate a basic text block, and the basic text block is spliced with the hierarchical title to generate a text block with hierarchical structure labels.
[0031] In this embodiment, the hierarchical title generally indicates the structure and organization of the text, such as chapter title, sub-chapter title, etc., and the body content is the main information carrier of the text.
[0032] As a preferred embodiment of the present embodiment, the step of extracting the hierarchical title is specifically: The parent-child relationship between the hierarchical titles is identified, and a hierarchical tree is constructed; and then the basic text block is associated to the end node of the hierarchical tree.
[0033] In this embodiment, the extracted hierarchical title and the body content are associated through hierarchical matching to establish the hierarchical relationship therebetween, and the logical connection between the hierarchical titles is further analyzed and constructed through hierarchical relationship tracing, forming a clear hierarchical structure.
[0034] According to the two preferred embodiments described above, the dynamic hierarchical recognition step of the historical question text in claim 1 can be arranged into a complete dynamic hierarchical segmentation flowchart as shown in Figure 3 .
[0035] The dynamic hierarchical segmentation outputs a series of structured text blocks, which makes the organization and structure of the text more clear through the integration of hierarchical titles and structural information, and maximizes the preservation of the semantics of the original text.
[0036] As a preferred embodiment of the present embodiment, the segmentation rule of the step of generating basic text blocks according to semantic boundaries of the content of the text is specifically: The paragraph end symbol is used as the segmentation point, and when the paragraph length exceeds the length threshold, secondary segmentation is performed according to the sentence boundary.
[0037] As a preferred embodiment of the present embodiment, the step of calculating the similarity of the candidate text blocks and the question text in the vector space is calculated by the cosine similarity algorithm.
[0038] In the present embodiment, in addition to calculating the similarity by the cosine similarity algorithm, the similarity can also be calculated by the Euclidean distance, dot product, Manhattan distance, and Jaccard similarity coefficient.
[0039] As a preferred embodiment of the present embodiment, the method further comprises removing redundant text blocks when sorting the candidate text blocks according to the relevance values of the candidate text blocks, specifically: Merging candidate text blocks that are homologous and have a semantic overlap degree higher than a threshold value; Deleting candidate text blocks with a weighted relevance value lower than a relevance threshold.
[0040] In the present embodiment, "homologous" refers to text blocks from the same original document and having the same hierarchical structure label.
[0041] As a preferred embodiment of the present embodiment, the step of constructing a domain classification model based on a neural network and pre-training, and outputting a domain classification and a domain weight according to the question text is specifically: The output layer of the domain classification model contains at least one neuron, each neuron corresponds to one of the domain types to which the input text question belongs, and the output value of each neuron is regarded as the score of the domain type. The score is converted to a probability value by a softmax function, which is the domain weight of each domain type.
[0042] In the present embodiment, the higher the score of each domain type, the larger the probability value, and the larger the domain weight.
[0043] The models that can be selected for neural network architecture include RNN / LSTM / GRU, CNN, Transformer, or CNN+RNN, RNN+Attention combination architecture.
[0044] Select the neural network architecture based on the characteristics of the collected data and actual needs: RNN / LSTM / GRU: Good at processing sequence data and can capture contextual information; commonly used bidirectional structure (BiLSTM); can be stacked in multiple layers.
[0045] It can process text like images (through 1D convolution), effectively capture local features (such as n-grams), and is usually faster than RNN.
[0046] Transformer: Currently the most mainstream and powerful architecture. Based on the self-attention mechanism, it efficiently captures long-range dependencies and global information. BERT, GPT, and their variants are representative examples of pre-trained Transformers. They are often used as powerful base models and fine-tuned for downstream tasks (such as classification).
[0047] As a preferred implementation of this embodiment, the steps of searching for candidate text blocks in the RAG knowledge base based on the domain to which the question text belongs and the domain weight are specifically as follows: Based on the domain label of the question text, the text blocks in the same domain in the RAG knowledge base are filtered, and then the filtered results are sorted based on the domain weight, and the text blocks in the high-weight domain are returned first as candidate text blocks.
[0048] In this embodiment, the input text title, field label and FAQ are processed by a text classification algorithm, which includes natural language processing technology to identify the characteristics of the text and classify it into the corresponding field. This step establishes a text field classification model that can understand the text content and classify it into predefined fields. The classified text is stored in the RAG knowledge base, which organizes and indexes the text according to the field label of the text, quickly locates the text block in a specific field, and makes subsequent retrieval more efficient. At the same time, the questions raised by the user are processed synchronously. Similar to the text field classification, the user questions are also processed by the text classification algorithm to determine the field affiliation of the question and understand the intention of the user query to improve the relevance and accuracy of the subsequent retrieval.
[0049] After the question domain is determined, the domain weight is referenced to prioritize among multiple possible domains, allowing for more efficient retrieval of relevant text blocks. The question domain and domain weight are used to retrieve text blocks from the domain vector library. The retrieval process involves calculating the similarity between the question vector and the text vectors stored in the RAG knowledge base to find relevant text blocks.
[0050] In order to verify the effectiveness and superiority of the method provided in this embodiment, a specific experimental case is provided below: Using publicly available energy trading data from a power trading center, we collected 9,772 relevant documents, including market member information, power market rules, transaction settlement information, and monthly, quarterly, and annual reports. We generated a set of 100 questions based on these 9,772 documents and compared the accuracy of our optimized solution with that of a traditional RAG knowledge quiz. The test results showed that the optimized solution achieved an accuracy rate of 81%, while the traditional RAG achieved an accuracy rate of 62%. The following is a partial transcript of the questions and answers: Problem Label answer Optimized answer Is it correct Traditional RAG answer Business scope change (new business scope) application process 1. Material audit: After the power selling company submits the application for business scope change in the registered place, the transaction center will conduct material audit and feedback the audit opinion within 5 working days. 2. SMS reminder: After passing the preliminary examination, the power selling company will receive the SMS reminder sent by the transaction center. 3. Video review: The original copy is reviewed by remote video. 4. Information publicity: The power transaction center conducts publicity on a monthly basis, and the publicity period is one month. At the same time of publicity, relevant business provinces will be pushed, and after the completion of the review of relevant business provinces, publicity will be conducted simultaneously, and the publicity period is also one month. If there is no objection at the end of the publicity period, it will take effect. The business scope change (new business scope) application process is as follows: 1. **Material audit**: After the power selling company submits the application for business scope change in the registered place, the transaction center will conduct material audit and feedback the audit opinion within 5 working days. 2. **SMS reminder**: After passing the preliminary examination, the power selling company will receive the SMS reminder sent by the transaction center. 3. **Video review**: The original copy is reviewed by remote video. 4. **Information publicity**: The power transaction center conducts publicity on a monthly basis, and the publicity period is one month. At the same time of publicity, relevant business provinces will be pushed, and after the completion of the review of relevant business provinces, publicity will be conducted simultaneously, and the publicity period is also one month. If there is no objection at the end of the publicity period, it will take effect. Correct The business scope change (new business scope) application process is as follows: 1. **Material audit**: After the power selling company submits the application for business scope change in the registered place, the transaction center will conduct material audit and feedback the audit opinion within 5 working days. 2. **SMS reminder**: After passing the preliminary examination, the power selling company will receive the SMS reminder sent by the transaction center. 3. **Video review**: The original copy is reviewed by remote video. 4. **Information publicity**: The power transaction center conducts publicity on a monthly basis, and the publicity period is one month. At the same time of publicity, relevant business provinces will be pushed, and after the completion of the review of relevant business provinces, publicity will be conducted simultaneously, and the publicity period is also one month. If there is no objection at the end of the publicity period, it will take effect. How long is the green certificate valid? The green certificate is valid for 2 years, and the time is calculated from the natural month of electricity production (including). The electricity of renewable energy power generation projects before January 1, 2024 (not including) corresponds to the extension of the green certificate validity period to the end of 2025. The green certificate that exceeds the validity period or has declared the completion of green power consumption should be timely cancelled by the State Energy Administration Qualification Center. The green certificate is valid for 2 years, and the time is calculated from the natural month of electricity production (including). The electricity of renewable energy power generation projects before January 1, 2024 (not including) corresponds to the extension of the green certificate validity period to the end of 2025. Correct According to the information provided, it is not possible to answer this question. The information does not specify the validity period of the green certificate. If you can provide more context or specify the country or region of the green certificate, I may be able to provide a more accurate answer. Under what circumstances should the power market operation rules be revised? (1) Major adjustments in laws or national policies; (2) Major changes in the operating environment of the power market; (3) Suggestions and recommendations for revision from market members, and deemed necessary by the power regulatory agency and relevant local government departments; (4) Other circumstances deemed necessary by the power regulatory agency and relevant local government departments. According to the information provided, the power market operation rules should be revised in the following circumstances: \n\n1. Major adjustments in laws or national policies; \n2. Major changes in the operating environment of the power market; \n3. Suggestions and recommendations for revision from market members, and deemed necessary by the power regulatory agency and relevant local government departments; \n4. Other circumstances deemed necessary by the power regulatory agency and relevant local government departments. Correct According to the information provided, it is not possible to answer this question. The information does not specify the circumstances under which the power market operation rules should be revised. To accurately answer this question, you need to consult more detailed power market registration basic rules or relevant policy documents. Which market members participate in green power transactions? Market members participating in green power transactions include power generation enterprises, power users, power selling companies, and other market entities, as well as power grid enterprises, institutions responsible for renewable energy development settlement services, power trading agencies, power dispatching agencies, and the National Renewable Energy Information Management Center. Market members participating in green power transactions include various power generation enterprises, power grid enterprises, power selling and purchasing enterprises, power trading agencies, power dispatching agencies, power users, and energy storage enterprises. Correct Market members participating in green power transactions include power generation enterprises, power users, power selling companies, power grid enterprises, and market operation agencies. Specifically, market operation agencies refer to the Beijing Power Trading Center, provincial (autonomous region, municipality) power trading centers, the National Power Dispatching and Control Center, regional power dispatching and control centers, and provincial power dispatching and control centers. What conditions must be met for independent new energy storage to enter commercial operation? (1) Sign the project start-up acceptance handover book or identification book. (2) Complete the necessary test projects for grid connection operation, and the power dispatching agency has confirmed that the connected system equipment (devices) meet the technical requirements for safe and stable operation of the power grid and the requirements for dispatching management. (3) Sign the grid connection dispatching agreement, power purchase and sale contract or high-voltage power supply and use contract. Independent new energy storage entering commercial operation should meet the following conditions: \n\n1. Sign the project start-up acceptance handover book or identification book. \n2. Complete the necessary test projects for grid connection operation, and the power dispatching agency has confirmed that the connected system equipment (devices) meet the technical requirements for safe and stable operation of the power grid and the requirements for dispatching management. \n3. Sign the grid connection dispatching agreement, power purchase and sale contract or high-voltage power supply and use contract. Correct The following conditions are required for independent new energy storage to enter commercial operation: 1. Legal entity and independent financial accounting: It should be an economic entity with legal entity, independent financial accounting, good credit and the ability to independently bear civil liability. 2. Sign the grid connection and dispatch agreement: Independent energy storage subjects should sign the grid connection and dispatch agreement, access the dispatch automation system, be monitored and dispatched by the grid, have the conditions for power and electricity data time metering and transmission, and the data accuracy and reliability meet the requirements, and complete the registration and household work in the grid enterprise marketing system. 3. Meet the market access conditions: Including the maximum charge and discharge power, the maximum adjustment capacity and the continuous charge and discharge time access conditions, the specific values are subject to the provisions of the national or local electric power competent department. 4. Registration management: New energy storage subjects that meet the market access conditions can register in the electric power trading platform corresponding to the dispatch affiliation, and the electric power trading agency shall verify the registration information according to the requirements. 5. Provide registration information: Relevant information including but not limited to legal entity certificate, financial status, credit status, technical parameters, etc. should be provided during registration, and the specific requirements can be found in the registration information reference template (Appendix 3, Table 1 and Table 2). 6. Perform information disclosure obligations: Perform information disclosure obligations according to the requirements to ensure the authenticity and integrity of the information. ... ... ... ... Table 1 Comparison of knowledge questions and answers between the optimization scheme and the traditional RAG model The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention's description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An intelligent customer service knowledge question and answer method based on RAG, characterized in that: The specific steps include: Dynamically identify the hierarchical structure of historical question texts, generate text blocks with hierarchical structure labels, and vectorize and store them in the RAG knowledge base of intelligent customer service; Based on the text classification algorithm, the features of each text block in the historical question text are extracted, each text block is divided into fields and stored as a field label on the corresponding text block in the RAG knowledge base; A domain classification model is constructed based on a neural network and pre-trained. The current question text is used as the input of the pre-trained domain classification model, and the domain classification and domain weight of the current question text are output. Based on the domain and domain weight of the current question text, candidate text blocks are retrieved from the RAG knowledge base. Calculate the similarity between the candidate text blocks and the question text in the vector space, combine the similarity with the domain weight of the question text to calculate a weighted relevance value, sort the candidate text blocks according to their relevance values, and output the candidate text blocks in order as the answer to the question text.
2. The RAG-based intelligent customer service knowledge question-answering method according to claim 1, characterized in that: The steps of dynamically identifying the hierarchical structure of the historical question text are specifically as follows: Extract hierarchical titles and main text content from historical question texts, perform semantic segmentation based on the semantic boundaries of the main text content to generate basic text blocks, and then splice the basic text blocks with hierarchical titles to generate text blocks with hierarchical structure labels.
3. The RAG-based intelligent customer service knowledge question and answer method according to claim 2, characterized in that: The steps of extracting hierarchical titles are specifically as follows: Identify the parent-child relationship between hierarchical titles and build a hierarchical tree; then associate the basic text block with the end node of the hierarchical tree.
4. The RAG-based intelligent customer service knowledge question and answer method according to claim 2, characterized in that: The segmentation rules for the step of performing semantic segmentation based on the semantic boundaries of the text content to generate basic text blocks are specifically as follows: The paragraph end mark is used as the segmentation point, and when the paragraph length exceeds the length threshold, a second segmentation is performed based on the sentence boundary.
5. The RAG-based intelligent customer service knowledge question and answer method according to claim 1, characterized in that: The step of calculating the similarity between the candidate text block and the question text in the vector space is performed by using a cosine similarity algorithm.
6. The RAG-based intelligent customer service knowledge question and answer method according to claim 1, characterized in that: The method further includes removing redundant text blocks when sorting the candidate text blocks according to the relevance values of the candidate text blocks, specifically: Merge candidate text blocks with the same origin and semantic overlap above a threshold; Candidate text blocks whose weighted relevance values are lower than a relevance threshold are removed.
7. The RAG-based intelligent customer service knowledge question and answer method according to claim 1, characterized in that: The steps of constructing a domain classification model based on a neural network and performing pre-training, and outputting domain classification and domain weight according to the question text are as follows: The output layer of the domain classification model includes at least one neuron, each neuron corresponds to one of the domain types of the input text question, the output value of each neuron is regarded as the score of the domain type, and then the score is converted into a probability value through the softmax function, which is the domain weight of each domain type.
8. The RAG-based intelligent customer service knowledge question and answer method according to claim 1, characterized in that: The specific steps for retrieving candidate text blocks in the RAG knowledge base based on the domain to which the question text belongs and its domain weight are as follows: Based on the domain label of the question text, the text blocks in the same domain in the RAG knowledge base are filtered, and then the filtered results are sorted based on the domain weight, and the text blocks in the high-weight domain are returned first as candidate text blocks.
9. 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 program, it implements the RAG-based intelligent customer service knowledge question and answer method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements an RAG-based intelligent customer service knowledge question and answer method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Question and answer method and device based on large model, storage medium and electronic equipment
CN119848222A
Question and answer method and system based on paragraph splitting and knowledge engine platform
CN119271779A
Power field knowledge question and answer optimization system based on large model retrieval enhancement generation and instruction supervision fine tuning
CN119961388A
Intelligent service method and system based on deep reasoning and knowledge enhancement
CN120578731A
Text processing model training method, and text processing method and apparatus
WO2021047286A1