Branch customer service question and answer method based on GraphRAG and large language model

Through the combination of GraphRAG and large language model, the problem of high cost of manual customer service and multi-hop reasoning in enterprise customer service is solved, and efficient and accurate intelligent Q&A is achieved, reducing costs and improving response speed and generalization capabilities.

CN120448491AActive Publication Date: 2025-08-08BAOWU SHARED SERVICES CO LTD +1

Patent Information

Application Number
CN202510531901.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The existing technology has high cost and low efficiency in enterprise customer service, which is difficult to meet the timely response needs of large enterprises to employee problems, and traditional RAG methods are difficult to accurately understand the complex semantics and multi-hop reasoning of user problems.

Method used

The customer service Q&A method based on GraphRAG and large language models is adopted. By obtaining benchmark Q&A data, labeling and formatting, the large language model is fine-tuned using DeepSpeed distributed training framework and noise embedding technology, combined with GraphRAG's search enhancement generation, a knowledge graph is built for multi-hop inference, and the response is accelerated through high-speed inference framework and HTTP gateway services.

Benefits of technology

Multi-hop reasoning and global knowledge extraction are realized, labor costs are reduced, response efficiency and generalization capabilities are improved, intelligent customer service Q&A effects on enterprise reporting and support platforms are enhanced, and model training and reasoning efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448491A_ABST
    Figure CN120448491A_ABST
Patent Text Reader

Abstract

The invention relates to an official customer service question-answering method based on GraphRAG and a large language model, which comprises the following steps of: firstly, manually arranging an official question-answering data set used in an enterprise production environment, and obtaining a data set in a question-answering pair form through data preprocessing and manual annotation; and then performing text extraction and integration on the data set in the form of question and answer pairs, and constructing a three-section cue word template to obtain data for fine tuning. Performing parameter fine tuning on the open-source base large model through parameter freezing and noise embedding technologies by utilizing the fine tuning data, and reducing resources required by training by adopting a distributed training framework; performing supplementary description on the integrated data set by using chart representation-based retrieval enhancement generation, and jointly inputting the integrated data set into the large model for enhancement generation, so as to improve the answer expression of the large model; and finally, accelerating model reasoning and response speed by using a high-speed reasoning framework and an optimization algorithm in a model reasoning process to obtain generation answers to report and expenditure related questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a customer service question-and-answer method for expense reporting based on GraphRAG and a large language model. Background Art

[0002] In the area of corporate expense claims, traditional customer service questions and answers primarily rely on human agents. These agents, through training and learning, master the company's products, services, and solutions to common problems, providing support and answers to users. This human-based customer service approach considers users' individual needs and delivers a personalized service experience. However, as businesses expand and customer demands increase, the traditional human customer service model faces numerous challenges.

[0003] Chinese patent application publication number CN118551772A discloses an intelligent conversational platform based on a large language model. This platform addresses the shortcomings of earlier conversational platforms in complex semantic understanding and personalized responses, enabling efficient and intelligent user interaction. It optimizes answer generation through data learning and contextual awareness, improving user experience and platform performance. However, this platform directly utilizes a public large language model for question-and-answering, without targeted optimization for specific application scenarios, resulting in limited understanding of user questions.

[0004] Therefore, the following problems currently exist in the field of enterprise expense reporting and customer service:

[0005] (1) The manual customer service answering method is costly and inefficient, and it is difficult to meet the needs of large enterprises for timely response to employee issues.

[0006] (2) For methods that match questions with answers to achieve question answering, their ability to understand user questions is limited and it is difficult to support multiple rounds of dialogue.

[0007] (3) Traditional RAG (Retrieval-Augmented Generation) has difficulty accurately understanding the complex semantics of user questions. For example, when a user question involves multi-hop reasoning (which requires extracting information from multiple documents), traditional RAG may not be able to retrieve all relevant documents.

[0008] In summary, there is currently a lack of a customer service Q&A method for expense reporting to solve or partially solve the aforementioned problems. Summary of the Invention

[0009] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a customer service question-answering method based on GraphRAG and a large language model to solve or partially solve the problems of multi-hop reasoning and unsatisfactory global knowledge extraction capabilities.

[0010] The purpose of the present invention can be achieved by the following technical solutions:

[0011] One aspect of the present invention provides a customer service question-and-answer method for expense reporting based on GraphRAG and a large language model, comprising the following steps:

[0012] Obtaining benchmark question-and-answer data in response to expense reporting questions;

[0013] For the benchmark question-answering data, a pre-formatted expense report dataset is obtained through annotation and prompting engineering;

[0014] Based on the payment data set, the zero-redundancy optimizer was used to fine-tune the base language model through parameter freezing and noise embedding in the DeepSpeed distributed training framework to complete the training of the payment customer service question-and-answer expert model.

[0015] Based on the payment data set, GraphRAG-based search enhancement generation is used to identify entities in the data set and establish relationships to form a payment question knowledge graph. Community detection is then used to divide the knowledge graph into multiple regions representing topics or concepts. Summary data is generated for the entities and relationships within each region, and these summaries are input into a large model of payment customer service question-and-answer experts to generate preliminary answers to payment questions.

[0016] By modifying the large model prompt words and configuring the payment customer service question and answer expert large model to verify the preliminary answer, the final answer is obtained.

[0017] As a preferred technical solution, the process of obtaining a pre-formatted expense claim dataset based on the benchmark question and answer data includes the following steps:

[0018] Extract question fields and answer fields from the big data and convert them into structured text including question-answer pairs through formatting;

[0019] adding a connecting statement to the structured text;

[0020] Optimize structured text through large language models;

[0021] Convert structured text into a preset format to form a payment report dataset.

[0022] As a preferred technical solution, the process of training a large model of customer service question-answering experts includes the following steps:

[0023] By building the Freeze fine-tuning script, freeze all layers except the last few layers of the base large language model;

[0024] Fine-tune the base large language model based on the DeepSpeed training framework and pre-configured redundancy elimination scheme.

[0025] As a preferred technical solution, the GraphRAG-based search enhancement generation process includes the following steps:

[0026] Obtain a large model of customer service Q&A experts and an embedded vector model to complete the deployment of the service environment.

[0027] Deploy a high-speed inference framework and a large prediction model service deployment framework;

[0028] Configure the path and address information of GraphRAG.

[0029] As a preferred technical solution, the process of configuring a large model of customer service question-answering experts to verify the preliminary answers includes the following steps:

[0030] By modifying the large model prompt words, the configuration model checks the initial answer from the perspective of accuracy, completeness and logic to see whether the answer is appropriate enough to the expense claim question raised by the user;

[0031] In response to the large model determining that the preliminary answer is sufficiently relevant to the expense claim question, the preliminary answer is used as the final answer;

[0032] In response to the big model's judgment that the preliminary answer is not sufficiently consistent with the expense claim question, the big model is used to generate a reasoning chain based on the user's question, and the external information retrieved from the knowledge graph is used to screen the reasoning chain that has the highest degree of match with the external information and the most reasonable logic to generate a final answer.

[0033] As an optimal technical solution, a high-speed reasoning framework and HTTP gateway service framework are used to accelerate large model reasoning.

[0034] As a preferred technical solution, the following steps are also included:

[0035] Encapsulate the GraphRAG query function into an interface that can be called through a POST request, create a web service using the Flask framework, and build an HTTP POST route to receive query requests;

[0036] The client passes the query data to the server through the POST request in the query field of the request body;

[0037] The server extracts the query information from the request and passes it to the GraphRAG query function;

[0038] Execute the GraphRAG query method, extract valid text from the returned results using regular expressions, and encapsulate the response data in JSON format;

[0039] The server returns the query result as an HTTP response. If the query is successful, it returns the result and status information. If an error occurs, it returns an error message and status code.

[0040] As a preferred technical solution, the following steps are also included:

[0041] The server is deployed with a Gunicorn server, which processes requests in parallel by setting up multiple worker processes.

[0042] As a preferred technical solution, the process of obtaining the original question-answer data includes the following steps:

[0043] Obtain original answer data on expense reporting questions that are representative and have a high probability of being repeated;

[0044] Based on the original answer data, the types of questions are clustered based on semantic similarity.

[0045] Another aspect of the present invention provides an electronic device comprising one or more processors, a memory, and one or more programs stored in the memory, wherein the one or more programs include instructions for executing the aforementioned expense claim customer service question-and-answer method based on GraphRAG and a large language model.

[0046] Another aspect of the present invention provides a computer-readable storage medium comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned expense reimbursement customer service question-and-answer method based on GraphRAG and a large language model.

[0047] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0048] (1) Realizing multi-hop reasoning and global knowledge extraction: The present invention uses GraphRAG-based search enhancement generation to identify entities in the data set and establish relationships to form a knowledge graph for payment problems. The knowledge graph is divided into multiple regions representing topics or concepts through community detection. A summary is generated for the entities and relationships in each region, which are then input into a large model of payment customer service question-and-answer experts to generate preliminary answers to the payment problems. GraphRAG utilizes the entities and relationships in the knowledge graph to achieve multi-hop reasoning. For example, when a user's question involves multiple entities or requires an answer to be derived from multiple steps, GraphRAG can efficiently find relevant paths and generate accurate answers through the graph structure. It is not limited by the user's word choice and expression, but instead searches for relevant knowledge in the knowledge graph based on the semantics of the question.

[0049] (2) Reduce the amount of annotation and improve efficiency: The present invention uses a zero-redundancy optimizer under the DeepSpeed distributed training framework to fine-tune the base large language model to complete the training of the large model of customer service question-and-answer experts. The large language model can be fine-tuned with a small amount of high-quality data, which significantly improves the speed and efficiency of answering user questions. At the same time, it reduces the dependence on manual customer service and specific terms and regulations in the field of claim payment, thereby reducing labor costs.

[0050] (3) Strong generalization and adaptability: The large language model is trained on a wide range of data sets and has better generalization capabilities. It can adapt to different intelligent customer service question-answering tasks. By fine-tuning and introducing graph retrieval enhancement generation to adapt it to the knowledge in the field of corporate expense reporting, it can improve the application effect in professional fields and show better performance than traditional machine learning models and small language models.

[0051] (4) Improving training and reasoning efficiency: This paper introduces DeepSpeed, vLLM, Gunicorn optimization and HTTP service to greatly improve the model training and reasoning efficiency and the generation speed of GraphRAG, thereby enhancing the practical application value of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 Flowchart of the expense claim customer service question-and-answer method based on GraphRAG and a large language model in an embodiment;

[0053] Figure 2 Schematic diagram of the input text structure of GraphRAG during inference;

[0054] Figure 3 This is a diagram of the dataset structure used for training the Qwen2.5-7B expert model;

[0055] Figure 4This is a diagram of the loss function curve during the training process of the Qwen2.5-7B expert large model;

[0056] Figure 5 This is a schematic diagram of the response speed of concurrent tests in a relatively high-pressure environment;

[0057] Figure 6 Schematic diagram of an electronic device in an embodiment. DETAILED DESCRIPTION

[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0059] Example 1

[0060] Regarding the problems existing in the above-mentioned prior art, see Figure 1 This embodiment provides a customer service question-and-answer method for reimbursement based on GraphRAG and a large language model. The method aims to reduce manual customer service costs, improve the efficiency of real-time responses to user questions, and simultaneously provide better concurrency and generalization capabilities, thereby enhancing the application effect in intelligent customer service fields such as enterprise reimbursement platforms. The method includes the following steps:

[0061] Step S1, data collection. Specifically, step S1 includes steps S101-S103:

[0062] Step S101: Obtaining the Q&A data from the enterprise expense reporting platform:

[0063] We collected repetitive, synonymous, and easily responsive and resolvable expense-related questions generated during the daily operations of the enterprise expense reimbursement platform. Through manual sorting and preliminary classification of several pairs of synonymous and near-synonymous questions, we obtained the question-and-answer data for the enterprise expense reimbursement platform.

[0064] Step S102: data preprocessing:

[0065] Data processing based on Python scripts. The collected data is processed using Python scripts. First, the data from the initial data file is read. The data parsing module extracts the "question" and "answer" fields for each row. The formatting module then combines the extracted content into a text structure according to a predetermined format, while maintaining the semantic integrity of the original question-answer pairs and, where necessary, adding semantically coherent connectives to enhance readability. A large language model with larger parameters, such as GPT-4o, is used to process and optimize any incoherent text while maintaining semantic integrity. Finally, the text output module saves the formatted content in a standard question-answer pair format for subsequent data processing.

[0066] Step S103, high-quality table data screening:

[0067] Representative and logical question-and-answer data of the enterprise expense reporting platform are screened from the initial data, and attention is paid to the semantic diversity of different question-and-answer pairs.

[0068] Step S2: Data integration. Specifically, step S2 includes steps S201-S203:

[0069] Step S201, extracting table information:

[0070] The pre-processed table data is extracted into text format and recorded as "content information".

[0071] Step S202: Sampling prompt word templates:

[0072] To prevent the classification results output by the expert model from being overly sensitive to prompt words, a prompt word candidate set was designed. For each sample, a template "prompt word" was randomly sampled, which effectively reduced the expert model's sensitivity to prompt words.

[0073] Step S203: Input text structure:

[0074] When constructing the input text, you can optionally add "examples" to improve the context learning ability of the expert model. The final constructed input text = {prompt word} + {content information} + {example}, such as Figure 3 shown.

[0075] Step S3: fine-tune data organization.

[0076] Alpaca-formatted data and a three-part prompt template: Alpaca is a fine-tuned dataset format built on the open-source LLaMA model from Meta. Its data format provides a three-part prompt template, consisting of a clear task description (instruction), input (input), and output (output). To convert TXT files containing question-answer pairs into the Alpaca dataset format, a script was written using Python. First, a Python script was used to read the TXT file. Each record is formatted as "question: <question content>" and "answer: <answer content>." Each question and answer pair was extracted using regular expressions or simple string segmentation methods.

[0077] The script first reads each row of data and extracts the corresponding text by searching for keywords in the fields "question" and "answer." It then saves the extracted questions and answers in Alpaca format, storing the questions in the instruction field and the answers in the output field. For each question-answer pair, a JSON object is generated using appropriate structure.

[0078] The processed data is saved as a new JSON file in the format of the Alpaca dataset. Each question-answer pair is stored as an independent JSON object, ultimately forming a complete Alpaca-format dataset for subsequent fine-tuning and other work.

[0079] Step S4: forming an expert model. Specifically, step S4 includes steps S401-S403:

[0080] Step S401: fine-tuning and training of the expert large model.

[0081] After data integration, this paper combines parameter freezing and fine-tuning with NEFTune to improve the performance and adaptability of large language models for specific tasks. Freeze fine-tuning enables efficient downstream task adaptation while maintaining a low parameter count, thereby increasing the platform's flexibility and efficiency. NEFTune improves the generalization and interference resistance of the expert large model by adding noise to the training data, further ensuring the quality and reliability of the expert large model's output.

[0082] Specifically, freeze fine-tuning refers to updating only a small portion of the model's weights during training, freezing most of the original model's parameters and training only a subset of those parameters. This allows large models to be trained on a single GPU, or without requiring Transmission Time (TP) or Processing Time (PP) operations. This reduces the requirements for video memory. This fine-tuning method only requires fine-tuning high-level features, accelerating model convergence. By freezing the parameters of the first few dozen layers of the model and training and updating only the last few layers, it maximizes the preservation of common linguistic features learned during pre-training of the large language model, enhancing interpretability.

[0083] Directly fine-tuning all parameters of a large model can lead to overfitting on downstream tasks. The Freeze method fixes the underlying parameters, retaining the common characteristics of the pre-trained model and reducing the risk of overfitting. This method is particularly suitable for fine-tuning smaller datasets, reducing the data collection requirements for enterprise expense reporting platforms, shifting the focus from data quantity to data quality, and enabling the collection of more diverse and logical question-and-answer data.

[0084] Noise Embedding Finetuning (NEFTune) is an innovative finetuning technique used to augment and perturb input training data, improving the generalization capabilities of the expert model. This helps mitigate overfitting and the "hallucination problem" that can occur during the fine-tuning phase of the expert model. It achieves data diversity and robustness by introducing uniformly distributed noise into word vectors. Specifically, uniformly distributed noise is added to word vectors in each training iteration. This improvement is not only simple to implement, but also requires no new model parameters and no additional computational resources or data overhead. NEFTune not only improves the expert model's tolerance to noise but also enhances its adaptability to unseen samples, resulting in better performance in real-world applications. In actual experiments, introducing NEFTune can improve accuracy by approximately 8%.

[0085] Step S402: Expert large model training optimization.

[0086] Considering that as the scale of deep learning models continues to expand, the computing and memory requirements during training also increase. Therefore, this method combines DeepSpeed to accelerate training. DeepSpeed greatly reduces the resources required for model parallelism and data parallelism through the parallel optimizer ZeRO (Zero Redundancy Optimizer), which is conducive to accelerating model training. This method is based on the ZeRO2 solution in DeepSpeed, and optimizes the storage of optimizer states and gradients, so that large expert models can be trained in parallel in a distributed environment, thereby maximizing the utilization of GPU computing resources. After applying DeepSpeed, the training speed of large expert models is significantly improved. Compared with traditional training methods, the training time is shortened by more than 50%, and it can handle larger-scale models. This improvement not only improves training efficiency, but also reduces the demand for computing resources, making the training of large-scale models more feasible.

[0087] Step S5: Graph retrieval generation enhancement.

[0088] RAG integrates external knowledge bases and dynamically introduces relevant information during the generation process to enhance the accuracy and richness of content generation. Compared with the methods based on vector similarity matching and traditional RAG, GraphRAG (Graph-based Retrieval Augmented Generation) of this embodiment introduces knowledge graphs to store data set information in the form of nodes and relationships, which can provide richer context and relationship information and realize multi-hop reasoning. For example, when user questions involve multiple entities or need to derive answers from multiple steps, GraphRAG can efficiently find relevant paths and generate accurate answers through the graph structure. Identify entities (concepts, paths, places, etc.) from the question-answer data set, and build a relationship network between them to form a knowledge graph for reporting and payment related issues. Using the community detection algorithm, the nodes in the knowledge graph are divided into different areas. Each community represents a specific topic or concept. A summary is generated for the entities and relationships in each community, and the summaries are input into the large model for enhanced generation, thereby improving the answer performance of the large model.

[0089] Modify the default prompt words of GraphRAG and introduce thought chain prompts in the prompt words of the large model to guide the large model to generate relatively high-quality answers, such as Figure 2 shown.

[0090] Step S6: Expert large model reasoning optimization and graph retrieval generation to enhance access acceleration.

[0091] During the expert model inference phase, the text to be inferred is fed into the expert model in the training format to obtain a binary classification result of whether it is sensitive or not. At the same time, the vLLM accelerated inference framework is combined to accelerate the inference speed of the expert model and improve its performance. The Gunicorn HTTP gateway service framework is used to enhance the concurrency and response speed of GraphRAG.

[0092] As the complexity and scale of natural language processing (NLP) tasks continue to increase, large language models face significant computational resource consumption and latency issues during inference. This method, combined with vLLM for inference acceleration, aims to significantly improve the throughput and memory efficiency of language model services in real-time scenarios. vLLM significantly improves inference speed by optimizing memory usage and computational processes. This framework supports model parallelism and pipeline processing, effectively handling extremely large models and improving overall inference efficiency.

[0093] During the implementation process, this method integrates vLLM into the expert large model. First, by utilizing the characteristics of model parallelism, the various parts of the expert large model are distributed on different computing units to achieve load balancing. Secondly, through pipeline processing, it is ensured that multiple inference requests can be made simultaneously in different computing stages, maximizing the utilization of computing resources. In addition, for memory management, an efficient caching strategy is adopted to reduce memory usage and data transmission delay. Through the above scheme, significant performance improvement is achieved in the inference process. This method implements the vLLMWrapper class adapted to Qwen2.5, which increases the inference speed of the fine-tuned Qwen by 33.8%, and does not require any changes to the expert large model architecture, which enhances the practical application value of the expert large model to a certain extent.

[0094] Considering the application scenarios of expense reimbursement customer service Q&A, and to standardize the model interface and make it accessible over the network, this method encapsulates the GraphRAG query function into an interface callable via POST requests. First, a web service is created based on the Flask framework, defining an HTTP POST route to receive query requests. The client sends the query data in the query field of the request body via POST to the server. The server extracts the query information from the request and passes it to the GraphRAG query function. After the GraphRAG query method is executed, the returned result is first processed through a regular expression to extract valid text and then encapsulated into a JSON response to ensure it conforms to the client's expected format. The server returns the query result as an HTTP response, which includes the result and status information if the query is successful, and an error message and status code if an error occurs. Ultimately, this approach encapsulates the GraphRAG query function into a standardized HTTP API that any client supporting HTTP can call to obtain the query results, thus ensuring remote access and interoperability between systems.

[0095] Considering the high concurrency of customer support Q&A scenarios, and to further improve the concurrent processing capabilities of the aforementioned API, Gunicorn was used as the WSGI server for application deployment. Gunicorn is an efficient Python WSGI HTTP server capable of handling large numbers of concurrent requests. During application deployment, Gunicorn was configured to increase its processing power and set up multiple worker processes to handle requests in parallel, significantly improving the API's response speed and concurrent processing capabilities. This is especially true in high-traffic environments, effectively reducing the burden on individual processes and ensuring system stability and efficiency. This allows the API to maintain low response latency and high throughput when handling a large number of requests, providing users with faster and more stable service.

[0096] To verify the effectiveness of this method in the expense claim customer service question-answering scenario, the obtained expert model was evaluated as follows:

[0097] Evaluation dataset preparation:

[0098] Since most enterprise expense reporting data involves specific terms and conditions related to enterprise expense reporting, the training goal of the fine-tuning task in this application scenario is primarily to infuse knowledge and improve the model's performance in the specific domain of enterprise expense reporting questions and answers. Therefore, the fine-tuning data is used directly for evaluation, assessing the textual similarity between the fine-tuned model's generated text and the corresponding human answers in the dataset.

[0099] Evaluation results:

[0100] Hyperparameters play a crucial role in fine-tuning the expert model. The hyperparameter settings during fine-tuning directly affect the performance and convergence speed of the expert model. Freeze fine-tuning involves several important hyperparameters, including:

[0101] (1) freeze_trainable_layers, which indicates the parameter range for Freeze fine-tuning. Generally, the last few layers of the model are used for fine-tuning, and the parameters of other layers remain unchanged.

[0102] (2) lr, represents the expert large model fine-tuning learning rate, which affects the rate of decrease of the loss function in model fine-tuning and the final fine-tuning convergence

[0103] (3) num_train_epochs, which indicates the number of training rounds on the dataset during fine-tuning. One epoch means that the model is trained on the entire dataset for one round.

[0104] (4)neftune_alpha, which represents the noise scaling parameter used by NEFTune

[0105] After trying various parameter combinations, the final hyperparameters are determined to be freeze_trainable_layers = 8, lr = 5e-5, num_train_epochs = 5, neftune_alpha = 5. The loss function decreases during fine-tuning as shown below: Figure 4 As shown. Other large-scale model inference settings refer to the official Qwen2.5 github settings, and all experiments were completed using an A100 graphics card. The test was conducted on the enterprise payment question-answering dataset. The BLEU score quantifies the quality of the generated text by comparing the n-gram (n consecutive words) matching between the generated text and the reference text. 4-gram is generally used to measure the generation of short sentences in the generated text. The Rouge-N score splits the generated text and the reference text into n-grams and evaluates the text generation quality by calculating the recall rate of the reference text. The Rouge-L score comprehensively evaluates the quality of text generation by calculating the recall rate and precision rate of the maximum common subsequence (LCS) between the generated text and the reference text. The fine-tuned Qwen2.5-7B expert large model was used for testing, with BLEU-4 = 54.56%, Rogue-1 = 66.23%, Rogue-2 = 55.05%, and Rogue-L = 60.29%. It can be seen that the expert large model of this method performs well on multiple evaluation indicators.

[0106] High-voltage concurrent test experiment:

[0107] In order to test the response speed of the Qwen2.5-7B expert model and GraphRAG in a relatively high-pressure user access environment, the postman software tool was used to set 20 virtual users to send 153 requests within 10 minutes, and the average response speed of GraphRAG was calculated. Figure 5 As shown in the figure, the shaded area represents virtual users, the blue curve represents the average response time, and the purple represents the response time represented by the number at the 90% position. According to the image, even though the running speed of the GraphRAG framework itself is generally considered to be a disadvantage, this method can use the vLLM model inference acceleration tool and the Gunicorn HTTP gateway service framework to improve the performance and response speed of GraphRAG in concurrent situations. It can also adjust the running parameter settings of vLLM and Gunicorn according to the running environment resources to further improve the concurrent performance.

[0108] Example 2

[0109] Based on Example 1, this embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the expense reimbursement customer service question and answer method based on GraphRAG and a large language model as described in Example 1.

[0110] like Figure 6 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to software implementation, the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0111] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0112] Example 3

[0113] Based on the foregoing embodiments, this embodiment provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the expense reimbursement customer service question-and-answer method based on GraphRAG and a large language model as described in Example 1.

[0114] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0115] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A customer service question-answering method for expense reporting based on GraphRAG and a large language model, characterized in that: The steps include: Obtaining benchmark question-and-answer data in response to expense reporting questions; For the benchmark question-answering data, a pre-formatted expense report dataset is obtained through annotation and prompting engineering; Based on the payment data set, the zero-redundancy optimizer was used to fine-tune the base language model through parameter freezing and noise embedding in the DeepSpeed distributed training framework to complete the training of the payment customer service question-and-answer expert model. Based on the payment data set, GraphRAG-based search enhancement generation is used to identify entities in the data set and establish relationships to form a payment question knowledge graph. Community detection is then used to divide the knowledge graph into multiple regions representing topics or concepts. Summary data is generated for the entities and relationships within each region, and these summaries are input into a large model of payment customer service question-and-answer experts to generate preliminary answers to payment questions. By modifying the large model prompt words and configuring the payment customer service question and answer expert large model to verify the preliminary answer, the final answer is obtained.

2. A customer service question-answering method based on GraphRAG and a large language model according to claim 1, characterized in that: The process of obtaining a pre-formatted expense claim dataset based on the benchmark question-and-answer data includes the following steps: Extract question fields and answer fields from the big data and convert them into structured text including question-answer pairs through formatting; adding a connecting statement to the structured text; Optimize structured text through large language models; Convert structured text into a preset format to form a payment report dataset.

3. A method for customer service question and answer based on GraphRAG and a large language model according to claim 1, characterized in that: The process of training the large model of customer service question-answering experts for payment and claim services includes the following steps: By building the Freeze fine-tuning script, freeze all layers except the last few layers of the base large language model; Fine-tune the base large language model based on the DeepSpeed training framework and pre-configured redundancy elimination scheme.

4. A method for customer service question and answer based on GraphRAG and a large language model according to claim 1, characterized in that: The GraphRAG-based search enhancement generation process includes the following steps: Obtain a large model of customer service Q&A experts and an embedded vector model to complete the deployment of the service environment. Deploy a high-speed inference framework and a large prediction model service deployment framework; Configure the path and address information of GraphRAG.

5. The method for customer service question and answer based on GraphRAG and a large language model according to claim 1, characterized in that: The process of configuring a large model of customer service question-answering experts to verify the preliminary answers includes the following steps: By modifying the large model prompt words, the configuration model checks the initial answer from the perspective of accuracy, completeness and logic to see whether the answer is appropriate enough to the expense claim question raised by the user; In response to the large model determining that the preliminary answer is sufficiently relevant to the expense claim question, the preliminary answer is used as the final answer; In response to the big model's judgment that the preliminary answer is not sufficiently consistent with the expense claim question, the big model is used to generate a reasoning chain based on the user's question, and the external information retrieved from the knowledge graph is used to screen the reasoning chain that has the highest degree of match with the external information and the most reasonable logic to generate a final answer.

6. A method for customer service question and answer based on GraphRAG and a large language model according to claim 1, characterized in that: Leverage the high-speed inference framework and HTTP gateway service framework to accelerate large model inference.

7. A method for customer service question and answer based on GraphRAG and a large language model according to claim 6, characterized in that: The following steps are also included: Encapsulate the GraphRAG query function into an interface that can be called through a POST request, create a web service using the Flask framework, and build an HTTP POST route to receive query requests; The client passes the query data to the server through the POST request in the query field of the request body; The server extracts the query information from the request and passes it to the GraphRAG query function; Execute the GraphRAG query method, extract valid text from the returned results using regular expressions, and encapsulate the response data in JSON format; The server returns the query result as an HTTP response. If the query is successful, it returns the result and status information. If an error occurs, it returns an error message and status code.

8. The method for customer service question and answer based on GraphRAG and a large language model according to claim 6, characterized in that: The following steps are also included: The server is deployed with a Gunicorn server, which processes requests in parallel by setting up multiple worker processes.

9. An electronic device, characterized in that: The system comprises one or more processors, a memory and one or more programs stored in the memory, wherein the one or more programs include instructions for executing the claim customer service question-and-answer method based on GraphRAG and a large language model as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that It includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing the claim customer service question and answer method based on GraphRAG and a large language model as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Intelligent dialogue platform based on large language model

    CN118551772A

  • Intelligent customer service question and answer method based on large language model technology

    CN118364084A

  • Question answering method and device based on large model, electronic equipment and medium

    CN119357364A

  • Knowledge management system and method for constructing large voice model

    CN119476458A

  • GraphRAG-based large model question and answer method, system and equipment, medium and product

    CN119558401A

Cited By

  • Domain-specific autonomous retrieval-augmented generative customer service agent system

    CN122796093A