Processing method of cross-border logistics AI customer service system based on knowledge base
By using a knowledge base-based AI customer service system for cross-border logistics, which combines image text recognition, document knowledge base, and knowledge graph knowledge base, the system solves the problems of insufficient accuracy, controllability, and business process execution in existing intelligent customer service systems, and achieves efficient and reliable enterprise-level customer service.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN XIYOU INTELLIGENT WAREHOUSE TECHNOLOGY CO LTD
- Filing Date
- 2025-12-24
- Publication Date
- 2026-05-08
AI Technical Summary
Existing intelligent customer service systems suffer from problems such as difficulty in ensuring factual accuracy, weak business process processing capabilities, and poor controllability and explainability when handling cross-border logistics business. They also struggle to organically combine the powerful language understanding capabilities of generative AI with the accuracy, controllability, and business process execution capabilities of traditional rule systems.
A knowledge-based AI customer service system for cross-border logistics is adopted. By acquiring and interpreting user conversations, it utilizes large models for image and text recognition, document knowledge bases, knowledge graph knowledge bases, and real-time data queries, combined with historical conversation information, to achieve intelligent and automated customer service.
It enables highly reliable and low-cost enterprise-level customer service, accurately understands user intent, handles complex business processes, and acquires external data in real time, thereby improving service efficiency and controllability.
Smart Images

Figure CN121998651A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of customer service system processing, and specifically relates to a knowledge base-based AI customer service system and method for cross-border logistics. Background Technology
[0002] With the rapid development of cross-border e-commerce and international logistics, businesses need to handle a large number of customer inquiries daily, involving complex issues such as shipping costs, customs clearance, warehousing, exchange rates, returns, and delivery. Intelligent customer service systems have gradually replaced traditional human customer service, becoming a core tool for businesses to provide customer service, product inquiries, and after-sales support. Traditional customer service models suffer from high labor costs, limited service hours, slow response times, and difficulty in standardizing service quality. Intelligent customer service systems, on the other hand, can operate 24 / 7, significantly reducing operating costs and improving service efficiency.
[0003] Existing intelligent customer service systems have mainly gone through the following two stages of development:
[0004] 1) A basic system based on rule and keyword matching
[0005] Such systems rely on pre-defined rule and keyword databases. When a user enters a query, the system retrieves pre-defined answers through pattern matching or simple logical rules. Its advantages lie in clear rules and strong controllability; its disadvantages include high maintenance costs and the inability to handle continuous multi-turn interactions requiring contextual information.
[0006] 2) Generative systems based on deep learning and natural language understanding (NLU)
[0007] In recent years, generative AI customer service based on Large Language Models (LLM) has become mainstream. These systems can understand user intent more deeply and generate fluent, natural responses, significantly improving their intelligence level. However, the inventors of this application have discovered that this solution still has the following limitations:
[0008] The accuracy of facts is difficult to guarantee (the "illusion" problem): the model may generate information that seems reasonable but is actually wrong or inconsistent with business data, which is fatal in rigorous customer service scenarios (such as finance, healthcare, and logistics tracking).
[0009] Weak business process handling capabilities: Generative models excel at "dialogue" but not at "business operations." For complex business processes that require database queries, external API calls, conditional checks, and multi-step operations (such as returns and refunds, order modifications, and fault reporting), pure generative models lack reliable and controllable execution logic, which can easily lead to process errors or operational failures.
[0010] Poor controllability and interpretability: The system's decision-making process is a "black box," making it difficult to trace and locate the root cause of problems when errors occur.
[0011] 3) Summary and bottlenecks of existing technologies
[0012] In summary, the current technological bottleneck in the field of intelligent customer service lies in how to organically combine the powerful language understanding capabilities of generative AI with the accuracy, controllability, and business process execution capabilities of traditional rule-based systems. In other words, the system needs to possess the following capabilities:
[0013] Precise intent recognition and multi-turn dialogue management: accurately understand user goals and fill in missing key information by proactively clarifying questions.
[0014] Reliable integration with external systems: It can seamlessly connect to and query business databases, and can seamlessly connect to external API interfaces to obtain real-time and accurate data.
[0015] Complex conditional judgments and dynamic workflow orchestration: It can make conditional judgments based on query results, business rules and user context, and dynamically select and execute the next operation to form a complete task processing loop.
[0016] Currently, no publicly available technical solution has been found that can systematically solve all of the above problems. Therefore, there is an urgent need for a new intelligent customer service system architecture and methodology to overcome the shortcomings of existing technologies and achieve truly intelligent, automated, highly reliable, and low-cost enterprise-level customer service. Summary of the Invention
[0017] This invention provides a processing method for a knowledge-based AI customer service system for cross-border logistics, aiming to solve at least one of the technical problems existing in the prior art.
[0018] The technical solution of this invention relates to a processing method for a knowledge-based AI customer service system for cross-border logistics, the processing method of which includes the following steps:
[0019] S100: Obtain and interpret user sessions, and obtain historical session information through user information;
[0020] S200: Determine whether the user session and historical session information contain image information, and process the image or the text in the image.
[0021] S300: Use the large model to write prompt words and complete the semantic information in the historical conversation information into the user conversation;
[0022] S400, a multi-class classification model, classifies user conversations into types including casual conversation, factual statement, unclear question, requiring human intervention, exchange rate question, real-time database query, and knowledge base combined.
[0023] S500: Based on different user session classification types, call the corresponding model to answer user questions.
[0024] Furthermore, in step S200,
[0025] If the user session and historical session information do not contain image information, the large model can be used to correct typos in the user's questions by writing prompt words.
[0026] If user sessions and historical session information contain image information, the text information in the images can be extracted using a large model by writing prompts.
[0027] Furthermore, in step S400,
[0028] The classification model uses a neural network architecture to classify the input text. First, the input user session needs to be vectorized. Then, the vectorized result is connected to a series of neural network hierarchical structures. By calculating the probability between the text vector and each category, the classification category corresponding to the text is the classification category with the highest probability.
[0029] Furthermore, in step S500,
[0030] When the user conversation is casual, use a large model to answer the user's questions by writing casual prompts.
[0031] When the user conversation is factual, answer the user's questions using a large model by writing factual prompts;
[0032] When a user session involves an unclear question, the large model is used to answer the user's question by writing prompts for the unclear question.
[0033] When a user session requires human intervention, and the user's question type requires human intervention, the system will respond with a message to transfer the user to human assistance and then transfer the user to human assistance.
[0034] Furthermore, when the user session involves a currency exchange rate question, the system first writes a prompt to extract currency exchange rate information. Then, it uses a large model to extract the conversion amount, query time, and currency information related to the currency exchange rate question from the user. Based on the extracted query time and currency, it calls the currency exchange rate query API to retrieve the corresponding exchange rate. Finally, based on the extracted conversion amount and the corresponding exchange rate, it uses a large model to answer the user's question by writing a currency exchange rate conversion prompt.
[0035] Furthermore, when the user session is a real-time query database type, the order number in the user's question is first extracted using regular expressions. By writing query target hint words, the query target in the user's question is extracted using a large model. The matched order number and the corresponding query target are combined into an SQL query statement, and the corresponding real-time data is retrieved from the business database. The retrieved real-time data is then applied to the reply template to provide the answer.
[0036] Furthermore, when the user session is knowledge-based, a semantic similarity model is used to determine whether the user's question belongs to a dynamic workflow. The semantic similarity model is used to calculate the semantic similarity between different texts, determine whether at least two texts express the same meaning, vectorize at least two texts to obtain text vectors, and calculate the cosine similarity between the two text vectors to obtain the cosine similarity. The higher the cosine similarity value, the more similar the two texts are. The dynamic workflow refers to the situation where multiple steps are required to jointly process a question in a user session.
[0037] If the user session belongs to a dynamic workflow, obtain the first step of the dynamic workflow, execute the first step of the dynamic action flow. If the first step is to ask for user information, directly reply with the asked information. If the first step requires querying the database or combining the knowledge base, perform the corresponding process operation, store the operation result, obtain the next step of the dynamic workflow, and output the result after all the process steps in the workflow are processed.
[0038] If the user session does not belong to a dynamic workflow, keywords in the user's question are extracted by training a named entity recognition model. The named entity recognition model is an end-to-end neural network model. First, the text is vectorized, and then a multi-layer neural network structure is connected to calculate the start and end positions of the keywords in the text. All characters from the start to the end position are combined to form the keywords. By writing intent recognition prompts, the intent result in the user's question is extracted using a large model. A semantic similarity model is used to determine whether the answer to the user session needs to be combined with a knowledge graph knowledge base.
[0039] Furthermore, if the user session requires integration with the knowledge graph knowledge base, the text similarity between keywords in the user session and nodes and edges in the knowledge graph is calculated using cosine similarity. Nodes and edges with text similarity less than a first preset value are filtered out. The nodes and edges filtered out by cosine similarity are then further filtered for relevance using a reordering model of the large model. The reordering model involves the large model simultaneously judging the relevance of a text with multiple texts, sorting them from high to low relevance, and taking the top N nodes and edges with the highest relevance. The top N nodes and edges with the highest relevance are then queried in the knowledge graph to find the nodes and edges connected in the links. Knowledge graph knowledge filtering prompts are written, and the large model uses the knowledge graph triples of the nodes and edges connected in the links to judge the user question. It is determined whether the triples can answer the user question, and triples that are irrelevant to the question are filtered out. Knowledge graph answer generation prompts are written, and the large model uses them to answer the user session.
[0040] If the user session requires integration with a document knowledge base, cosine similarity is used to calculate the text similarity between keywords in the user session and keywords in the document knowledge base. Keywords from the document knowledge base with a text similarity less than a second preset value are filtered out. The keywords from the document knowledge base filtered by cosine similarity are further filtered for relevance using a large model's reordering model, selecting the top M most relevant keywords. These top M most relevant keywords are then searched in document blocks to find all candidate knowledge base documents containing the keywords. These candidate knowledge base documents are then semantically filtered using a large model's reordering model, selecting the top K most relevant candidate knowledge base documents. Document relevance prompts are written and the large model is used to filter out candidate knowledge base documents strongly related to the user's question. Finally, document knowledge base answer generation prompts are written and the large model is used to answer the user session.
[0041] Furthermore, the knowledge graph knowledge base is constructed through the following steps:
[0042] Collect relevant domain-specific documents and data;
[0043] Write prompt words, extract entities from the document using a large model, and semantically align the entities to obtain aligned entities;
[0044] Write prompt words, use a large model to extract relationships from all documents, semantically align the relationships, and obtain the aligned relationships.
[0045] The aligned entities and aligned relationships are vectorized, and the vectorization results are stored in a vector database.
[0046] All entities and relations are combined into knowledge graph triples and stored in the knowledge graph knowledge base.
[0047] Furthermore, the document knowledge base is constructed through the following steps:
[0048] Collect relevant documents and data;
[0049] Use a large model to segment and organize the text in the document;
[0050] Write prompt words and use a large model to extract keywords from the segmented and organized document;
[0051] The segmented and organized documents and their corresponding keywords are vectorized, and the vectorization results are stored in a vector knowledge base.
[0052] All the segmented and organized documents, along with their corresponding keywords, are stored in the document knowledge base.
[0053] Compared with existing technologies, the present invention has the following characteristics:
[0054] This invention presents a processing method for a knowledge-based AI customer service system for cross-border logistics. It combines functions such as image text recognition, document knowledge base, knowledge graph knowledge base, real-time data query, and automatic external API calls. By interpreting user sessions and combining them with historical sessions, and by integrating the processing of knowledge graph knowledge base and document knowledge base, it achieves intelligent, automated, highly reliable, and low-cost enterprise-level customer service. Attached Figure Description
[0055] Figure 1 This is a flowchart illustrating the overall processing method of a knowledge-based AI customer service system for cross-border logistics.
[0056] Figure 2 This is a flowchart illustrating the process of establishing a knowledge graph knowledge base for the processing method of a knowledge-based AI customer service system for cross-border logistics.
[0057] Figure 3 This document presents a flowchart illustrating the process of establishing a knowledge base for the processing methods of a knowledge-based AI customer service system for cross-border logistics. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention.
[0060] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. The singular forms "a," "described," and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and not for limiting the invention. The term "and / or" as used herein includes any combination of one or more of the associated listed items.
[0061] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. Any and all instances or exemplary language (“e.g.,” “such as,” etc.) used herein are intended only to better illustrate embodiments of the invention and, unless otherwise required, do not impose a limitation on the scope of the invention. Furthermore, the industry term “pose” as used herein refers to the position and orientation of an element relative to a spatial coordinate system.
[0062] Reference Figures 1 to 3 This invention provides a processing method for a knowledge-based AI customer service system for cross-border logistics, referring to... Figure 1 The processing method of the knowledge-based cross-border logistics AI customer service system includes the following steps:
[0063] S100: Obtain and interpret user sessions, and obtain historical session information through user information;
[0064] S200: Determine whether the user session and historical session information contain image information, and process the image or the text in the image.
[0065] S300: Use the large model to write prompt words and complete the semantic information in the historical conversation information into the user conversation;
[0066] S400, a multi-class classification model, classifies user conversations into types including casual conversation, factual statement, unclear question, requiring human intervention, exchange rate question, real-time database query, and knowledge base combined.
[0067] S500: Based on different user session classification types, call the corresponding model to answer user questions.
[0068] Compared with existing technologies, the present invention has the following characteristics:
[0069] This invention presents a processing method for a knowledge-based AI customer service system for cross-border logistics. It combines functions such as image text recognition, document knowledge base, knowledge graph knowledge base, real-time data query, and automatic external API calls. By interpreting user sessions and combining them with historical sessions, and by integrating the processing of knowledge graph knowledge base and document knowledge base, it achieves intelligent, automated, highly reliable, and low-cost enterprise-level customer service.
[0070] Specifically, the disadvantages of the existing technology are as follows:
[0071] 1) Inability to obtain external data in real time: For example, when a user asks "What is the exchange rate of RMB to USD today?" or "Where is my package (tracking number: 12345678) now?", the existing technology cannot obtain real-time data to answer the question. The present invention aims to obtain real-time external data to answer the question by using a large model to call external APIs and query real-time databases.
[0072] 2) Inability to handle complex business processes: For example, if a user asks, "Can I intercept this package (tracking number: 12345678)?", the first step should be to check the package's status to see if it has been delivered to the operator and is in transit. If it is in transit, the response should be that it cannot be intercepted; otherwise, the response should be that it can be intercepted. Existing technology cannot handle such complex execution logic. This invention aims to use a dynamic workflow approach to make conditional judgments based on query results, business rules, and user context, and dynamically select and execute the next operation to form a complete task processing closed loop.
[0073] 3) Unnecessary knowledge base matching exists: When the question type is casual ("Um, I'm outside right now, I'll take a good look later"), factual ("Okay, the order has indeed not been shipped"), or unclear ("What's the situation now?"), the answer to these questions is not in the knowledge base and there is no need to perform a knowledge base search. In this case, the existing technology still needs to search the knowledge base, which will lead to inaccurate answers. The present invention aims to use the prompt words of various question types to directly answer the questions by utilizing the language capabilities of the large model itself.
[0074] 4) Lack of multi-hop reasoning ability: For example, when a user asks, "What is the earliest closing time at your company's warehouse in the US West Coast?", this question first requires identifying which warehouses are in the US West Coast, the closing time of each warehouse, and then comparing the times. At this point, the existing text knowledge base cannot perform multi-hop reasoning. This invention aims to add a knowledge graph knowledge base, which will contain entities and relationships related to US West Coast, warehouse, and closing time, so that the earliest closing time can be inferred through a large model.
[0075] 5) Missing image content: For example, if a user sends an image with a screenshot of text, the existing technology cannot process the image data. The present invention aims to use an image text recognition module to recognize the text in the image and provide an answer.
[0076] In one specific embodiment, the large models involved in this invention all use the API interface of the Qwen3 large model from Tongyi Qianwen.
[0077] In a specific embodiment, the processing method of the knowledge base-based cross-border logistics AI customer service system can be summarized as follows: The processing type is determined by parsing the user's question. If it does not require combining the knowledge base or external queries, a direct response can be provided through the large model. If external queries are required, the query-related information in the question needs to be parsed, and relevant API interfaces and database queries are called. If the knowledge base needs to be combined, the relevant knowledge documents in the knowledge base are first matched with the results of question parsing, and the relevant knowledge documents are summarized through the large model to provide the answer.
[0078] AI Customer Service System Algorithm Implementation Process:
[0079] 1) The user asks a question during the conversation; proceed to the next step.
[0080] 2) Retrieve historical messages using user ID and session ID, then proceed to the next step;
[0081] 3) Determine if the user's question and historical messages contain image information, then proceed to the next step;
[0082] 4) If no image information is included, proceed to step 6;
[0083] 5) If the image contains information, use a large model to extract the text information from the image by writing prompts. Example prompt: "You are an expert in image text recognition. Only extract the key content or the content that the user is concerned about in the image. Do not extract anything else." Proceed to the next step.
[0084] 6) Correct typos in user questions using a large model by writing prompts. Example prompt: "You are a typo correction expert in the cross-border logistics field, and you can correct typos in user questions without changing other parts of the content." Proceed to the next step.
[0085] 7) By writing prompt words, the large model is used to complete the semantic information in the historical messages into the user's question. Example prompt words: "You are an information completion expert. You are responsible for judging whether the semantic information in the user's question is complete. If it is not complete, find the missing semantic information from the historical messages and add it to the user's question. If it cannot be added, then do not add it." Proceed to the next step.
[0086] 8) By training a multi-class classification model, user questions are categorized as follows: Casual conversational questions (asking about everyday topics unrelated to cross-border logistics, such as "Are you there? Are you off work?"), factual questions (objectively describing the current situation, such as "Yes, this order hasn't been submitted yet"), unclear questions (the user's question is semantically incomplete, such as "What's the situation now?"), questions requiring human intervention (questions that AI cannot directly handle, such as "Transfer to human service"), exchange rate questions (users asking exchange rate-related questions, such as "What is the exchange rate of RMB to USD today?"), real-time database query questions (user questions involving real-time data queries, such as "Where is my order 123456 now?"), and knowledge base-based questions (user questions involving cross-border logistics expertise, such as "How do I create a B2C order?"). The classification model utilizes a neural network architecture to classify the input text. First, the input text is vectorized. Then, the vectorized results are connected to a series of neural network layers. By calculating the probability between the text vector and each category, the category corresponding to the text is the category with the highest probability. Proceed to the next step.
[0087] Furthermore, refer to Figure 1 In step S200,
[0088] If the user session and historical session information do not contain image information, the large model can be used to correct typos in the user's questions by writing prompt words.
[0089] If user sessions and historical session information contain image information, the text information in the images can be extracted using a large model by writing prompts.
[0090] Furthermore, refer to Figure 1 In step S400,
[0091] The classification model uses a neural network architecture to classify the input text. First, the input user session needs to be vectorized. Then, the vectorized result is connected to a series of neural network hierarchical structures. By calculating the probability between the text vector and each category, the classification category corresponding to the text is the classification category with the highest probability.
[0092] Furthermore, refer to Figure 1 In step S500,
[0093] When the user conversation is casual, use a large model to answer the user's questions by writing casual prompts.
[0094] When the user conversation is factual, answer the user's questions using a large model by writing factual prompts;
[0095] When a user session involves an unclear question, the large model is used to answer the user's question by writing prompts for the unclear question.
[0096] When a user session requires human intervention, and the user's question type requires human intervention, the system will respond with a message to transfer the user to human assistance and then transfer the user to human assistance.
[0097] In one specific embodiment, the following processing flow is included:
[0098] 9) Use a large model to answer user questions by writing casual conversation prompts. Example prompt: "You are a customer service representative for Xiyou Smart Warehouse, mainly responsible for answering casual conversations and interacting with users in a friendly manner." Proceed to step 39;
[0099] 10) Use the large model to answer user questions by writing factual prompts. Example prompt: "You are a customer service representative for Xiyou Smart Warehouse. You can provide corresponding responses based on the facts stated by the user and interact with the user in a friendly manner." Proceed to step 39;
[0100] 11) Use a large model to answer user questions by writing prompts for unclear questions. Example prompt: "You are a customer service representative for Xiyou Smart Warehouse. The user's question is not semantically complete. We need to identify the missing semantic information in the user's question, ask a follow-up question, and interact with the user in a friendly manner." Proceed to step 39;
[0101] 12) When the user's problem type requires human intervention, reply "We are transferring you to a human customer service representative, please wait patiently..." and proceed to step 39.
[0102] Furthermore, refer to Figure 1When a user session involves a currency exchange rate question, the system first writes a prompt to extract currency exchange rate information. Then, it uses a large model to extract the conversion amount, query time, and currency information related to the currency exchange rate question. Based on the extracted query time and currency, it calls the currency exchange rate query API to retrieve the corresponding exchange rate. Finally, based on the extracted conversion amount and the corresponding exchange rate, it uses a large model to answer the user's question by writing a currency exchange rate conversion prompt.
[0103] In one specific embodiment, the following processing flow is included:
[0104] 13) When the user's question type is exchange rate, you first need to write a prompt to extract exchange rate information. Use the large model to extract the "conversion amount," "query time," and "query currency" from the user's question. Example prompt: "You are a cross-border logistics customer service AI, responsible for handling user inquiries. Your task is to extract exchange rate-related information from the user's input question." Proceed to the next step.
[0105] 14) Based on the extracted query time and currency, call the exchange rate query API to retrieve the corresponding exchange rate, and proceed to the next step;
[0106] 15) Based on the extracted conversion amount and the corresponding exchange rate, use the large model to answer the user's question by writing exchange rate conversion prompts. Example prompt: "You are an exchange rate conversion expert and need to obtain the required exchange rate result based on the conversion amount, the corresponding exchange rate, and the user's question description." Proceed to step 39.
[0107] Furthermore, refer to Figure 1 When a user session is a real-time query database type, the order number in the user's question is first extracted using regular expressions. By writing query target hints, the query target in the user's question is extracted using a large model. The matched order number and the corresponding query target are combined into an SQL query statement. The corresponding real-time data is then retrieved from the business database and applied to the reply template to provide the answer.
[0108] In one specific embodiment, the following processing flow is included:
[0109] 16) If the user question type is a real-time query database type, first extract the tracking number from the user question using regular expressions. For example, if the user is asking "What is the status of the logistics track of tracking number 123456?", the tracking number is 123456. Proceed to the next step.
[0110] 17) Extract the query target from the user's question using a large model by writing query target suggestions. Example suggestion: "You are a cross-border logistics AI customer service assistant, and you need to determine which business queries are involved based on the user's question." Proceed to the next step;
[0111] 18) Combine the matched order numbers and the corresponding query targets into an SQL query statement, retrieve the corresponding real-time data from the business database, and proceed to the next step;
[0112] 19) Apply the real-time data obtained from the query to the reply template to provide the answer, and proceed to step 39.
[0113] Furthermore, refer to Figure 1 When a user session is knowledge-based, a semantic similarity model is used to determine whether the user's question belongs to a dynamic workflow. The semantic similarity model is used to calculate the semantic similarity between different texts, determine whether at least two texts express the same meaning, vectorize at least two texts to obtain text vectors, and calculate the cosine similarity between the two text vectors. The higher the cosine similarity value, the more similar the two texts are. The dynamic workflow refers to the situation where multiple steps are required to jointly process a question in a user session.
[0114] If the user session belongs to a dynamic workflow, obtain the first step of the dynamic workflow, execute the first step of the dynamic action flow. If the first step is to ask for user information, directly reply with the asked information. If the first step requires querying the database or combining the knowledge base, perform the corresponding process operation, store the operation result, obtain the next step of the dynamic workflow, and output the result after all the process steps in the workflow are processed.
[0115] If the user session does not belong to a dynamic workflow, keywords in the user's question are extracted by training a named entity recognition model. The named entity recognition model is an end-to-end neural network model. First, the text is vectorized, and then a multi-layer neural network structure is connected to calculate the start and end positions of the keywords in the text. All characters from the start to the end position are combined to form the keywords. By writing intent recognition prompts, the intent result in the user's question is extracted using a large model. A semantic similarity model is used to determine whether the answer to the user session needs to be combined with a knowledge graph knowledge base.
[0116] In a specific embodiment, when the user question type is knowledge base-based, the following processing flow is included:
[0117] 20) User question types are combined with knowledge base types. A semantic similarity model is used to determine whether a user's question falls under the dynamic workflow category. The semantic similarity model is used to calculate the semantic similarity between two texts. In simple terms, it determines whether two texts express the same meaning. This is done by vectorizing the two texts and calculating the cosine similarity between the two vectors. The higher the cosine similarity value, the more similar the two texts are. The dynamic workflow requires multiple steps to process a question. For example, if a user asks, "Which method can I use to recharge and pay?", the system first needs to query the contracting entity of the user's contract, and then provide different recharge methods based on different contracting entities before proceeding to the next step.
[0118] In a specific embodiment, when the user question type falls under the category of dynamic workflow, the following processing flow is included:
[0119] 21) User issues fall under the category of dynamic workflows. Obtain the first step of the dynamic workflow and proceed to the next step.
[0120] 22) Execute the first step of the dynamic action flow. If the first step is to ask for user information, reply directly with the asked information and proceed to step 39. If the first step is to query the database or combine with the knowledge base, perform the corresponding process operation, store the operation result, and proceed to the next step.
[0121] 23) Obtain the next step in the dynamic workflow, repeat the execution process of step 22, and proceed to the next step;
[0122] 24) Continue until all process steps in the workflow are completed, then proceed to step 39.
[0123] In a specific embodiment, when a user issue does not fall under the scope of a dynamic workflow, the following processing flow is included:
[0124] 25) User questions do not fall under the scope of dynamic workflow. Keywords in user questions are extracted by training a named entity recognition model. The named entity recognition model is an end-to-end neural network model. First, the text is vectorized, and then a multi-layer neural network structure is connected to calculate the start and end positions of the keywords in the text. All the words from the start position to the end position are combined into keywords, and then the process moves to the next step.
[0125] 26) Extract the intent from the user's question using a large model by writing intent recognition prompts. Example prompt: "You are an expert in intent recognition. You are responsible for identifying the intent that the user wants to express in the user's question." Proceed to the next step.
[0126] 27) Determine whether answering user questions requires combining a knowledge graph knowledge base using a semantic similarity model, then proceed to the next step.
[0127] Furthermore, refer to Figure 1 If a user session requires integration with a knowledge graph knowledge base, cosine similarity is used to calculate the text similarity between keywords in the user session and nodes and edges in the knowledge graph. Nodes and edges with text similarity less than a first preset value are filtered out. The nodes and edges filtered out by cosine similarity are further filtered for relevance by a reordering model of a large model. The reordering model involves the large model simultaneously judging the relevance of a text with multiple texts, sorting them from high to low relevance, and taking the top N nodes and edges with the highest relevance. The top N nodes and edges with the highest relevance are then used to query the nodes and edges connected in the link in the knowledge graph. Knowledge graph knowledge filtering prompts are written, and the large model uses the knowledge graph triples of the nodes and edges connected in the query link to judge the user question. It is determined whether the triples can answer the user question, and triples that are irrelevant to the question are filtered out. Knowledge graph answer generation prompts are written, and the large model uses them to answer the user session.
[0128] If the user session requires integration with a document knowledge base, cosine similarity is used to calculate the text similarity between keywords in the user session and keywords in the document knowledge base. Keywords from the document knowledge base with a text similarity less than a second preset value are filtered out. The keywords from the document knowledge base filtered by cosine similarity are further filtered for relevance using a large model's reordering model, selecting the top M most relevant keywords. These top M most relevant keywords are then searched in document blocks to find all candidate knowledge base documents containing the keywords. These candidate knowledge base documents are then semantically filtered using a large model's reordering model, selecting the top K most relevant candidate knowledge base documents. Document relevance prompts are written and the large model is used to filter out candidate knowledge base documents strongly related to the user's question. Finally, document knowledge base answer generation prompts are written and the large model is used to answer the user session.
[0129] In a specific embodiment, when a user question requires the integration of a knowledge graph knowledge base, the following processing flow is included:
[0130] 28) User questions need to be combined with the knowledge graph knowledge base. The cosine similarity is used to calculate the text similarity between the keywords in the user question and the nodes and edges in the knowledge graph. Nodes and edges with a text similarity of less than 0.7 are filtered out and then proceed to the next step.
[0131] 29) The nodes and edges filtered by cosine similarity are further filtered for relevance by the reordering model of the large model. The reordering model is a large model that judges the relevance of a text with multiple texts at the same time, sorts them from high to low relevance, and takes the top 5 nodes and edges with the highest relevance, and then moves to the next step.
[0132] 30) Query the knowledge graph to find the nodes and edges connected in the link of the top 5 most relevant nodes and edges, and proceed to the next step;
[0133] 31) By writing knowledge graph knowledge filtering prompts, the large model is used to judge the knowledge graph triple data of the nodes and edges connected in the query link with the user question, and to determine whether the triple data can answer the user question. Triple data that is irrelevant to the question is filtered out. Example prompt: "You are a knowledge graph knowledge filtering expert, responsible for filtering out triple data that is irrelevant to the user question", proceed to the next step;
[0134] 32) Use the large model to answer user questions by writing knowledge graph answer generation prompts. Example prompt: "You are a knowledge graph data answer generation expert, responsible for combining knowledge graph triple data into a natural and fluent answer to the user's question." Proceed to step 39.
[0135] In a specific embodiment, if a user session needs to incorporate a document knowledge base, the following processing flow is included:
[0136] 33) User questions need to be combined with the document knowledge base. The text similarity between the keywords in the user questions and the keywords in the document knowledge base is calculated by cosine similarity. Keywords in the document knowledge base with a text similarity of less than 0.7 are filtered out and then proceed to the next step.
[0137] 34) The keywords of the document knowledge base filtered by cosine similarity are further filtered for relevance by the large model re-ranking model, and the top 10 keywords with the highest relevance are selected and moved to the next step.
[0138] 35) Search the document blocks for the 10 most relevant keywords to find all candidate knowledge base documents containing the keywords, then proceed to the next step;
[0139] 36) Perform semantic filtering on the candidate knowledge base documents using the large model's re-ranking model, and select the top 5 candidate knowledge base documents with the highest relevance, then proceed to the next step;
[0140] 37) Use a large model to filter out candidate knowledge base documents that are strongly related to the user's question by writing document relevance prompts. Example prompt: "You are a knowledge base relevance judgment expert and are responsible for finding knowledge base documents that are strongly related to the user's question." Proceed to the next step.
[0141] 38) Use a large model to answer user questions by writing prompt words for document knowledge base answer generation. Example prompt word: "You are a document knowledge base answer generation expert, responsible for extracting and combining relevant knowledge base documents to create a natural and fluent answer to the user's question." Proceed to the next step.
[0142] 39) End the process.
[0143] Furthermore, refer to Figure 2 The knowledge graph knowledge base is constructed through the following steps:
[0144] Collect relevant domain-specific documents and data;
[0145] Write prompt words, extract entities from the document using a large model, and semantically align the entities to obtain aligned entities;
[0146] Write prompt words, use a large model to extract relationships from all documents, semantically align the relationships, and obtain the aligned relationships.
[0147] The aligned entities and aligned relationships are vectorized, and the vectorization results are stored in a vector database.
[0148] All entities and relations are combined into knowledge graph triples and stored in the knowledge graph knowledge base.
[0149] In one specific embodiment, the knowledge graph knowledge base construction process is as follows:
[0150] 1) Collect relevant domain documentation and data, then proceed to the next step;
[0151] 2) By writing prompts, the large model can extract entities and relationships between entities from the document. Example prompt: "You are a knowledge graph data extraction expert, responsible for identifying and outputting the entities and corresponding relationships involved in the document." For example, if there is a sentence in the document: "We have our own overseas warehouses in the United States, Germany, and the United Kingdom," the large model can extract four entities: "United States," "Germany," "United Kingdom," and "overseas warehouses," and one relationship: "warehouse distribution," and then proceed to the next step.
[0152] 3) By writing prompt words, the large model is used to semantically align the entities extracted from all documents. Example prompt words: "You are a semantic alignment expert, responsible for aligning the entities extracted from a large number of cross-border logistics documents." For example, "United States" or "United States / US" can be aligned to the entity "United States". Proceed to the next step.
[0153] 4) By writing prompt words, the large model is used to semantically align the relationships extracted from all documents. Example prompt words: "You are a semantic alignment expert, responsible for aligning the relationships extracted from a large number of cross-border logistics documents." For example, "operation steps" and "operation process" can be aligned to a relationship "operation process" to proceed to the next step.
[0154] 5) Vectorize all aligned entities and relationships, and store the vectorization results in the vector database. Proceed to the next step.
[0155] 6) Combine all entities and relationships into knowledge graph triples and store them in the knowledge graph knowledge base, for example: "Overseas Warehouse" - "Warehouse Distribution" - "United States", then proceed to the next step;
[0156] 7) End the build process.
[0157] Furthermore, refer to Figure 3 The document knowledge base is constructed through the following steps:
[0158] Collect relevant documents and data;
[0159] Use a large model to segment and organize the text in the document;
[0160] Write prompt words and use a large model to extract keywords from the segmented and organized document;
[0161] The segmented and organized documents and their corresponding keywords are vectorized, and the vectorization results are stored in a vector knowledge base.
[0162] All the segmented and organized documents, along with their corresponding keywords, are stored in the document knowledge base.
[0163] In one specific embodiment, the document knowledge base construction process is as follows:
[0164] 1) Gather relevant documents and proceed to the next step;
[0165] 2) Use a large model to segment the document, for example, split a paragraph of text into multiple sentences, and proceed to the next step;
[0166] 3) Extract keywords from the segmented document using a large model by writing prompts. Example prompt: "You are a keyword extraction expert, responsible for extracting keywords from user questions," such as "West Coast warehouse supports FedEx delivery." The extracted keywords are "West Coast warehouse," "FedEx," and "delivery." Proceed to the next step.
[0167] 4) Vectorize the segmented documents and their corresponding keywords, and store the vectorization results in the vector knowledge base. Proceed to the next step.
[0168] 5) Store all the segmented documents and their corresponding keywords in the document knowledge base, then proceed to the next step;
[0169] 6) End the build process.
[0170] Furthermore, the present invention also proposes a computer-readable storage medium storing program instructions thereon, which, when executed by a processor, implement the aforementioned natural disaster early warning method based on digital human intelligent agents.
[0171] It should be understood that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).
[0172] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.
[0173] Furthermore, the method can be implemented operatively connected to any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or communicating with charged particle tools or other imaging systems, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention may also include the computer itself.
[0174] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.
[0175] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.
Claims
1. A processing method for a knowledge-based AI customer service system for cross-border logistics, characterized in that, The processing method of the knowledge-based cross-border logistics AI customer service system includes the following steps: S100: Obtain and interpret user sessions, and obtain historical session information through user information; S200: Determine whether the user session and historical session information contain image information, and process the image or the text in the image. S300: Use the large model to write prompt words and complete the semantic information in the historical conversation information into the user conversation; S400, a multi-class classification model, classifies user conversations into types including casual conversation, factual statement, unclear question, requiring human intervention, exchange rate question, real-time database query, and knowledge base combined. S500: Based on different user session classification types, call the corresponding model to answer user questions.
2. The processing method of the knowledge-based cross-border logistics AI customer service system according to claim 1, characterized in that, In step S200, If the user session and historical session information do not contain image information, the large model can be used to correct typos in the user's questions by writing prompt words. If user sessions and historical session information contain image information, the text information in the images can be extracted using a large model by writing prompts.
3. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 1, characterized in that, In step S400, The classification model uses a neural network architecture to classify the input text. First, the input user session needs to be vectorized. Then, the vectorized result is connected to a series of neural network hierarchical structures. By calculating the probability between the text vector and each category, the classification category corresponding to the text is the classification category with the highest probability.
4. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 1, characterized in that, In step S500, When the user conversation is casual, use a large model to answer the user's questions by writing casual prompts. When the user conversation is factual, answer the user's question using a large model by writing factual prompts; When a user session involves an unclear question, the large model is used to answer the user's question by writing prompts for the unclear question. When a user session requires human intervention, and the user's question type requires human intervention, the system will respond with a message to transfer the user to human assistance and then transfer the user to human assistance.
5. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 1, characterized in that, When a user session involves a currency exchange rate question, first, we write a prompt to extract currency exchange rate information. Then, we use a large model to extract the conversion amount, query time, and currency information related to the user's currency exchange rate question. Based on the extracted query time and currency, we call the currency exchange rate query API to retrieve the corresponding exchange rate. Finally, based on the extracted conversion amount and the corresponding exchange rate, we use a large model to answer the user's question by writing a currency exchange rate conversion prompt.
6. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 1, characterized in that, When a user session is a real-time query database type, the order number in the user's question is first extracted using regular expressions. Then, by writing query target hints, the query target in the user's question is extracted using a large model. The matched order number and the corresponding query target are combined into an SQL query statement, which retrieves the corresponding real-time data from the business database. Finally, the retrieved real-time data is applied to the reply template to provide the answer.
7. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 1, characterized in that, When a user session is knowledge-based, a semantic similarity model is used to determine whether the user's question belongs to a dynamic workflow. The semantic similarity model is used to calculate the semantic similarity between different texts, determine whether at least two texts express the same meaning, vectorize at least two texts to obtain text vectors, and calculate the cosine similarity between the two text vectors. The higher the cosine similarity value, the more similar the two texts are. The dynamic workflow refers to the situation where multiple steps are required to jointly process a question in a user session. If the user session belongs to a dynamic workflow, obtain the first step of the dynamic workflow, execute the first step of the dynamic action flow. If the first step is to ask for user information, directly reply with the asked information. If the first step requires querying the database or combining the knowledge base, perform the corresponding process operation, store the operation result, obtain the next step of the dynamic workflow, and output the result after all the process steps in the workflow are processed. If the user session does not belong to a dynamic workflow, keywords in the user's question are extracted by training a named entity recognition model. The named entity recognition model is an end-to-end neural network model. First, the text is vectorized, and then a multi-layer neural network structure is connected to calculate the start and end positions of the keywords in the text. All characters from the start to the end position are combined to form the keywords. By writing intent recognition prompts, the intent result in the user's question is extracted using a large model. A semantic similarity model is used to determine whether the answer to the user session needs to be combined with a knowledge graph knowledge base.
8. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 7, characterized in that, If a user session requires integration with a knowledge graph knowledge base, cosine similarity is used to calculate the text similarity between keywords in the user session and nodes and edges in the knowledge graph. Nodes and edges with text similarity less than a first preset value are filtered out. The nodes and edges filtered out by cosine similarity are further filtered for relevance by a reordering model of a large model. The reordering model involves the large model simultaneously judging the relevance of a text with multiple texts, sorting them from high to low relevance, and taking the top N nodes and edges with the highest relevance. The top N nodes and edges with the highest relevance are then used to query the nodes and edges connected in the link in the knowledge graph. Knowledge graph knowledge filtering prompts are written, and the large model uses the knowledge graph triples of the nodes and edges connected in the query link to judge the user question. It is determined whether the triples can answer the user question, and triples that are irrelevant to the question are filtered out. Knowledge graph answer generation prompts are written, and the large model uses them to answer the user session. If the user session requires integration with a document knowledge base, cosine similarity is used to calculate the text similarity between keywords in the user session and keywords in the document knowledge base. Keywords from the document knowledge base with a text similarity less than a second preset value are filtered out. The keywords from the document knowledge base filtered by cosine similarity are further filtered for relevance using a large model's reordering model, selecting the top M most relevant keywords. These top M most relevant keywords are then searched in document blocks to find all candidate knowledge base documents containing the keywords. These candidate knowledge base documents are then semantically filtered using a large model's reordering model, selecting the top K most relevant candidate knowledge base documents. Document relevance prompts are written and the large model is used to filter out candidate knowledge base documents strongly related to the user's question. Finally, document knowledge base answer generation prompts are written and the large model is used to answer the user session.
9. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 8, characterized in that, The knowledge graph knowledge base is constructed through the following steps: Collect relevant domain-specific documents and data; Write prompt words, extract entities from the document using a large model, and semantically align the entities to obtain aligned entities; Write prompt words, use a large model to extract relationships from all documents, semantically align the relationships, and obtain the aligned relationships. The aligned entities and aligned relationships are vectorized, and the vectorization results are stored in a vector database. All entities and relations are combined into knowledge graph triples and stored in the knowledge graph knowledge base.
10. The processing method of the knowledge-based AI customer service system for cross-border logistics according to claim 8, characterized in that, The document knowledge base is constructed through the following steps: Collect relevant documents and data; Use a large model to segment and organize the text in the document; Write prompt words and use a large model to extract keywords from the segmented and organized document; The segmented and organized documents and their corresponding keywords are vectorized, and the vectorization results are stored in a vector knowledge base. All the segmented and organized documents, along with their corresponding keywords, are stored in the document knowledge base.