Toll road customer service system and method based on large language model
Through the highway customer service system based on the LangChain large language model, the problem that traditional manual customer service cannot provide all-weather services is solved, and all-weather intelligent customer service and cross-business system joint inspection is realized, which improves service efficiency and user experience.
Patent Information
- Application Number
- CN202411148007.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-29
AI Technical Summary
Traditional manual customer service cannot provide all-weather and real-time services, resulting in long wait times for users, low service efficiency, and long complex business processing cycles, affecting user satisfaction.
Based on the LangChain large language model framework, the large language fee model and knowledge model library are trained, and user input is intelligently recognized through agent Agent, and the association tool is automatically accessed to data retrieval, providing accurate answers, and transferring to manual customer service when answers cannot be obtained directly. Learn new knowledge.
It realizes all-weather intelligent customer service, significantly improves customer satisfaction and service efficiency, reduces the workload of manual customer service, supports 24/7 services, and automatically checks across business systems, improving query efficiency and accuracy.
Smart Images

Figure CN119048108A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of highway fee management, and in particular relates to a toll road customer service system and method based on a large language model. Background Art
[0002] With the continuous increase in the number of cars, the average daily service volume of the ETC service center customer service hotline is as high as more than 1,000 orders. However, the traditional manual customer service processing method is still used, which leads to the emergence of multiple problems. First, traditional manual customer service is limited to fixed working hours and cannot provide all-weather, real-time service. Secondly, manual customer service needs to spend a lot of time on problem investigation and diagnosis, which delays user waiting time and reduces service efficiency. In addition, the processing speed of traditional manual customer service is slow, especially during peak hours, which can easily cause users to wait for a long time, which is not conducive to user experience. There are also some complex businesses that need to be queried from related systems with R&D personnel before they can be processed, which further increases the problem solving cycle and significantly damages user satisfaction. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a toll road customer service system and method based on a large language model.
[0004] The technical solution is as follows: A toll road customer service system and generation method based on a large language model, comprising:
[0005] S1, based on the LangChain big model framework, conduct big language model training, and generate big language rate model library and big language knowledge model library through big language rate model and big language knowledge model training respectively:
[0006] S2, when the large language rate model library and the large language knowledge model library cannot provide accurate answers, the agent provided by the Langchain framework intelligently identifies user input and automatically accesses related tools for data retrieval. The basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate;
[0007] S3, for queries that cannot directly obtain accurate answers from the large language rate model library, the large language knowledge model library or the agent tool set, transfers the questions to manual customer service, learns new knowledge from the interaction, and improves and adapts to new data and user needs.
[0008] In step S1, a large language model is trained, including: building a highway rate model and a customer service knowledge model based on the LangChain large model framework, and implementing intelligent customer service Q&A to cope with multi-language tasks and application scenarios;
[0009] Generate a large language rate model library, including: collecting highway toll station information and road network structure data, using the LangChain framework to understand and parse the road network model, generating a structured rate model, and using a recursive character text segmenter to segment the collected data into multiple independent text blocks. i , and assign each text block a unique ID, that is, T = {T1, T2...T n}, the text block T is transformed into i Convert to a numerical vector E i , and get E i =Embedding(T i ), Embedding() is a process function that maps data to a low-dimensional vector space; the text block T i ID and vector E i Stored in the large language rate model library, forming the model library M Fee , the expression is: M Fee ={(ID1, E1), (ID2, E2)…(ID n , E n )), where (ID n , E n ) is the model library factor composed of the nth address ID and the nth vector;
[0010] Generate a large language knowledge model library, including: collecting customer problems and their solutions, using recursive character text segmentation and OpenAI Embedding model to segment text blocks K in the knowledge base i Convert to a numeric vector V i , that is, K={K1,K2…K n},V i =Embedding(K i ), the text block V i The ID and text block K i Stored in the large language rate model library, forming the model library M Knowledge , the expression is: M Knowledge ={(ID1, K1), (ID2, K2)…(ID n , K n )), where (ID n , K n ) is the model library M consisting of the nth address ID and the nth text block Knowledge Factors of
[0011] In step S2, the basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate. The expression is:
[0012]
[0013] Where cosθ Fee (Q, E i ) is the cosine similarity between the query vector and the vector in the database, cosθ Knowledge (Q,V i ) is the cosine similarity between the query vector and the vector in the knowledge model library, || || is the modulus of the vector, Q is the query vector, E i is the vector in the rate model library, V i is the vector in the knowledge model library;
[0014] When cosθ Fee (Q, E i )>0 or cosθ Knowledge (Q,V i )>0, the answer is considered accurate, otherwise the agent will automatically access the associated tool for data retrieval;
[0015] The agent in the LangChain framework will intelligently identify user input and automatically call associated tools for data retrieval and processing to achieve intelligent input. First, when the user initiates a query, the agent accepts and parses the user input to generate a query vector Q. Then, the cosine similarity formula is used to calculate the similarity between the query vector Q and the rate model library E. i and knowledge model library V i The similarity of the vector in Cosθ Fee (Q, E i )>0 or cosθ Knowledge (Q,V i )>0, it is considered that the exact answer has been found; if the preliminary match fails to provide an exact answer, the agent will call the pre-configured association tool to perform data retrieval based on the analysis results, further search for relevant information, or transfer the query to manual customer service.
[0016] Furthermore, the highway rate model is used to answer users' questions about highway tolls. It collects highway network structure information including toll station information, road connection relationships and distances, and uses the Langchain large language model framework to semantically understand and parse the road network model to generate a structured rate model. The collected road network information is divided into multiple independent text blocks using a recursive character text segmenter, and each block is assigned a unique number. The text blocks are converted into numerical vectors through the OpenAI Embedding model and stored in the large language rate model library. When a user raises a highway fee question, the cosine similarity technology is used to calculate the similarity between the query vector and the vector in the database, thereby retrieving the relevant rate information.
[0017] Furthermore, the customer service knowledge model is used to answer frequently asked questions and answers about highways and policy issues, and collect customer service common questions and answers, user consultation records, business processes and policy data in the field of highway toll business; based on the collected original data set, the text segmenter technology in the LangChain architecture is used to segment the content of PDF or WORD files into multiple independent paragraph blocks, and each block is assigned a unique number, and the paragraph blocks are converted into vectors through the text embedding model and stored in the toll road customer service knowledge model;
[0018] The trained big language knowledge model library and highway rate model are connected to the toll road customer service system, and connected to the business logic layer of the customer service system through the API interface. When a user asks a question, a similarity search is first performed in the model to identify the document fragment that best matches the user's question vector. The best matching question is identified and its content is sent to the big language model. The big language model uses natural language processing technology to analyze in a semantic way and generate accurate answers to return to the user.
[0019] In step S2, the associated tool is automatically accessed to retrieve data, including:
[0020] Use the agent provided by the Langchain large language model framework to establish a connection with the business database, and automatically generate the corresponding database query statements through predefined query templates to create an agent tool set; the tool set includes gantry image tools, rate tools, and fee statistics tools, which are used to process and analyze different types of data to meet business needs; the agent tool interacts and compares with different databases through APIs to verify the rationality of the data and reduce the query of multiple systems by manual customer service;
[0021] Among them, the gantry image tool interacts with the gantry camera system database to obtain images of vehicles passing through each gantry, and uses image recognition technology to identify the vehicle's license plate number, model and driving direction information; the rate tool calculates the toll based on the vehicle information and driving path provided by the gantry image tool; the toll statistics tool handles highway tolls and settlements, and calculates the vehicle's toll amount based on the traffic record flow.
[0022] In step S3, new knowledge is learned from the interaction to improve and adapt to new data and user needs, including: through natural language processing technology, the system converts unstructured voice data into structured text data and automatically adds it to the large language knowledge model library to meet new data and user needs.
[0023] Another object of the present invention is to provide a toll road customer service system based on a large language model, the system implements the toll road customer service rate generation method based on a large language model, and the system includes:
[0024] The model training module is used to train the large language model based on the LangChain large model framework. Through the training of the large language rate model and the large language knowledge model, the large language rate model library and the large language knowledge model library are generated respectively;
[0025] The agent tool set module is used to intelligently identify user input through the agent provided by the Langchain framework when the large language rate model library and the large language knowledge model library cannot provide accurate answers, and automatically access related tools for data retrieval. The basis for judging the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate;
[0026] The autonomous learning module is used to process queries that cannot obtain accurate answers directly from the large language rate model library, the large language knowledge model library or the agent tool set, transfer the questions to manual customer service, learn new knowledge from the interaction, and improve and adapt to new data and user needs.
[0027] Furthermore, the system is mounted on a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, and when the processor executes the computer program, the functions of the toll road customer service system based on the large language model are implemented.
[0028] Furthermore, the system is mounted on a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the functions of the toll road customer service system based on the large language model can be realized.
[0029] Combining all the above technical solutions, the beneficial effects of the present invention are as follows: the present invention integrates the highway toll collection business into the large model with the help of the data understanding and generation capabilities of the Langchain large model to achieve all-weather, year-round intelligent customer service, thereby significantly improving customer satisfaction. At the same time, by analyzing user feedback data, the system can continuously optimize services and provide more personalized and targeted solutions for highway management bureaus, which helps to improve the efficiency and quality of highway management.
[0030] The present invention improves customer service efficiency and user experience: the large language customer service system can automatically parse user input and process query requests, greatly reducing the workload of manual customer service, while supporting all-weather uninterrupted service to meet the needs of users in different time zones around the world and achieve true 24 / 7 customer service coverage. Realize integration and joint query across business systems: the work that originally required customer service personnel to manually retrieve vehicle information in multiple isolated toll business systems can now be automatically retrieved and shared between different business systems through agent tools, eliminating the need for manual query and improving query efficiency and accuracy. Comprehensive improvement of value-added services: the system covers intelligent planning of vehicle driving routes, quick query of real-time tolls, accurate intelligent navigation guidance, and a rich knowledge base that includes answers to frequently asked questions and the latest policy interpretations, etc., to comprehensively improve the user's travel experience and create a more intimate and intelligent service system.
[0031] Traditional customer service systems rely on manual customer service, such as simple FAQ responses and static information queries, and cannot cope with complex user needs, especially when dealing with cross-business system queries, which involve technical issues. Currently, they mainly rely on third-party system maintenance personnel to process queries through the background, resulting in low query efficiency and long waiting time. The present invention uses the LangChain large model framework to construct a large language rate model and a large language knowledge model, and realizes the ability to intelligently and dynamically respond to user query needs. Through the collaborative work of the agent Agent and a variety of related tools, it realizes automated data retrieval and cross-system joint query, eliminates the need for manual query, and significantly improves query efficiency and accuracy. Through the above innovations, it fills the deficiencies of the existing domestic customer service system in terms of intelligence and automation, and improves customer service efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;
[0033] Figure 1 is a schematic diagram of a toll road customer service system based on a large language model provided by an embodiment of the present invention;
[0034] Figure 2 is a diagram of a large language model training process provided by an embodiment of the present invention;
[0035] Figure 3 It is a flow chart of a method for generating customer service rates for toll roads based on a large language model provided by an embodiment of the present invention;
[0036] Figure 4 It is a schematic diagram of a method for generating customer service rates for toll roads based on a large language model provided by an embodiment of the present invention;
[0037] In the figure: 1. Model training module; 2. Agent tool module; 3. Autonomous learning module. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.
[0039] With the rapid development of artificial intelligence technology, the application of large language models in customer service systems is becoming more and more extensive. The present invention proposes a toll road customer service system and method based on a large language model, aiming to improve the efficiency of customer service inquiries and user experience through intelligent technology. The system integrates natural language processing and machine learning technologies, realizes intelligent data retrieval and cross-business system joint query capabilities, and ensures that users can quickly obtain accurate and timely query results. The innovations of the present invention are: 1) efficient natural language understanding capabilities, which can accurately analyze user intentions; 2) cross-system data integration capabilities, which simplifies the operating procedures of customer service personnel; 3) advanced speech recognition technology, which supports system self-learning and dynamic updating of the knowledge base.
[0040] Embodiment 1, as Figure 1 As shown, a toll road customer service system based on a large language model provided by an embodiment of the present invention includes a model training module 1, a data verification module 2 and an autonomous learning module 3.
[0041] Model training module 1 is used to train the large language model based on the LangChain large model framework, and to generate the large language rate model library and the large language knowledge model library through the large language rate model and the large language knowledge model training respectively;
[0042] Agent tool set module 2 is used to intelligently identify user input through the agent provided by the Langchain framework when the large language rate model library and the large language knowledge model library cannot provide an accurate answer, and automatically access the associated tool for data retrieval. The basis for judging the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate;
[0043] The autonomous learning module 3 is used to process queries that cannot obtain accurate answers directly from the large language rate model library, the large language knowledge model library or the agent tool set, transfer the questions to manual customer service, learn new knowledge from the interaction, and improve and adapt to new data and user needs.
[0044] For example, Figure 2 As shown,
[0045] 1. Road network model definition: First, define the road network model, including the structural information of the road network, such as the location of toll stations, road connection relationships, distances and other information.
[0046] 2. Large language model processing: Use the large language model to process the defined road network model, perform semantic understanding and analysis, and generate a structured rate model.
[0047] 3. Structured rate generation: Based on the results of large language model analysis, structured rate information is generated, including the fee calculation rules and models between each toll station.
[0048] 4. Multi-dimensional update: The generated rate model can be optimized through multi-dimensional update, and the rate model can be adjusted according to actual usage to ensure the accuracy and real-time performance of the model.
[0049] 5. Store in a relational database; the processed and optimized rate model is stored in a relational database, and the saved rate model can be called by subsequent processing steps.
[0050] 6. Semantic processing: semantic processing is performed on the rate model stored in the database to facilitate further understanding and use, including converting the rate model into vector form for easy embedding processing.
[0051] 7. OpenAI Embedding (Ada) processing: Use OpenAI's Embedding model (such as Ada) to embed the semantically processed rate model. The generated embedding vector represents the characteristics of the rate model, which is convenient for subsequent storage and query.
[0052] 8. Create a rate model: Create a rate model based on the embedded vector, including the rate information represented by the vector, which can be used for fast query and comparison.
[0053] 9. Rate model storage: The created rate model is stored in the vector database (VectorDataBase). The rate model stored in the vector database can be quickly retrieved and queried to answer users' natural language questions.
[0054] Model training module 1 is used to:
[0055] The large language model training includes: building a highway rate model and a customer service knowledge model based on the LangChain large model framework, first collecting the highway customer service information set and the highway network information set, and using a recursive character text segmenter to divide the information set into independent paragraph blocks. The highway customer service information set includes: route planning and navigation, charging standards and fees, services and facilities; the highway network information set includes: frequently asked questions and answers, user consultation records, business processes and related policies;
[0056] Subsequently, based on the segmented paragraph blocks, the text blocks are converted into numerical vectors using a text embedding model and stored in the rate model library and the customer service knowledge model library respectively;
[0057] Finally, the trained large language knowledge model library and highway rate model are connected to the toll road customer service system, and the connection with the business logic layer of the customer service system is realized through the API interface. When the user asks a question, the system can intelligently analyze the user's intention, call the relevant model for data retrieval and processing, generate accurate answers and feedback to the user.
[0058] The highway rate model is used to answer users' questions related to highway tolls and collect highway network structure information, including toll station information, road connection relationships and distances. The Langchain large language model framework (embedded machine learning model) is used to semantically understand and parse the road network model to generate a structured rate model. Then, a recursive character text segmenter is used to divide the collected road network information into multiple independent text blocks, and each block is assigned a unique number, so that it can understand and process each part more efficiently and accurately. Subsequently, the text blocks are converted into numerical vectors through the OpenAI Embedding model and stored in the vector database (large language rate model library) for efficient management and retrieval. When a user initiates a question related to highway fees, the cosine similarity technology is used to calculate the similarity between the query vector and the vector in the database, so as to retrieve the most relevant rate information.
[0059] The customer service knowledge model is used to answer users' frequently asked questions and answers about highways and related policies, and collect customer service common questions and answers, user consultation records, business processes and related policy data in the field of highway toll business; based on the collected original data set, the text segmenter technology in the LangChain architecture is used to segment the PDF or WORD file content into multiple independent paragraph blocks, and each block is assigned a unique number, and then the paragraph blocks are converted into vectors through the text embedding model and stored in the toll road customer service knowledge model for subsequent use.
[0060] The trained large language knowledge model library and highway rate model are connected to the toll road customer service system, and the connection with the business logic layer of the customer service system is realized through the API interface. When a user asks a question, a similarity search is first performed in the relevant model to identify the document fragment that best matches the user's question vector. The best matching question is identified and its content is sent to the large language model, which uses natural language processing technology to analyze and generate accurate answers in a semantic way and return them to the user.
[0061] Agent Tool Module 2 interacts with external data sources by combining the Agent component provided by the Langchain framework, including:
[0062] By customizing the tool set through the agent components provided by the Langchain large language model framework, the agent can seamlessly access data sources across business systems. When faced with user inquiries about vehicle tolls, the agent can quickly identify the needs and automatically call the gantry tool and rate tool through the inference engine to obtain the current toll rate. By working together with multiple tools, it ensures that the agent can provide accurate and timely responses.
[0063] Create a custom agent tool set, including rate tools, charging tools, customer service tools, and gantry tools. This tool set interacts with the charging business database by calling the API interface to ensure the accuracy and efficiency of the query results.
[0064] Gantry tool: used to parse and recognize gantry image data, helping the agent understand the specific location and time of vehicle passing.
[0065] Rate tool: responsible for retrieving and calculating toll rates for different road sections or services to ensure the accuracy of toll calculation.
[0066] Charge statistics tool: Provides statistics and analysis functions for charge data, helping agents to quickly respond to users' needs for historical charge inquiries.
[0067] Furthermore, the user submits a query request through the customer service system input box, for example: "On June 2, 2024, vehicle AC6E95 in Gansu drove out from toll station A at point B. The toll was 32 yuan, but it was charged 8 yuan more this time. Please give a reasonable reply?"
[0068] Step 1: Large language model LLM analyzes user intent;
[0069] Step 2: Based on the parsing results, construct a query request and send it to the proxy service through the API;
[0070] Step 3: After receiving the query request, the proxy service calls the corresponding tool to obtain data;
[0071] Step 4: The proxy service generates a response based on the acquired data and sends it back to the LLM.
[0072] Step 5: LLM parses the response content into natural language and returns the final query answer to the user.
[0073] The autonomous learning module 3 is used for autonomous learning, including:
[0074] Autonomous learning means that when data cannot be directly obtained from the big language rate model library, big language knowledge model library and agent tools, the customer system automatically transfers the problem to the manual customer service and calls the multimodal big language model's speech recognition technology to capture and process the customer's voice information, thereby learning new knowledge and skills. Through natural language processing technology, the system converts unstructured voice data into structured text data and automatically saves it to the big language knowledge model library to meet new data and user needs.
[0075] Through the above embodiments, it can be seen that the large language rate model in the system provided by the present invention has been carefully trained and data verified, and can quickly and accurately answer specific business questions raised by users, thereby improving the efficiency and accuracy of customer service. At the same time, the customer service knowledge model can quickly answer common questions and provide users with standard answers.
[0076] The autonomous learning module in the system enables the model to quickly transfer problems to human customer service when it is unable to understand user intent or handle certain business matters, learn new knowledge and skills from the interaction, and continuously improve and adapt to new data and user needs.
[0077] Embodiment 2, as Figure 3 As shown, the method for generating customer service rates for toll roads based on a large language model provided by an embodiment of the present invention includes: a method for generating customer service rates for toll roads based on a large language model, the method comprising:
[0078] S1, based on the LangChain big model framework, conduct big language model training, and generate big language rate model library and big language knowledge model library through big language rate model and big language knowledge model training respectively:
[0079] S2, when the large language rate model library and the large language knowledge model library cannot provide accurate answers, the agent provided by the Langchain framework intelligently identifies user input and automatically accesses related tools for data retrieval. The basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate;
[0080] S3, for queries that cannot directly obtain accurate answers from the large language rate model library, the large language knowledge model library or the agent tool set, transfers the questions to manual customer service, learns new knowledge from the interaction, and improves and adapts to new data and user needs.
[0081] In step S1, a large language model is trained, including: building a highway rate model and a customer service knowledge model based on the LangChain large model framework, and implementing intelligent customer service Q&A to cope with multi-language tasks and application scenarios;
[0082] Generate a large language rate model library, including: collecting highway toll station information and road network structure data, using the LangChain framework to understand and parse the road network model, generating a structured rate model, and using a recursive character text segmenter to segment the collected data into multiple independent text blocks. i , and assign each text block a unique ID, that is, T = {T1, T2...T n}, the text block T is transformed into i Convert to a numerical vector E i , and get E i =Embedding(T i ), Embedding() is a process function that maps data to a low-dimensional vector space; the text block T i ID and vector E i Stored in the large language rate model library, forming the model library M Fee , the expression is: M Fee ={(ID1, E1), (ID2, E2)…(ID n , E n )), where (ID n , E n ) is the model library factor composed of the nth address ID and the nth vector;
[0083] Generate a large language knowledge model library, including: collecting customer problems and their solutions, using recursive character text segmentation and OpenAI Embedding model to segment text blocks K in the knowledge base i Convert to a numeric vector V i , that is, K={K1,K2…K n},V i =Embedding(K i ), the text block V i The ID and text block K i Stored in the large language rate model library, forming the model library M Knowledge , the expression is: M Knowledge ={(ID1, K1), (ID2, K2)…(ID n , K n )), where (ID n , K n ) is the model library M consisting of the nth address ID and the nth text block Knowledge Factors of
[0084] In step S2, the basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate. The expression is:
[0085]
[0086]
[0087] Where cosθ Fee (Q, E i ) is the cosine similarity between the query vector and the vector in the database, Cosθ Knowledge (Q,V i ) is the cosine similarity between the query vector and the vector in the knowledge model library, || || is the modulus of the vector, Q is the query vector, E i is the vector in the rate model library, V i is the vector in the knowledge model library;
[0088] When cosθ Fee (Q, E i )>0 or cosθ Knowledge (Q,V i )>0, the answer is considered accurate, otherwise the agent will automatically access the associated tool for data retrieval;
[0089] The agent in the LangChain framework will intelligently identify user input and automatically call associated tools for data retrieval and processing to achieve intelligent input. First, when the user initiates a query, the agent accepts and parses the user input to generate a query vector Q. Then, the cosine similarity formula is used to calculate the similarity between the query vector Q and the rate model library E. i and knowledge model library V i The similarity of the vector in Cosθ Fee (Q, E i )>0 or cosθ Knowledge (Q,V i )>0, it is considered that the exact answer has been found; if the preliminary match fails to provide an exact answer, the agent will call the pre-configured association tool to perform data retrieval based on the analysis results, further search for relevant information, or transfer the query to manual customer service.
[0090] The highway rate model is used to answer users' questions about highway tolls. It collects highway network structure information including toll station information, road connection relationships and distances, and uses the Langchain large language model framework to semantically understand and parse the road network model to generate a structured rate model. The collected road network information is divided into multiple independent text blocks using a recursive character text segmenter, and each block is assigned a unique number. The text blocks are converted into numerical vectors through the OpenAIEmbedding model and stored in the large language rate model library. When a user raises a highway fee question, the cosine similarity technology is used to calculate the similarity between the query vector and the vector in the database, thereby retrieving the relevant rate information.
[0091] The customer service knowledge model is used to answer frequently asked questions and answers about highways and policy issues, and collect customer service common questions and answers, user consultation records, business processes and policy data in the field of highway toll business; based on the collected original data set, the text segmenter technology in the LangChain architecture is used to segment the content of PDF or WORD files into multiple independent paragraph blocks, and each block is assigned a unique number. The paragraph blocks are converted into vectors through the text embedding model and stored in the toll road customer service knowledge model;
[0092] The trained big language knowledge model library and highway rate model are connected to the toll road customer service system, and connected to the business logic layer of the customer service system through the API interface. When a user asks a question, a similarity search is first performed in the model to identify the document fragment that best matches the user's question vector. The best matching question is identified and its content is sent to the big language model. The big language model uses natural language processing technology to analyze in a semantic way and generate accurate answers to return to the user.
[0093] In step S2, the associated tool is automatically accessed to retrieve data, including:
[0094] Use the agent provided by the Langchain large language model framework to establish a connection with the business database, and automatically generate the corresponding database query statements through predefined query templates to create an agent tool set; the tool set includes gantry image tools, rate tools, and fee statistics tools, which are used to process and analyze different types of data to meet business needs; the agent tool interacts and compares with different databases through APIs to verify the rationality of the data and reduce the query of multiple systems by manual customer service;
[0095] Among them, the gantry image tool interacts with the gantry camera system database to obtain images of vehicles passing through each gantry, and uses image recognition technology to identify the vehicle's license plate number, model and driving direction information; the rate tool calculates the toll based on the vehicle information and driving path provided by the gantry image tool; the toll statistics tool handles highway tolls and settlements, and calculates the vehicle's toll amount based on the traffic record flow.
[0096] Step 1. Create an agent tool set: Agent Langchain → Business database → Agent tool set {gantry image tool, rate tool, fee statistics tool, etc.}; Agent tool → API → Database. The agent tool interacts with different databases through API.
[0097] Step 2: Gantry image tool: Gantry image tool → Gantry camera system database → Get vehicle image → {license plate number, vehicle model, driving direction, time};
[0098] Step 3: Rate tool: Rate tool←{license plate number, vehicle type, driving direction, driving path}→calculate tolls, and calculate tolls based on the vehicle information and driving path provided by the gantry image tool;
[0099] Step 4: Toll Statistics Tool: Toll Statistics Tool → {Traffic Record Flow} → Calculate Toll Amount, process highway toll collection and settlement, and calculate the toll amount of the vehicle based on the traffic record flow;
[0100] In step S3, new knowledge is learned from the interaction to improve and adapt to new data and user needs, including: through natural language processing technology, the system converts unstructured voice data into structured text data and automatically adds it to the large language knowledge model library to meet new data and user needs.
[0101] Embodiment 3, as Figure 4 As shown, as another embodiment of the present invention, the method for generating a toll road customer service system based on a large language model provided by the present invention includes:
[0102] The driver or customer service staff inputs the query request through the customer service system. The large language model LLM receives the user input and performs natural language processing to parse the user's query intention. LLM queries the large language rate model library and the large language knowledge model library according to the parsed user intention. These two libraries store the numerical vector data generated by text embedding, such as [0.1, 0.3, 0.6, 1.2, ...], [0.3, 0.5, 0.8, 2.2, ...], [0.8, 1.3, 2.4, 3.2, ...], [0.1, 0.3, 0.6, 1.2, ...], including rate model data and knowledge model data. The data in the library is queried and returned to LLM, which performs natural language processing and returns the query results.
[0103] LLM calls the proxy tool to obtain data. If the query content cannot be directly answered in the large language model library and the large language knowledge model library, it is necessary to further call the external data source through the proxy tool set for query. The proxy tool set includes multiple tools, such as the gantry image tool, customer service log tool, charging statistics tool, and rate tool. Each proxy tool interacts with the charging service database to obtain the required data. The proxy tool set calls the corresponding tool to obtain data based on the query content. If the proxy tool query is successful, the query result is returned.
[0104] Acquire new knowledge through manual customer service. If the relevant information of the vehicle is not obtained from the agent tool, the system will transfer the question to the manual customer service and call the speech recognition technology of the multimodal large language model to capture and process the customer's voice information to acquire new knowledge. Through natural language processing technology, the system converts unstructured voice data into structured text data and updates it to the large language knowledge model library to meet new data and user needs.
[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0106] To further illustrate the effects of the embodiments of the present invention, the following experiment was conducted.
[0107] Suppose a customer asks: "My vehicle with license plate number GAT2210 entered station A on June 1, 2024 and exited station B. The normal toll is 32 yuan, but this time the toll is 46 yuan. Please give me an answer."
[0108] The customer service system calls the large language model to extract and verify evidence and give a reply. The process is as follows:
[0109] ###Pseudocode example
[0110] #Define road network model
[0111] class RoadNetworkModel:
[0112] def __init__(self):
[0113] self.fee_rate_model = {
[0114] ("Station A","Station B"):{"distance":100,"fee":32},
[0115] #Rate model for other sites...
[0116] }
[0117] def calculate_fee(self,entry_station,exit_station):key=(entry_station,exit_station)
[0118] if key in self.fee_rate_model:
[0119] return self.fee_rate_model[key]["fee"]
[0120] else:
[0121] return None def get_route(self,entry_station,exit_station):
[0122] #Simplified path finding logic
[0123] return["Station A","Intermediate Station 1","Intermediate Station 2","Station B"]
[0124] #Define camera capture tool
[0125] class CaptureTool:
[0126] def capture_image(self,station,plate_number):
[0127] #Simulated snapshot pictures
[0128] return f"Image of{plate_number}captured at{station}"#Define the traffic record query tool
[0129] class TrafficRecordTool:
[0130] def get_record(self,plate_number,date):
[0131] #Simulate query of traffic records
[0132] return {
[0133] "entry_station":"Station A",
[0134] "exit_station":"B Station",
[0135] "entry_time":"2024-06-0108:00:00",
[0136] "exit_time":"2024-06-0110:00:00",
[0137] "detour":True#Whether there is a roundabout
[0138] }
[0139] #Define proxy authentication tool
[0140] class ProxyTool:
[0141] def validate(self, model):
[0142] #Simulation verification rate model
[0143] return True
[0144] #Main process function
[0145] def main():
[0146] # Initialize components
[0147] road_network_model=RoadNetworkModel()
[0148] capture_tool=CaptureTool()
[0149] traffic_record_tool=TrafficRecordTool()
[0150] proxy_tool=ProxyTool()
[0151] #Customer Input
[0152] user_query="My vehicle with license plate number: GAT2210 entered from station A on June 1, 2024 and exited from station B. The normal toll is 32 yuan, but this time the toll is 46 yuan. Please give me a reply"
[0153] plate_number="GAT2210"
[0154] entry_station="Station A"
[0155] exit_station="Station B"
[0156] date="2024-06-01"
[0157] #Query rate
[0158] correct_fee=road_network_model.calculate_fee(entry_station,exit_station)
[0159] if correct_fee is None:
[0160] return "Unable to find the corresponding rate information, please contact manual customer service"
[0161] #Query the traffic record
[0162] traffic_record = traffic_record_tool.get_record (plate_number, date) # Take a picture as evidence
[0163] entry_image=capture_tool.capture_image(entry_station,plate_number)exit_image=capture_tool.capture_image(exit_station,plate_number)#Verify rate model
[0164] if proxy_tool.validate(correct_fee):
[0165] if traffic_record["detour"]:
[0166] explanation="Your vehicle had a roundabout route during the trip, so the toll was increased."
[0167] else:
[0168] explanation="During normal driving of your vehicle, the fee has increased. This may be due to system errors. Please contact manual customer service."
[0169] #Return results
[0170] result = {
[0171] "plate_number":plate_number,
[0172] "correct_fee":correct_fee,
[0173] "charged_fee":46,
[0174] "route":road_network_model.get_route(entry_station,exit_station),"evidence":{
[0175] "entry_image":entry_image,
[0176] "exit_image":exit_image
[0177] },
[0178] "explanation":explanation
[0179] }
[0180] else:
[0181] #Handle verification failure
[0182] result = "Unable to verify the fee, please contact manual customer service"
[0183] return result
[0184] #Execute the main process
[0185] if__name__=="__main__":
[0186] response = main()
[0187] print(response)
[0188] ```
[0189] ### Notes
[0190] 1.**Road Network Model**:
[0191] -Contains rate models and path finding methods between toll stations.
[0192] - `calculate_fee` method calculates the fee from entry station to exit station.
[0193] -`get_route` method to get the driving route.
[0194] 2.**Camera capture tool (CaptureTool)**:
[0195] - The `capture_image` method simulates capturing images of toll booths.
[0196] 3.**Traffic Record Query Tool (TrafficRecordTool)**:
[0197] -`get_record` method simulates querying the vehicle's travel record, including the entry station, exit station, time and whether there is a roundabout sign.
[0198] 4.**Proxy Tool**:
[0199] - The `validate` method simulates and verifies the correctness of the rate model.
[0200] 5. **Processing process**:
[0201] -Receive and process user input.
[0202] - Calculate correct tolls through road network model.
[0203] - Check the vehicle's travel record to confirm whether it has traveled on a roundabout.
[0204] - Use the camera tool to capture pictures of entry and exit stations as evidence.
[0205] - Validates the computed cost and returns a result containing the path, cost and evidence.
[0206] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the protection scope of the present invention.
Claims
1. A method for generating customer service for toll roads based on a large language model, characterized in that: The method includes: S1, based on the LangChain big model framework, conduct big language model training, and generate big language rate model library and big language knowledge model library through big language rate model and big language knowledge model training respectively: S2, when the large language rate model library and the large language knowledge model library cannot provide accurate answers, the agent provided by the Langchain framework intelligently identifies user input and automatically accesses related tools for data retrieval. The basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate; S3, for queries that cannot directly obtain accurate answers from the large language rate model library, the large language knowledge model library or the agent tool set, transfers the questions to manual customer service, learns new knowledge from the interaction, and improves and adapts to new data and user needs.
2. The method for generating customer service for toll roads based on a large language model according to claim 1, characterized in that: In step S1, a large language model is trained, including: building a highway rate model and a customer service knowledge model based on the LangChain large model framework, and implementing intelligent customer service Q&A to cope with multi-language tasks and application scenarios; Generate a large language rate model library, including: collecting highway toll station information and road network structure data, using the LangChain framework to understand and parse the road network model, generating a structured rate model, and using a recursive character text segmenter to segment the collected data into multiple independent text blocks. i , and assign each text block a unique ID, that is, T = {T1, T2…T n }, the text block T is transformed into i Convert to a numerical vector E i , and get E i =Emeedding(T i ), Embedding() is a process function that maps data to a low-dimensional vector space; the text block T i ID and vector E i Stored in the large language rate model library, forming the model library M Fee , the expression is: M Fee ={(ID1,E1),(ID2,E2)…(ID n ,E n )}, where (ID n ,E n ) is the model library factor composed of the nth address ID and the nth vector; Generate a large language knowledge model library, including: collecting customer problems and their solutions, using recursive character text segmentation and OpenAI Embedding model to segment text blocks K in the knowledge base i Convert to a numeric vector V i , that is, K={K1,K2…K n },V i =Embedding(K i ), the text block V i The ID and text block K i Stored in the large language rate model library, forming the model library M Knowledge , the expression is: M Knowledge ={(ID1,K1),(ID2,K2)…(ID n ,K n )}, where (ID n ,K n ) is the model library M consisting of the nth address ID and the nth text block Knowledge factor.
3. The method for generating customer service for toll roads based on a large language model according to claim 2, characterized in that: In step S2, the basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds the preset threshold θ, the answer is considered to be accurate. The expression is: Where cosθ Fee (Q,E i ) is the cosine similarity between the query vector and the vector in the database, cosθ Knowledge (Q,V i ) is the cosine similarity between the query vector and the vector in the knowledge model library, || || is the modulus of the vector, Q is the query vector, E i is the vector in the rate model library, V i is the vector in the knowledge model library; When cosθ Fee (Q,E i )>0 or cosθ Knowledge (Q,V i )>0, the answer is considered accurate, otherwise the agent will automatically access the associated tool for data retrieval; The agent in the LangChain framework will intelligently identify user input and automatically call associated tools for data retrieval and processing to achieve intelligent input. First, when the user initiates a query, the agent accepts and parses the user input to generate a query vector Q. Then, the cosine similarity formula is used to calculate the similarity between the query vector Q and the rate model library E. i and knowledge model library V i The similarity of the vectors in Fee (Q,E i )>0 or cosθ Knowledge (Q,V i )>0, it is considered that the exact answer has been found; if the preliminary match fails to provide an exact answer, the agent will call the pre-configured association tool to perform data retrieval based on the analysis results, further search for relevant information, or transfer the query to manual customer service.
4. The method for generating customer service for toll roads based on a large language model according to claim 2, characterized in that: The highway rate model is used to answer users' questions about highway tolls. It collects highway network structure information including toll station information, road connection relationships and distances, uses the Langchain large language model framework to semantically understand and parse the road network model, and generates a structured rate model. The collected road network information is divided into multiple independent text blocks using a recursive character text segmenter, and each block is assigned a unique number. The text blocks are converted into numerical vectors through the OpenAI Embedding model and stored in the large language rate model library. When a user raises a highway fee question, the cosine similarity technology is used to calculate the similarity between the query vector and the vector in the database, thereby retrieving the relevant rate information.
5. The method for generating customer service for toll roads based on a large language model according to claim 2, characterized in that: The customer service knowledge model is used to answer frequently asked questions and answers about highways and policy issues, and collect customer service common questions and answers, user consultation records, business processes and policy data in the field of highway toll business; based on the collected original data set, the text segmenter technology in the LangChain architecture is used to segment the content of PDF or WORD files into multiple independent paragraph blocks, and each block is assigned a unique number. The paragraph blocks are converted into vectors through the text embedding model and stored in the toll road customer service knowledge model; The trained big language knowledge model library and highway rate model are connected to the toll road customer service system, and connected to the business logic layer of the customer service system through the API interface. When a user asks a question, a similarity search is first performed in the model to identify the document fragment that best matches the user's question vector. The best matching question is identified and its content is sent to the big language model. The big language model uses natural language processing technology to analyze in a semantic way and generate accurate answers to return to the user.
6. The method for generating customer service for toll roads based on a large language model according to claim 1, characterized in that: In step S2, the associated tool is automatically accessed to retrieve data, including: Use the agent provided by the Langchain large language model framework to establish a connection with the business database, and automatically generate the corresponding database query statements through predefined query templates to create an agent tool set; the tool set includes gantry image tools, rate tools, and fee statistics tools, which are used to process and analyze different types of data to meet business needs; the agent tool interacts and compares with different databases through APIs to verify the rationality of the data and reduce the query of multiple systems by manual customer service; Among them, the gantry image tool interacts with the gantry camera system database to obtain images of vehicles passing through each gantry, and uses image recognition technology to identify the vehicle's license plate number, model and driving direction information; the rate tool calculates the toll based on the vehicle information and driving path provided by the gantry image tool; the toll statistics tool handles highway tolls and settlements, and calculates the vehicle's toll amount based on the traffic record flow.
7. The method for generating customer service for toll roads based on a large language model according to claim 6, characterized in that: In step S3, new knowledge is learned from the interaction to improve and adapt to new data and user needs, including: through natural language processing technology, the system converts unstructured voice data into structured text data and automatically adds it to the large language knowledge model library to meet new data and user needs.
8. A toll road customer service system based on a large language model, characterized in that: The system implements the method for generating customer service for a toll road based on a large language model as described in any one of claims 1 to 7, and the system comprises: Model training module (1), used for training a large language model based on the LangChain large model framework, and generating a large language rate model library and a large language knowledge model library through training of a large language rate model and a large language knowledge model respectively; The agent tool set module (2) is used to intelligently identify user input through the agent provided by the Langchain framework when the large language rate model library and the large language knowledge model library cannot provide an accurate answer, and automatically access the associated tool to retrieve data. The basis for determining the accurate answer is to calculate the cosine similarity between the query vector and the vector in the database. When the cosine similarity exceeds a preset threshold θ, the answer is considered to be accurate; The autonomous learning module (3) is used to process queries that cannot obtain accurate answers directly from the large language rate model library, the large language knowledge model library or the agent tool set, transfer the questions to manual customer service, learn new knowledge from the interaction, and improve and adapt to new data and user needs.
9. The toll road customer service system based on a large language model according to claim 8, characterized in that: The system is mounted on a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, the functions of the toll road customer service system based on the large language model are implemented.
10. The toll road customer service system based on a large language model according to claim 9, characterized in that: The system is mounted on a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the functions of the toll road customer service system based on the large language model can be realized.
