E-commerce customer service reply method and device, equipment and medium

By abstracting knowledge documents into semantically nested document abstraction trees, the problems of coarse retrieval granularity and missing semantic hierarchy in existing technologies are solved, enabling accurate positioning and efficient responses to long documents, and improving the response accuracy and user experience of e-commerce customer service systems.

CN120952801APending Publication Date: 2025-11-14GUANGZHOU SHANGYUN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511158917.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing e-commerce customer service response methods struggle to efficiently and accurately determine whether long documents truly answer user questions when faced with long document knowledge bases due to their coarse retrieval granularity, lack of semantic hierarchy, and crude modeling. This impacts the accuracy of responses and user experience.

Method used

The document abstraction tree is used to abstract knowledge documents into a structure with semantic nesting relationships. The unit text set is constructed by the path from the root node to the end node. The comprehensive relevance between each unit text set and the consultation text is determined. Target knowledge documents that meet the preset conditions are selected and the response text is constructed.

Benefits of technology

It enables precise retrieval from the entire document to local semantic units, improving the hit rate of key information and the accuracy of response text, and significantly enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952801A_ABST
    Figure CN120952801A_ABST
Patent Text Reader

Abstract

The invention relates to an e-commerce customer service reply method and device, equipment and medium in the technical field of e-commerce customer service, and the method comprises the steps: responding to a customer service consultation event triggered by a user, and obtaining a consultation text corresponding to the event; determining a unit text set corresponding to each node path formed from a root node to each tail end node in a document abstract tree of each knowledge document in the customer service knowledge base, and determining the maximum value in the comprehensive relevancy between each unit text set and the consultation text as the consultation document relevancy, the comprehensive relevancy fuses the consultation unit relevancy between each semantic unit text and the consultation text in the corresponding unit text set; and screening the target knowledge document of which the relevancy of the consultation document meets a preset condition, and pushing a reply text corresponding to the consultation text structure to the user. According to the method and the device, long documents related to user consultation can be recalled accurately, so that satisfactory replies can be provided for the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of e-commerce customer service technology, and in particular to an e-commerce customer service response method and its corresponding apparatus, computer equipment, and computer-readable storage medium. Background Technology

[0002] In e-commerce Q&A scenarios, customer service systems typically rely on pre-built knowledge bases to quickly generate responses. The current mainstream approach is to treat each knowledge document in the knowledge base as a whole as a retrieval unit. Using full-text indexing or inverted indexing techniques, keyword matching or semantic similarity calculations are performed on the user's inquiry text to retrieve the most relevant entire document and generate a response accordingly. To improve recall, some systems further split documents into two independent fields: title and body text. Different weights are assigned to these fields before merging and scoring, attempting to leverage the title field's advantage in expressing the topic to improve the overall hit rate. However, the above traditional processing logic has gradually revealed several insurmountable limitations in practical applications.

[0003] First, from the perspective of retrieval granularity, existing technologies use the entire document or a few fixed fields as the basic indexing unit, meaning the system can only judge the relevance at the overall document level. When knowledge documents are long, the key information that truly answers the user's question often resides in a specific paragraph or even just a few sentences, while the rest of the document only serves as background information or process descriptions. Because traditional methods cannot further distinguish these localized pieces of information at a finer granularity, the system cannot accurately retrieve the correct document, inevitably leading to interference from non-critical content and reducing the hit rate of truly relevant segments.

[0004] Secondly, from a semantic perspective, traditional technologies lack an effective mechanism for distinguishing the importance of information within a document. Even in schemes that split the document into titles and body text, the titles and body text remain two independent fields, failing to perform hierarchical modeling of paragraphs or even sentences within the body text. Since titles typically highly condense the theme, while different paragraphs or sub-paragraphs in the body text may elaborate on different aspects, and sentences within paragraphs are the smallest semantic units that most meticulously express local key points, traditional methods do not quantitatively assess the relationship between user inquiries and information at different levels. As a result, when a user's question falls on a specific detail, the system often fails to capture the independent semantic weight of the segment containing that detail and can only rely on the macroscopic similarity of the entire document for scoring, leading to inaccurate relevance calculations.

[0005] Furthermore, from the perspective of relevance fusion mechanisms, most existing technologies ignore the semantic nesting and complementary relationships between different levels of information within a document, failing to reflect the importance of a segment in a specific context. For example, if a key operational step in a paragraph is removed from its context, its independent semantics may be significantly weakened, making it difficult to understand and represent accurately. Traditional methods lack modeling of such dependencies, resulting in a significant deviation between the final document-level relevance obtained and the user's actual need for the answer.

[0006] In summary, traditional e-commerce customer service response methods struggle to efficiently and accurately determine whether long documents truly answer user questions when faced with long document knowledge bases due to their coarse retrieval granularity, lack of semantic hierarchy, and crude modeling. This results in compromised response accuracy and user experience. Summary of the Invention

[0007] The primary objective of this application is to address at least one of the aforementioned problems by providing an e-commerce customer service response method and corresponding apparatus, computer equipment, and computer-readable storage medium.

[0008] To achieve the various objectives of this application, the following technical solution is adopted: One e-commerce customer service response method provided for one of the purposes of this application includes the following steps: Respond to customer service inquiries triggered by users and obtain the corresponding inquiry text. For each knowledge document in the customer service knowledge base, determine the unit text set corresponding to each node path formed from the root node to each end node in the document abstract tree of the knowledge document. The unit text set includes each semantic unit text originating from the knowledge document corresponding to each node with a semantic nesting relationship in the corresponding node path. Determine the overall relevance between each unit text set and the consultation text, and take the largest overall relevance as the consultation document relevance between the knowledge document and the consultation text. The overall relevance integrates the consultation unit relevance between each semantic unit text in the corresponding unit text set and the consultation text. Select target knowledge documents whose relevance to the consultation document meets preset conditions, construct corresponding response text based on the target knowledge document and the consultation text, and push the response text to the user.

[0009] On the other hand, an e-commerce customer service response device provided to meet one of the purposes of this application includes an event response module, a text set determination module, a relevance determination module, and a user response module. The event response module is used to respond to a customer service inquiry event triggered by a user and obtain the corresponding inquiry text. The text set determination module is used to determine, for each knowledge document in the customer service knowledge base, the unit text set corresponding to each node path formed by the root node to each end node in the document abstract tree of the knowledge document. The unit text set includes each semantic unit text originating from the knowledge document corresponding to each node with a semantic nesting relationship in the corresponding node path. The relevance determination module is used to determine the comprehensive relevance between each unit text set and the inquiry text, using the highest comprehensive relevance as the inquiry document relevance between the knowledge document and the inquiry text. The comprehensive relevance integrates the inquiry unit relevance between each semantic unit text in the corresponding unit text set and the inquiry text. The user response module is used to filter target knowledge documents whose inquiry document relevance meets preset conditions, construct corresponding response text based on the target knowledge document and the inquiry text, and push the response text to the user.

[0010] On another front, a computer device provided for one of the purposes of this application includes a central processing unit and a memory, wherein the central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the e-commerce customer service response method described in this application.

[0011] 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.

[0012] The technical solution of this application has many advantages, including but not limited to the following aspects: This application first achieves a leap in retrieval granularity from "whole document" to "local semantic unit" by abstracting lengthy knowledge documents into a document abstract tree with semantic nesting relationships. When a user enters consultation text, the entire document is no longer used as the smallest retrieval unit. Instead, multiple node paths from the root node to all terminal nodes are extracted along the tree structure, and each path is further broken down into nested semantic unit texts. In this way, key fragments that were originally obscured by a large amount of contextual information can independently participate in relevance calculation. This avoids interference from irrelevant information in answer location, significantly improves the hit rate of truly answerable local content, and, more importantly, enhances the accuracy and completeness of local semantics by integrating the contextual semantics of the local text content, fundamentally overcoming the recall inaccuracy problem caused by excessively coarse granularity.

[0013] Furthermore, by leveraging the hierarchical design of the document abstraction tree, a progressively fine-grained multi-level representation is established at the semantic level. Each node corresponds to a text unit with independent semantics. These text units rely on the semantic nesting relationships between them, enabling the accurate capture of the independent value of the segment containing the consultation question even if it falls on a specific detail in a long text. This avoids the drawback of traditional methods that can only rely on macroscopic similarity while ignoring local differences.

[0014] Ultimately, by mapping node paths to semantic dependency chains, the complementary relationships between semantic unit texts can be considered during the relevance fusion process. That is, the reason why the terminal node in a path can maintain high semantic integrity is because its upper-level nodes provide necessary higher-level contextual support. Since the resulting comprehensive relevance incorporates this gain, the final consultation document relevance accurately represents the relevance between long documents and user inquiries. The target knowledge documents selected accordingly can more realistically reflect the user's actual need for answers, significantly improving the accuracy of response texts obtained from relying on target knowledge documents and enhancing the user experience. Attached Figure Description

[0015] 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 e-commerce customer service response method of this application; Figure 3 This is a schematic block diagram of the e-commerce customer service 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

[0016] The embodiments of this application are described in detail below. 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.

[0017] 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.

[0018] 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.

[0019] 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.

[0020] 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.

[0021] 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.

[0022] 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.

[0023] 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.

[0024] 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.

[0025] 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.

[0026] 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.

[0027] 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.

[0028] 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.

[0029] 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.

[0030] The e-commerce customer service response method of this application can be programmed into a computer program product and deployed on a client or server to run. For example, in the 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 runs.

[0031] Please see Figure 2 The e-commerce customer service response method of this application, in its typical embodiment, includes the following steps: Step S1100: Respond to the customer service inquiry event triggered by the user and obtain the corresponding inquiry text; E-commerce platforms offer customer service to both buyers and sellers, allowing users to consult customer service for answers and assistance. Buyers typically need to consult customer service for issues such as product quality disputes, abnormal order statuses, logistics delays, unclear or untimely return and exchange policies, and ambiguous or misunderstood promotional rules. Sellers typically need to consult customer service for issues related to building and operating independent websites, store operations, store marketing, and platform activities. It's easy to understand that the knowledge required for customer service to respond to these two different user roles differs. Therefore, separate customer service knowledge bases can be built and maintained for buyers and sellers respectively. The knowledge architecture of these two knowledge bases can be consistent, but the specific knowledge content will differ depending on the inquiry intent and / or response for the different user roles. It can be understood that when providing customer service to users on an e-commerce platform, the corresponding customer service knowledge base can be accessed based on the current user's role. The customer service knowledge base includes multiple knowledge documents, which are documents containing the relevant knowledge needed to answer user inquiries. Those skilled in the art can flexibly and adaptably prepare customer service knowledge bases for buyers and / or for sellers in advance as needed, based on the relevant disclosures of the knowledge base, or implement them according to the disclosures of the following embodiments.

[0032] E-commerce platforms offer multiple customer service entry points, allowing users to seek assistance through these entry points. These entry points can include a "Contact Customer Service" button on the page, a help center page, and so on. When a user initiates a customer service inquiry, a customer service inquiry event is triggered. The e-commerce platform's server responds to this event by creating a customer service inquiry session for communication between the user and customer service. Based on the user's identity (buyer or seller), the server determines the customer service knowledge base to be invoked and retrieves the inquiry text sent by the user during the customer service inquiry session.

[0033] It is understandable that users often use informal, colloquial, context-omitted, or even misspelled expressions in their consultation texts. This can lead to the consultation intent deviating from the user's actual intended meaning, meaning the consultation intent may be inaccurate. Therefore, it is necessary to determine whether the consultation intent is accurate. If accurate, no rewriting is needed; if inaccurate, the consultation text should be rewritten to ensure accuracy. Those skilled in the art can flexibly adapt these methods to determine the accuracy of the consultation intent and to correct and rewrite consultation texts with inaccurate intent.

[0034] In one embodiment, the user's current consultation text and its preceding dialogue can be embedded into a preset consultation preprocessing prompt template. The resulting consultation preprocessing prompt text is input into a large language model, guiding the model to determine whether the consultation intent of the consultation text is clear based on the preceding dialogue. If unclear, the model rewrites the consultation text to clarify the consultation intent; if clear, the model does not need to rewrite and directly outputs the consultation text. Those skilled in the art can flexibly construct the consultation preprocessing prompt template in advance, for example, based on a few-sample approach, so that the resulting consultation preprocessing prompt template includes various consultation texts with unclear consultation intents and their preceding dialogues, as well as a description of the criteria for determining whether the consultation intent is clear. It is easy to understand that the preceding dialogue for any consultation text in a customer service consultation session refers to all text content preceding that consultation text in the customer service consultation session, including all consultation texts sent by the user beforehand and the reply texts corresponding to each consultation text.

[0035] Step S1200: For each knowledge document in the customer service knowledge base, determine the unit text set corresponding to each node path formed from the root node to each end node in the document abstract tree of the knowledge document. The unit text set includes each semantic unit text corresponding to each node with a semantic nesting relationship in the corresponding node path, which originates from the knowledge document. For the document abstraction tree of knowledge documents, each node in the current level of the document abstraction tree can be traversed layer by layer. Then, each node in each level and the associated node in the next level are combined to form a node path. Then, for each node path, the semantic unit text corresponding to each node in the node path is determined, and these semantic unit texts are grouped into a unit text set.

[0036] In a further embodiment, before performing step S1100, the document abstraction tree of the knowledge documents in the customer service knowledge base can be determined in advance, including the following steps: Step S1000: For each knowledge document in the customer service knowledge base, determine the document category to which the knowledge document belongs in the preset document classification system, and use it as the semantic unit text corresponding to the node of the first-level semantic layer; A document classification system is a framework for systematically categorizing various knowledge documents in a customer service knowledge base. It divides knowledge documents into corresponding categories based on different themes, business segments, and other factors. For example, a customer service knowledge base serving buyers could include categories such as "product information," "order processing," "payment methods," "logistics and delivery," and "after-sales service." It could even use these categories as primary categories, with each primary category further subdivided into secondary categories, and so on, with each secondary category further subdivided into tertiary categories—a multi-level classification structure. Similarly, a customer service knowledge base serving sellers could include categories such as "store setup," "product management," "marketing and promotion," "data operation," and "platform rules." It could also use these categories as primary categories, with each primary category further subdivided into secondary categories, and so on, with each secondary category further subdivided into tertiary categories—a multi-level classification structure.

[0037] It is understandable that each knowledge document in the customer service knowledge base belongs to a document category in the document classification system. The document category corresponds to a specific category within a single-level document classification system. For example, a knowledge document about return and exchange policies in the customer service knowledge base serving buyers belongs to the document category "After-sales Service". In a multi-level document classification system, a category path within that system includes a specific category within each level of the system. For example, a knowledge document about return and exchange policies in the customer service knowledge base serving buyers belongs to the document category "After-sales Service" - "Return and Exchange" - "Rules / Regulations".

[0038] The document category to which a knowledge document belongs in the document classification system is usually determined by the e-commerce platform's operations team. Alternatively, it can be determined first by a large language model, and then reviewed and corrected as needed by the operations team to ensure accuracy and improve efficiency.

[0039] The large language model is pre-trained to convergence using an extremely large corpus, acquiring the ability to generate text describing human language, and possessing accurate basic text semantic understanding and basic logical reasoning capabilities. The large language model can be selected from models such as Chinchilla, PaLM, LLaMA, Alpaca, and Vicuna, and any one of them can be chosen as needed.

[0040] As can be understood, a document category is a semantic unit text corresponding to a knowledge document. It concisely and clearly summarizes the topic category involved in the knowledge document, which is equivalent to the most abstract expression of the semantics of the knowledge document. Therefore, this semantic unit text is mapped and associated with nodes in the first-level semantic layer.

[0041] Step S1010: Determine the article title in the knowledge document as the semantic unit text corresponding to the node in the second-level semantic layer; There are several ways to determine an article title. One method is for the e-commerce platform's operations team to manually draft an accurate and concise title based on the detailed content already provided in the knowledge document when compiling and / or writing it. This method fully leverages the operations team's understanding of the business and user needs, ensuring the title's accuracy and practicality. Another method is to utilize a large language model, where the model automatically generates a title based on the knowledge document's content, which is then reviewed and revised by the operations team. This leverages the efficient text processing capabilities of the large language model while ensuring the title's quality meets actual needs, thus improving work efficiency.

[0042] The article title is the semantic unit text of the corresponding knowledge document. As a core content guide, it summarizes the main theme or discussion direction of the document and is an important clue for users to quickly understand its general content. Therefore, mapping this semantic unit text to nodes in the second-level semantic layer plays a crucial role in the document abstraction tree. Upward, it is associated with the document category nodes in the first-level semantic layer, reflecting the specific topic positioning of the corresponding knowledge document within its category; downward, it connects with the subsequently determined nodes in the third, fourth, and other semantic layers, as well as their corresponding semantic unit texts, together forming a complete and hierarchical document abstraction tree.

[0043] Step S1020: Determine the detailed content text corresponding to the document title in the knowledge document as the semantic unit text corresponding to the node of the third-level semantic layer; The detailed content text in a knowledge document is the text that elaborates and explains the core theme summarized in the document title. It expands on the document title, providing more specific and comprehensive information so that users can gain a deeper understanding of the specific content and details of the topic covered in the document.

[0044] To determine the detailed content text, there are usually several methods: First, the e-commerce platform's operations team manually writes detailed content based on the topic direction determined by the existing document titles when writing knowledge documents. This method ensures the accuracy and relevance of the content and fully incorporates the operations team's deep understanding of business processes and user needs. Second, a large language model is used. The model first generates a draft of the detailed content text based on the document titles and the overall content of the document. Then, the operations team reviews, corrects, and supplements it. This method leverages the efficiency advantage of the model in quickly generating text while ensuring that the content quality meets actual business requirements.

[0045] After the detailed content text is determined, it is used as the semantic unit text corresponding to the node of the third-level semantic layer. This means that in the structure of the document abstract tree, the detailed content text is below the document category (first-level semantic layer) and the article title (second-level semantic layer), which further refines the semantic hierarchy of the document.

[0046] Step S1030: Determine each paragraph text within the detailed content text of the knowledge document as the semantic unit text corresponding to the node of the fourth-level semantic layer; For detailed content text in knowledge documents written using a chapter structure, the paragraph text within the detailed content text can be determined based on the paragraph representation in the chapter structure. For example, in Markdown format, paragraph syntax does not use spaces or tabs for indentation, but uses a newline character at the end of the paragraph to indicate its end. For detailed content text in knowledge documents not written using a chapter structure, those skilled in the art can flexibly construct prompt text to guide the large language model to divide the detailed content text into paragraphs and output the corresponding paragraph text.

[0047] After identifying the individual paragraphs within the detailed content text, these paragraphs are treated as semantic unit texts corresponding to nodes in the fourth-level semantic layer. This means that in the document abstraction tree structure, these paragraphs are located below the document category (first-level semantic layer), article title (second-level semantic layer), and detailed content text (third-level semantic layer), representing a further refinement and decomposition of the document's semantics.

[0048] Step S1040: Determine each sentence structure text within each paragraph of the knowledge document as the semantic unit text corresponding to the node of the fifth-level semantic layer; Sentence-based texts refer to text units composed of sentences that have relatively complete semantic expression, such as imperative sentences, declarative sentences, interrogative sentences, and other different types of sentences.

[0049] When determining the sentence structure text within each paragraph of a knowledge document, those skilled in the art can flexibly construct prompt text to guide the large language model in segmenting the paragraph text into sentence structure texts and outputting the corresponding sentence structure texts. For example, the prompt text can specify punctuation marks such as periods, question marks, and exclamation marks as the end markers of sentences to guide the model in segmentation, thereby obtaining the sentence structure texts.

[0050] After identifying the sentence texts within each paragraph, each sentence text is treated as a semantic unit text corresponding to a node in the fifth-level semantic layer. This means that in the structure of the document abstract tree, these sentence texts are located below the document category (first-level semantic layer), article title (second-level semantic layer), detailed content text (third-level semantic layer), and paragraph text (fourth-level semantic layer), representing a further refinement and decomposition of the document's semantics.

[0051] Step S1050: Associate each node of each semantic layer other than the first-level semantic layer with the node of its corresponding upper-level semantic layer to construct the document abstract tree of the knowledge document.

[0052] When constructing a document abstraction tree, these nodes at different levels need to be interconnected. Specifically, a second-level semantic node (article title) is associated with a first-level semantic node (document category), indicating that the document belongs to a specific topic within a particular category. A third-level semantic node (detailed content text) is associated with a second-level semantic node (article title), further expanding on the content covered by the title. Similarly, each fourth-level semantic node (paragraph text) is associated with a third-level semantic node (detailed content text), while each fifth-level semantic node (sentence text) is associated with a fourth-level semantic node (paragraph text) corresponding to the paragraph text from which the semantic unit text of that node originates. This association method constructs a hierarchical and clearly structured document abstraction tree, ensuring that each node is closely connected to its parent node, forming a complete semantic hierarchy.

[0053] Step S1300: Determine the overall relevance between each unit text set and the consultation text, and take the largest overall relevance as the consultation document relevance between the knowledge document and the consultation text. The overall relevance integrates the consultation unit relevance between each semantic unit text in the corresponding unit text set and the consultation text. In one embodiment, a word segmentation algorithm is first used to segment the semantic unit texts in each unit text set, obtaining corresponding unit word segmentation sequences. This same algorithm is then used to segment the consultation text, obtaining corresponding consultation word segmentation sequences. Subsequently, for each unit text set, an information retrieval algorithm is used to determine the word segmentation sequence relevance between the segmentation sequences corresponding to each semantic unit text in that unit text set and the consultation word segmentation sequence, which is then used as the retrieval relevance. The retrieval relevance of each semantic unit text is multiplied by a preset weight that matches that semantic unit text, and then summed to calculate a comprehensive relevance, which characterizes the relevance between the unit text set and the consultation text.

[0054] Word segmentation algorithms can include split (delimiter) segmentation, Jieba segmentation, n-gram segmentation, WordPiece segmentation, CRF segmentation, etc., and those skilled in the art can flexibly choose one to implement. Information retrieval algorithms can include TF-IDF algorithm, BM25 algorithm, etc., and those skilled in the art can flexibly choose one to implement.

[0055] It is understandable that the hierarchy in the document abstraction tree reflects the semantic hierarchy of the knowledge document, and the semantic unit texts corresponding to nodes at different levels have varying sensitivities to matching the user's query intent. For example, titles and sentences (i.e., the second and fifth levels of semantics in the document abstraction tree) are more sensitive to the specific intent of the user's query, while document categories, detailed content texts, and paragraphs (i.e., the first, third, and fourth levels of semantics) focus more on supplementing the overall semantic meaning. Therefore, in order to more accurately match the relevance between query text and knowledge documents, different weights are assigned to semantic unit texts at different levels, specifically as follows: First-level semantic layer (document category): lower weight. Document category is a macro-level classification of knowledge documents, covering a wide range of topics. However, it is not strongly related to the user's specific inquiry intent, so it is assigned a lower weight.

[0056] Second-level semantic layer (article title): High weight. The article title is the core content guide of the knowledge document, and can accurately summarize the main theme or discussion direction of the document. It plays an important role in matching users' inquiry intentions, and therefore is assigned a high weight.

[0057] Level 3 Semantic Layer (Detailed Content Text): Moderate Weight. The detailed content text elaborates on and explains the document title, providing more specific and comprehensive information. When matching user inquiry intent, it needs to be relevant to both the title and the document category, hence the appropriate weight.

[0058] Level 4 Semantic Layer (Paragraph Text): Moderate to High Weight. Paragraph text is the core structure of a knowledge document, representing a further refinement and breakdown of the detailed content text. When matching user inquiry intent, paragraph text needs to be associated with both the title and the detailed content text, as well as maintaining a certain correlation with the document category; therefore, it is assigned a moderate to high weight.

[0059] Level 5 Semantic Layer (Sentence-based Text): Highest weight. Sentence-based text represents key local elements within a knowledge document; it consists of text units composed of sentences that possess relatively complete semantic expression. For matching user inquiry intent, sentence-based text provides more specific and precise information, thus receiving the highest weight.

[0060] Those skilled in the art can further configure the weights of the semantic unit texts corresponding to the nodes of the first, second, third, fourth, and fifth semantic layers as needed, according to the above disclosure, for example, the corresponding configurations are: {0.05, 0.25, 0.1, 0.2, 0.4}.

[0061] Step S1400: Filter target knowledge documents whose relevance to the consultation document meets preset conditions, construct corresponding response text based on the target knowledge document and the consultation text, and push the response text to the user.

[0062] Multiple knowledge documents from the customer service knowledge base with high relevance to the consultation document and exceeding a preset threshold are selected as target knowledge documents. These documents are then sorted in descending order of consultation relevance. Extraction is performed on each target knowledge document sequentially until the cumulative extracted character content reaches a preset character limit. A response material composed of these extracted characters is then obtained. This response material and the consultation text are further embedded into a preset prompt template to obtain prompt text. The prompt text guides the large language model to strictly respond to the consultation intent of the consultation text based on the response material, outputting the corresponding response text. Finally, the response text is sent to the currently active customer service consultation session by calling the session communication interface provided by the e-commerce platform, thus completing the closed loop of responding to user inquiries. Both the preset threshold and the preset character limit can be configured as needed by those skilled in the art.

[0063] 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 first achieves a leap in retrieval granularity from "whole document" to "local semantic unit" by abstracting lengthy knowledge documents into a document abstract tree with semantic nesting relationships. When a user enters consultation text, the entire document is no longer used as the smallest retrieval unit. Instead, multiple node paths from the root node to all terminal nodes are extracted along the tree structure, and each path is further broken down into nested semantic unit texts. In this way, key fragments that were originally obscured by a large amount of contextual information can independently participate in relevance calculation. This avoids interference from irrelevant information in answer location, significantly improves the hit rate of truly answerable local content, and, more importantly, enhances the accuracy and completeness of local semantics by integrating the contextual semantics of the local text content, fundamentally overcoming the recall inaccuracy problem caused by excessively coarse granularity.

[0064] Furthermore, by leveraging the hierarchical design of the document abstraction tree, a progressively fine-grained multi-level representation is established at the semantic level. Each node corresponds to a text unit with independent semantics. These text units rely on the semantic nesting relationships between them, enabling the accurate capture of the independent value of the segment containing the consultation question even if it falls on a specific detail in a long text. This avoids the drawback of traditional methods that can only rely on macroscopic similarity while ignoring local differences.

[0065] Ultimately, by mapping node paths to semantic dependency chains, the complementary relationships between semantic unit texts can be considered during the relevance fusion process. That is, the reason why the terminal node in a path can maintain high semantic integrity is because its upper-level nodes provide necessary higher-level contextual support. Since the resulting comprehensive relevance incorporates this gain, the final consultation document relevance accurately represents the relevance between long documents and user inquiries. The target knowledge documents selected accordingly can more realistically reflect the user's actual need for answers, significantly improving the accuracy of response texts obtained from relying on target knowledge documents and enhancing the user experience.

[0066] In a further embodiment, step S1300, determining the overall relevance between each unit text set and the consultation text, includes the following steps: Step S1310: For each unit text set, determine the retrieval relevance and semantic relevance between each semantic unit text in the unit text set and the consultation text; In one embodiment, the n-gram algorithm is first used to segment the semantic unit texts in the unit text set to obtain the corresponding unit segmentation sequences. This segmentation algorithm is then used to segment the consultation text to obtain the corresponding consultation segmentation sequence. The value of n is determined by the total number of characters in the segmentation object. For example, if the segmentation object is consultation text and the total number of characters in the consultation text does not exceed 20, then n is set to 2, meaning the bi-gram algorithm is actually used to segment the consultation text. If the segmentation object is detail content text, which is a semantic unit text, and the total number of characters in the semantic unit text exceeds 20, then n is set to 3, meaning the tri-gram algorithm is actually used to segment the semantic unit text. Further, the BM25 algorithm is used to calculate the segmentation sequence relevance between each unit segmentation sequence and the consultation segmentation sequence, which serves as the retrieval relevance.

[0067] In one embodiment, the similarity between the semantics of each semantic unit text in the unit text set and the semantics of the consultation text is determined, and the numerical value quantifying this similarity is used as the semantic relevance. Specifically, the determination of the similarity can be achieved using a vector similarity algorithm to calculate the vector similarity between two text encoding vectors representing the semantics of different texts. This vector similarity quantifies the similarity between semantics. The vector similarity algorithm can be any algorithm that can calculate the distance between two vectors in the vector space, such as the cosine similarity algorithm. Those skilled in the art can choose and apply the appropriate algorithm as needed. Specifically, the vector encoding representation of text semantics can be achieved using a pre-trained text encoding model that has reached a convergent state. This model encodes the input text into a vectorized text encoding vector representing its semantics. The closer the semantics of different input texts are, the closer the corresponding encoded text encoding vectors are in the vector space. The BERT model is recommended for text encoding model selection, but those skilled in the art can also use other open-source models suitable for text encoding tasks in the NLP field.

[0068] Step S1330: Based on the retrieval relevance and semantic relevance corresponding to each semantic unit text, determine the comprehensive relevance between the unit text set and the consultation text.

[0069] Each semantic relevance is used as a weight for its corresponding retrieval relevance. Then, each semantic relevance is multiplied by its respective weight and summed to calculate the comprehensive relevance, which quantitatively represents the degree of relevance between the unit text set and the consultation text.

[0070] In this embodiment, by introducing "semantic relevance" in parallel with "retrieval relevance," a deep semantic algorithm is used to explicitly quantify the deep semantic consistency between semantic unit text and consultation text. Then, the two relevance scores are weighted and fused, with one used as the weight for the other. This significantly alleviates the persistent problem of "literal hit but semantic deviation" in general keyword retrieval. Because semantic relevance can capture implicit associations such as paraphrasing, colloquial omissions, and typos, it can provide accurate high-match scores even in scenarios with significant literal differences but highly consistent intents, such as "Why hasn't my package arrived yet?" and "How to handle delayed logistics delivery." Meanwhile, retrieval relevance retains the sensitivity of strong literal signals to precise terminology. The complementary nature of these two scores ensures that the overall relevance maintains a stable high distinguishability between long-tail colloquial consultations and professional terminology consultations. This improves the alignment between the retrieved target knowledge documents and the user's true intent, reducing the probability of illusions caused by material bias in subsequent large language models.

[0071] In a further embodiment, step S1310, determining the retrieval relevance between each semantic unit text in the unit text set and the consultation text, includes the following steps: Step S1311: For each semantic unit text in the unit text set, determine at least one word segmentation algorithm that matches the text structure of the semantic unit text, and use each word segmentation algorithm to segment the semantic unit text and the consultation text to obtain the corresponding unit word segmentation sequence and consultation word segmentation sequence; For each semantic unit text in the text set, the total number of words in the semantic unit texts corresponding to the first, second, and fifth level semantic layer nodes (i.e., document category, article title, and sentence text) is much less than the total number of words in the semantic unit texts corresponding to the fourth and fifth level semantic layer nodes (i.e., detailed content text and paragraph text). Therefore, for the semantic unit texts corresponding to document category, article title, and sentence text, the ik_max_word algorithm, ik_smart algorithm, and n-gram algorithm (n can be set by those skilled in the art as needed) are used for word segmentation to obtain the corresponding word segmentation sequence for each unit; while for the semantic unit texts corresponding to detailed content text and paragraph text, the ik_smart algorithm is used for word segmentation to obtain the corresponding word segmentation sequence for each unit.

[0072] The ik_max_word algorithm, ik_smart algorithm, and n-gram algorithm are used to segment the consultation text to obtain the corresponding consultation word segmentation sequence.

[0073] It's understandable that short texts such as document categories, article titles, and sentence structures have high information density, where each character can potentially be a key feature. Therefore, three complementary word segmentation algorithms are used to address the challenge of a single segmenter simultaneously achieving both high recall and high precision. This approach effectively covers various query expressions, and the total number of segmentation results for short texts is controllable, preventing storage / computational disasters due to minimal redundancy. `ik_max_word` provides maximum dictionary coverage to prevent word omissions; `ik_smart` provides the most semantically concise segmentation, reducing noise; and `n-gram` provides a fallback for out-of-vocabulary words, misspellings, and variant words. This maximizes recall without adding excessive noise, preventing the loss of key information due to over-disambiguation. However, for longer texts such as paragraphs and detailed descriptions, which have strict contextual semantic relationships, only the `ik_smart` segmentation algorithm is used. This ensures semantic coherence and accuracy of the segmentation results, as well as efficient storage and retrieval, while avoiding excessive fragmentation that could lead to over-expansion of segmentation storage and computational resources.

[0074] Step S1312: For each word segmentation algorithm, an information retrieval algorithm is used to determine the word segmentation sequence relevance between the unit word segmentation sequence and the consultation word segmentation sequence obtained based on the word segmentation algorithm; For a single semantic unit text and a consultation text, after determining the corresponding unit segmentation sequence and consultation segmentation sequence obtained by applying the same segmentation algorithm to both texts, the BM25 algorithm is used as the information retrieval algorithm to determine the degree of relevance between the two sequences at the retrieval level, thus obtaining the corresponding segmentation sequence relevance. Adjustable parameters in the BM25 algorithm include: k1 controls the word frequency saturation level, and b controls the document length normalization strength, which can be configured as needed by those skilled in the art, for example, values ​​of 1.2 and 0.75 respectively.

[0075] Step S1313: Perform a summation operation based on the relevance of all word segmentation sequences, normalize the result, and use the result as the retrieval relevance between the semantic unit text and the consultation text.

[0076] After determining the relevance between the unit segmentation sequence and the query segmentation sequence corresponding to each segmentation algorithm, the sum of all segmentation sequence relevances is calculated. A normalization algorithm is then used to normalize this sum, yielding the result, which can be considered the retrieval relevance between the semantic unit text and the query text. The normalization algorithm includes truncation, binning, logarithmic transformation, min-max normalization, and center normalization, which can be implemented by those skilled in the art as needed.

[0077] In this embodiment, a strategy of using ik_max_word, ik_smart, and n-gram parallel word segmentation for short texts such as document categories, titles, and sentence-based texts, and using only ik_smart word segmentation for long texts such as paragraphs and detailed content, balances the three objectives of "high recall, low noise, and controllable computation." Short texts undergo cross-validation using multiple algorithms to eliminate out-of-vocabulary words, misspellings, and colloquial variations, preventing the loss of key features due to blind spots in the word segmenter. Long texts utilize the semantic coherence segmentation of ik_smart to avoid fragmentation, reducing storage bloat and computational waste caused by redundant features. Subsequently, the segmentation results from each path are calculated using BM25 and then normalized and summed, making semantic units of different lengths and expression dimensions comparable and ranked in a unified metric space, thus improving the robustness of retrieval relevance and adaptability to cross-verbal scenarios.

[0078] In a further embodiment, step S1400, screening target knowledge documents whose relevance to the consultation document meets preset conditions, and constructing corresponding response text based on the target knowledge document and the consultation text, includes the following steps: Step S1410: Recall multiple knowledge documents in the customer service knowledge base that have a high relevance to the consultation documents and exceed a preset threshold, and use them as target knowledge documents respectively. Based on the previously calculated relevance of the consultation documents, and according to a preset numerical threshold, all knowledge documents exceeding this threshold are first identified from the customer service knowledge base. Then, these knowledge documents are sorted using algorithms such as bubble sort or binary search. The top-ranked knowledge documents, indicating high relevance to the consultation documents, are retrieved and designated as target knowledge documents. The threshold measures whether the relevance between the knowledge document and the current consultation is sufficiently high to provide adequate response value for extracting content from subsequent response materials. This threshold is typically pre-configured by operations personnel in a configuration file, with a typical value of 0.7. It can also be optimized through online experiments or A / B testing. The retrieved knowledge documents are temporarily stored in an in-memory list, where each entry retains both the document's identifier and its corresponding consultation document relevance value.

[0079] Step S1420: Sort all target knowledge documents in descending order of consultation relevance, and use the consultation document relevance of each target knowledge document ranked last as the corresponding relevance indicator of each target knowledge document ranked first. Next, the list is sorted in reverse order, with the documents with the highest relevance to the top. After sorting, the relevance score of each knowledge document following it is directly copied to the knowledge documents preceding it, serving as a "relevance metric." For clarity, here's an example: If the list includes three knowledge documents D1, D2, and D3, with relevance scores of 0.9, 0.8, and 0.7 respectively, then D1's relevance metric is 0.8 of D2's, D2's relevance metric is 0.7 of D3's, and D3, which has no subsequent documents, can be set to zero or its own value; this logic is controlled by a code switch. The purpose of this is to provide a benchmark for subsequently eliminating low-value segments.

[0080] Step S1430: For each target knowledge document, determine whether there is a non-target unit text set in all unit text sets originating from the target knowledge document with a comprehensive relevance lower than the relevance index of the target knowledge document. If so, remove the semantic unit text corresponding to the end node in each non-target unit text set from the target knowledge document. Next comes the "removal" phase. For each recalled target knowledge document, all corresponding unit text sets in the document abstraction tree are traversed, and their overall relevance is checked one by one. If the overall relevance of a unit text set is lower than the relevance index obtained in the previous step, the semantic unit text corresponding to the last-level node of that unit text set is directly deleted from the target knowledge document; this deletion only affects the copy of the constructed response material, and the original knowledge document in the knowledge base remains unchanged. After the deletion is completed, the remaining content of the target knowledge document is considered "valid content".

[0081] Step S1440: Extract target knowledge documents one by one according to the sorting until the cumulative extracted character content in the target knowledge documents reaches the preset character limit, and obtain the corresponding response material; After the initial elimination, characters are extracted from the valid content of each knowledge document in the sorted order, from beginning to end, accumulating the total number of characters until a preset character limit is reached. This character limit can be configured by those skilled in the art based on the input character limit of the large language model minus the total number of characters required for the task description text to generate the subsequent response text, for example, 2000. During extraction, a sequential appending method is used to write the character stream into the buffer, forming the final "response material." If the remaining valid content of a document causes the total number of characters to exceed the limit, only the beginning portion is extracted to ensure the buffer does not overflow.

[0082] Step S1450: Use a large language model to generate corresponding response text based on the response materials and consultation text.

[0083] The response materials and the original inquiry text are embedded together into a preset prompt template. Template example: "Please answer the user's question strictly according to the following information, and do not introduce external knowledge:\n{Response Materials}\nUser Question: {Inquiry Text}". After embedding, the complete prompt text is submitted to the deployed large language model. After inference on its own or in the cloud, the model returns a natural language text as the final response. This response is then pushed to the user via a session communication interface, thus completing the entire response process.

[0084] In this embodiment, a "relevant index removal" mechanism is added after recall to perform a fine-grained filtering within each target knowledge document: first, the relevance of the next most relevant consultation document is used as a dynamic threshold, and the end nodes (usually paragraphs or sentences) of unit text sets below this threshold are deleted, thus retaining the effective document content with relatively higher response value. Then, the remaining effective content is concatenated sequentially to the character limit to form highly refined response material. In this way, information overload caused by "whole-document copying" is prevented on the one hand, and context breakage caused by "one-size-fits-all" truncation is avoided on the other hand. The threshold is adapted to the quality of the recalled documents, ensuring that highly relevant details of the documents are retained, and low-relevance redundant content is removed to avoid occupying positions in the limited number of characters of response material. This allows the large language model to obtain the most valuable content within a limited input window, and finally output a more concise and accurate response, significantly improving the user reading experience.

[0085] In a further embodiment, after step S1400, which involves pushing the reply text to the user, the following steps are included: Step S1500: Obtain the user's satisfaction with the response text. When the satisfaction is lower than a preset threshold, construct a document display link corresponding to the knowledge document with the highest relevance to the consultation document in the customer service knowledge base, and push the document display link to the user. Once the reply text is pushed to the user, the system immediately begins listening for the user's feedback. Feedback can take the form of explicit star ratings, likes / dislikes, or text reviews, or implicit conversational behaviors, such as whether to ask follow-up questions or whether to quickly respond with a clear answer (e.g., "Okay, I understand"). This feedback data is collected, and explicit ratings or implicit behaviors are quantified into satisfaction values ​​between 0 and 1. For star ratings, five stars are directly mapped to 1.0 and one star to 0.2; for likes / dislikes, likes are recorded as 1.0 and dislikes as 0; for implicit behaviors, asking follow-up questions is recorded as 0.3, and quickly responding with a clear answer is recorded as 0.8. The quantified satisfaction level is compared to a preset threshold, typically 0.6. Those skilled in the art can configure this threshold as needed; satisfaction levels below this threshold are considered unsatisfactory.

[0086] Once the satisfaction level is determined to be below the threshold, the system immediately retrieves the most relevant knowledge document from the customer service knowledge base's calculated consultation document relevance list and constructs a link to that document. There are two link construction methods: the first is to present it as a clickable card in the current conversation window, with the card title being the knowledge document's article title and the subtitle "View Details"; the second is to append a hyperlink text below the conversation bubble, with the text "Click to view full instructions." The link URL contains the knowledge document's unique identifier or the knowledge document's loading path, ensuring that the user can locate and visualize the document after clicking.

[0087] Step S1510: Respond to the loading event of the document display link, visualize the knowledge document, and highlight all semantic unit texts in the unit text set with the highest comprehensive relevance from the knowledge document.

[0088] When a user clicks the link to display the document, the front-end triggers a capture of the corresponding link loading event, then opens a new visual display area on the current page or redirects to a new page displaying the document (e.g., a specific page in the help center). The display area can be a pop-up overlay, a side drawer, or a full-screen page, consisting of three parts: a fixed top bar displaying the article title and a close button; a central main area rendering the text content of the knowledge document, retaining the original paragraph, list, and bold formatting; and a bottom toolbar providing a "Return to Session" button. Simultaneously, during the rendering process, all unit text sets of the knowledge document are retrieved, identifying the node path with the highest overall relevance. The positions of all semantic unit texts contained in this path within the original knowledge document are highlighted. Highlighting methods include: adding a colored vertical bar to the left of a paragraph, filling the background of sentence text with light yellow, and adding a wavy line below keywords. The highlighting range is precise to the sentence level, ensuring that users can immediately see the segment that best matches their consultation intent. After highlighting, the page automatically scrolls to a specific highlighted point (e.g., a highlighted sentence text), ensuring that users are guided to key content upon entering the page.

[0089] In this embodiment, by integrating "satisfaction feedback" with "original text tracing," when a user's satisfaction with the response text is detected to be below a threshold, the system automatically pushes a link to the knowledge document with the highest relevance to the consultation document. After the user opens the displayed document page, all semantic unit texts corresponding to the node path with the highest overall relevance are highlighted. This closed-loop design not only provides a channel for secondary self-service queries, reducing the number of conversation rounds caused by repeated user inquiries and alleviating user dissatisfaction with responses, but also, in addition to providing detailed full-text documents that accurately respond to consultations, achieves "instant location" through highlighting guidance, significantly shortening the time required for users to "find the answer" and understand it.

[0090] In a further embodiment, step S1310, determining the semantic relevance between each semantic unit text in the unit text set and the consultation text, includes the following steps: Step S13101: Combine the semantic unit texts in the unit text set with the consultation texts to form corresponding question-and-answer data pairs; First, each unit text set is broken down into individual semantic unit texts, and then these are paired one-to-one with the consultation text to form multiple question-and-answer data pairs. A typical pairing method is "one-to-one" pairing, which means that a single semantic unit text is directly combined with the entire consultation text to form a pair, represented as a question-and-answer tuple of "semantic unit text + consultation text", for use by subsequent models.

[0091] Step S13102: Use a preset question-answer matching model to determine the question-answer matching score of each question-answer data pair, which is used as the semantic relevance of the question-answer data pair.

[0092] Next, the pre-trained question-answering matching model, which has reached convergence, is invoked to calculate a question-answering matching score for each question-answering data pair. The question-answering matching score is a continuous value between 0 and 1; the higher the value, the more accurately the semantic unit text answers the question posed in the consultation text. Two types of question-answering matching models are available: the first type is a context-matching encoding-based model, such as a fine-tuned version of BERT for the question-answering matching task. This model takes the question and answer as input simultaneously and outputs the matching probability through the hidden state at the [CLS] position. The second type is a dual-tower structure model, such as DPR or ANCE, where the question tower and answer tower independently encode the consultation text and semantic unit text, respectively, and then calculate the score using cosine similarity. The model is deployed according to hardware conditions and response time requirements, and inference is completed through a standard interface or local calls. Those skilled in the art can flexibly and adaptably pre-train the model until it reaches convergence based on the functional disclosure of the question-answering matching model in this embodiment; however, the specific training process is not detailed in this embodiment.

[0093] When calculating the question-answer matching score, the input text undergoes the same preprocessing as during training: taking the BERT model as an example, it first uses a word segmenter such as WordPiece or BPE to segment words, and then adds special tags [CLS] and [SEP]. After inference, the sigmoid activation value output by the model is directly taken as the semantic relevance, without additional transformation. Furthermore, if a dual-tower model is used, the vectors of the semantic unit texts can be cached separately first, and then the vector of the query text in the question-answer data pair can be determined in real time during the query phase. Then, the cosine similarity between the vector of the query text and the vector of the semantic unit text in the question-answer data pair is calculated, thus reducing redundant computation overhead.

[0094] In this embodiment, semantic relevance is calculated using a combination of question-and-answer data pairs and a question-and-answer matching model, transforming the semantic similarity problem, which originally relied on rules or heuristic weights, into an end-to-end learning task. After fine-tuning on a large number of real customer service dialogues, the question-and-answer matching model can directly output a matching probability between 0 and 1, avoiding semantic matching errors caused by natural differences in expression between questions and answers. This probability adapts to subsequent weighted fusion steps and can automatically evolve with business data without manual parameter tuning.

[0095] Please see Figure 3This e-commerce customer service response device, provided to meet one of the purposes of this application, is a functional embodiment of the e-commerce customer service response method of this application. On another aspect, this e-commerce customer service response device, provided to meet one of the purposes of this application, includes an event response module 1100, a text set determination module 1200, a relevance determination module 1300, and a user response module 1400. The event response module 1100 is used to respond to customer service inquiry events triggered by users and obtain the corresponding inquiry text. The text set determination module 1200 is used to determine, for each knowledge document in the customer service knowledge base, the units corresponding to each node path formed by the root node to each end node in the document abstract tree of the knowledge document. The text set, wherein the unit text set includes each semantic unit text corresponding to each node with a semantic nesting relationship in the corresponding node path, originating from the knowledge document; the relevance determination module 1300 is used to determine the comprehensive relevance between each unit text set and the consultation text, and takes the largest comprehensive relevance as the consultation document relevance between the knowledge document and the consultation text, wherein the comprehensive relevance integrates the consultation unit relevance between each semantic unit text in the corresponding unit text set and the consultation text; the user reply module 1400 is used to filter target knowledge documents whose consultation document relevance meets preset conditions, construct corresponding reply text according to the target knowledge document and the consultation text, and push the reply text to the user.

[0096] In a further embodiment, the relevance determination module 1300 includes: a relevance determination submodule, used to determine the retrieval relevance and semantic relevance between each semantic unit text in the unit text set and the consultation text for each unit text set; a relevance weighting submodule, used to perform weighted calculations based on the relevance of each consultation unit and the corresponding semantic relevance used as its weight, and to obtain the consultation unit relevance between each semantic unit text and the consultation text; and a relevance fusion submodule, used to determine the comprehensive relevance between the unit text set and the consultation text based on the retrieval relevance and semantic relevance corresponding to each semantic unit text.

[0097] In a further embodiment, the relevance determination submodule includes: a sequence construction unit, configured to determine at least one word segmentation algorithm that matches the text structure of each semantic unit text in the unit text set, and to segment the semantic unit text and the consultation text using each word segmentation algorithm to obtain corresponding unit word segmentation sequences and consultation word segmentation sequences; a first relevance determination unit, configured to determine the word segmentation sequence relevance between the unit word segmentation sequence and the consultation word segmentation sequence obtained based on each word segmentation algorithm using an information retrieval algorithm; and a second relevance determination unit, configured to perform a summation operation based on all word segmentation sequence relevances, normalize the obtained operation result, and use the obtained processing result as the retrieval relevance between the semantic unit text and the consultation text.

[0098] In a further embodiment, the event response module 1100 includes: a first unit construction submodule, used to determine the document category to which the knowledge document belongs in a preset document classification system for each knowledge document in the customer service knowledge base, as the semantic unit text corresponding to the node of the first-level semantic layer; a second unit construction submodule, used to determine the article title in the knowledge document, as the semantic unit text corresponding to the node of the second-level semantic layer; a third unit construction submodule, used to determine the detailed content text corresponding to the document title in the knowledge document, as the semantic unit text corresponding to the node of the third-level semantic layer; a fourth unit construction submodule, used to determine each paragraph text in the detailed content text of the knowledge document, as the semantic unit text corresponding to the node of the fourth-level semantic layer; a fifth unit construction submodule, used to determine each sentence text in each paragraph text of the knowledge document, as the semantic unit text corresponding to the node of the fifth-level semantic layer; and a sixth unit construction submodule, used to associate each node of each semantic layer other than the first-level semantic layer with the node of its corresponding previous-level semantic layer, to construct a document abstract tree of the knowledge document.

[0099] In a further embodiment, the user response module 1400 includes: a document retrieval submodule, used to retrieve multiple knowledge documents in the customer service knowledge base that have a high relevance to the consultation documents and exceed a preset threshold as target knowledge documents; a document sorting and scaling submodule, used to sort all target knowledge documents in descending order of consultation relevance, and use the consultation document relevance of each target knowledge document ranked later as the relevant index of each target knowledge document ranked earlier; a unit elimination submodule, used to determine, for each target knowledge document, whether there is a non-target unit text set in all unit text sets originating from the target knowledge document with a comprehensive relevance lower than the relevant index of the target knowledge document, and when such a set exists, to eliminate the semantic unit text corresponding to the end node in each non-target unit text set from the target knowledge document; a material construction submodule, used to extract from each target knowledge document according to the sorting until the cumulative extracted character content in the target knowledge document reaches a preset character limit, and to obtain the corresponding response material; and a response generation submodule, used to generate the corresponding response text using a large language model based on the response material and the consultation text.

[0100] In a further embodiment, after the user reply module 1400, there are: a link push submodule, used to obtain the user's satisfaction with the reply text feedback, and when the satisfaction is lower than a preset threshold, construct a document display link corresponding to the knowledge document with the highest relevance to the consultation document in the customer service knowledge base, and push the document display link to the user; an event response submodule, used to respond to the loading event of the document display link, visually display the knowledge document, and highlight all semantic unit texts in the unit text set with the highest comprehensive relevance from the knowledge document.

[0101] In a further embodiment, the relevance determination submodule includes: a question-answer construction unit, used to construct corresponding question-answer data pairs by combining each semantic unit text in the unit text set with the consultation text; and a question-answer matching unit, used to determine the question-answer matching score of each question-answer data pair using a preset question-answer matching model, as the semantic relevance of the question-answer data pair.

[0102] 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, they enable the processor to implement an e-commerce customer service 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 these computer-readable instructions are executed by the processor, they enable the processor to execute the e-commerce customer service 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.

[0103] 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 e-commerce customer service response device of this application. The server can call the server's program code and data to execute the functions of all sub-modules.

[0104] 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 e-commerce customer service response method of any embodiment of this application.

[0105] 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.

[0106] In summary, this application is able to accurately recall long documents related to user inquiries in order to provide users with satisfactory responses.

[0107] 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.

[0108] 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 method for responding to customer service in e-commerce, characterized in that, Includes the following steps: Respond to customer service inquiries triggered by users and obtain the corresponding inquiry text. For each knowledge document in the customer service knowledge base, determine the unit text set corresponding to each node path formed from the root node to each end node in the document abstract tree of the knowledge document. The unit text set includes each semantic unit text originating from the knowledge document corresponding to each node with a semantic nesting relationship in the corresponding node path. Determine the overall relevance between each unit text set and the consultation text, and take the largest overall relevance as the consultation document relevance between the knowledge document and the consultation text. The overall relevance integrates the consultation unit relevance between each semantic unit text in the corresponding unit text set and the consultation text. Select target knowledge documents whose relevance to the consultation document meets preset conditions, construct corresponding response text based on the target knowledge document and the consultation text, and push the response text to the user.

2. The e-commerce customer service response method according to claim 1, characterized in that, Determining the overall relevance between each unit text set and the consultation text includes the following steps: For each unit text set, determine the retrieval relevance and semantic relevance between each semantic unit text in the unit text set and the consultation text; The relevance of each consultation unit is calculated by weighting it according to the relevance of each consultation unit and the corresponding semantic relevance as its weight, and the consultation unit relevance between each semantic unit text and the consultation text is obtained accordingly. Based on the retrieval relevance and semantic relevance of each semantic unit text, the overall relevance between the unit text set and the consultation text is determined.

3. The e-commerce customer service response method according to claim 2, characterized in that, Determining the retrieval relevance between each semantic unit text in the unit text set and the consultation text includes the following steps: For each semantic unit text in the unit text set, at least one word segmentation algorithm that matches the text structure of the semantic unit text is determined. Each word segmentation algorithm is used to segment the semantic unit text and the consultation text to obtain the corresponding unit word segmentation sequence and consultation word segmentation sequence. For each word segmentation algorithm, an information retrieval algorithm is used to determine the word segmentation sequence relevance between the unit word segmentation sequence and the consultation word segmentation sequence obtained based on the word segmentation algorithm; The relevance of all word segmentation sequences is summed, and the result is normalized. The result is then used as the retrieval relevance between the semantic unit text and the consultation text.

4. The e-commerce customer service response method according to claim 1, characterized in that, Before responding to a user-triggered customer service inquiry, the following steps are included: For each knowledge document in the customer service knowledge base, determine the document category to which the knowledge document belongs in the preset document classification system, and use it as the semantic unit text corresponding to the node of the first-level semantic layer; The article titles in the knowledge document are determined as the semantic unit text corresponding to the nodes in the second-level semantic layer; The detailed content text corresponding to the document title in the knowledge document is determined as the semantic unit text corresponding to the node in the third-level semantic layer. Each paragraph of text within the detailed content text of the knowledge document is identified as the semantic unit text corresponding to the node of the fourth-level semantic layer. Each sentence structure text within each paragraph of the knowledge document is identified as the semantic unit text corresponding to the node of the fifth-level semantic layer. By associating each node of each semantic layer other than the first-level semantic layer with the corresponding node of the next higher-level semantic layer, a document abstraction tree of the knowledge document is constructed.

5. The e-commerce customer service response method according to claim 1, characterized in that, Selecting target knowledge documents whose relevance to the consultation document meets preset conditions, and constructing corresponding response text based on the target knowledge document and the consultation text, includes the following steps: Multiple knowledge documents in the customer service knowledge base that have a high relevance to the consultation documents and exceed a preset threshold are recalled as target knowledge documents. All target knowledge documents are sorted in descending order of consultation relevance. The consultation document relevance of each target knowledge document ranked last is used as the relevance indicator of each target knowledge document ranked first. For each target knowledge document, determine whether there is a non-target unit text set in all unit text sets originating from the target knowledge document whose overall relevance is less than the relevance index of the target knowledge document. If so, remove the semantic unit text corresponding to the end node in each non-target unit text set from the target knowledge document. The target knowledge documents are extracted one by one according to the sorting until the cumulative extracted character content in the target knowledge documents reaches the preset character limit, and the corresponding response material is obtained. A large language model is used to generate corresponding response texts based on the provided response materials and consultation texts.

6. The e-commerce customer service response method according to claim 1, characterized in that, After sending the reply text to the user, the following steps are included: Obtain the user's satisfaction with the response text. When the satisfaction level is lower than a preset threshold, construct a document display link corresponding to the knowledge document with the highest relevance to the consultation document in the customer service knowledge base, and push the document display link to the user. In response to the loading event of the document display link, the knowledge document is visualized, and all semantic unit texts within the unit text set with the highest comprehensive relevance derived from the knowledge document are highlighted.

7. The e-commerce customer service response method according to claim 1, characterized in that, Determining the semantic relevance between each semantic unit text in the unit text set and the consultation text includes the following steps: Each semantic unit text in the unit text set is combined with the consultation text to form corresponding question-and-answer data pairs; A pre-defined question-answer matching model is used to determine the question-answer matching score for each question-answer data pair, which is then used as the semantic relevance of the question-answer data pair.

8. An e-commerce customer service response device, characterized in that, include: The event response module is used to respond to customer service inquiry events triggered by users and obtain the corresponding inquiry text for the event; The text set determination module is used to determine, for each knowledge document in the customer service knowledge base, the unit text set corresponding to each node path formed from the root node to each end node in the document abstract tree of the knowledge document. The unit text set includes each semantic unit text originating from the knowledge document corresponding to each node with a semantic nesting relationship in the corresponding node path. The relevance determination module is used to determine the comprehensive relevance between each unit text set and the consultation text, and to take the maximum comprehensive relevance as the consultation document relevance between the knowledge document and the consultation text. The comprehensive relevance integrates the consultation unit relevance between each semantic unit text in the corresponding unit text set and the consultation text. The user reply module is used to filter target knowledge documents whose relevance to the consultation document meets preset conditions, construct corresponding reply text based on the target knowledge document and the consultation text, and push the reply text 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.