Consultation response method and device, equipment and medium
By constructing a three-layer progressive filtering mechanism, combined with semantic vector matching, deep semantic interaction, and large language model evaluation, the problem of balancing recall efficiency and accuracy in customer service document retrieval systems has been solved, achieving efficient and accurate document answers.
Patent Information
- Application Number
- CN202511693913.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies struggle to balance recall efficiency and recall accuracy in enterprise-level and internet-level customer service document retrieval systems. Traditional vector-based retrieval methods lack text interaction, resulting in insufficient semantic capture capabilities, while the resource consumption and response latency of large language models limit their application.
A three-tiered progressive screening mechanism is adopted. First, the semantic vector of the target consultation text is matched with the document vector library, and the semantic vector of the first-level category is combined for preliminary screening. Then, deep semantic interaction is carried out to calculate the question-answer relevance. Finally, a large language model is used to evaluate the document answer rate to ensure the accuracy of the answers.
It significantly improves the quality of response documents and user satisfaction. By quickly filtering out semantically relevant documents and leveraging the powerful reasoning capabilities of large language models, it ensures the high credibility and practical value of the answers, thus solving the problem of balancing recall efficiency and accuracy.
Smart Images

Figure CN121503687A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of e-commerce technology, and in particular to a consultation response method and the corresponding apparatus, computer equipment, and computer-readable storage medium. Background Technology
[0002] With the rapid development of information technology and artificial intelligence, massive amounts of document resources have emerged in enterprise-level and internet-level customer service document retrieval systems. When faced with such a vast amount of documents, traditional retrieval methods struggle to simultaneously achieve both recall efficiency and retrieval accuracy. One traditional retrieval method encodes queries and documents into high-dimensional semantic vectors, using metrics such as cosine similarity for recall. This approach excels in handling synonyms, near-synonyms, and contextual semantic matching; for example, a query for "Bluetooth headphones active noise cancellation" can retrieve documents on topics such as "wireless headphone noise control technology." However, this retrieval model simply encodes queries and documents into vectors, lacking interaction between texts, resulting in a slightly weaker ability to capture complex semantics. Another traditional retrieval method leverages the powerful understanding and reasoning capabilities of large language models. By directly analyzing the relevance between queries and documents, it can deeply understand the query intent at the natural language level, exhibiting the strongest semantic capture ability. Unfortunately, large language models consume enormous inference resources and have high response latency, making the overall solution difficult to implement when dealing with a large number of documents.
[0003] It is evident that in scenarios involving large-scale documents, existing technologies struggle to achieve an ideal balance between recall efficiency and recall precision. While traditional vector-based retrieval methods offer advantages in semantic matching, their lack of text interaction prevents them from effectively handling complex semantic relationships, potentially resulting in recalled documents that do not accurately meet user needs. Although large language models possess deep semantic understanding capabilities, their high resource consumption and response latency limit their application in large-scale document retrieval. Summary of the Invention
[0004] The primary objective of this application is to address at least one of the aforementioned problems by providing a consultation response method and corresponding apparatus, computer equipment, and computer-readable storage medium.
[0005] To achieve the various objectives of this application, the following technical solution is adopted: A consultation response method provided for one of the purposes of this application includes the following steps: In response to a user inquiry event, based on the first and second semantic vectors of the target inquiry text corresponding to the event, and the document matching degree and category matching degree between the document semantic vector and the first-level category semantic vector of each response knowledge document in the document vector library, multiple first candidate documents corresponding to the category matching degree and document matching degree satisfying the first preset condition are recalled. The target consultation text is subjected to deep semantic interaction with each first candidate document and its secondary category to determine the question-answer relevance of each first candidate document, and multiple second candidate documents corresponding to the question-answer relevance satisfying the second preset condition are recalled. For each second candidate document and its category path, a large language model is used to evaluate the answer rate of the second candidate document in answering the target consultation text. At least one target knowledge document corresponding to the answer rate that meets the standard is recalled to respond to the user.
[0006] On the other hand, a consultation response device provided to meet one of the purposes of this application includes an event response module, an intermediate selection module, and a user response module. The event response module is used to respond to user consultation events and, based on the first and second semantic vectors of the target consultation text corresponding to the event, the document matching degree and category matching degree between these vectors and the document semantic vectors and first-level category semantic vectors of each response knowledge document in the document vector library, recall multiple first candidate documents whose category matching degree and document matching degree satisfy a first preset condition. The intermediate selection module is used to perform deep semantic interaction between the target consultation text and each first candidate document and its second-level category, determine the question-answer relevance of each first candidate document, and recall multiple second candidate documents whose question-answer relevance satisfies a second preset condition. The user response module is used to evaluate the answer rate of each second candidate document and its category path using a large language model, and recall at least one target knowledge document corresponding to the answer rate reaching a certain threshold, for use in responding to the user.
[0007] In another aspect, a computer device provided for one of the purposes of this application includes a central processing unit and a memory, the central processing unit being used to invoke and run a computer program stored in the memory to perform the steps of the consultation and response method described in this application.
[0008] In another aspect, a computer program product provided for another purpose of this application includes a computer program / instructions that, when executed by a processor, implement the steps of the method described in any embodiment of this application.
[0009] The technical solution of this application has many advantages, including but not limited to the following aspects: This application constructs a three-tiered progressive screening mechanism—"coarse-precise-accurate"—which significantly improves the quality of response documents while ensuring retrieval efficiency. Specifically, in the initial recall stage, by combining the first and second semantic vectors of the target consultation text with the semantic vectors of each document in the document vector library and its primary category semantic vectors, it can quickly filter out semantically relevant and topic-matching candidate documents from a massive knowledge base. A dual-path recall strategy integrating document content and primary category is adopted. This leverages the high efficiency of vector semantic matching in identifying synonyms, near-synonyms, and contextual relationships, while also using category information for coarse-grained preliminary screening of document topics. This effectively eliminates a large number of irrelevant documents, significantly improving the purity and efficiency of the first round of recall and avoiding unnecessary processing in subsequent stages.
[0010] Secondly, in the deep semantic interaction stage, fine-grained semantic interaction is performed between the consultation text and each first candidate document and its secondary categories to calculate the question-answer relevance, thereby achieving a secondary screening of candidate documents. The secondary categories, serving as fine-grained semantic anchors, enhance the model's ability to capture intent in complex semantic scenarios. They are particularly helpful in identifying the deep, implicit causal relationships between consultation intent and response knowledge, thereby further improving the semantic relevance of the recalled documents to the user's actual problem and the relevance of the answers.
[0011] Finally, in the target selection stage, a large language model is introduced to comprehensively evaluate the second candidate documents and their complete category paths, determining their actual ability to answer user inquiries. By fully utilizing the powerful semantic understanding and logical reasoning capabilities of the large language model on a small number of second candidate documents, it can understand complete multi-level categories and comprehensively and accurately grasp the content of the documents, thereby more precisely quantifying the answer rate that can truly resolve user inquiries. This ensures that the final target responses have high credibility and practical value, improving user satisfaction. Attached Figure Description
[0012] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 The network architecture of the e-commerce platform exemplified in this application; Figure 2 This is a flowchart illustrating a typical embodiment of the consultation response method of this application; Figure 3 This is a schematic block diagram of the consultation response device of this application; Figure 4 This is a schematic diagram of the structure of a computer device used in this application. Detailed Implementation
[0013] The following describes in detail Embodiment 1 of this application. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0014] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0015] Those skilled in the art will understand that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0016] like Figure 1 In the network architecture shown, the e-commerce platform 82 is deployed on the Internet to provide corresponding services to its users. Similarly, the devices 80 of the merchant users and the devices 81 of the consumer users of the e-commerce platform 82 are also connected to the Internet to use the services provided by the e-commerce platform.
[0017] An exemplary e-commerce platform 82 provides supply and demand matching of products and / or services to the general public through the Internet infrastructure. In e-commerce platform 82, products and / or services are provided as commodity information. For the sake of simplicity, the concepts of commodity and product are used in this application to refer to the products and / or services in e-commerce platform 82. Specifically, these may be physical products, digital products, tickets, service subscriptions, other offline services, etc.
[0018] In reality, various entities can access e-commerce platform 82 as users and utilize its online services to participate in the business activities facilitated by the platform. These entities can be natural persons, legal persons, or social organizations. Corresponding to the two types of entities in business activities—merchants and consumers—e-commerce platform 82 has two corresponding categories of users: merchant users and consumer users. Entities involved in the product distribution chain in business activities, including manufacturers, sellers, retailers, and logistics providers, can all use online services on e-commerce platform 82 as merchant users. Similarly, consumers in business activities, including actual or potential consumers, can use online services on e-commerce platform 82 as consumer users. In actual business activities, the same entity can operate as both a merchant user and a consumer user; this should be interpreted flexibly.
[0019] The infrastructure used to deploy the e-commerce platform 82 mainly includes the backend architecture and frontend devices. The backend architecture runs various online services through a service cluster, including middleware or frontend services for the platform, services for consumers, and services for merchants, to enrich and improve its service functions. The frontend devices mainly cover the terminal devices used by users as clients to access the e-commerce platform 82, including but not limited to various mobile terminals, personal computers, and point-of-sale devices. For example, merchant users can use their terminal device 80 to enter product information for their online stores or use the interfaces opened by the e-commerce platform to generate their product information; consumer users can use their terminal device 81 to access the webpage of the online store implemented by the e-commerce platform 82, trigger the shopping process by clicking the shopping button provided on the webpage, and call various online services provided by the e-commerce platform 82 during the shopping process to achieve the purpose of placing an order.
[0020] In some embodiments, the e-commerce platform 82 may be implemented via a processing facility including a processor and memory, which stores a set of instructions that, when executed, cause the e-commerce platform 82 to perform the e-commerce and support functions as described in this application. The processing facility may be part of a server, client, network infrastructure, mobile computing platform, cloud computing platform, fixed computing platform, or other computing platform, and may provide electronic components, merchant devices, payment gateways, application developers, marketing channels, transportation providers, customer devices, point-of-sale devices, etc., for the e-commerce platform 82.
[0021] E-commerce platform 82 can provide online services such as cloud computing services, Software as a Service (SaaS), Infrastructure as a Service (IaaS), Platform as a Service (PaaS), Desktop as a Service (DaaS), Hosted Software as a Service, Mobile Backend as a Service (MBaaS), and Information Technology Management as a Service (ITMaaS). In some embodiments, the various functional components of e-commerce platform 82 can be implemented to operate on various platforms and operating systems. For example, for an online store, its administrator user enjoys the same or similar functions regardless of whether it is on iOS, Android, HomonyOS, or a web page.
[0022] E-commerce platform 82 enables merchants to create their own independent websites to run their online stores. It provides merchants with corresponding business management engine instances, allowing them to establish, maintain, and operate one or more online stores across these independent websites. The business management engine instance can be used for content management, task automation, and data management for one or more online stores. It can be configured through interfaces or built-in components to support various specific business processes in the online store, supporting business activities. Independent websites are the infrastructure of e-commerce platform 82, which offers cross-border services. Merchants can maintain their online stores relatively independently and centrally based on these independent websites. Independent websites typically have dedicated domain names and storage space, and different independent websites are relatively independent. E-commerce platform 82 can provide standardized or customized technical support for a large number of independent websites, allowing merchants to customize a business management engine instance that suits their needs and use it to maintain one or more online stores.
[0023] Online stores can be configured and maintained in the backend by merchant users logging into their Business Management Engine instance as administrators. Supported by the various online services provided by the e-commerce platform 82's infrastructure, merchant users can configure various functions within their online stores and view various data as administrators. For example, merchant users can manage various aspects of their online stores, such as viewing recent online store activities, updating the online store's product catalog, managing orders, recent visit activity, and total order activity. Merchant users can also view more detailed information about their business and visitors to their online store by obtaining reports or metrics, such as displaying a sales summary of the merchant's overall business, specific sales and engagement data from promotional sales and marketing channels, etc.
[0024] E-commerce platforms 82 can provide communication facilities and associated merchant interfaces for electronic communication and marketing. For example, they can utilize electronic messaging aggregation facilities to collect and analyze communication interactions between merchants, consumers, merchant devices, customer devices, point-of-sale devices, etc., aggregating and analyzing communications to increase the potential for product sales. For instance, a consumer may have product-related questions, which could lead to a dialogue between the consumer and the merchant (or an automated processor-based agent representing the merchant), where the communication facilities handle the interaction and provide the merchant with analysis on how to increase the probability of a sale.
[0025] In some embodiments, applications suitable for installation on terminal devices can be provided to serve the access needs of different users, enabling various users to access the e-commerce platform 82 by running the application on their terminal devices. Examples include the merchant backend module of online stores within the e-commerce platform 82. During the process of conducting business activities through these functions, the e-commerce platform 82 can implement various functions related to business activities as middleware or online services and expose corresponding interfaces. Then, toolkits corresponding to the interface access functions are embedded into the application to achieve functional expansion and task completion. The business management engine can include a series of basic functions and expose these functions to online services and / or applications via APIs. Online services and applications use the corresponding functions by remotely calling the corresponding APIs.
[0026] With the support of various components of the Business Management Engine instance, E-commerce Platform 82 can provide online shopping functionality, enabling merchants to connect with customers in a flexible and transparent manner. Consumers can select items online, create orders, provide delivery addresses in the orders, and complete payment confirmation. Merchants can then review and complete or cancel orders.
[0027] One consultation response method of this application can be programmed into a computer program product and deployed on a client or server for execution. For example, in an exemplary application scenario of this application, it can be deployed on the server of an e-commerce customer service platform. In this way, the method can be executed by human-computer interaction with the process of the computer program product through a graphical user interface by accessing the interface opened after the computer program product is running.
[0028] Please see Figure 2 The consultation response method of this application, in its typical embodiment, includes the following steps: Step S1100: Respond to user inquiry events, and based on the first semantic vector and second semantic vector of the target inquiry text corresponding to the event, the document matching degree and category matching degree between the document semantic vector and the first-level category semantic vector of each response knowledge document in the document vector library, recall multiple first candidate documents that meet the first preset conditions for category matching degree and document matching degree. In the cross-border e-commerce environment, e-commerce platforms provide independent website services for merchants, enabling them to independently maintain and operate their online stores. However, merchants encounter various problems while operating their independent website stores, such as product information management, order processing, marketing strategy development, and logistics arrangements. To help merchants solve these problems, e-commerce platforms need to provide effective customer service support, including but not limited to help centers and intelligent customer service agents.
[0029] The Help Center is a searchable customer service knowledge base containing a large number of response knowledge documents. These documents cover various common problems that merchants may encounter while operating independent online stores and their solutions. These documents are organized under different category paths. Each first-level category in each category path has its corresponding semantic vector, used to quantify the topic and content of that category. Simultaneously, each document also has its own document semantic vector, used to quantify the specific semantic information of that document's content. The document semantic vector and category semantic vector corresponding to each document and its first-level category are pre-determined by two different text encoders and stored in a document vector library. Furthermore, the network weight parameters of the text encoder used to determine the response knowledge document are the same as those of the text encoder used to determine the target consultation text, ensuring mapping to the same semantic space. This allows for semantic parsing and quantification of the response knowledge document and the target consultation text within the same context. Similarly, the network weight parameters of the text encoder used to determine the first-level category of the response knowledge document are the same as those of the other text encoder used to determine the target consultation text, ensuring mapping to the same semantic space. This allows for semantic parsing and quantification of the first-level category and the target consultation text within the same context.
[0030] A customer service AI agent is an automated consultation service system based on artificial intelligence. It can quickly and accurately locate relevant knowledge documents based on a user's inquiry and provide answers. To achieve this, the customer service AI agent needs efficient document retrieval and semantic understanding capabilities.
[0031] When merchants encounter problems while operating their independent online stores, they can trigger a client-side construction and submit a corresponding consultation request to the e-commerce platform's backend server by searching through the help center provided on the e-commerce platform's front-end interface or engaging in dialogue with the customer service AI. The server then returns the corresponding answer text to the target consultation text, which is displayed on the front-end interface. The consultation request contains the target consultation text, i.e., the specific question the merchant wants to ask. To find knowledge documents related to the target consultation text, the server first needs to perform semantic analysis on the target consultation text, extracting its deep semantic information and quantifying it into corresponding vectors. Since the primary category and the answer knowledge document are different types of specific text, differentiated modeling analysis of the matching relationship with the target consultation text is required. Therefore, the server uses two different text encoders to extract semantic features from the target consultation text, obtaining the corresponding first semantic vector and second semantic vector as input.
[0032] Next, the server calls the document vector library to calculate the cosine similarity between the first and second semantic vectors of the target consultation text and the document semantic vectors and first-level category semantic vectors of each response knowledge document in the document vector library, respectively. This yields the corresponding document matching score and category matching score. The document matching score represents the semantic similarity between the target consultation text and the knowledge document, while the category matching score represents the semantic similarity between the target consultation text and the first-level category. By calculating these matching scores, documents with high semantic relevance to the target consultation text can be preliminarily and quickly filtered out.
[0033] To ensure the selected documents have high relevance, a first preset condition is set. When both the document matching degree and category matching degree meet the first preset condition, multiple corresponding response knowledge documents are recalled and used as first candidate documents. These documents have a high comprehensive semantic matching degree with the target consultation text. In one embodiment, the first preset condition may be to determine whether the sum of the weighted sums of the document matching degree and category matching degree corresponding to the response knowledge document exceeds a preset threshold. Here, the sum of the weights corresponding to the document matching degree and category matching degree is 1. Each weight and the preset threshold can be preset as needed by those skilled in the art based on the disclosure herein. For example, the weights corresponding to the document matching degree and category matching degree are 0.7 and 0.3, and the preset threshold is 0.7.
[0034] Step S1200: Perform deep semantic interaction between the target consultation text and each first candidate document and its secondary category to determine the question-answer relevance of each first candidate document, and recall multiple second candidate documents corresponding to the question-answer relevance satisfying the second preset condition; Building upon the efficient retrieval of multiple first-line candidate documents based on rapid matching of document and category semantic vectors, this study delves deeper into the question-and-answer correspondence between the target consultation text and these first-line candidate documents. To this end, a deep semantic interaction mechanism is employed. Analogous to human reading comprehension, this mechanism performs bidirectional semantic parsing and interactive analysis on the target consultation text, each first-line candidate document, and its secondary categories. This allows for a more nuanced examination of whether the documents truly possess the ability to answer consultation questions. Specifically, deep semantic interaction integrates the target consultation text, document content, and secondary category information, calculating the interaction features between these three elements in a deep semantic space. For example, attention mechanisms and / or contextual encoding are used to quantify the strength of the association between the corresponding consultation intent and the document content. This approach considers not only local semantic matching but also the global context to ensure semantic correctness, thereby deriving the question-and-answer correlation degree for each first-line candidate document, representing its logical connection in answering consultation questions. Subsequently, based on a second preset condition (such as setting a correlation degree threshold), multiple first-line candidate documents with high question-and-answer correlation degrees are selected as second-line candidate documents. These documents exhibit stronger logical relevance to the target consultation text at the semantic level, laying the foundation for subsequent evaluation.
[0035] Step S1300: For each second candidate document and its category path, use a large language model to evaluate the answer rate of the second candidate document in answering the target consultation text, and recall at least one target knowledge document corresponding to the answer rate that meets the standard to respond to the user.
[0036] To further refine the evaluation of the substantive solution capability of each second candidate document and ensure its effective use in answering the target consultation text, a large language model is employed as the evaluation tool. Leveraging its powerful natural language understanding and reasoning capabilities, the model comprehensively assesses the second candidate documents and their category paths, quantifying the likelihood of each document answering the target consultation text—the solution rate. Specifically, the large language model acquires extensive domain knowledge and language patterns through pre-training, enabling it to simulate logical analysis and intent matching by human experts. During the evaluation process, the model takes the target consultation text and the content and category paths of the second candidate documents as input. Through deep encoding and attention mechanisms, it captures the causal relationship between the consultation intent and the document content. The category path serves as contextual reinforcement, providing the document's thematic background and helping the model to more accurately and deeply understand the document, locating relevant content that specifically matches the consultation intent and thus addresses the corresponding consultation question. The evaluation result is the output solution rate. The model can be input with a corresponding task description text requiring the model to use this metric as output. This metric characterizes the degree to which the document content answers the consultation question, typically a normalized value, reflecting whether the document directly and completely responds to the core of the consultation.
[0037] Finally, the second candidate documents with a response rate exceeding the response threshold can be recalled as target knowledge documents. Then, for the help center scenario, these target knowledge documents are directly returned to the client, which receives them and displays them as the results of the user's search in the help center, showing them in the display area of the front-end interface. For the customer service agent scenario, in one embodiment, a large language model can be further used to extract the relevant content needed to answer the target inquiry text from these target knowledge documents, generating corresponding response text and returning it to the client. The client then receives this text as a response message and sends it in the instant chat window of the front-end interface as a customer service representative, completing the response to the user's previous inquiry.
[0038] It is easy to understand from the above embodiments that, compared with the prior art, this application has many advantages, including at least: This application constructs a three-tiered progressive screening mechanism—"coarse-precise-accurate"—which significantly improves the quality of response documents while ensuring retrieval efficiency. Specifically, in the initial recall stage, by combining the first and second semantic vectors of the target consultation text with the semantic vectors of each document in the document vector library and its primary category semantic vectors, it can quickly filter out semantically relevant and topic-matching candidate documents from a massive knowledge base. A dual-path recall strategy integrating document content and primary category is adopted. This leverages the high efficiency of vector semantic matching in identifying synonyms, near-synonyms, and contextual relationships, while also using category information for coarse-grained preliminary screening of document topics. This effectively eliminates a large number of irrelevant documents, significantly improving the purity and efficiency of the first round of recall and avoiding unnecessary processing in subsequent stages.
[0039] Secondly, in the deep semantic interaction stage, fine-grained semantic interaction is performed between the consultation text and each first candidate document and its secondary categories to calculate the question-answer relevance, thereby achieving a secondary screening of candidate documents. The secondary categories, serving as fine-grained semantic anchors, enhance the model's ability to capture intent in complex semantic scenarios. They are particularly helpful in identifying the deep, implicit causal relationships between consultation intent and response knowledge, thereby further improving the semantic relevance of the recalled documents to the user's actual problem and the relevance of the answers.
[0040] Finally, in the target selection stage, a large language model is introduced to comprehensively evaluate the second candidate documents and their complete category paths, determining their actual ability to answer user inquiries. By fully utilizing the powerful semantic understanding and logical reasoning capabilities of the large language model on a small number of second candidate documents, it can understand complete multi-level categories and comprehensively and accurately grasp the content of the documents, thereby more precisely quantifying the answer rate that can truly resolve user inquiries. This ensures that the final target responses have high credibility and practical value, improving user satisfaction.
[0041] In a further embodiment, before step S1100, which responds to a user inquiry event, the following steps are included: Step S1000: Locally verify whether the consultation intent of the original consultation text provided by the user is clear. When the consultation intent of the original consultation text is clear, confirm that the original consultation text is the target consultation text and trigger the user consultation event. In the cross-border e-commerce environment, merchants operating independent online stores can submit inquiries through the e-commerce platform's front-end interface, such as entering questions in the help center's input box or engaging in dialogue with a customer service AI. The original inquiry text provided by the user is a prerequisite for triggering an inquiry event. To eliminate risks beforehand and avoid processing invalid inquiries later, the original inquiry text provided by the user is first validated locally on the client side to determine if the inquiry intent is clear. Specifically, the client can use pre-deployed natural language processing technology to analyze the original inquiry text. This process involves operations such as word segmentation, part-of-speech tagging, and semantic parsing to extract key information and intent expressions from the text. For example, a pre-trained, convergent intent recognition model can be used to identify whether the original inquiry text clearly expresses the intended inquiry question or contains related keywords. When the semantic intent of the original inquiry text is determined to be clear, the text is confirmed as the target inquiry text, triggering the user's inquiry event and advancing the subsequent inquiry processing flow.
[0042] Step S1001: When the consultation intent of the original consultation text is unclear, after determining that multiple rewritten consultation texts that match the original consultation text in the consultation corpus are pushed to the user, the rewritten consultation text selected by the user is obtained as the target consultation text, and the user consultation event is triggered.
[0043] When the original consultation text's intent is unclear, to avoid processing invalid consultations later and to help users clearly express their intent, the client requests the server to retrieve multiple historical consultation texts matching the original from a pre-built consultation corpus, which are then used as rewritten consultation texts. The client receives these rewritten consultation texts from the server and pushes them to the user, who can choose the text that best suits their needs, saving them the trouble of editing. Finally, the user-selected rewritten consultation text is confirmed as the target consultation text, triggering the user's consultation event and allowing the subsequent consultation processing flow to continue. This matching can be implemented using various fuzzy matching algorithms, including but not limited to edit distance (Levenshtein distance) and Fassis-based retrieval algorithms, ensuring that the user is quickly provided with optional consultation texts for rewriting. Those skilled in the art can flexibly adapt these methods to achieve the desired result.
[0044] The historical consultation texts in the consultation corpus are taken from original consultation texts from which the corresponding consultation intent was confirmed to be clear during the consultation process. The purpose is to help users clearly express their potential consultation intent.
[0045] In this embodiment, by pre-verifying the clarity of the user's inquiry intent locally on the client side, unnecessary processing of invalid or ambiguous inquiries on the server side is effectively avoided, significantly reducing resource consumption and response latency. When an unclear inquiry intent is detected, a matching rewritten inquiry text is proactively pushed for the user to choose from. This not only helps users accurately express their true needs, improving the user experience and interaction efficiency, but also ensures the quality of the input text in the subsequent semantic matching process. This improves the accuracy and success rate of the entire inquiry response system from the source, and is especially suitable for the complex situation in cross-border e-commerce scenarios where merchants' inquiries are not standardized and have varying levels of professionalism. It realizes the pre-optimization and risk control of the inquiry processing flow.
[0046] In a further embodiment, before step S1100, which responds to a user inquiry event, the following steps are included: Step S1010: For each response knowledge document and its first-level category in the customer service knowledge base, the document encoding tower in the first dual-tower model is used to infer the document semantic vector of the response knowledge document. The consultation encoding tower in the first dual-tower network is used to infer the first semantic vector of the target consultation text. For each response knowledge document and its primary category in the customer service knowledge base, the document encoding tower in the first dual-tower model is used to infer the document semantic vector of the response knowledge document. The first dual-tower model is a neural network architecture for text matching, consisting of two independent encoding towers, each used to encode different texts. The document encoding tower is specifically used for semantic feature extraction from knowledge documents. Through a series of neural network layers (such as a multilayer perceptron or Transformer encoder architecture), the document text is mapped to a high-dimensional semantic space, generating a document semantic vector. This vector can quantify the specific semantic information of the document's content; for example, it can represent the semantic features of topics such as product information management, order processing, or marketing strategies within the document.
[0047] Simultaneously, the consultation encoding tower in the first dual-tower network is used to infer the first semantic vector of the target consultation text. The consultation encoding tower shares the same network architecture and network weight parameters as the document encoding tower, but it encodes the semantic features of the consultation text. The consultation encoding tower extracts deep features from the consultation text through multiple neural network layers to generate the first semantic vector. This vector can reflect the deep semantic information of the consultation text. For example, when a user inquires about logistics arrangements, the first semantic vector can capture semantic features related to logistics details in texts such as response knowledge documents, such as specific key information like transportation methods and delivery times.
[0048] Step S1020: The category encoding tower in the second dual-tower model is used to infer the first-level category semantic vector of the first-level category, and the consultation encoding tower in the second dual-tower network is used to infer the second semantic vector of the target consultation text. The first-level category semantic vector is derived using the category encoding tower in the second dual-tower model. This model also comprises two encoding towers that share the same network architecture and weight parameters. The category encoding tower is specifically used for semantic encoding of the first-level categories. The first-level category is the first category label in the category path of a knowledge document, reflecting the document's subject matter, such as "product information management" or "order processing." The category encoding tower generates a first-level category semantic vector by encoding the category name or description text. This vector quantifies the topic and content of the first-level category. For example, for the category "product information management," its semantic vector reflects semantic features related to managing product information. The category encoding tower can employ a similar neural network architecture to the document encoding tower, but it is optimized for the conciseness and categorical characteristics of the category text, such as Sentence-BERT.
[0049] The consultation encoding tower in the second dual-tower network is used to infer the second semantic vector of the target consultation text. This consultation encoding tower extracts semantic features from the consultation text through a specific network structure to generate the second semantic vector. The difference between the second and first semantic vectors is that the second semantic vector focuses more on semantic parsing of the consultation text from the perspective of the summary semantics of the matching category, so as to facilitate subsequent matching calculations with the first-level category semantic vector. For example, when processing user inquiries about marketing strategies, the second semantic vector can more accurately reflect the semantic relationship between the consultation text and the marketing strategy category, such as key semantic information like promotions and advertising placement.
[0050] Step S1030: Associate each response knowledge document with its corresponding document semantic vector and first-level category semantic vector and store them in the document vector library.
[0051] Finally, a document vector library is created to store the document semantic vector and the first-level category semantic vector corresponding to each response knowledge document. Specifically, the document semantic vector of each response knowledge document and the first-level category semantic vector of its respective category are stored as key-value pairs for later retrieval.
[0052] In this embodiment, by employing two independent dual-tower models corresponding to document encoding and category encoding respectively, and ensuring that the network weight parameters of the consultation encoding tower and the document / category encoding tower are the same, accurate mapping between consultation text and knowledge documents and first-level categories is achieved in their respective unified semantic spaces. This overcomes the shortcomings of traditional single models, which are unable to simultaneously take into account the fine-grained semantics of documents and the general semantics of categories. This differentiated modeling approach not only ensures deep matching between document content and consultation questions at the micro level, but also enables rapid filtering of category themes and consultation intentions at the macro level, significantly improving the recall quality and efficiency of vector retrieval. At the same time, the decoupled design of the dual-tower structure allows the document vector library to be pre-built offline and maintained independently, significantly reducing the computational load of online services and enhancing the overall scalability and real-time response capability.
[0053] In a further embodiment, before step S1010, which involves inferring the document semantic vector of each response knowledge document and its primary category in the customer service knowledge base using the document encoding tower in the first dual-tower model, the following steps are included: Step S2010: Obtain a training set, which includes multiple training samples and their supervision labels. The training samples include historical target consultation texts, response knowledge documents and their first-level categories. The supervision labels indicate whether the corresponding response knowledge documents are used to answer historical consultation texts. This can be achieved by collecting the historical target consultation text provided by the user during each historical response process, as well as the response knowledge documents relied upon by the human answerer, and then manually filtering out the unreliable response knowledge documents from the customer service knowledge base. Each relied-upon response knowledge document and its primary category, along with the historical target consultation text, constitute a training sample of a single positive example. The supervision label for each positive training sample is 1, indicating that the corresponding response knowledge document was used to answer the historical consultation text. Conversely, each unreliable response knowledge document and its primary category, along with the historical target consultation text, constitute a training sample of a single negative example. The supervision label for each negative training sample is 0, indicating that the corresponding response knowledge document was not used to answer the historical consultation text.
[0054] Step S2020: Use the training set to jointly train the first dual-tower model and the second dual-tower model to obtain the first dual-tower model and the second dual-tower model that are simultaneously trained to the convergence state.
[0055] A single training sample and its supervision label from the training set are used. The response knowledge document and the historical target consultation text in the training sample are input into the first dual-tower model. The consultation encoding tower in this model infers the first semantic vector of the historical target consultation text, and the document encoding tower in this model infers the document semantic vector of the response knowledge document. The cosine similarity between the first semantic vector and the document semantic vector is calculated as the document matching degree. At the same time, the first-level category of the training sample and the historical target consultation text are input into the second dual-tower model. The consultation encoding tower in this model infers the second semantic vector of the historical target consultation text, and the category encoding tower in this model infers the category semantic vector of the first-level category. The cosine similarity between the second semantic vector and the category semantic vector is calculated as the category matching degree. The document matching degree and category matching degree are multiplied by their respective weights and summed to obtain the predicted probability that the response knowledge document in the training sample can be used to answer historical target consultation texts. Then, the cross-entropy loss function is used to calculate the loss value between the predicted probability and the supervision label. When the loss value exceeds a preset threshold, the parameters of the first and second dual-tower models are updated through backpropagation based on this loss value. Then, other training samples and their supervision labels are called to iterate the above process. When the loss value does not exceed the preset threshold, it is determined that the first and second dual-tower models have simultaneously converged to the convergence state, training is stopped, and the parameters of the first and second dual-tower models are saved. The two weights here are the same as those used in the aforementioned online computation. The preset threshold here can be configured as needed by those skilled in the art.
[0056] In this embodiment, two dual-tower models are jointly trained by constructing a training set containing positive and negative samples, and the model parameters are simultaneously optimized using the cross-entropy loss function. This achieves adaptive learning of the weights for document matching degree and category matching degree, enabling the model to automatically capture the importance differences of different matching dimensions from historical consultation data. This end-to-end joint training mechanism not only avoids the semantic space inconsistency problem caused by separate training, but also enhances the synergistic effect between the two models by sharing optimization objectives, significantly improving the model's ability to model the complex relationship between consultation intent and knowledge documents. At the same time, the supervision labels constructed based on actual answer relationships ensure the authenticity and effectiveness of the training samples, giving the converged model stronger generalization ability and discrimination accuracy, laying a solid model foundation for the subsequent "coarse-precise-accurate" three-layer screening mechanism.
[0057] In a further embodiment, step S1200, which involves performing deep semantic interaction between the target consultation text and each first candidate document and its secondary category to determine the question-answer relevance of each first candidate document, and recalling multiple second candidate documents whose question-answer relevance meets the second preset condition, includes the following steps: Step S1210: For each first candidate document, concatenate the target consultation text and the first candidate document with its secondary category to form the target interactive text; For each first candidate document, the target consultation text, the content of the first candidate document, and the second-level category to which the document belongs are concatenated to form the target interactive text. Specific delimiters are used to distinguish different parts during concatenation. In one embodiment, special tags such as [CLS] and [SEP] are used to structure the input text, with the specific format being: [CLS]Target Consultation Text [SEP]Second-Level Category [SEP]First Candidate Document [SEP]. Here, the target consultation text is the user-input consultation question, the first candidate document is the document content in the customer service knowledge base, and the second-level category is the second-level category tag in the category path to which the document belongs, used to provide a more granular and generalized document classification definition. This concatenation method ensures that the model can simultaneously process consultation, category, and document information, facilitating subsequent deep semantic analysis. In practical implementation, additional metadata such as category descriptions can be added to enhance the corresponding semantic representation.
[0058] Step S1220: Use a question-answering discrimination model to perform deep bidirectional encoding on the target text to be interacted with, map the obtained question-answering semantic vectors to the relevance classification space, and determine the corresponding question-answering relevance. A question-answering discriminative model is employed to perform deep bidirectional encoding on the target text to be interacted with. The network structure of this model can be a pre-trained language model such as Bi-LSTM, BERT, or RoBERTa, capable of capturing long-distance dependencies within and between texts through bidirectional encoding. The deep bidirectional encoding process involves inputting the target text to be interacted with into the model, which then performs word embedding, positional encoding, and attention calculation through a sub-network composed of multiple stacked Transformer encoders, generating a context-aware vector representation for each input token. Subsequently, the encoded output of the entire sequence, typically the vector corresponding to the [CLS] marker, is taken as the semantic summary of the overall text, i.e., the question-answering semantic vector. This question-answering semantic vector is then input into an association classification layer, which is usually a fully connected neural network, mapping to an association classification space and outputting a scalar score as the question-answering association degree. The association classification space is a semantic space learned through model training, where vector positions represent the degree of relevance between texts. The question-answering association quantifies the semantic matching strength between the target consultation text and the first candidate document in the context of the secondary category; the value range is typically 0 to 1, with higher values indicating stronger relevance. The question-answering discrimination model can call the training set in the above embodiments to initialize the model based on different pre-trained text feature representations, and fine-tune it for the question-answering matching task. For example, it can use the cross-entropy loss function to optimize the model parameters to distinguish between relevant and irrelevant documents. In an alternative implementation, the model structure can be a distilled version such as DistilBERT to improve inference efficiency while maintaining inference accuracy.
[0059] Step S1230: Select multiple first candidate documents that meet the preset evaluation criteria and their question-answer relevance as second candidate documents.
[0060] The pre-set evaluation criteria can be a specific relevance threshold, such as 0.8. Only when the question-answer relevance exceeds this threshold will the corresponding document be selected as the second candidate document. This process further refines the first candidate documents, ensuring that the documents entering the next stage of evaluation have a stronger logical relevance to the target consultation text at the semantic level, laying the foundation for the subsequent final evaluation.
[0061] In this embodiment, the target consultation text, the first candidate document, and its secondary categories are structurally concatenated into the text to be interacted with. A question-and-answer discriminant model is then used for deep bidirectional encoding, fully utilizing the fine-grained semantic anchors provided by the secondary categories. This allows the model to understand the question-and-answer correspondence between the document and the consultation in a more precise context. Based on attention mechanisms and contextual encoding, the associative classification space mapping effectively captures the causal logic and deep implicit connections between the consultation intent and the document content, significantly improving the depth and accuracy of semantic interaction compared to traditional shallow similarity calculations. This design not only considers local semantic matching but also ensures the correctness of global semantics through the contextual constraints of the secondary categories, thereby accurately quantifying the question-and-answer correlation of the document. This achieves efficient secondary screening of the first candidate document, providing a higher-quality candidate set for subsequent large language model evaluation and reducing noise interference in the final evaluation.
[0062] In a further embodiment, step S1300, for each second candidate document and its category path, uses a large language model to evaluate the answer rate of the second candidate document in answering the target consultation text, and recalls at least one target knowledge document corresponding to the answer rate meeting the standard, including the following steps: Step S1310: For each second candidate document, embed the target consultation text and the second candidate document and its category path into the answer prompt template to obtain the answer prompt text; Category path refers to the hierarchical category sequence of the corresponding response knowledge document in the customer service knowledge base, including first-level category, second-level category and at least one parent category above it.
[0063] The answer prompt template includes a task description, the target consultation text to be embedded therein, the response knowledge document and its category path, and corresponding output constraints. Specifically, the task description can be a detailed quantitative evaluation rule for the answer. In one embodiment, it is: "Based on the following user consultation and response knowledge documents and their respective document categories, evaluate the document's answer rate for the user consultation and give a score of 0–1:" 0 = Completely irrelevant: This block has no connection to the consultation.
[0064] 0.1 = Almost irrelevant: Only a very slight or vague connection with the consultation.
[0065] 0.2 = Very slight correlation: the association is minimal or non-correlated.
[0066] 0.3 = Slightly relevant: Only involves a small part of the consultation, but lacks substantial details.
[0067] 0.4 = Somewhat relevant: Contains partial information, but not comprehensive.
[0068] 0.5 = Moderately relevant: Involves consultation, but with limited or partial relevance.
[0069] 0.6 = Moderately relevant: Provides relevant information, but lacks depth or specificity.
[0070] 0.7 = Clearly Relevant: Clearly relevant to the consultation, providing substantial but not entirely comprehensive information.
[0071] 0.8 = Highly Relevant: Highly relevant to the consultation and provides important information.
[0072] 0.9 = Highly relevant: Almost completely answers the inquiry and provides detailed and specific information.
[0073] 1 = Fully Relevant: The inquiry was answered directly and comprehensively, and all necessary specific information was provided.
[0074] Consultation text: <Target consultation text to be embedded> Document Category: <Path to be embedded category> Response knowledge document: <Second candidate document to be embedded> score:".
[0075] By embedding the target consultation text, the second candidate document, and its category path into the prompt template, the answer prompt text can be obtained and input into the large language model for scoring.
[0076] Step S1320: Using a large language model, based on the answer quantification evaluation details in the answer prompt text, generate the answer rate of the second candidate document in answering the target consultation text; The Large Language Model (LLM) is a pre-trained generative model based on the Transformer decoder architecture, possessing powerful natural language understanding and reasoning capabilities. After receiving answer prompt text, the model parses the text semantics through an internal multi-layered attention mechanism, identifying the logical connections between the consultation intent, document content, and category path. Based on pre-trained knowledge, it simulates human evaluation behavior and directly infers a value between 0 and 1 as the answer rate. The answer rate quantifies the degree to which the document content answers the consultation question; for example, 0.9 indicates that the document is highly relevant and almost completely answers the question. In its implementation, the server can call the cloud-based LLM service via API or deploy the model locally for direct access.
[0077] Step S1330: Select the second candidate documents corresponding to the solution rate that exceeds the preset solution threshold as the target knowledge documents.
[0078] A preset answer threshold is used to filter documents with a satisfactory answer rate. This threshold can be configured as needed by those skilled in the art. The answer rate of each second candidate document is compared with the preset answer threshold. Only answer knowledge documents with an answer rate exceeding the threshold are retained as the final target knowledge documents. For example, if a document has an answer rate of 0.85 and the threshold is 0.7, the document is selected; conversely, documents with an answer rate of 0.6 are excluded. The threshold can be adjusted according to business needs; for example, it can be set to 0.9 in scenarios with high accuracy requirements and 0.8 in scenarios with high recall requirements. In an alternative embodiment, the filtering can be combined with a top-K strategy, for example, selecting the top N documents from those exceeding the threshold to ensure a controllable number of results.
[0079] In this embodiment, a solution prompt template with a detailed scoring rubric is designed, embedding the target consultation text, the second candidate document, and its complete category path. The deep understanding and reasoning capabilities of the large language model are used to generate a 0-1 graded solution rate, achieving a fine-grained and quantifiable evaluation of the document's solution capability. The ten levels of the scoring rubric, from "completely irrelevant" to "completely relevant," provide the model with clear evaluation criteria, enabling it to simulate consistent scoring by human experts and significantly improving the reliability and interpretability of the evaluation results. Simultaneously, the complete embedding of the category path provides a multi-layered thematic context, helping the model more accurately locate the core solution content within the document and avoiding misjudgments caused by detachment from context. Finally, a preset solution threshold is used for screening, achieving precise control over solution quality and ensuring that the recalled target knowledge documents are not only semantically relevant but also possess substantial solution capability, greatly increasing the probability of users obtaining satisfactory answers.
[0080] In a further embodiment, after step S1300, which involves evaluating the response rate of each second candidate document and its category path using a large language model to answer the target consultation text, and recalling at least one target knowledge document corresponding to the response rate meeting the standard, the method further includes: Step S1400: Using a response generation model, generate corresponding target response text based on key answer information extracted from the target knowledge document; In real-time dialogue scenarios between users and customer service agents, after the server identifies the target knowledge documents through the first three layers of filtering mechanisms, it needs to convert these documents into natural language responses that directly answer the user's questions and return them to the client to complete the response to the user as a customer service representative.
[0081] In one embodiment, from the aforementioned training set, multiple response knowledge documents used to answer the same historical consultation text are extracted from the corresponding training samples based on supervision labels. Then, each historical target consultation text is combined with the multiple response knowledge documents answering that historical target consultation text to form a single fine-tuning training sample. Subsequently, a manual process determines the target response text of the natural language reply for each fine-tuning training sample and the portions of content referenced from each original document as key answer information, thus forming the fine-tuning supervision label for the corresponding fine-tuning training sample. These fine-tuning training samples and their fine-tuning supervision labels constitute the fine-tuning training set.
[0082] The large language model is fine-tuned and trained using a fine-tuning training set until convergence. Specifically, the large language model performs forward inference on a single fine-tuned training sample in the fine-tuning training set, outputting key answer information extracted from the response knowledge document in the fine-tuned training sample that can answer the historical target consultation text, and generating the target response text in natural language. Then, the cross-entropy loss function is used to determine the loss value of the current inference output based on the fine-tuning supervision label of the fine-tuned training sample. When the loss value does not exceed a preset threshold, the large language model is fine-tuned using LoRA (Low-Rank Adaptation of Large Language Models), thereby implicitly transforming the weight matrix into a low-rank form. The original parameters of the model's weight matrix are fixed, and the weight change parameters of the model's weight matrix are determined based on the loss value. The weight matrix is then adjusted accordingly based on the weight change parameters. Then, other fine-tuned training samples and their fine-tuning supervision labels are used to iteratively train the large language model until the model is trained to a convergent state. The large language model trained to a convergent state is then used as the response generation model. The preset threshold can be flexibly set by those skilled in the art. It is easy to understand that by applying the response generation model, multiple target knowledge documents can be used to infer and output corresponding key answer information and target response text.
[0083] Step S1410: Associate the target response text with the key answer information and its document location, and push the associated target response text to the user so that the user can trace and view the key answer information.
[0084] The generated target response text needs to be explicitly associated with the key answer information and its position in the original document to form traceable knowledge output. The client pushes the associated target response text to the user's front-end interface. After receiving it, the merchant user can not only directly read the complete answer, but also quickly locate the information source in the original document through interactive operations. The front-end interface provides two typical traceability and retrieval design schemes, rendering the target response text into rich text format, where the text fragments corresponding to the key answer information are marked as interactive hotspot links. In one embodiment, when the merchant user clicks on the hotspot text, the client triggers a jump instruction, and the interface switches from the current response display area to the knowledge document retrieval window in the help center, which displays multiple optional detailed retrieval items. Each item displays the key answer information and the document title of the response knowledge document from which it originates. The user can further touch any optional detailed retrieval item to view the corresponding response knowledge document, and the key answer information in the visualization hotspot is then viewed in the retrieval hotspot.
[0085] In this embodiment, by employing a large language model to extract key answer information from target knowledge documents and generate natural and fluent target response text, an end-to-end intelligent transformation from knowledge retrieval to answer generation is achieved. The generated response not only accurately matches user inquiries but also conforms to human language habits, significantly improving the interactive experience in customer service scenarios. The LoRA fine-tuning method retains the general capabilities of the large language model while efficiently adapting to specific domain knowledge, reducing training costs and accelerating convergence. Associating the target response text with key answer information and its document location provides users with a traceable verification mechanism. Merchants can directly locate the answer basis in the original knowledge document through interactive hotspot links, enhancing the credibility and transparency of the answer. This design not only meets users' needs for answer accuracy but also supports deep learning and independent querying through traceability, achieving an upgrade from passive response to proactive knowledge service. In the long run, this helps improve the independent operational capabilities of merchants, reduces reliance on platform customer service, and forms a win-win value loop for both the platform and merchants.
[0086] Please see Figure 3This consultation response device, provided to meet one of the purposes of this application, is a functional embodiment of the consultation response method of this application. On another note, this consultation response device, provided to meet one of the purposes of this application, includes an event response module 1100, an intermediate optimization module 1200, and a user response module 1300. The event response module 1100 is used to respond to user consultation events. Based on the first and second semantic vectors of the target consultation text corresponding to the event, and the document matching degree and category matching degree between these vectors and the document semantic vectors and first-level category semantic vectors of each response knowledge document in the document vector library, it recalls categories. The system includes: a first candidate document whose matching degree and document matching degree meet the first preset condition; an intermediate selection module 1200, which performs deep semantic interaction between the target consultation text and each first candidate document and its secondary category to determine the question-answer relevance of each first candidate document and recalls a number of second candidate documents whose question-answer relevance meets the second preset condition; and a user response module 1300, which evaluates the response rate of each second candidate document to the target consultation text using a large language model for each second candidate document and its category path and recalls at least one target knowledge document corresponding to the response rate meeting the standard to respond to the user.
[0087] In a further embodiment, before the event response module 1100, there are: a first event triggering submodule, used to locally verify whether the consultation intent of the original consultation text provided by the user is clear; when the consultation intent of the original consultation text is clear, the original consultation text is confirmed as the target consultation text, and a user consultation event is triggered; a second event triggering submodule, used to, when the consultation intent of the original consultation text is unclear, determine that multiple rewritten consultation texts matching the original consultation text in the consultation corpus are pushed to the user, obtain the rewritten consultation text selected by the user as the target consultation text, and trigger a user consultation event.
[0088] In a further embodiment, before the event response module 1100, there are: a first reasoning submodule, used to reason out the document semantic vector of the response knowledge document using the document encoding tower in the first dual-tower model for each response knowledge document and its first-level category in the customer service knowledge base, and the consultation encoding tower in the first dual-tower network is used to reason out the first semantic vector of the target consultation text; a second reasoning submodule, used to reason out the first-level category semantic vector of the first-level category using the category encoding tower in the second dual-tower model, and the consultation encoding tower in the second dual-tower network is used to reason out the second semantic vector of the target consultation text; and a vector storage submodule, used to store the document semantic vector and the first-level category semantic vector associated with each response knowledge document in a document vector library.
[0089] In a further embodiment, before the first inference submodule, there is a training set acquisition submodule, used to acquire a training set, the training set including multiple training samples and their supervision labels, the training samples including historical target consultation texts, response knowledge documents and their first-level categories, the supervision labels representing whether the corresponding response knowledge document is used to answer historical consultation texts; and a joint training submodule, used to use the training set to jointly train the first dual-tower model and the second dual-tower model to obtain the first dual-tower model and the second dual-tower model simultaneously trained to a convergent state.
[0090] In a further embodiment, the event response module 1100 includes: a text concatenation submodule, used to concatenate the target consultation text and the first candidate document with its secondary category for each first candidate document to form a target interactive text; a classification mapping submodule, used to perform deep bidirectional encoding on the target interactive text using a question-and-answer discriminant model, map the resulting question-and-answer semantic vector to an association classification space, and determine the corresponding question-and-answer association degree; and a document selection submodule, used to select multiple first candidate documents that meet the preset evaluation criteria and their corresponding question-and-answer association degrees as second candidate documents.
[0091] In a further embodiment, the user response module 1300 includes: a prompt construction submodule, used to embed the target consultation text and the second candidate document and its category path into an answer prompt template for each second candidate document to obtain an answer prompt text; a quantitative evaluation submodule, used to generate an answer rate of the second candidate document in answering the target consultation text based on the answer quantitative evaluation details in the answer prompt text using a large language model; and a target selection submodule, used to select second candidate documents with answer rates exceeding a preset answer threshold as target knowledge documents.
[0092] In a further embodiment, after the event response module 1100, the system further includes: a response generation submodule, used to generate a corresponding target response text based on key answer information extracted from the target knowledge document using a response generation model; and a traceable push submodule, used to associate the target response text with the key answer information and its document location, and push the associated target response text to the user so that the user can trace and view the key answer information.
[0093] To address the aforementioned technical problems, embodiments of this application also provide computer equipment. For example... Figure 4The diagram shows the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable storage medium stores an operating system, a database, and computer-readable instructions. The database may store a sequence of control information. When the computer-readable instructions are executed by the processor, the processor can implement a query-response method. The processor of the computer device provides computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the query-response method of this application. The network interface of the computer device is used for communication with a terminal. Those skilled in the art will understand that… Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0094] In this embodiment, the processor is used to execute... Figure 3 The system contains the specific functions of each module and its sub-modules. The memory stores the program code and various data required to execute these modules or sub-modules. The network interface is used for data transmission between the user terminal and the server. In this embodiment, the memory stores the program code and data required to execute all modules / sub-modules in the consultation response device of this application. The server can call the server's program code and data to execute the functions of all sub-modules.
[0095] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the consultation and response method of any embodiment of this application.
[0096] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0097] In summary, this application enables efficient and accurate retrieval of documents to answer user inquiries from a large-scale, multi-level classified document library, providing users with a high-quality customer service experience.
[0098] Those skilled in the art will understand that the steps, measures, and solutions in the various operations, methods, and processes discussed in this application can be alternated, modified, combined, or deleted. Furthermore, other steps, measures, and solutions in the various operations, methods, and processes discussed in this application can also be alternated, modified, rearranged, decomposed, combined, or deleted. Furthermore, steps, measures, and solutions in the prior art that are similar to those in the open-source operations, methods, and processes of this application can also be alternated, modified, rearranged, decomposed, combined, or deleted.
[0099] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A consultation response method, characterized in that, Includes the following steps: In response to a user inquiry event, based on the first and second semantic vectors of the target inquiry text corresponding to the event, and the document matching degree and category matching degree between the document semantic vector and the first-level category semantic vector of each response knowledge document in the document vector library, multiple first candidate documents corresponding to the category matching degree and document matching degree satisfying the first preset condition are recalled. The target consultation text is subjected to deep semantic interaction with each first candidate document and its secondary category to determine the question-answer relevance of each first candidate document, and multiple second candidate documents corresponding to the question-answer relevance satisfying the second preset condition are recalled. For each second candidate document and its category path, a large language model is used to evaluate the answer rate of the second candidate document in answering the target consultation text. At least one target knowledge document corresponding to the answer rate that meets the standard is recalled to respond to the user.
2. The consultation response method according to claim 1, characterized in that, Before responding to user inquiries, the following steps are included: The system locally verifies whether the user's original consultation text clearly indicates their consultation intent. If the consultation intent of the original consultation text is clear, the system confirms that the original consultation text is the target consultation text and triggers the user consultation event. When the consultation intent of the original consultation text is unclear, after determining that multiple rewritten consultation texts that match the original consultation text in the consultation corpus are pushed to the user, the rewritten consultation text selected by the user is obtained as the target consultation text, and the user consultation event is triggered.
3. The consultation response method according to claim 1, characterized in that, Before responding to user inquiries, the following steps are included: For each response knowledge document and its primary category in the customer service knowledge base, the document semantic vector of the response knowledge document is inferred using the document encoding tower in the first dual-tower model, and the consultation encoding tower in the first dual-tower network is used to infer the first semantic vector of the target consultation text. The category encoding tower in the second dual-tower model is used to infer the first-level category semantic vector of the first-level category, and the consultation encoding tower in the second dual-tower network is used to infer the second semantic vector of the target consultation text. Each response knowledge document is associated with its corresponding document semantic vector and first-level category semantic vector and stored in the document vector library.
4. The consultation response method according to claim 3, characterized in that, Before inferring the document semantic vector of each response knowledge document and its primary category in the customer service knowledge base using the document encoding tower in the first dual-tower model, the following steps are included: Obtain a training set, which includes multiple training samples and their supervision labels. The training samples include historical target consultation texts, response knowledge documents and their first-level categories. The supervision labels indicate whether the corresponding response knowledge documents are used to answer historical consultation texts. The first dual-tower model and the second dual-tower model are jointly trained using the training set to obtain the first dual-tower model and the second dual-tower model that are simultaneously trained to the convergence state.
5. The consultation response method according to claim 1, characterized in that, The target consultation text is subjected to deep semantic interaction with each first candidate document and its secondary category to determine the question-answer relevance of each first candidate document. Multiple second candidate documents corresponding to the question-answer relevance satisfying the second preset condition are recalled, including the following steps: For each of the first candidate documents, the target consultation text and the first candidate document and its second-level category are concatenated to form the target interactive text; A question-and-answer discriminant model is used to perform deep bidirectional encoding on the target text to be interacted with, and the resulting question-and-answer semantic vectors are mapped to the relevance classification space to determine the corresponding question-and-answer relevance. Multiple first candidate documents that meet the preset evaluation criteria for question-answer relevance will be used as second candidate documents.
6. The consultation response method according to claim 1, characterized in that, For each second candidate document and its category path, a large language model is used to evaluate the answer rate of the second candidate document in answering the target consultation text, and at least one target knowledge document corresponding to the answer rate meeting the standard is recalled, including the following steps: For each second candidate document, the target consultation text and the second candidate document and its category path are embedded into the answer prompt template to obtain the answer prompt text; Using a large language model, based on the answer quantification evaluation details in the answer prompt text, the answer rate of the second candidate document in answering the target consultation text is generated; The second candidate documents with a solution rate exceeding the preset solution threshold are selected as the target knowledge documents.
7. The consultation response method according to claim 1, characterized in that, For each second candidate document and its category path, a large language model is used to evaluate the response rate of the second candidate document to the target consultation text. After recalling at least one target knowledge document corresponding to the response rate meeting the standard, the process also includes: A response generation model is used to generate corresponding target response text based on key answer information extracted from the target knowledge document; The target response text is associated with the key answer information and its document location, and the associated target response text is pushed to the user so that the user can trace and view the key answer information.
8. A consultation response device, characterized in that, include: The event response module is used to respond to user inquiry events. Based on the first and second semantic vectors of the target inquiry text corresponding to the event, and the document matching degree and category matching degree between the document semantic vector and the first-level category semantic vector of each response knowledge document in the document vector library, it recalls multiple first candidate documents that meet the first preset conditions in terms of category matching degree and document matching degree. The intermediate selection module is used to perform deep semantic interaction between the target consultation text and each first candidate document and its secondary category, determine the question-answer relevance of each first candidate document, and recall multiple second candidate documents corresponding to the question-answer relevance satisfying the second preset condition. The user response module is used to evaluate the response rate of each second candidate document and its category path using a large language model, and to recall at least one target knowledge document corresponding to the response rate that meets the standard, for use in responding to the user.
9. A computer device comprising a central processing unit and a memory, characterized in that, The central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implemented according to any one of claims 1 to 7, which, when invoked by a computer, executes the steps included in the corresponding method.