Complaint text reply method and electronic equipment

By performing semantic segmentation and domain knowledge tree matching on complaint texts, targeted response texts are generated, which solves the problems of fragmented logic decomposition and lack of specificity in large language models in traditional methods. This achieves efficient, accurate, and automated processing of complaint texts, and improves the robustness of the system and the stability of the responses.

CN121835847APending Publication Date: 2026-04-10WEBANK (CHINA)
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-04
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional financial industry complaint text processing relies on manual operation, resulting in fragmented decomposition logic, making it difficult to achieve systematic knowledge accumulation. Furthermore, the decomposition approach of large language models lacks specificity, leading to over-reasoning and insufficient stability, which affects the accuracy of responses and the robustness of the system.

Method used

By semantically segmenting the complaint text, extracting a set of semantic vectors, and selecting target topics from a pre-built domain knowledge tree, a response text is generated. The semantic segmentation module, strategy generation module, and domain knowledge tree are used for precise decomposition, and a targeted response text is generated by combining the response thinking chain.

Benefits of technology

It enables efficient and accurate automated processing of complaint texts, avoids omission of key sub-tasks, improves the robustness and adaptability of the system, ensures the relevance and stability of responses, and reduces regulatory compliance risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121835847A_ABST
    Figure CN121835847A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, and particularly relates to a complaint text reply method and electronic equipment. The method comprises the following steps: performing semantic segmentation on a complaint text to obtain a plurality of semantic units, and extracting semantic vectors from the plurality of semantic units to obtain a semantic vector set of the complaint text; selecting a target topic matched with the semantic vector set from a pre-constructed domain knowledge tree, wherein the domain knowledge tree is used for describing a topic distribution domain of the complaint content in a tree structure; and generating a reply text for the complaint text according to the reply thinking chain corresponding to the target topic. According to the method, the reply accuracy of the complaint text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, specifically relating to a method for responding to complaint texts and an electronic device. Background Technology

[0002] In financial industry regulatory practice, the handling of customer complaint documents faces significant challenges. Complaint texts issued by regulatory agencies cover multiple dimensions of issues, including product-related, debt collection-related, risk-related, and customer service-related complaints, with each category containing numerous detailed and specific questions.

[0003] Traditional processing methods rely on manual operation: first, complaints are categorized according to type, then assigned to experts in the corresponding fields. Experts must manually break down the complaints into sub-tasks based on their personal experience and collect relevant data around these sub-tasks to verify the issues. This manual breakdown process is highly dependent on the subjective judgment of frontline staff. If key sub-tasks are omitted, the response will be incomplete, easily perceived by regulatory agencies as evasive, and could trigger compliance risks. Furthermore, manual methods struggle to achieve systematic knowledge accumulation; the breakdown logic is fragmented and cannot form a reusable structured framework, severely hindering the efficiency of transferring experience to new business scenarios.

[0004] In recent years, the industry has attempted to introduce large-scale language models to assist in the breakdown of complaint points. However, directly applying the breakdown ideas generated by large models often lacks specificity, and the output content is too broad. Although it can cover many potential sub-tasks, it mixes in a large number of distracting items unrelated to the core issue, resulting in over-reasoning. In addition, when dealing with complex complaints, the breakdown logic of large models is not stable enough. Adjustments to a single topic may affect the processing flow of other topics, leading to overall performance fluctuations and making it difficult to achieve a balance between accuracy and system robustness. Summary of the Invention

[0005] This application provides a method and electronic device for responding to complaint texts, with the aim of improving the accuracy of responses to complaint texts.

[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0007] According to one aspect of the embodiments of this application, a method for responding to a complaint text is provided. The method includes: semantically segmenting the complaint text to obtain multiple semantic units, and extracting semantic vectors from the multiple semantic units to obtain a set of semantic vectors for the complaint text; selecting a target topic that matches the set of semantic vectors from a pre-constructed domain knowledge tree, wherein the domain knowledge tree is used to describe the topic distribution domain of the complaint content in a tree structure; and generating a response text for the complaint text based on a response thought chain corresponding to the target topic.

[0008] According to one aspect of the embodiments of this application, a device for responding to complaint texts is provided, the device comprising: The segmentation module is configured to perform semantic segmentation on the complaint text to obtain multiple semantic units, and extract semantic vectors from the multiple semantic units to obtain a set of semantic vectors for the complaint text. The selection module is configured to select target topics that match the set of semantic vectors from a pre-built domain knowledge tree, the domain knowledge tree being used to describe the topic distribution domain of the complaint content in a tree structure; The generation module is configured to generate a response text for the complaint text based on the response thought chain corresponding to the target topic.

[0009] In some embodiments of this application, based on the above technical solutions, the segmentation module includes: The subtext segmentation module is configured to segment the complaint text into multiple subtexts based on preset delimiters; The strategy generation module is configured to generate a target segmentation strategy based on the perplexity of the subtext, the target segmentation strategy being used to indicate one or more semantic segmentation boundaries; The semantic segmentation module is configured to segment the complaint text into multiple semantic units according to the target segmentation strategy.

[0010] In some embodiments of this application, based on the above technical solutions, the strategy generation module includes: The encoding acquisition module is configured to acquire the hidden state and position encoding of the subtext; The perplexity acquisition module is configured to acquire the perplexity of the subtext and the change in perplexity of the subtext relative to the preceding text. The model mapping module is configured to map the hidden state, position encoding, perplexity, and perplexity change of the subtext according to a pre-trained boundary decision model to obtain a target segmentation strategy, wherein the target segmentation strategy is used to indicate whether the subtext is used as a semantic segmentation boundary relative to the preceding text.

[0011] In some embodiments of this application, based on the above technical solutions, the perplexity acquisition module is further configured to: acquire the perplexity of generating the current subtext given all preceding texts, to obtain a first perplexity; acquire the perplexity of generating the current subtext given a previous subtext, to obtain a second perplexity; and determine the change in perplexity of the subtext relative to the preceding texts based on the difference between the first perplexity and the second perplexity.

[0012] In some embodiments of this application, based on the above technical solutions, the model mapping module is further configured to: determine a first reward value based on the perplexity of each semantic unit; determine a second reward value based on the difference between the number of semantic units and the target number; determine a third reward value based on the unit length of the semantic unit; perform a weighted mapping on the first reward value, the second reward value, and the third reward value to obtain a comprehensive reward value for the target segmentation strategy; and update the model parameters of the boundary decision model based on the comprehensive reward value.

[0013] In some embodiments of this application, based on the above technical solutions, the selection module includes: The path traversal module is configured to traverse a pre-built domain knowledge tree to obtain multiple candidate paths, which include multiple nodes from the root node to the leaf node of the domain knowledge tree. The path similarity acquisition module is configured to acquire the path similarity between the semantic vector set and the candidate path; The path selection module is configured to select the candidate path with the highest path similarity as the target path, and to use the topic corresponding to the leaf node of the target path as the target topic that matches the semantic vector set.

[0014] In some embodiments of this application, based on the above technical solutions, the path similarity acquisition module includes: The node similarity acquisition module is configured to acquire the node similarity between the semantic vector set and each node in the candidate path; The node similarity mapping module is configured to perform weighted mapping on the node similarity according to a preset depth weight to obtain the path similarity between the semantic vector set and the candidate path. The depth weight is positively correlated with the depth level of the node in the domain knowledge tree.

[0015] In some embodiments of this application, based on the above technical solutions, the node similarity acquisition module is further configured to: for each node in the candidate path, acquire the vector similarity between the topic vector of the node and each semantic vector in the semantic vector set, and take the maximum value of the semantic similarity as the node similarity between the semantic vector set and the node.

[0016] In some embodiments of this application, based on the above technical solutions, the method for constructing the domain knowledge tree includes: obtaining a sample set including multiple historical complaint samples, wherein the historical complaint samples include complaint text samples and response text samples; performing semantic segmentation on the complaint text samples and extracting semantic vectors to obtain a complaint sample vector set; performing semantic segmentation on the response text and extracting semantic vectors to obtain a response sample vector set; for any two historical complaint samples, determining the clustering relationship between the two historical complaint samples based on the similarity between the complaint sample vector set and the response sample vector set; performing clustering operations on the sample set based on the clustering relationship to obtain multiple sample clusters; and constructing a domain knowledge tree by using the cluster centers of the sample clusters as nodes.

[0017] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements a method for responding to complaint texts as described in the above technical solutions.

[0018] According to one aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement a method for responding to complaint text as described in the above technical solutions.

[0019] According to one aspect of the embodiments of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements a method for responding to complaint texts as described in the above technical solutions.

[0020] In the technical solution provided in the embodiments of this application, automated semantic segmentation and knowledge tree matching can efficiently and accurately process complaint texts, generate complete and targeted responses, avoid omission of key sub-tasks, and improve the robustness and adaptability of the system.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0023] Figure 1 An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.

[0024] Figure 2 A flowchart illustrating a method for responding to complaint text according to one embodiment of this application is shown.

[0025] Figure 3 A flowchart illustrating semantic segmentation of complaint text is shown in one embodiment of this application.

[0026] Figure 4 This paper illustrates a method for generating a target segmentation strategy in one embodiment of the present application.

[0027] Figure 5 A flowchart illustrating the selection of a target topic is shown in one embodiment of this application.

[0028] Figure 6 The overall flowchart of a claim point decomposition method based on domain knowledge tree implemented using the technical solution of this application is shown.

[0029] Figure 7 This illustration shows a partial structure of a domain knowledge tree constructed in an application scenario according to an embodiment of this application.

[0030] Figure 8 This illustrates the case breakdown approach generated in an application scenario according to an embodiment of this application.

[0031] Figure 9 A schematic block diagram of the device for responding to complaint texts provided in an embodiment of this application is shown.

[0032] Figure 10 A schematic diagram of a computer system architecture suitable for implementing the embodiments of this application is shown. Detailed Implementation

[0033] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.

[0034] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0035] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0036] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0037] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0038] Figure 1 An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.

[0039] like Figure 1 As shown, the system architecture 100 may include terminal devices 110, a network 120, and a server 130. Terminal devices 110 may include various electronic devices such as smartphones, tablets, laptops, desktop computer smart speakers, smart wearable devices, smart in-vehicle devices, and smart payment terminals. Server 130 may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal devices 110 and server 130, such as a wired communication link or a wireless communication link.

[0040] Depending on the implementation requirements, the system architecture in this application embodiment can have any number of terminal devices, networks, and servers. For example, server 130 can be a server group composed of multiple server devices. In addition, the technical solutions provided in this application embodiment can be applied to terminal device 110, or to server 130, or can be implemented jointly by terminal device 110 and server 130. This application does not impose any special limitations on this.

[0041] In traditional financial complaint handling systems, the classification of complaint points and the breakdown of subtasks in customer complaint documents are performed manually based on experience. This results in a lack of structured knowledge accumulation, and the breakdown logic is fragmented and lacks scalability. Furthermore, when large language models are used for automated processing, the complaint point breakdown ideas generated by the model lack specificity, leading to high recall but low accuracy for subtasks, and introducing tasks unrelated to the core issue, i.e., over-reasoning. In particular, the model lacks stability when handling complex complaints, and adjusting the breakdown logic may negatively impact other topics, causing fluctuations in the system's response timeliness and accuracy.

[0042] For example, in the specific scenario of banks handling customer complaints, the complaint text simultaneously contains product-related issues (such as "unreasonable credit card annual fees") and collection-related issues (such as "frequent harassing collection calls"). When processed manually, experts only break down product-related issues into sub-tasks, omitting collection-related tasks, resulting in incomplete responses. In automated trials, large language models break down complaints into multiple sub-tasks, including tasks with low relevance to the core issue (such as "historical contract terms lookup"), leading to over-reasoning. Consequently, the system's efficiency in verifying complaints decreases, and the generated response text may contain irrelevant content, increasing the risk of being judged by regulatory agencies as evasive and ultimately affecting the compliance of the overall service process.

[0043] Due to the aforementioned issues, the system continues to face challenges of incomplete and low-accuracy responses, leading to a significant increase in regulatory compliance risks. Knowledge cannot be effectively retained, migration to new business scenarios is difficult, and the time required for the system to adapt to new regulatory requirements is prolonged. The instability of automated methods will cause fluctuations in overall service quality, impacting customer satisfaction and institutional reputation. In the long term, these problems may hinder the optimization of complaint handling processes in the financial industry and fail to meet the demands of an increasingly complex regulatory environment.

[0044] In view of the problems existing in the above-mentioned related technologies, this application provides a method for responding to complaint texts, which aims to solve the problems of low efficiency of traditional manual processing, difficulty in structuring and accumulating knowledge, and lack of pertinence and stability of automated methods.

[0045] Figure 2 A flowchart illustrating a method for responding to complaint text according to one embodiment of this application is shown. Figure 2 As shown, the method may include the following steps S210 to S230.

[0046] S210: Perform semantic segmentation on the complaint text to obtain multiple semantic units, and extract semantic vectors from the multiple semantic units to obtain a set of semantic vectors for the complaint text.

[0047] A complaint text is a written document submitted by a user or customer to express dissatisfaction, questions, or to seek assistance. These texts typically contain feedback on products, services, processes, or personnel and serve as the initial input information for processing this application.

[0048] Semantic segmentation refers to dividing a continuous text into multiple independent text segments with clear semantic meanings based on their inherent semantic relationships. Each text segment is called a semantic unit, and these semantic units together constitute the complete semantic information of the original complaint text.

[0049] A semantic unit is the smallest text segment with independent semantic meaning, obtained after semantic segmentation. Each semantic unit carries a specific claim, factual description, or emotional expression in the complaint text.

[0050] Semantic vectors are representations of text (such as semantic units or the entire complaint text) converted into high-dimensional numerical vectors using natural language processing techniques. These vectors capture the semantic information of the text, enabling computers to perform mathematical operations and comparisons to understand its meaning.

[0051] A semantic vector set is a collection of semantic vectors extracted from multiple semantic units in a complaint text and then aggregated. This set comprehensively reflects the numerical representation of each semantic level of the complaint text.

[0052] Semantic segmentation and vector extraction can break down potentially lengthy and complex complaint texts into smaller, more manageable semantic fragments, transforming them into machine-understandable numerical representations. For example, a complaint text like "The returns on my purchased financial product did not meet expectations, and customer service responses were not timely. I hope to receive a reasonable explanation and resolution." can be segmented into two semantic units: "The returns on my purchased financial product did not meet expectations" and "Customer service responses were not timely. I hope to receive a reasonable explanation and resolution." One implementation method uses punctuation marks (such as periods, question marks, and exclamation marks) or pre-defined keywords (such as "but" and "and") for text segmentation. Another implementation method uses fixed-length text truncation, such as segmenting every N characters. After obtaining the semantic units, pre-trained word embedding models (such as Word2Vec or GloVe) or sentence embedding models (such as Sentence-BERT) can be used to convert each semantic unit into a high-dimensional vector. These vectors collectively form the semantic vector set of the complaint text.

[0053] S220: Select a target topic that matches the set of semantic vectors from a pre-built domain knowledge tree, which is used to describe the topic distribution domain of the complaint content in a tree structure.

[0054] Domain knowledge trees are tools for organizing and describing knowledge in a specific domain in a tree-like structure. In this application, it is used to represent the topic distribution of complaint content in a hierarchical manner, such as from broad topic categories (e.g., "product category") to sub-topics (e.g., "benefit issues"), thereby providing a structured knowledge system.

[0055] The target topic refers to the specific topic identified from the domain knowledge tree that best matches the content of the current complaint text. It is a precise classification of the core demands of the complaint text, providing direction for the subsequent generation of response text.

[0056] Domain knowledge trees describe the topic distribution of complaint content in a tree-like structure. Their purpose is to provide a structured knowledge system so that the system can accurately pinpoint the core demands of the complaint. For example, the root node of the domain knowledge tree could be a "complaint category," with branches such as "product category," "service category," and "debt collection category." Each category can be further subdivided into more specific topics, such as "benefit issues" and "unclear risk warnings" under the "product category." In one implementation, the system can calculate the cosine similarity between the semantic vector set of the complaint text (e.g., by averaging all semantic vectors to obtain a representative vector) and the topic vectors represented by each node in the domain knowledge tree, and select the node with the highest similarity as the target topic. In another implementation, a set of keywords or phrases can be pre-associated with each node in the domain knowledge tree. Then, the matching degree is determined by calculating the overlap between the keywords in the complaint text and the node keywords, and the topic with the highest matching degree is selected.

[0057] S230: Generate a response text for the complaint text based on the response thought chain corresponding to the target topic.

[0058] A response thought process refers to a predefined series of logical steps or processing flows for a specific target topic. These steps guide the generation of the response text, ensuring that the response is comprehensive, accurate, and conforms to business standards. Examples of steps include "confirming the facts," "analyzing the causes," and "providing solutions."

[0059] A response text refers to the text content of a complaint response that is automatically or semi-automatically generated based on the target topic and the corresponding response thought process. This text aims to resolve the user's issue and provide explanations or follow-up solutions.

[0060] The response thought chain provides structured guidance for generating comprehensive, accurate, and compliant responses. For example, for the target topic of "product-related - revenue issues," the response thought chain might include steps such as "confirming user product information," "verifying the revenue calculation method," "explaining the impact of market fluctuations," and "providing follow-up consultation channels." In one implementation, a set of response templates can be preset for each target topic. The system selects appropriate template fragments from the template library according to the steps of the response thought chain, fills in and combines them, thereby generating a preliminary response text. In another implementation, a set of predefined response phrases or sentences can be associated with each thought chain step. The system splices these phrases or sentences according to the order of the thought chain and makes appropriate modifications based on the specific information in the complaint text to form the final response text.

[0061] The following describes in detail various aspects of the embodiments of this application through an application scenario.

[0062] Suppose User A submits a complaint to a financial institution stating: "I purchased a certain wealth management product with an expected return of 5%, but it only reached 3%, which is inconsistent with the advertisement. Moreover, I have contacted customer service multiple times but have not received a timely and effective response. I hope your company can give me a reasonable explanation and solution."

[0063] First, after receiving the complaint text, the system performs semantic segmentation. For example, based on sentence completeness and semantic independence, the system might segment the complaint text into two semantic units: the first unit is "I purchased a certain financial product with an expected return of 5%, but it only reached 3%, which is inconsistent with the advertisement."; the second unit is "Furthermore, I contacted customer service multiple times but did not receive a timely and effective response. I hope your company can give me a reasonable explanation and solution." Subsequently, the system extracts semantic vectors from these two semantic units and aggregates them to form the semantic vector set of the complaint text. This process transforms user A's complex complaint into a machine-processable numerical form, laying the foundation for subsequent intelligent analysis.

[0064] Next, the system utilizes a pre-constructed domain knowledge tree to select target topics that match the aforementioned set of semantic vectors. This domain knowledge tree may contain first-level topics such as "products" and "services," as well as second- or third-level topics such as "revenue issues," "false advertising," and "untimely customer service response." By calculating the similarity between the set of semantic vectors in the complaint text and the semantic vectors represented by each topic node in the domain knowledge tree, the system identifies the core topic most relevant to User A's complaint. In this example, the system might identify two highly relevant topics: "products - revenue issues" and "services - untimely customer service response." As a preferred implementation, the system selects one of these as the primary target topic based on a preset priority or matching degree, such as "products - revenue issues."

[0065] Finally, once "Product-related - Benefits Issue" is identified as the target topic, the system will generate a response text for User A's complaint based on the corresponding thought process for that topic. The response thought process for "Product-related - Benefits Issue" might include the following steps: First, confirm the product information purchased by the user; second, verify the difference between the actual and expected benefits of the product; third, explain the possible reasons for the lower-than-expected benefits (e.g., market fluctuations, product terms); fourth, provide suggestions for follow-up processing or contact information. Based on these steps and the specific information in the complaint text, the system will automatically generate a structured and targeted response text. For example, the generated response text might read: "Dear User A, we have received and highly value your feedback regarding the lower-than-expected returns on your investment product. We will immediately verify the information about the investment product you purchased and its specific returns, and conduct a detailed analysis of the reasons for the fluctuations in returns. We also sincerely apologize for the delayed customer service response you mentioned and will conduct an internal investigation. A specialist will contact you later to provide you with a detailed explanation and solution. Thank you for your understanding and support." Thus, through semantic segmentation, topic matching, and thought chain guidance, the system can automatically generate a comprehensive and professional response.

[0066] In light of the above application scenarios, the overall technical concept of this application demonstrates significant technical contributions. Traditional complaint handling methods, whether relying entirely on human experience to break down and respond to complaints or directly using large language models for broad summarization, suffer from inefficiency, difficulty in structuring and accumulating knowledge, lack of targeted responses, and insufficient stability.

[0067] Specifically, in the aforementioned application scenario, by semantically segmenting user A's complaint text and extracting semantic vectors, this application avoids the subjective breakdown of complaint content by humans, thus solving the problem of missed sub-tasks due to differences in front-line experience in traditional methods, and ensuring a comprehensive understanding of the complaint content. Compared to the overly broad breakdown approach that may result from directly using large language models, the semantic segmentation in this application can generate more refined and targeted semantic units, improving the accuracy of subsequent analysis.

[0068] Furthermore, by selecting target topics that match the semantic vector set from a pre-constructed domain knowledge tree, this application provides a structured knowledge matching mechanism. Compared with the traditional method of manually classifying and assigning cases based on experience, this achieves structured knowledge accumulation and automated matching, greatly improving processing efficiency. At the same time, compared with the potential for low accuracy and over-reasoning when large language models directly summarize topics, the hierarchical structure of the domain knowledge tree ensures accurate positioning of target topics, avoids introducing a large number of tasks unrelated to the core issue, and thus improves the relevance of the response.

[0069] Furthermore, by generating response text based on the response thought chain corresponding to the target topic, this application provides a clear logical framework for the response process. This effectively solves the problem of fragmented and non-scalable thought chains in traditional manual response writing, enabling knowledge to be systematically reused. Compared to the potential instability and negative impact on other topics that may arise when large language models handle complex arguments, the introduction of the response thought chain ensures the stability and consistency of the response logic, thereby guaranteeing the accuracy and robustness of the generated response text.

[0070] In summary, the embodiments of this application construct an automated, structured, and highly targeted complaint text response system through semantic segmentation, domain knowledge tree matching, and response thought chain generation. This effectively overcomes the shortcomings of existing technologies in terms of efficiency, accuracy, and stability, and provides an innovative solution for handling customer complaints in complex business scenarios such as finance.

[0071] Figure 3 A flowchart illustrating semantic segmentation of complaint text is shown in one embodiment of this application. Based on the above embodiment, step S210 may further include steps S212 to S216.

[0072] S212: Divide the complaint text into multiple subtexts according to the preset delimiter.

[0073] Text segmentation aims to perform preliminary structuring of the original complaint text, breaking it down into smaller, manageable, and analyzable segments. Predefined delimiters can be common punctuation marks in language, such as periods, question marks, exclamation marks, semicolons, or paragraph marks and line breaks. These clear delimiters allow for the rapid and preliminary segmentation of long texts into logically relatively independent sentences or phrases, laying the foundation for subsequent, more refined semantic analysis. This preliminary segmentation helps reduce the computational complexity of subsequent processing and provides candidate points for identifying potential semantic boundaries.

[0074] S214: Generate a target segmentation strategy based on the perplexity of the subtext. The target segmentation strategy is used to indicate one or more semantic segmentation boundaries.

[0075] The core of this step lies in using the "perplexity" of a subtext to assess its semantic integrity and boundary probability. Perplexity is a metric that measures a language model's ability to predict text sequences, typically representing the model's uncertainty in predicting a given text sequence. A high perplexity for a subtext may indicate poor semantic coherence or a break in its semantic connection with the preceding and following text, thus suggesting a potential semantic segmentation boundary. Conversely, a low perplexity indicates semantic coherence, making segmentation unsuitable at that point. Generating the target segmentation strategy can involve setting a perplexity threshold or using a machine learning model (such as a classifier) ​​that takes perplexity as a feature input and outputs a binary decision (whether it's a boundary) or a boundary probability value. For example, a model can be trained to take the perplexity of a subtext and its contextual information as input and output a strategy indicating whether the subtext should be considered a semantic segmentation boundary.

[0076] S216: Segment the complaint text into multiple semantic units according to the target segmentation strategy.

[0077] Once the target segmentation strategy clearly indicates which locations are semantic segmentation boundaries, the system will segment the complaint text into multiple semantic units based on these indications. Each semantic unit should be a semantically relatively complete and independent text fragment, clearly expressing one or more relevant complaint points or facts. This strategy-based segmentation ensures the accuracy and reasonableness of the segmentation results, avoiding semantic fragmentation or excessive merging that may result from simple rule-based segmentation, thus providing high-quality input for subsequent semantic vector extraction and topic matching.

[0078] This application proposes a method for semantically segmenting complaint text to obtain multiple semantic units. The method first performs preliminary segmentation of the complaint text based on preset delimiters, resulting in multiple sub-texts. This preliminary processing utilizes inherent structural features of the text, such as punctuation marks or paragraph markers, to quickly construct potential segmentation candidate points, effectively reducing the scope of subsequent complex analysis. Building upon this, to overcome the limitations of simple rule-based segmentation in traditional methods, this application introduces an evaluation of the perplexity of sub-texts. By calculating the perplexity of each sub-text, the system can quantify its semantic coherence and its connection to the context. Sub-texts with high perplexity often indicate semantic shifts or uncertainties, thus becoming potential semantic segmentation boundaries. Based on this perplexity information, the system generates a target segmentation strategy that intelligently indicates one or more precise semantic segmentation boundaries in the complaint text. Finally, according to this target segmentation strategy, the complaint text is accurately segmented into multiple semantic units. This rule- and model-driven segmentation approach makes each semantic unit more semantically complete and independent, avoiding the omission or redundancy of semantic information caused by inaccurate segmentation. This provides high-quality and accurate input for subsequent semantic vector extraction and matching with target topics in the domain knowledge tree, significantly improving the comprehensiveness and stability of complaint text responses.

[0079] The specific implementation of the above embodiments will be explained in detail below with an application scenario in mind.

[0080] Suppose we receive a complaint text: "I purchased your company's financial product last week. The salesperson promised a high return, but the actual return was far lower than expected. Furthermore, the customer service hotline was always busy, resulting in a poor service experience." First, the system can initially segment the complaint text into multiple subtexts based on preset delimiters, such as periods and commas. For example, it might obtain subtexts like: "I purchased your company's financial product last week.", "The salesperson promised a high return, but the actual return was far lower than expected.", and "Furthermore, the customer service hotline was always busy, resulting in a poor service experience." Next, the system calculates the perplexity of these subtexts. For example, a pre-trained language model (such as a Transformer-based model) can be used to evaluate the fluency and semantic completeness of each subtext. If the subtext "The salesperson promised a high return, but the actual return was far lower than expected" has a relatively high perplexity, or its perplexity changes significantly compared to the previous subtext, this may indicate an important semantic inflection point that needs to be treated as a separate semantic unit. The system can then generate a target segmentation strategy based on these perplexity values, combined with a preset threshold or through a decision model. This strategy may indicate a semantic segmentation boundary between "expected" and "in addition." Finally, based on the generated target segmentation strategy, the system precisely segments the complaint text into two semantic units: the first unit is "I purchased your company's financial product last week. The salesperson promised a high return, but the actual return was far lower than expected," focusing on the product's return; the second unit is "In addition, the customer service hotline was always unreachable, resulting in a poor service experience," focusing on customer service issues. In this way, each semantic unit carries relatively independent and complete complaint content, providing a clear and accurate foundation for subsequent semantic analysis and response generation.

[0081] Through the above technical solutions, the embodiments of this application effectively solve the problems of inaccurate semantic segmentation and the tendency for omissions or redundancy in traditional methods. By combining preliminary segmentation with preset delimiters with dynamic strategy generation based on subtext perplexity, the embodiments of this application can more accurately identify semantic boundaries in complaint texts, ensuring the integrity and independence of each semantic unit. This significantly improves the accuracy and robustness of semantic segmentation, avoids information loss or redundancy caused by segmentation errors, and thus provides high-quality input for subsequent semantic vector extraction and target topic matching. Ultimately, this enables the generated response text to more comprehensively and accurately address various customer demands, improves the efficiency of complaint handling and customer satisfaction, and effectively reduces the risk of being judged by regulators as downplaying the issue.

[0082] Figure 4 This paper illustrates a method for generating a target segmentation strategy according to one embodiment of this application. For example... Figure 4As shown, based on the above embodiments, step S214 may further include the following steps S214a to S214c.

[0083] S214a: Obtain the hidden state and position encoding of the subtext.

[0084] When performing semantic segmentation on complaint texts, the first step is to obtain the hidden state and positional encoding of the subtext. The hidden state is a vector representation of the current input and all preceding input information, compressed and abstracted by a deep learning model when processing sequence data. It captures the deep semantic features and contextual information of the text. Positional encoding is a technique that provides the model with information about the position of words in the sequence, enabling the model to understand the order of words. This information can be obtained in various ways. For example, pre-trained language models (such as BERT and GPT) can be used to encode the subtext, and the output vector of a specific layer serves as the hidden state. The positional encoding is typically superimposed on the word embedding vectors at the model's input layer. Alternatively, recurrent neural network structures such as Long Short-Term Memory (LSTM) or Gated Recurrent Units (GRUs) can be used to process the subtext. The final hidden layer output can serve as the hidden state, and the positional information is obtained through the inherent characteristics of sequence processing or additional encoding methods.

[0085] S214b: Obtain the perplexity of the subtext and the change in perplexity of the subtext relative to the preceding text.

[0086] To more comprehensively evaluate the semantic boundaries of a subtext, it is also necessary to obtain the perplexity of the subtext and the change in perplexity relative to the preceding text. Perplexity is a metric that measures the ability of a language model to predict samples; the lower the perplexity, the stronger the language model's ability to predict or generate the text, and the higher the fluency and predictability of the text. The perplexity of a subtext reflects the difficulty of the language model's prediction of that subtext itself. The change in perplexity measures the change in the prediction difficulty of the current subtext given the context of the preceding text, relative to the situation given only the immediately preceding subtext. This helps to identify semantic boundaries, as semantic boundaries are often accompanied by significant changes in the prediction difficulty of the context. This perplexity information can be obtained by using a pre-trained language model to calculate the perplexity of the subtext. For the change in perplexity, the perplexity of generating the current subtext given all preceding texts (i.e., the first perplexity) and the perplexity of generating the current subtext given the preceding subtext (i.e., the second perplexity) can be calculated separately, and then the difference between the two can be calculated.

[0087] S214c: Based on the pre-trained boundary decision model, the hidden state, position encoding, perplexity, and perplexity change of the subtext are mapped to obtain the target segmentation strategy. The target segmentation strategy is used to indicate whether the subtext is used as the semantic segmentation boundary relative to the preceding text.

[0088] Multi-dimensional information, including the hidden state, positional encoding, perplexity, and perplexity variation of the subtext, is fed as input into a pre-trained boundary decision model. This boundary decision model is a machine learning model that receives these multi-dimensional input features and outputs a decision result, i.e., the target segmentation strategy. By learning from a large amount of labeled data, this model can identify the reasonable boundaries of semantic units in the text. Mapping processing refers to the model transforming and calculating these input features through its internal neural network layers or decision logic, ultimately outputting the decision result. The target segmentation strategy is a specific instruction or judgment used to determine whether the current subtext should be considered the end of an independent semantic unit, thus forming a semantic boundary with the preceding text. For example, the target segmentation strategy can be a binary label (e.g., 0 for non-boundary, 1 for boundary) or a probability value between 0 and 1, with a threshold set to determine whether it is a boundary.

[0089] The specific implementation of the above embodiments will be explained in detail below with an application scenario in mind.

[0090] When performing semantic segmentation on complaint texts, the following steps can be used to generate a target segmentation strategy. For a subtext to be processed, a pre-trained Transformer encoder model (e.g., a model based on BERT or RoBERTa architecture) can be used to obtain its hidden state and positional encoding. Specifically, the subtext is input into the Transformer encoder, and the average pooling result of the word vector sequence output from its last layer is extracted as the hidden state of the subtext. Simultaneously, the positional encoding mechanism built into the Transformer model already incorporates positional information into the word embeddings, so the hidden state output by the model can be directly used to indirectly represent the positional encoding information. To obtain the perplexity of the subtext and its change in perplexity relative to the preceding text, a pre-trained autoregressive language model (e.g., a model based on GPT-2 or GPT-3 architecture) can be used. For the perplexity of the subtext, the subtext can be directly input into the language model, and its perplexity value under the model can be calculated. To calculate the change in perplexity, we first compute the perplexity of the current subtext generated by the language model, given all preceding text (e.g., all content from the beginning of the complaint text to the current subtext), resulting in the first perplexity. Next, we compute the perplexity of the current subtext generated by the language model, given only the immediately preceding subtext, resulting in the second perplexity. Then, the difference between the first and second perplexities is used as the change in perplexity of the subtext relative to its preceding texts. Finally, the hidden state of the subtext (e.g., a 768-dimensional vector), the perplexity (a scalar), and the change in perplexity (a scalar) are concatenated into a comprehensive feature vector. This comprehensive feature vector is then input into a pre-trained boundary decision model. This boundary decision model can be a multilayer perceptron containing three fully connected neural networks, using ReLU activation between each layer and a Sigmoid activation at the output layer, outputting a probability value between 0 and 1. For example, if the output probability is greater than 0.5, the target segmentation strategy indicates that the subtext is considered a semantic segmentation boundary relative to the preceding text; otherwise, it is not considered a boundary. This boundary decision model can be trained using supervised learning, using manually annotated semantic segmentation boundary data as training samples.

[0091] Through the above technical solutions, the embodiments of this application effectively solve the problem that relying solely on a single perplexity in the semantic segmentation of complaint texts may ignore textual context information and dynamic changes, leading to incomplete or unstable segmentation decisions. Specifically, by acquiring the hidden state and positional encoding of sub-texts, the deep semantic features and sequence positional relationships of the text can be captured, thereby providing a richer contextual understanding and avoiding semantic misjudgments caused by relying solely on surface perplexity. Simultaneously, by combining the perplexity of a sub-text and its change in perplexity relative to the preceding text, the critical positions and dynamic turning points of semantic changes in the text can be sensitively identified, reducing omissions or over-segmentation. Based on this, a pre-trained boundary decision model is used to comprehensively map and process this multi-dimensional information, integrating and optimizing the decision logic to ensure that the generated target segmentation strategy has higher targeting and stability. Therefore, the embodiments of this application can achieve more comprehensive, accurate, and robust semantic segmentation results, significantly improving the automation level and quality of complaint text processing, and providing high-quality semantic units for subsequent complaint content analysis and response generation.

[0092] In one embodiment of this application, obtaining the change in perplexity of a subtext relative to its preceding text may further include: obtaining the perplexity of generating the current subtext given all preceding texts, to obtain a first perplexity; obtaining the perplexity of generating the current subtext given a previous subtext, to obtain a second perplexity; and determining the change in perplexity of the subtext relative to its preceding text based on the difference between the first perplexity and the second perplexity.

[0093] For example, obtaining the perplexity of generating the current subtext given all preceding texts, resulting in the first perplexity, refers to the difficulty of predicting the current subtext in the complete preceding context using a language model. Perplexity is an indicator of a language model's ability to predict text sequences; a smaller value indicates a stronger predictive or generative ability. In this step, "given all preceding texts" means that when calculating the perplexity of the current subtext, all preceding text content is considered as contextual information. This ensures that the semantic understanding of the current subtext is based on a global and complete context. For example, a pre-trained language model with long context processing capabilities (e.g., a large language model based on the Transformer architecture) can be used. The current subtext and all preceding texts are input into the model, and then the perplexity of generating the current subtext given the complete preceding context is calculated. Alternatively, a recurrent neural network (RNN) or long short-term memory (LSTM) model can be constructed, and after processing all preceding texts, their final hidden states can be used as context to calculate the perplexity of generating the current subtext.

[0094] For example, obtaining the perplexity of generating the current subtext given the preceding subtext, resulting in a second perplexity, refers to evaluating the prediction difficulty of the current subtext when only the immediately preceding subtext is considered as context. Unlike the first perplexity, "given the preceding subtext" means that when calculating the perplexity of the current subtext, only the immediately preceding subtext is considered as contextual information. This approach emphasizes the coherence of local semantics and can capture the strength of the direct association between the current subtext and the preceding subtext. For example, a sliding window mechanism can be used, inputting only the current subtext and its immediately preceding subtext into the language model each time, and calculating the perplexity of the model generating the current subtext given the local context. Alternatively, a language model with a smaller context window can be used, or the perplexity of the current subtext can be calculated by using only the word vectors of the preceding subtext as the initial state or additional input during computation.

[0095] The change in perplexity of a subtext relative to its preceding text is determined based on the difference between the first and second perplexity values. This aims to quantify the semantic "novelty" or "fragmentation" of the current subtext relative to its preceding text by comparing the perplexity in the global context with that in the local context. A significant difference between global and local perplexity values ​​may indicate a substantial deviation between the semantics of the current subtext and the overall semantics of the preceding text, thus pointing to a potential semantic segmentation boundary. For example, the first perplexity can be directly subtracted from the second perplexity to obtain a difference that reflects the amount of semantic change. Alternatively, the first and second perplexities can be normalized before calculating their difference or ratio to eliminate the influence of different perplexity units, making the changes in perplexity more comparable.

[0096] In the semantic segmentation of complaint text, to accurately identify semantic boundaries, this embodiment uses the aforementioned method to finely calculate the change in perplexity of a subtext relative to its preceding text. The method first obtains the perplexity of the current subtext generated given all preceding texts, yielding a first perplexity. This operation ensures that the semantic evaluation of the current subtext is based on the complete context of all its preceding texts, thereby capturing global semantic coherence. Subsequently, this embodiment obtains the perplexity of the current subtext generated given the preceding subtext, yielding a second perplexity. This step focuses on the local semantic association between the current subtext and its immediate preceding subtext, sensitively reflecting semantic connections or breaks within a short distance. By comparing the perplexities under these two different contextual conditions—that is, calculating the difference between the first and second perplexities—this embodiment can accurately quantify the magnitude of semantic change of the current subtext relative to its preceding text. When this difference is large, it indicates a significant deviation between the semantics of the current subtext and the overall semantics of the preceding text, and the semantic association with its immediate preceding subtext may also be weak. This is a strong signal indicating the possible existence of a semantic segmentation boundary. This perplexity analysis method, which combines global and local contexts, makes the judgment of semantic boundaries more accurate and reliable, thus providing a solid foundation for subsequent target segmentation strategies.

[0097] For example, suppose a complaint text fragment is: "The insurance product I purchased has unclear terms. Furthermore, the customer service representative's attitude was very poor." During semantic segmentation, the text has already been divided into multiple subtexts, such as "The insurance product I purchased has unclear terms." and "Furthermore, the customer service representative's attitude was very poor." Now, consider the second subtext, "Furthermore, the customer service representative's attitude was very poor." To obtain the change in perplexity of this subtext relative to the preceding text, firstly, a pre-trained language model (such as BERT or GPT series models) can be used to calculate the first perplexity. The complete context "The insurance product I purchased has unclear terms. Furthermore," is input into the model, and the perplexity of the model-generated "The customer service representative's attitude was very poor" is calculated, resulting in the first perplexity P1. Next, the second perplexity is calculated. Here, only the last part of the immediately preceding subtext, "Furthermore," is used as context, and the perplexity of the model-generated "The customer service representative's attitude was very poor" is calculated, resulting in the second perplexity P2. Finally, by calculating the difference between P1 and P2 (P1 - P2), we can determine the change in perplexity of the subtext "The customer service staff's attitude was also very poor" relative to its preceding text. If this difference is significant, it indicates that "The customer service staff's attitude was also very poor" is semantically significantly different from the preceding text "The insurance product I purchased had unclear terms," ​​and may mark the beginning of a new semantic unit, thus indicating a semantic segmentation boundary.

[0098] Through the above technical solution, this application provides a more accurate and reliable method for calculating the change in perplexity. By comprehensively considering the global preceding text context and the local preceding sub-text context, and calculating the difference between the two perplexity levels, the true semantic breakpoints in the complaint text can be captured more accurately. This effectively solves the problems of insufficient accuracy and poor operability that may exist in traditional methods when calculating the change in perplexity, thereby significantly improving the accuracy of semantic segmentation boundary judgment. This accurate boundary recognition capability enables the subsequently generated target segmentation strategy to more accurately indicate the division of semantic units, avoiding over-segmentation or under-segmentation, thereby improving the reliability of semantic unit division in the complaint text, laying a solid foundation for subsequent target topic matching and response text generation, and ultimately improving the quality and efficiency of complaint text responses.

[0099] In one embodiment of this application, after segmenting the complaint text into multiple semantic units according to the target segmentation strategy, a first reward value can be determined based on the perplexity of each semantic unit; a second reward value can be determined based on the difference between the number of semantic units and the target number; a third reward value can be determined based on the unit length of the semantic units; the first reward value, the second reward value, and the third reward value are weighted and mapped to obtain the comprehensive reward value of the target segmentation strategy; and the model parameters of the boundary decision model are updated based on the comprehensive reward value.

[0100] The first reward value is determined based on the perplexity of each semantic unit, aiming to evaluate the semantic clarity and coherence of each semantic unit. Perplexity is an indicator of a language model's ability to predict text sequences; the lower the perplexity, the more accurate the model's prediction and the better the semantic coherence of the text. One implementation is to use a pre-trained language model (e.g., Transformer-based models such as BERT and RoBERTa) to calculate the perplexity of each semantic unit. Specifically, the semantic unit is input into the language model, and the inverse of the geometric mean of the model's predicted probabilities for each word in that unit is calculated. The lower the perplexity, the higher the first reward value is assigned. Another implementation is to use a statistical language model (e.g., an N-gram model) to calculate the perplexity. Based on the frequency of N-gram occurrences in a large-scale corpus, the probability of word sequences in the semantic unit is calculated, and the perplexity is determined accordingly. The relationship between perplexity and the first reward value can be set as an inverse relationship or mapped through a non-linear function.

[0101] A second reward value is determined based on the difference between the number of semantic units and the target number, aiming to evaluate the rationality of the segmentation granularity. The target number is the expected, ideal number of semantic units. By comparing the difference between the actual number of semantic units obtained from the segmentation and the target number, it can be determined whether the segmentation is too fine or too coarse, thus avoiding over-segmentation or under-segmentation. One implementation is to set the target number as a fixed value, for example, based on domain expert experience or historical data statistics, complaint texts typically contain 3 to 5 core semantic points. The smaller the absolute difference between the actual number of semantic units and this target number, the higher the second reward value. Another implementation is that the target number can also be a dynamic range, for example, adaptively adjusted according to the length or complexity of the complaint text; longer complaint texts may allow for more semantic units. The second reward value can be designed to be positive when the actual number falls within the target range and negative when it deviates from the range, with the larger the deviation, the larger the negative value.

[0102] A third reward value is determined based on the length of the semantic unit, aiming to evaluate the information density and processability of each semantic unit. Overly long semantic units may contain too much information, leading to semantic ambiguity, while overly short semantic units may lack sufficient information. Evaluating unit length encourages the generation of semantic units of moderate length and balanced information content. One implementation is to set an ideal range for unit length (e.g., 20 to 50 Chinese characters). When the length of a semantic unit falls within this range, the third reward value is higher; when it exceeds or falls below this range, the reward value decreases. Another implementation is to use the variance or standard deviation of all semantic unit lengths to evaluate their uniformity. The more concentrated the length distribution of all semantic units is around a certain ideal value, or the smaller the length differences, the higher the third reward value, thus encouraging the generation of semantic units with relatively consistent lengths.

[0103] A weighted mapping is applied to the first, second, and third reward values ​​to obtain the comprehensive reward value of the target segmentation strategy, aiming to comprehensively evaluate the quality of the segmentation strategy. By weighting the reward values ​​across different dimensions, the importance of each evaluation indicator can be balanced, resulting in a single numerical value that comprehensively reflects the segmentation quality. One implementation method is to use a linear weighted summation, for example, comprehensive reward value = w1 × first reward value + w2 × second reward value + w3 × third reward value, where w1, w2, and w3 are preset weights, and w1 + w2 + w3 = 1. These weights can be set through expert experience or dynamically adjusted through the reinforcement learning training process. Another implementation method is to use a non-linear mapping function, such as the sigmoid function or the tanh function, to map the weighted summation result to a specific interval to facilitate subsequent model updates.

[0104] The goal of updating the boundary decision model's parameters based on the comprehensive reward value is to optimize the model's segmentation capability using feedback signals. The boundary decision model is a core component for determining the semantic segmentation boundary. By using the comprehensive reward value as a feedback signal, mechanisms such as reinforcement learning can be used to adjust the model's internal parameters, enabling it to generate higher-quality semantic units in future segmentation tasks. One implementation approach is to use policy gradient algorithms (e.g., REINFORCE, Actor-Critic) to update the model parameters. The comprehensive reward value is used as a reward signal to optimize the boundary decision model's policy network, making it more inclined to choose segmentation policies that yield higher rewards. Another implementation approach is to use Q-learning or SARSA equivalent value function learning algorithms. The comprehensive reward value is used to update the state-action value function, and then the boundary decision model's behavior policy is adjusted based on the updated value function, thereby optimizing the segmentation decision.

[0105] This application's embodiments introduce a multi-dimensional evaluation mechanism after the complaint text is segmented into multiple semantic units. This mechanism determines different reward values ​​based on the perplexity of the semantic units, the difference between the number of units and the target number, and the unit length. These reward values ​​are weighted and mapped to form a comprehensive reward value, which serves as a feedback signal to update the model parameters of the boundary decision model. This process forms a closed-loop optimization mechanism, enabling the boundary decision model to learn and adjust itself based on the actual segmentation results. Specifically, after the complaint text undergoes initial segmentation, the system immediately performs a "quality check" on the segmentation results, quantitatively evaluating them from multiple dimensions such as semantic clarity, segmentation granularity balance, and information content appropriateness. These evaluation results are integrated into a unified "score," namely the comprehensive reward value. This score is then used to guide the parameter adjustment of the boundary decision model. For example, if the segmentation result has excessive perplexity, or the number of semantic units deviates from expectations, or the unit length is unreasonable, the comprehensive reward value will be low, and the model will adjust its internal parameters accordingly to avoid similar problems recurring in future segmentations. Conversely, if the segmentation result is of high quality and the overall reward value is high, the model will strengthen the current segmentation strategy. This feedback-based iterative optimization process enables the boundary decision model to continuously learn and improve its segmentation strategy, thereby generating more stable, accurate, and suitable semantic units for subsequent processing.

[0106] As an optional implementation, after segmenting the complaint text into multiple semantic units according to the target segmentation strategy, the following steps can be used for optimization: First, for each semantic unit, its perplexity is calculated using a pre-trained Transformer encoder (e.g., based on Google's BERT model). The lower the perplexity, the higher the first reward value; for example, it can be set to 1 / perplexity. Second, the target number of semantic units is preset to 5. If 6 semantic units are actually segmented, the difference in number is 1; if 4 semantic units are obtained, the difference in number is also 1. The smaller the difference in number, the higher the second reward value; for example, it can be set to 1 / (1+abs(actual number - target number)). Third, the ideal semantic unit length range is set to 30-60 Chinese characters. For each semantic unit, if its length falls within this range, the third reward value is higher, for example, 1; if it exceeds this range, the reward value is lower, for example, 0.5. Then, the three reward values ​​are linearly weighted, for example, with weights set as w1=0.4, w2=0.3, and w3=0.3, resulting in a comprehensive reward value = 0.4 × first reward value + 0.3 × second reward value + 0.3 × third reward value. Finally, this comprehensive reward value is used as the reward signal in reinforcement learning, and a policy gradient algorithm (such as the REINFORCE algorithm) is employed to update the parameters of the boundary decision model. The boundary decision model can be a sequence labeling model based on a recurrent neural network (RNN) or Transformer, whose output layer indicates whether each position is a semantic segmentation boundary. In this way, the model can adjust its internal parameters based on the comprehensive reward value, enabling it to generate semantic units with lower perplexity, a number closer to the target, and a more balanced length in subsequent complaint text segmentation tasks.

[0107] Through the above technical solution, the embodiments of this application effectively solve the problem of the lack of segmentation quality evaluation and optimization mechanisms in traditional segmentation methods. By introducing a multi-dimensional reward mechanism and updating model parameters based on comprehensive reward values, the stability and accuracy of semantic segmentation can be significantly improved. Specifically, this scheme can effectively reduce the perplexity of semantic units, ensuring that the semantics of each unit are clear and coherent; at the same time, by controlling the number and length of semantic units, over-segmentation or under-segmentation is avoided, making the segmentation results more in line with the processing needs of subsequent topic matching and response generation. This continuous optimization capability enables the boundary decision model to adapt to complaint texts of different types and complexities, thereby providing high-quality input for subsequent target topic selection and response text generation, ultimately improving the accuracy and robustness of the entire complaint response method.

[0108] Figure 5 A flowchart illustrating the selection of a target topic is shown in one embodiment of this application. For example... Figure 5As shown, based on the above embodiments, step S220 may further include the following steps S222 to S226.

[0109] S222: Traverse the pre-built domain knowledge tree to obtain multiple candidate paths, which include multiple nodes from the root node to the leaf node of the domain knowledge tree.

[0110] A domain knowledge tree is a hierarchical structure used to organize and represent knowledge within a specific domain, where nodes represent topics or concepts, and edges represent relationships between them. Traversal operations can be implemented using algorithms such as Depth-First Search (DFS) or Breadth-First Search (BFS). For example, with DFS, the system can start from the root node and explore downwards along each branch until a leaf node is reached, thus generating a complete candidate path. Another implementation approach is to maintain a queue or stack, progressively expanding the nodes until all paths from the root node to the leaf node have been discovered and recorded. This process ensures that subsequent topic matching takes into account the complete context and hierarchical relationships of the topics, avoiding the limitations of matching based solely on local information.

[0111] By incorporating the hierarchical structure information of the domain knowledge tree, the selection process for target topics in complaint texts is optimized. After receiving the complaint text and performing semantic segmentation and semantic vector extraction to form a set of semantic vectors for the complaint text, the system first performs a comprehensive traversal of the pre-constructed domain knowledge tree. This traversal aims to systematically explore all possible paths from the root node to all leaf nodes in the knowledge tree, thereby generating a set containing multiple candidate paths. These candidate paths represent topic combinations at different levels and granularities in the domain knowledge tree, ensuring comprehensive coverage of the topic distribution of the complaint content.

[0112] S224: Obtain the path similarity between the semantic vector set and the candidate path.

[0113] The semantic vector set is a representation of the complaint text obtained after semantic segmentation and vector extraction, capturing its core semantic information. Path similarity measures the degree of matching between this semantic vector set and a complete path from the root node to a leaf node. One implementation is to calculate the similarity between the semantic vector set and the semantic vectors of all nodes on the path, and then combine these node similarities using an aggregation function (e.g., average, maximum, or weighted sum) to obtain the path similarity. Another implementation is to concatenate or pool the vectors of all nodes on the path to form a holistic vector representation of the path, and then calculate the similarity between this holistic path vector and the semantic vector set. This step is crucial for achieving accurate topic matching, as it combines the semantic information of the complaint text with the structural information of the domain knowledge tree.

[0114] For each generated candidate path, the system calculates the path similarity between that path and the set of semantic vectors of the complaint text. This calculation process goes beyond simply comparing individual nodes; it comprehensively considers the semantic information of all nodes on the path, as well as their hierarchical relationships in the knowledge tree, thereby more accurately reflecting the degree of matching between the complaint text and the entire topic path. In this way, the embodiments of this application can capture the deep topic associations implicit in the complaint text, avoiding the shallow matching problems that may occur in traditional methods.

[0115] S226: Select the candidate path with the highest path similarity as the target path, and take the topic corresponding to the leaf node of the target path as the target topic that matches the semantic vector set.

[0116] After calculating the path similarity of all candidate paths, the system compares them and selects the path with the highest similarity value. For example, the system can maintain a maximum similarity value and its corresponding path, updating this maximum value and path after traversing all candidate paths and calculating their similarities. Alternatively, all candidate paths and their corresponding similarity values ​​can be stored in a list, which is then sorted, and the path with the highest similarity in the sorted results is selected. This step ensures that the selected target path most accurately reflects the core topics involved in the complaint text, laying the foundation for generating a targeted response.

[0117] In a domain knowledge tree, leaf nodes typically represent the most specific topics or concepts. Once the target path is determined, the system directly retrieves the topic associated with the leaf node at the end of that path. For example, if the target path is "Product Category -> Credit Card -> Overdue Payment," then the topic corresponding to the leaf node "Overdue Payment" will be selected as the target topic. Alternatively, the system can pre-store corresponding topic tags in the leaf nodes of the domain knowledge tree. Once the target path is determined, it can directly query the tag of the node at the end of that path. This step ensures that the final selected topic is highly specific and targeted, directly guiding the generation of the response text and avoiding the problem of overly broad or vague topics.

[0118] After obtaining the path similarity of all candidate paths, the system selects the candidate path with the highest similarity value as the target path. This selection mechanism ensures that the determined target path best matches the semantic content of the complaint text, thus most accurately reflecting the core demands of the complaint text. Finally, in this embodiment, the topic corresponding to the leaf node of the target path is taken as the target topic that matches the semantic vector set of the complaint text. Leaf nodes typically represent the most specific and detailed topics in the domain knowledge tree; therefore, selecting the topic corresponding to the leaf node ensures the relevance and accuracy of the selected topic, providing a solid foundation for generating high-quality response text. Through the above mechanism, the solution of this application effectively solves the problems of inaccurate topic matching and neglect of hierarchical information of the knowledge tree in traditional methods, significantly improving the accuracy and robustness of target topic selection. This enables the generated response text to more accurately address the customer's complaint content, thereby improving the efficiency of complaint handling and customer satisfaction.

[0119] As an optional implementation, assume there exists a domain knowledge tree for financial complaints, with the root node being "Financial Complaints," and first-level nodes such as "Products" and "Services." The "Products" category further includes second-level nodes such as "Credit Cards" and "Loans," and "Credit Cards" includes leaf nodes such as "Overdue" and "Fraudulent Transactions." When the system receives a complaint text, such as "My credit card statement is incorrect, showing that I am overdue, but I clearly paid on time," it obtains a set of semantic vectors for the complaint text after semantic segmentation and vector extraction. To select a target topic matching this set of semantic vectors, the system first traverses the pre-constructed domain knowledge tree. For example, the system can use a depth-first search algorithm, starting from the root node "Financial Complaints," exploring all paths from the root node to the leaf nodes. This generates multiple candidate paths such as "Financial Complaints -> Product Categories -> Credit Cards -> Overdue," "Financial Complaints -> Product Categories -> Credit Cards -> Fraudulent Transactions," and "Financial Complaints -> Services -> Poor Attitude." Next, the system obtains the path similarity between the set of semantic vectors of the complaint text and these candidate paths. Specifically, for each candidate path, the system calculates the similarity between the semantic vector set of the complaint text and the semantic vectors of all nodes on the path. For example, for the path "Financial Complaint -> Product Category -> Credit Card -> Overdue Payment", the system calculates the similarity between the semantic vector set of the complaint text and the node vectors of "Financial Complaint", "Product Category", "Credit Card", and "Overdue Payment" respectively. Then, the system aggregates these node similarities using a weighted average, where the weights can be adjusted according to the depth of the node in the path; for example, leaf nodes have higher weights to reflect their importance in terms of topic specificity. After calculating the path similarity of all candidate paths, the system compares these similarity values. Suppose the path "Financial Complaint -> Product Category -> Credit Card -> Overdue Payment" has the highest path similarity, for example, 0.92, while the similarities of other paths are all lower than this value. In this case, the system selects "Financial Complaint -> Product Category -> Credit Card -> Overdue Payment" as the target path. Finally, the system uses the topic corresponding to the leaf node "Overdue Payment" of this target path as the target topic that matches the semantic vector set of the complaint text. In this way, the system can accurately identify that the core issue of the complaint text is about "credit card delinquency," thus providing precise topic guidance for generating targeted response texts.

[0120] Through the above technical solution, this application effectively solves the problems of inaccurate topic matching and neglect of hierarchical knowledge tree information in traditional complaint handling. By comprehensively traversing the domain knowledge tree to generate candidate paths and calculating the path similarity between the semantic vector set and these paths, this application can comprehensively consider the semantic content of the complaint text and the hierarchical structure of domain knowledge. This allows the system to evaluate the degree of topic matching from multiple dimensions, thereby selecting the target path that best matches the semantic content of the complaint text. Finally, by using the topic corresponding to the leaf node of the target path as the matching result, this application ensures the accuracy and relevance of the selected topic, avoiding the problem of topics being too broad or vague. This accurate topic matching capability significantly improves the quality and efficiency of subsequent response text generation, enabling the response content to more accurately address customer complaints, thereby improving customer satisfaction and optimizing the complaint handling process.

[0121] In one embodiment of this application, obtaining the path similarity between the semantic vector set and the candidate path may further include: obtaining the node similarity between the semantic vector set and each node in the candidate path; performing a weighted mapping on the node similarity according to a preset depth weight to obtain the path similarity between the semantic vector set and the candidate path, wherein the depth weight is positively correlated with the depth level of the node in the domain knowledge tree.

[0122] The node similarity between the semantic vector set and each node in the candidate path refers to quantifying the semantic association between the semantic vector set of the complaint text and a specific node (representing a topic) in the domain knowledge tree. This similarity can be obtained in various ways, such as calculating it based on semantic vectors generated by deep learning models (e.g., BERT, RoBERTa), or by aggregating word vectors generated by word embedding models (e.g., Word2Vec, GloVe).

[0123] In one embodiment of this application, obtaining the node similarity between the semantic vector set and each node in the candidate path may further include: for each node in the candidate path, obtaining the vector similarity between the node's topic vector and each semantic vector in the semantic vector set, and taking the maximum value of the semantic similarity as the node similarity between the semantic vector set and the node.

[0124] Performing independent similarity evaluations on each node along a complete path from the root node to a leaf node in the domain knowledge tree helps capture fine-grained matching information for each topic along the path. During processing, an iterator pattern can be used to sequentially visit each node on the candidate path, or the candidate path can be converted into a list of nodes, and then each node in the list can be traversed and processed.

[0125] The similarity between the topic vector of the node and each semantic vector in the semantic vector set is obtained to comprehensively evaluate the matching between the node's topic and all semantic units in the complaint text, ensuring that no potential associations are overlooked. Vector similarity can be calculated using various metrics such as cosine similarity, the reciprocal of Euclidean distance, the reciprocal of Manhattan distance, or the Pearson correlation coefficient. Alternatively, a dedicated similarity prediction model (such as the Siamese network) can be trained to directly output the similarity score.

[0126] Using the maximum semantic similarity as the node similarity between the semantic vector set and the node means selecting the highest value from the similarity calculation results of the node topic vector and all semantic vectors in the complaint text. After calculating all semantic similarity values, they can be directly obtained using the maximum value function provided by the programming language, or by sorting the similarity values ​​and selecting the first element.

[0127] This application embodiment processes each node in the candidate path individually, ensuring that the similarity of each node is evaluated independently and avoiding ambiguity caused by overall calculation. Specifically, for each node in the candidate path, the system compares its corresponding topic vector with the semantic vector of each semantic unit obtained from semantic segmentation in the complaint text, calculating the vector similarity between them. This meticulous comparison comprehensively covers all potential semantic matching points, capturing the semantic information in the complaint text most relevant to the node's topic. Subsequently, the system selects the maximum value from these calculated vector similarities as the node similarity between that node and the set of semantic vectors in the complaint text. This strategy of taking the maximum value highlights the semantic units in the complaint text that best represent the node's topic, effectively filtering out semantic units with low relevance to the node's topic, thereby improving the accuracy and robustness of node similarity calculation. The node similarity obtained in this way can more accurately reflect the degree of matching between the complaint text and each topic node in the domain knowledge tree, thus making the subsequent path similarity calculation more accurate, and ultimately helping the system select the target topic that matches the set of semantic vectors in the complaint text from the pre-constructed domain knowledge tree.

[0128] The following is a specific example to illustrate this.

[0129] Suppose that after semantic segmentation, the complaint text yields a set of semantic units, with corresponding semantic vector sets {V_seg1, V_seg2, V_seg3}. A candidate path exists in the domain knowledge tree, containing a node with a topic vector of V_topic. To obtain the similarity between this node and the nodes in the semantic vector set, the system first calculates the vector similarity (Sim1) between V_topic and V_seg1, the vector similarity (Sim2) between V_topic and V_seg2, and the vector similarity (Sim3) between V_topic and V_seg3. These vector similarities can be calculated using cosine similarity. For example, if Sim1 is 0.8, Sim2 is 0.3, and Sim3 is 0.6, then the node's similarity to the semantic vector set will be determined as the maximum of these three values, i.e., 0.8. This process is repeated for all nodes in the candidate path, ultimately obtaining the precise similarity for each node, providing a reliable basis for subsequent path similarity calculations.

[0130] The above technical solution optimizes the calculation method for node similarity, resolving the issue of inaccurate node matching and thus improving the accuracy and stability of path similarity. This method effectively avoids biases caused by inaccurate semantic matching, such as the lack of specificity in similarity assessment between topic vectors and semantic vectors, which can easily introduce irrelevant matches or ignore key connections. By highlighting the most relevant matching results, noise and irrelevant information are effectively filtered out, enhancing the relevance and robustness of the calculation. This leads to more accurate selection of target topics, laying a solid foundation for generating response texts to complaint texts.

[0131] In one embodiment of this application, the method for constructing a domain knowledge tree includes: obtaining a sample set comprising multiple historical complaint samples, wherein the historical complaint samples include complaint text samples and response text samples; performing semantic segmentation on the complaint text samples and extracting semantic vectors to obtain a complaint sample vector set; performing semantic segmentation on the response text and extracting semantic vectors to obtain a response sample vector set; for any two historical complaint samples, determining the clustering relationship between the two historical complaint samples based on the similarity between the complaint sample vector set and the response sample vector set; performing clustering operations on the sample set based on the clustering relationship to obtain multiple sample clusters; and constructing a domain knowledge tree by using the cluster centers of the sample clusters as nodes.

[0132] Specifically, obtaining a sample set including multiple historical complaint samples aims to provide a comprehensive data foundation for building the domain knowledge tree. The sample set can be obtained from various sources, such as batch export from an enterprise's internal customer service database, historical ticket systems, or publicly available complaint handling platforms. The composition of the historical complaint samples is crucial, as it includes not only original complaint text samples submitted by users but also official or expert response text samples. This dual information source ensures that subsequent analysis can simultaneously capture the semantic features of both the complaint content and the response strategy, laying the foundation for more accurate topic understanding.

[0133] Semantic segmentation and semantic vector extraction of complaint text samples aim to transform unstructured complaint text into a computable and comparable numerical representation. Semantic segmentation breaks down complaint text into smaller, semantically independent units, such as phrases, sentences, or paragraphs, thus avoiding coarse-grained processing of the entire text as a whole. Semantic vector extraction maps these semantic units or the entire text into a high-dimensional vector space, making semantically similar texts closer together in the vector space. Specific schemes for semantic segmentation and semantic vector extraction of complaint text samples can be found in the above embodiments and will not be repeated here.

[0134] Similarly, the steps of semantic segmentation and semantic vector extraction of the response text aim to obtain a semantic representation of the response text. This can be achieved in the same way as the semantic processing of the complaint text sample.

[0135] For any two historical complaint samples, the clustering relationship between them is determined based on the similarity of the complaint sample vector sets and the similarity of the response sample vector sets, overcoming the limitations of single-dimensional similarity judgment. Similarity calculation can employ various metrics; for example, for a vector set, the cosine similarity of its average vectors can be calculated, or the maximum similarity of all vector pairs within the set can be calculated. Specifically, the cosine similarity between the semantic vector sets of the two complaint text samples can be calculated to obtain the complaint similarity; simultaneously, the cosine similarity between the semantic vector sets of the two response text samples can be calculated to obtain the response similarity. Then, the overall clustering relationship between the two historical complaint samples can be comprehensively judged based on these two similarities (e.g., through weighted averaging or logical combination). For example, a comprehensive similarity threshold can be set; when the comprehensive similarity between two samples exceeds this threshold, they are considered to have a clustering relationship.

[0136] Clustering operations are performed on the sample set based on clustering relationships to obtain multiple sample clusters. This categorizes historical samples with similar complaint content and response strategies. Various mature clustering algorithms can be used for clustering operations. For example, the K-means algorithm can be used to iteratively optimize and assign samples to K clusters; hierarchical clustering algorithms can be used to construct cluster trees from the bottom up or top down and truncate them according to preset distance thresholds or the number of clusters; density-based clustering algorithms such as DBSCAN can also be used.

[0137] Constructing a domain knowledge tree by using cluster centers as nodes transforms clustering results into a structured knowledge representation. Cluster centers can be the average or median of the semantic vectors of all samples within a cluster, or the semantic vector of the representative sample closest to other samples within the cluster. These cluster centers represent different topics or question types. The construction of a domain knowledge tree can be done in various ways. For example, each cluster center can be directly used as a leaf node, and then further hierarchical clustering can be performed on these leaf nodes to form parent nodes, ultimately constructing a hierarchical tree. Alternatively, based on the semantic similarity or distance between cluster centers, a top-down or bottom-up approach can be used to gradually establish parent-child relationships between nodes, thus forming a tree structure that describes the topic distribution of complaint content.

[0138] This application constructs a domain knowledge tree by integrating the dual semantic information of complaint text samples and response text samples. First, semantic segmentation and vector extraction are performed on both complaint and response texts respectively, ensuring a comprehensive understanding of the complaint content and response strategy. Second, when determining the clustering relationships of historical complaint samples, the similarity of both the complaint text vector set and the response text vector set is considered, making the clustering judgment more accurate and robust, avoiding the bias that may result from a single dimension. Finally, based on the clustering relationships formed by this dual semantic similarity, the sample set is clustered, and the cluster centers of the sample clusters are used as nodes to construct the domain knowledge tree. This allows the knowledge tree to more accurately reflect the topic distribution of the complaint content and the potential response logic. This construction method enables the domain knowledge tree not only to accurately capture the semantics of the complaint content but also to effectively associate it with its corresponding response strategy, providing a solid foundation for subsequent topic matching and response generation.

[0139] The following is a specific example to illustrate this.

[0140] Suppose we have a large number of historical complaint samples obtained from a financial institution's historical complaint database. Each sample contains the customer's original complaint text and the bank's official response text. First, a pre-trained Chinese BERT model is used to segment each complaint text and response text, and the vector of its [CLS] token is extracted as the semantic vector of that text. For each historical complaint sample, the semantic vectors of the complaint text and the response text are stored separately. Next, for any two historical complaint samples A and B, the cosine similarity `Sim_C(A, B)` between their complaint text semantic vectors and the cosine similarity `Sim_R(A, B)` between their response text semantic vectors are calculated. Then, a comprehensive similarity is obtained by weighted averaging, for example, `0.6 × Sim_C(A, B) + 0.4 × Sim_R(A, B)`. A threshold (e.g., 0.7) is set; if the comprehensive similarity is higher than this threshold, samples A and B are considered to have a clustering relationship. Based on these clustering relationships, the K-means algorithm is used to cluster all historical complaint samples, resulting in multiple sample clusters, each representing a specific complaint topic or issue type. Finally, the average of the complaint text semantic vector and the response text semantic vector for all samples within each sample cluster is calculated. This average vector is used as the cluster center and a node in the domain knowledge tree. By further analyzing the similarity between these cluster centers, for example using hierarchical clustering methods, a multi-level domain knowledge tree can be constructed, where top-level nodes represent broad topics and bottom-level nodes represent specific complaint points.

[0141] Through the above technical solution, this application effectively addresses the problems of inaccurate and unstable topic distribution caused by relying on single-dimensional similarity in traditional methods for constructing domain knowledge trees, as well as the inability to comprehensively capture the correlation between complaints and responses. By comprehensively considering the dual semantic similarity of complaint and response texts, the constructed domain knowledge tree can more accurately and robustly describe the topic distribution of complaint content and effectively reflect the inherent logic between complaints and responses. This not only improves the stability and scalability of the domain knowledge tree, enabling it to better adapt to the dynamic changes in the regulatory environment and avoiding the fragmentation of knowledge accumulation, but also provides a more accurate and stable topic matching foundation for subsequent complaint text response methods, thereby significantly improving the accuracy and relevance of responses.

[0142] The following section provides a detailed explanation of a specific implementation method of the technical solution in this application, using an application scenario as an example.

[0143] Figure 6 The overall flowchart of a claim point decomposition method based on domain knowledge tree implemented using the technical solution of this application is shown.

[0144] In this application scenario, a case includes the complaint statement (Q1) as the complaint text and the response (A1) as the reply text. The following is an example of a risk scenario.

[0145] Point of contention (Q1): Did your bank violate prudent operating principles by condoning the practice of using loans to repay other loans? An investigation revealed that customer Zhang applied for a consumer loan of 50,000 yuan from our bank on August 10, 2021. At that time, the customer already had an outstanding loan of 80,000 yuan with our bank, which was overdue for more than 30 days and under collection pressure. Under collection pressure, the customer transferred 42,000 yuan of the newly applied 50,000 yuan loan on the day of disbursement to repay the aforementioned overdue loan, clearly demonstrating the practice of using loans to repay other loans. Your bank's risk control system failed to effectively identify this behavior, did not trigger the loan-to-loan warning rule, and did not take corresponding risk control measures, violating Article 21 of the "Measures for the Supervision and Administration of the Banking Industry of the People's Republic of China" regarding prudent operating practices, and Article 30 of the "Guidelines for Internal Control of Commercial Banks" regarding the requirements for credit business risk control. Please verify the above issues and explain the rectification measures.

[0146] Reply (A1): The allegations are untrue. At the time of the loan on August 10, 2021, our bank, based on… and in conjunction with the People's Bank of China report…, considering the basic information…, considering the People's Bank of China information…, considering internal risk borrowing and repayment behavior… and taking into account… adjusted to medium-high risk… In summary,… possessing a certain repayment ability… the loan was disbursed.

[0147] The implementation process of the technical solution in this application is divided into two parts: the knowledge modeling stage and the reasoning stage.

[0148] 1. Knowledge modeling stage.

[0149] (1) Domain knowledge tree construction.

[0150] The domain knowledge tree can contain multiple subdomains, and each subdomain can contain multiple topics. This content does not require manual summarization; it is automatically generated based on historical cases. Figure 7 This illustration shows a partial structure of a domain knowledge tree constructed in an application scenario according to an embodiment of this application.

[0151] The specific construction method of the domain knowledge tree is as follows.

[0152] Step 1: Pre-train a large model.

[0153] The claims and responses in all cases are separated and mixed, and used as training data for further pre-training (CPT) of the large model. Here, Sen represents a sentence, and i is the index of that sentence; there are N sentences in total. We employ LoRa's efficient fine-tuning method, balancing the model's generality with specific domain knowledge. Assume the trained large model is... .

[0154] Step 2: Semantic unit segmentation using reinforcement learning.

[0155] Regarding the first Case ,in It is the point of contention. This is a reply. Yes. Using punctuation marks as delimiters, several clauses are obtained. The following calculations are then performed on these clauses based on the change in perplexity:

[0156] in,

[0157] The initial boundary is generated using the perplexity thresholding method. Then, multiple boundary schemes are generated based on the current policy. The reward R for each scheme is calculated. The boundary decision model is optimized through policy gradient optimization until convergence.

[0158] The boundary decision model is as follows:

[0159] Where a(i) ∈ {segmented, not segmented}, h(i) is the hidden state at position i, PPL is the perplexity of the current clause, ΔPPL is the change in perplexity, and pos(i) is the relative position code.

[0160] The reinforcement learning reward function is:

[0161] The first term is used to minimize the internal perplexity (semantic consistency) of each unit, the second term is used to ensure that the number of units is within a reasonable range, the target is the expected number, and the third term is used to penalize excessive differences in unit length.

[0162] After reinforcement learning, the aforementioned complaint point (Q1) can be segmented into multiple semantic units as follows.

[0163] Does your bank violate the principle of prudent operation by condoning the use of loans to repay other loans?

[0164] Upon investigation, it was found that customer Zhang applied for a consumer loan of 50,000 yuan at our bank on August 10, 2021. At that time, customer Zhang already had an outstanding loan of 80,000 yuan at our bank, and the loan was overdue for more than 30 days and was in the process of collection.

[0165] Your bank's risk control system failed to effectively identify this behavior, did not trigger the early warning rule for using loans to repay other loans, and did not take corresponding risk control measures, which violates Article 21 of the "Measures for the Supervision and Administration of the Banking Industry of the People's Republic of China" regarding prudent operation and Article 30 of the "Guidelines for Internal Control of Commercial Banks" regarding the requirements for risk control of credit business.

[0166] Please verify the above issues and explain the corrective measures.

[0167] By using reinforcement learning, different types of claims automatically learn different segmentation strategies, considering the overall segmentation quality rather than local decisions, and eliminating the need for manually labeled boundary data.

[0168] Step 3: Generate the semantic vector sets of the complaint points and responses respectively.

[0169] pass Semantic units can be obtained The vector of each token Therefore, the vector representation of this semantic unit can be according to To calculate. Therefore, the semantic representation of the claim point Q1 can be represented by a vector set X= Similarly, the vector representation of the response can be obtained. This is the dual-channel vectorization of the complaint point and the response. Unlike the traditional BERT-based method of obtaining complaint point vectors, the large model that first generates the vectors is further fine-tuned and trained using domain data. Furthermore, based on… The claims were segmented into semantic units and represented by multiple vectors, effectively overcoming the problem of losing semantic details when using a single vector to represent complex claims.

[0170] Step 4: Clustering based on semantic units.

[0171] For all L historical cases, assume The two cases with the highest similarity are found from the bottom up and merged. The similarity calculation formula for the current claim point X(i) is as follows:

[0172] Statistics can be calculated Therefore, the merging tendency of case L(i) is and The average value of the values ​​is calculated. The merged cases are denoted as L_new. Finally, the clustering results can be obtained using Ward's minimum variance method.

[0173] Step 5: Subdomain and topic generation.

[0174] Based on the clustered cases, the top K cases closest to the cluster center are selected from each cluster, and then the large model is used to generate subdomains and topics. The corresponding cases are then mapped to specific topics. Here, the center vector of the leaf nodes is:

[0175] The selection of topK filters out homogeneous cases, effectively reduces the context length of large models, overcomes the problem of loss in the middle, and ensures the accuracy and completeness of subdomains and topics.

[0176] (2) Generation of complaint point decomposition strategy.

[0177] Step 1: Case topic identification.

[0178] Given a domain knowledge tree, large models can reason by attaching cases to specific (subdomains, topics) within the domain knowledge tree. After attachment, a breakdown approach is generated based on each case. Taking the risk scenarios Q1 and A1 in the example above, it can be deduced that the case belongs to (subdomain: imprudent credit review, topic: credit granting to high-debt customers).

[0179] Step 2: Generate a strategy for breaking down the key points of a case.

[0180] For each case (claims and responses) under a given topic, a breakdown approach can be generated based on a large model. Figure 8 This illustrates the case breakdown approach generated in an application scenario according to an embodiment of this application.

[0181] To ensure the quality of the case breakdown approach, the breakdown approach and the response need to be used as input for validation by a large model. The output should check if the breakdown approach and the response content are consistent. If they are inconsistent, the sample is discarded. If they are consistent, the difficulty is determined based on the depth of reasoning in the thought process chain.

[0182] Regarding the determination of difficulty, this application proposes three key dimensions.

[0183] Dimension 1: Syntactic Complexity (based on dependency tree depth) dep:

[0184] Dimension 2: Semantic unit complexity:

[0185] Dimension 3: Thinking Complexity If the reasoning steps are 1 to 2, it is considered simple, and think=0; if it is 3 to 5, it is considered medium, and think=1; if it is 6 or more, it is considered complex, and think=2.

[0186] Finally, the scores from the three dimensions are added together according to their respective weights to obtain the final difficulty score.

[0187]

[0188] in, .

[0189] Step 3: Combine the case analysis approaches.

[0190] For cases of simple, medium, and complex difficulty, we merged the breakdown strategies for cases of the same difficulty level to generate a complete breakdown approach. The advantage of differentiating by difficulty is that for simple cases, we only need to select simple breakdown strategies to prevent over-decomposition and the introduction of irrelevant subtasks. For complex cases, we need a more detailed breakdown of the claims to prevent omissions.

[0191] (3) Summary of error correction strategies for error cases.

[0192] This step involves collecting a set of incorrect questions during the online bad case phase, allowing the large model to extract modification strategies based on the incorrect cases and correction results. It serves as a supplementary module for bad case repair. This module can quickly fix and intervene in erroneous results for specific bad cases without altering preceding nodes.

[0193] 2. Reasoning stage.

[0194] (1) Knowledge tree topic localization based on path similarity.

[0195] Given a new case X= For the path p = (v1→ v2→ ... → v) from the root node to the leaf node, k Define weighted path similarity:

[0196]

[0197] in: Let w(j) be the vector of the i-th node in the domain tree (calculated during knowledge tree construction), and w(j) be the hierarchical weight.

[0198] This design assigns greater weight to deeper nodes (more specific topics). It allows us to find several topics that meet a threshold, along with their corresponding decomposition strategies, which can then be used as input for subsequent steps.

[0199] (2) Breaking down the points of contention.

[0200] Given the topic of the complaint and its corresponding hard value, select the complaint breakdown approach under that topic and hard value, and then combine it with the complaint itself to allow the large model to generate the complaint breakdown results.

[0201] (3) Result correction.

[0202] Since the results of the previous step cannot be guaranteed to be completely correct, a correction module is introduced here. This model is based on correction strategies summarized from online bad cases and is used to improve common errors in large models.

[0203] As described in the above application scenarios, this application can automatically construct a domain knowledge tree and extract the logic for breaking down complaint points from historical cases. During the reasoning phase, it can automatically locate customer complaints to specific sub-domains and topics, and break down the complaints into sub-tasks according to the complaint point breakdown logic under that topic. This allows for the association of specific evidence to determine the veracity of the sub-tasks and provides specific reasons and evidence. This solves the problem of regulatory response personnel previously needing to manually break down complaint points, saving significant repetitive manpower and compensating for the problem of incomplete complaint point responses due to insufficient human experience. After this technology is implemented, manual review is only required, effectively improving efficiency and reducing the risk of missed complaint points.

[0204] This application uses dual-channel vectorization to model the claims and responses of each case separately. Then, adaptive clustering is employed to organize a large number of historical cases into several clusters. The top K typical cases from each cluster are selected as model inputs. Based on LLM clustering, semantic labels for intermediate nodes, "subdomain" and "topic," are generated. This approach overcomes the limitations of relying on expert experience. The selection of the top K cases filters out homogeneous cases, effectively reducing the context length of large models while preserving case diversity, ensuring comprehensive knowledge coverage and clear hierarchy.

[0205] Under the topic of knowledge tree hierarchical structure, corresponding cases are summarized and specific decomposition ideas are generated based on LLM, avoiding interference and over-decomposition caused by a comprehensive global approach. This localized generation mechanism significantly improves the targeting and accuracy of task decomposition and reduces the risk of introducing irrelevant subtasks.

[0206] When processing new claims, this application first segments the claims into semantic units based on the change in perplexity, preserving fine-grained semantic information. Then, it calculates the subdomain and topic to which the claim belongs based on path similarity (allowing matching of multiple paths for complex claims), and then calls the corresponding decomposition approach for further processing. Simultaneously, during model tuning, independent optimization can be performed for specific topics, avoiding changes to specific topic logic from affecting overall performance, thereby ensuring the stability and maintainability of the system results.

[0207] Overall, this application, through the technical route of "domain knowledge tree modeling - topic-level decomposition - precise positioning and independent optimization", has achieved the systematicness, pertinence and stability of regulatory complaint point decomposition, and overcomes the technical difficulties of low accuracy and unstable results caused by existing methods relying on experience or general ideas.

[0208] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0209] The following describes an embodiment of the apparatus of this application, which can be used to execute the complaint text response method in the above embodiments of this application.

[0210] Figure 9 A schematic block diagram illustrating the structure of a complaint text response device provided in an embodiment of this application is shown. Figure 9 As shown, the complaint text response device 900 includes: The segmentation module 910 is configured to perform semantic segmentation on the complaint text to obtain multiple semantic units, and extract semantic vectors from the multiple semantic units to obtain a set of semantic vectors for the complaint text. The selection module 920 is configured to select a target topic that matches the set of semantic vectors from a pre-built domain knowledge tree, which is used to describe the topic distribution domain of the complaint content in a tree structure. The generation module 930 is configured to generate a response text for the complaint text based on the response thought chain corresponding to the target topic.

[0211] In some embodiments of this application, based on the above technical solutions, the segmentation module 910 includes: The subtext segmentation module is configured to segment the complaint text into multiple subtexts based on preset delimiters; The strategy generation module is configured to generate a target segmentation strategy based on the perplexity of the subtext. The target segmentation strategy is used to indicate one or more semantic segmentation boundaries. The semantic segmentation module is configured to segment the complaint text into multiple semantic units based on the target segmentation strategy.

[0212] In some embodiments of this application, based on the above technical solutions, the strategy generation module includes: The encoding acquisition module is configured to acquire the hidden state and position encoding of the subtext; The perplexity acquisition module is configured to acquire the perplexity of a subtext and the change in perplexity of the subtext relative to the preceding text. The model mapping module is configured to map the hidden state, position encoding, perplexity, and perplexity change of the subtext according to a pre-trained boundary decision model to obtain a target segmentation strategy. The target segmentation strategy is used to indicate whether the subtext is used as a semantic segmentation boundary relative to the preceding text.

[0213] In some embodiments of this application, based on the above technical solutions, the perplexity acquisition module is further configured to: acquire the perplexity of generating the current subtext given all preceding texts, and obtain a first perplexity; acquire the perplexity of generating the current subtext given a previous subtext, and obtain a second perplexity; and determine the change in perplexity of the subtext relative to the preceding texts based on the difference between the first perplexity and the second perplexity.

[0214] In some embodiments of this application, based on the above technical solutions, the model mapping module is further configured to: determine a first reward value based on the perplexity of each semantic unit; determine a second reward value based on the difference between the number of semantic units and the target number; determine a third reward value based on the unit length of the semantic unit; perform a weighted mapping on the first reward value, the second reward value and the third reward value to obtain the comprehensive reward value of the target segmentation strategy; and update the model parameters of the boundary decision model based on the comprehensive reward value.

[0215] In some embodiments of this application, based on the above technical solutions, module 920 includes: The path traversal module is configured to traverse a pre-built domain knowledge tree to obtain multiple candidate paths, which include multiple nodes from the root node to the leaf node of the domain knowledge tree. The path similarity acquisition module is configured to obtain the path similarity between the semantic vector set and the candidate path; The path selection module is configured to select the candidate path with the highest path similarity as the target path, and to use the topic corresponding to the leaf node of the target path as the target topic that matches the semantic vector set.

[0216] In some embodiments of this application, based on the above technical solutions, the path similarity acquisition module includes: The node similarity acquisition module is configured to acquire the node similarity between the semantic vector set and each node in the candidate path; The node similarity mapping module is configured to perform weighted mapping of node similarity according to preset depth weights to obtain the path similarity between the semantic vector set and the candidate path. The depth weights are positively correlated with the depth level of the node in the domain knowledge tree.

[0217] In some embodiments of this application, based on the above technical solutions, the node similarity acquisition module is further configured to: for each node in the candidate path, acquire the vector similarity between the topic vector of the node and each semantic vector in the semantic vector set, and take the maximum value of the semantic similarity as the node similarity between the semantic vector set and the node.

[0218] In some embodiments of this application, based on the above technical solutions, the method for constructing a domain knowledge tree includes: obtaining a sample set comprising multiple historical complaint samples, wherein the historical complaint samples include complaint text samples and response text samples; performing semantic segmentation on the complaint text samples and extracting semantic vectors to obtain a complaint sample vector set; performing semantic segmentation on the response text and extracting semantic vectors to obtain a response sample vector set; for any two historical complaint samples, determining the clustering relationship between the two historical complaint samples based on the similarity between the complaint sample vector set and the response sample vector set; performing clustering operations on the sample set based on the clustering relationship to obtain multiple sample clusters; and constructing a domain knowledge tree by using the cluster center of the sample cluster as a node.

[0219] The specific details of the complaint text response device provided in the various embodiments of this application have been described in detail in the corresponding method embodiments, and will not be repeated here.

[0220] Figure 10 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.

[0221] It should be noted that, Figure 10 The computer system 1000 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0222] like Figure 10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1002 or programs loaded from storage section 1008 into random access memory (RAM). The RAM 1003 also stores various programs and data required for system operation. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output interface 1005 (I / O interface) is also connected to the bus 1004.

[0223] The following components are connected to the input / output interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a local area network card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the input / output interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.

[0224] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit 1001, it performs various functions defined in the system of this application.

[0225] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0226] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0227] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0228] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0229] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0230] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of replying to a complaint text, characterized by, The method comprises: performing semantic segmentation on the complaint text to obtain a plurality of semantic units, and extracting semantic vectors of the plurality of semantic units to obtain a set of semantic vectors of the complaint text; selecting a target topic matching the set of semantic vectors from a pre-constructed domain knowledge tree, the domain knowledge tree being used to describe topic distribution domains of complaint content in a tree structure; generating a reply text for the complaint text according to a reply thinking chain corresponding to the target topic.

2. The method of claim 1, wherein, The performing semantic segmentation on the complaint text to obtain a plurality of semantic units comprises: segmenting the complaint text into a plurality of subtexts according to a preset delimiter; generating a target segmentation strategy according to a perplexity of the subtexts, the target segmentation strategy being used to indicate one or more semantic segmentation boundaries; segmenting the complaint text into a plurality of semantic units according to the target segmentation strategy.

3. The method of claim 2, wherein, The generating a target segmentation strategy according to a perplexity of the subtexts comprises: obtaining a hidden state and a position encoding of the subtext; obtaining a perplexity of the subtext and a perplexity change amount of the subtext relative to a previous text; mapping the hidden state, the position encoding, the perplexity and the perplexity change amount of the subtext according to a pre-trained boundary decision model to obtain a target segmentation strategy, the target segmentation strategy being used to indicate whether the subtext is taken as a semantic segmentation boundary relative to the previous text.

4. The method of claim 3, wherein, The obtaining a perplexity change amount of the subtext relative to a previous text comprises: obtaining a first perplexity of generating a current subtext under the condition of giving all previous texts, to obtain a first perplexity; obtaining a second perplexity of generating a current subtext under the condition of giving a previous subtext, to obtain a second perplexity; determining the perplexity change amount of the subtext relative to the previous text according to a difference between the first perplexity and the second perplexity.

5. The method of claim 3, wherein, After segmenting the complaint text into a plurality of semantic units according to the target segmentation strategy, the method further comprises: determining a first reward value according to a perplexity of each semantic unit; determining a second reward value according to a difference between a number of the semantic units and a target number; determining a third reward value according to a unit length of the semantic units; performing weighted mapping on the first reward value, the second reward value and the third reward value to obtain a comprehensive reward value of the target segmentation strategy; updating model parameters of the boundary decision model according to the comprehensive reward value.

6. The method of claim 1, wherein, The selecting a target topic matching the set of semantic vectors from a pre-constructed domain knowledge tree comprises: traversing the pre-constructed domain knowledge tree to obtain a plurality of candidate paths, the candidate paths comprising a plurality of nodes between a root node and a leaf node of the domain knowledge tree; obtaining a path similarity between the set of semantic vectors and the candidate paths; selecting a candidate path with a highest path similarity as a target path, and taking a topic corresponding to a leaf node of the target path as a target topic matching the set of semantic vectors.

7. The method of claim 6, wherein, The obtaining a path similarity between the set of semantic vectors and the candidate paths comprises: obtain a node similarity between the semantic vector set and each node in the candidate path; weight and map the node similarity according to a preset depth weight to obtain a path similarity between the semantic vector set and the candidate path, the depth weight being in positive correlation with a depth level of the node in the domain knowledge tree.

8. The method of claim 7, wherein, The obtaining of the node similarity between the semantic vector set and each node in the candidate path comprises: for each node in the candidate path, obtaining a vector similarity between a topic vector of the node and each semantic vector in the semantic vector set, and taking a maximum value of the semantic similarity as the node similarity between the semantic vector set and the node.

9. The method according to any one of claims 1 to 8, characterized in that, The construction method of the domain knowledge tree comprises: obtain a sample set comprising a plurality of historical complaint samples, the historical complaint sample comprising a complaint text sample and a reply text sample; perform semantic segmentation on the complaint text sample and extract a semantic vector to obtain a complaint sample vector set; perform semantic segmentation on the reply text and extract a semantic vector to obtain a reply sample vector set; for any two historical complaint samples, determine a clustering relationship of the two historical complaint samples according to a similarity of the complaint sample vector set and a similarity of the reply sample vector set; perform a clustering operation on the sample set according to the clustering relationship to obtain a plurality of sample clusters; construct a domain knowledge tree with a cluster center of the sample cluster as a node.

10. An electronic device, comprising: comprise: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement the reply method of the complaint text according to any one of claims 1 to 9.

Citation Information

Cited By

  • Method for financial text generation error correction based on MRAG and ACD

    CN122242781A

  • Method for financial text generation error correction based on MRAG and ACD

    CN122242781B