Natural language-based intelligent customer service dialogue interaction method and system
By constructing a counterexample generation network and a condition transformation mechanism, the critical conditions of the intelligent customer service system are identified and labeled, solving the problem of unclear scope of application of answers in existing technologies, achieving more accurate and transparent responses, and improving user experience and service security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SOOLE INFORMATION TECH CORP LTD
- Filing Date
- 2025-10-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing intelligent customer service dialogue systems fail to clearly inform users of the applicable scope and boundary conditions of the answers, and lack an automated counterexample generation mechanism, which may lead users to apply the answers incorrectly to inapplicable scenarios, resulting in misunderstandings and decision-making errors.
A counterexample generation network is constructed to identify the conditional parameters on which the initial response depends and perform directional transformations. Multiple candidate transformation values are generated and knowledge retrieval and reasoning are re-executed. Critical conditions of logical conflicts are marked, semantic distance is calculated, applicable premises and critical conditions are extracted and encoded into structured constraint expressions, and condition sensitivity hints are added to the response.
It effectively avoids the response errors of traditional intelligent customer service systems in boundary scenarios, improves service accuracy and applicability, enhances the interpretability and transparency of system responses, prevents the risk of user misuse under boundary conditions, and improves user experience.
Smart Images

Figure CN121387932B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to natural language processing technology, and more particularly to a method and system for intelligent customer service dialogue interaction based on natural language. Background Technology
[0002] Natural language processing-based intelligent customer service systems can understand users' natural language queries and provide corresponding answers through knowledge retrieval and semantic understanding, greatly improving the efficiency of customer service and user experience. Currently, mainstream intelligent customer service dialogue systems typically employ a knowledge base-based retrieval approach combined with natural language processing technology to achieve intelligent responses to user questions. These systems usually contain a large amount of domain knowledge and pre-set dialogue templates, enabling them to retrieve relevant information from the knowledge base based on user queries and generate responses.
[0003] However, existing natural language-based intelligent customer service dialogue technologies have significant shortcomings: The answers generated by current technologies lack applicable condition limitations and fail to clearly inform users of the scope and boundary conditions of the answers, potentially leading users to apply the answers incorrectly to inappropriate scenarios, causing misunderstandings and decision-making errors. Intelligent customer service systems lack sufficient sensitivity to query conditions, failing to identify and highlight critical conditions where slight changes can significantly alter the answer's conclusion, leaving users unable to assess the stability and reliability of the responses. Existing intelligent customer service systems lack automated counterexample generation mechanisms, failing to proactively identify potential boundary cases and exceptions, resulting in overly absolute answers lacking necessary condition limitations and risk warnings. Summary of the Invention
[0004] This invention provides a natural language-based intelligent customer service dialogue interaction method and system, which can solve the problems in the prior art.
[0005] A first aspect of this invention provides an intelligent customer service dialogue interaction method based on natural language, comprising:
[0006] Obtain the user's natural language query and generate an initial response based on a multimodal knowledge base;
[0007] A counterexample generation network is constructed to identify the condition parameters upon which the initial response depends. Each condition parameter undergoes a targeted transformation, including replacing numerical parameters with boundary values and categorical parameters with opposing concepts. Knowledge retrieval and reasoning are re-executed for each transformed condition. When the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition. The semantic distance between the critical condition and the original query condition is calculated to obtain a set of critical conditions and their semantic distance values.
[0008] Extract the applicable premises implicit in the initial response, encode the applicable premises and the set of critical conditions into a structured constraint expression, the structured constraint expression includes the applicable condition range and the failure boundary condition; convert the applicable condition range and the failure boundary condition into natural language form respectively and integrate them into the initial response to form a basic reconstruction response; when the semantic distance value is less than a preset distance threshold, add a condition sensitivity prompt to the basic reconstruction response, and output the reconstructed response to the user.
[0009] The steps for obtaining the user's natural language query and generating an initial response based on a multimodal knowledge base include:
[0010] The natural language query statement is semantically parsed to extract the query intent; knowledge entries matching the query intent are retrieved from a multimodal knowledge base, which contains structured data and unstructured text; and an initial response is generated based on the retrieved knowledge entries.
[0011] The steps of constructing a counterexample generation network, identifying the conditional parameters on which the initial response depends, and performing directional transformation on each conditional parameter include:
[0012] A counterexample generation network is constructed, which includes a condition extraction module, a transformation rule base, and an inference verification module.
[0013] The initial response is subjected to causal dependency analysis by the condition extraction module, and a causal inference graph is constructed. The causal inference graph takes the conclusion of the initial response as the root node, and traces back to extract the preconditions as parent nodes and the upstream conditions as ancestor nodes to form a multi-layer causal chain. The critical path that directly affects the conclusion of the initial response is identified, and the variable parameters on the critical path are extracted as condition parameters. The importance weight is calculated according to the hierarchical depth of the condition parameters in the causal chain, and the set of condition parameters and their corresponding importance weights are output.
[0014] For each condition parameter in the set of condition parameters, the transformation priority is determined according to its importance weight. The transformation rule base is called to perform adversarial directional transformation, generating multiple candidate transformation values and sorting them from weakest to strongest transformation intensity, thus obtaining the set of transformation conditions and transformation intensity labels.
[0015] For each condition parameter in the aggregated set of condition parameters, the step of determining the transformation priority based on its importance weight and calling the transformation rule base to perform adversarial directional transformation includes:
[0016] For numerical conditional parameters, a gradient ascent algorithm is used to iteratively search for boundary values. In each iteration, the value of the conditional parameter is changed, and the multimodal knowledge base is called to re-execute the inference to obtain a confidence score. The gradient of the confidence score with respect to the value of the conditional parameter is calculated, and the value of the conditional parameter is updated along the gradient ascent direction. When the rate of decrease of the confidence score exceeds a preset decrease threshold, the current value of the conditional parameter is recorded as a candidate boundary value. Multiple initial search points are set to perform iterations in parallel, candidate boundary values are collected and sorted according to the rate of decrease of the confidence score, and the top N boundary values with the largest decrease are selected as replacement values.
[0017] For categorical condition parameters, the semantic vector of the original category is obtained in the pre-trained semantic embedding space. The cosine distance of the candidate categories is calculated by spherical search with the semantic vector of the original category as the center. For each candidate category, a replacement query condition is constructed, and the inference is re-executed by calling the multimodal knowledge base. When the new inference result logically contradicts the conclusion of the initial response, the candidate category is marked. Candidate categories with a cosine distance less than the similarity threshold and marked are selected. The category with the smallest distance is selected as the replacement value by sorting by cosine distance.
[0018] For each transformed condition, knowledge retrieval and reasoning are re-executed; when the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition; the steps of calculating the semantic distance between the critical condition and the original query condition to obtain the set of critical conditions and the semantic distance value include:
[0019] For each transformation condition in the set of transformation conditions, according to the transformation intensity label in ascending order, the knowledge retrieval and logical reasoning are re-executed by calling the multimodal knowledge base through the reasoning verification module to generate the transformed reasoning result and its conclusion credibility.
[0020] The logical consistency of the transformed reasoning result and the conclusion of the initial response is compared. When the two contradict each other and the credibility of the conclusion is higher than the conflict determination threshold, the corresponding transformation condition is marked as a critical condition, forming a set of critical conditions.
[0021] For each critical condition in the set of critical conditions, the edit distance between the keyword set of the critical condition and the original query condition is calculated as the lexical distance, the cosine distance is calculated as the semantic distance, and the structure difference is calculated as the logical distance after converting the semantic vector representation into a logical expression. The lexical distance, semantic distance and logical distance are weighted and fused to obtain the comprehensive semantic distance value, and the semantic distance value corresponding to each critical condition is obtained.
[0022] The steps of extracting the implicit applicable premises from the initial response, encoding the applicable premises and the set of critical conditions into a structured constraint expression, wherein the structured constraint expression includes the applicable condition range and the failure boundary conditions; and converting the applicable condition range and the failure boundary conditions into natural language form and incorporating them into the initial response to form the basic reconstructed response include:
[0023] The initial response is logically parsed to extract the implicit preconditions upon which the conclusion depends, and the parameter constraints and category constraints in the implicit preconditions are identified as applicable preconditions; a constraint dependency graph is constructed, with the applicable preconditions as nodes and the logical dependencies between applicable preconditions as edges to form a hierarchical structure; independent preconditions and composite preconditions are identified based on the constraint dependency graph;
[0024] The independent premises and the composite premises are semantically aligned with the set of critical conditions, and critical conditions with semantic overlap are identified as boundary conflict conditions. For each boundary conflict condition, the corresponding parameter constraint range is extracted as the applicable condition range, and the parameter replacement value of the boundary conflict condition is extracted as the failure boundary condition. A structured constraint expression is constructed, and predicate logic is used to connect the applicable condition range and the failure boundary condition through a negation operator to form a complementary relationship.
[0025] The applicable conditions are converted into restrictive modifier phrases, and the failure boundary conditions are converted into exclusionary explanatory statements. Semantically relevant insertion sites are identified in the initial response, and the restrictive modifier phrases and exclusionary explanatory statements are inserted into the insertion sites to form a basic reconstructed response.
[0026] When the semantic distance value is less than a preset distance threshold, a conditional sensitivity prompt is added to the basic reconstruction response, and the reconstructed response is output to the user. The steps include:
[0027] Obtain the semantic distance value corresponding to each critical condition in the set of critical conditions. When the semantic distance value is less than a preset distance threshold, it is determined to be a highly sensitive critical condition. Count the number and distribution of the highly sensitive critical conditions, calculate the sensitivity level, and trigger an enhanced prompt when the sensitivity level exceeds a preset level threshold.
[0028] For highly sensitive critical conditions that require enhanced prompts, the change range between the parameter replacement value and the original parameter value is calculated, the prompt intensity level is determined based on the change range, and condition-sensitive prompt text is generated. The alert level of the condition-sensitive prompt text is determined by the prompt intensity level.
[0029] The condition-sensitive prompt text is appended to the basic reconstructed response to obtain the reconstructed response, which is then output to the user.
[0030] A second aspect of this invention provides an intelligent customer service dialogue interaction system based on natural language, comprising:
[0031] The first unit is used to obtain the natural language query statement input by the user and generate an initial response based on the multimodal knowledge base retrieval.
[0032] The second unit is used to construct a counterexample generation network, identify the condition parameters on which the initial response depends, and perform targeted transformation on each condition parameter. The targeted transformation includes replacing numerical parameters with boundary values and categorical parameters with opposing concepts. Knowledge retrieval and reasoning are re-executed for each transformed condition. When the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition. The semantic distance between the critical condition and the original query condition is calculated to obtain a set of critical conditions and semantic distance values.
[0033] The third unit is used to extract the applicable premises implicit in the initial response, encode the applicable premises and the set of critical conditions into a structured constraint expression, which includes the applicable condition range and the failure boundary condition; convert the applicable condition range and the failure boundary condition into natural language form and integrate them into the initial response to form a basic reconstruction response; when the semantic distance value is less than a preset distance threshold, add a condition sensitivity prompt to the basic reconstruction response, and output the reconstructed response to the user.
[0034] A third aspect of the present invention,
[0035] An electronic device is provided, comprising:
[0036] processor;
[0037] Memory used to store processor-executable instructions;
[0038] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0039] Fourth aspect of the present invention,
[0040] A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0041] The beneficial effects of this invention are as follows:
[0042] By using retrieval based on a multimodal knowledge base and condition recognition through a counterexample generation network, this invention can automatically identify implicit applicable prerequisites and critical conditions, effectively avoiding response errors in traditional intelligent customer service systems under conditional boundary scenarios, and improving service accuracy and applicability.
[0043] By converting complex conditions and constraints into natural language and integrating them into the response content, this invention achieves a clear expression of the applicable conditions and boundary restrictions of the answer, enabling users to accurately understand the usage scenarios and limitations of the answer, and enhancing the interpretability and transparency of the system's response.
[0044] The condition sensitivity judgment mechanism based on semantic distance can intelligently identify the degree of proximity between user queries and boundary conditions, and proactively provide targeted prompts in near-boundary scenarios, effectively preventing the risk of user misuse under boundary conditions and improving service security and user experience. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating the intelligent customer service dialogue interaction method based on natural language according to an embodiment of the present invention.
[0046] Figure 2 A flowchart of network construction and parameter transformation is generated for the counterexample. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0049] Figure 1 This is a flowchart illustrating the intelligent customer service dialogue interaction method based on natural language according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0050] Obtain the user's natural language query and generate an initial response based on a multimodal knowledge base;
[0051] A counterexample generation network is constructed to identify the condition parameters upon which the initial response depends. Each condition parameter undergoes a targeted transformation, including replacing numerical parameters with boundary values and categorical parameters with opposing concepts. Knowledge retrieval and reasoning are re-executed for each transformed condition. When the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition. The semantic distance between the critical condition and the original query condition is calculated to obtain a set of critical conditions and their semantic distance values.
[0052] Extract the applicable premises implicit in the initial response, encode the applicable premises and the set of critical conditions into a structured constraint expression, the structured constraint expression includes the applicable condition range and the failure boundary condition; convert the applicable condition range and the failure boundary condition into natural language form respectively and integrate them into the initial response to form a basic reconstruction response; when the semantic distance value is less than a preset distance threshold, add a condition sensitivity prompt to the basic reconstruction response, and output the reconstructed response to the user.
[0053] In one optional implementation, the steps of obtaining the user's input natural language query and generating an initial response based on a multimodal knowledge base include:
[0054] The natural language query statement is semantically parsed to extract the query intent; knowledge entries matching the query intent are retrieved from a multimodal knowledge base, which contains structured data and unstructured text; and an initial response is generated based on the retrieved knowledge entries.
[0055] For example, the system retrieves the user's natural language query. For instance, a user might input "I want to know your bank's annual fee schedule for credit cards" through the intelligent customer service system. This query is received by the customer service dialogue interface module and passed to the subsequent processing module.
[0056] After obtaining the query statement, semantic parsing is performed on the natural language query statement to extract the query intent. A BERT-based pre-trained model is used for semantic parsing, processing the query statement through steps such as word segmentation, part-of-speech tagging, entity recognition, and relation extraction. In this example, the focus entity of the query is identified as "credit card," the entity is limited to "this bank," the target attribute is "annual fee collection standard," and the operation type is "query." These elements are combined into a structured query intent representation: <"this bank.credit card", "query", "annual fee collection standard">.
[0057] After extracting the query intent, the system retrieves knowledge entries matching the query intent from a multimodal knowledge base. This multimodal knowledge base contains structured data and unstructured text. The structured data includes a product parameter database, a fee standard table, and a customer rights rule table; the unstructured text includes product manuals, terms of service, frequently asked questions, and customer service training manuals. The retrieval process employs a hybrid retrieval strategy, searching both structured and unstructured data simultaneously.
[0058] For structured data retrieval, construct query conditions and locate the parameter fields related to "Annual Fee Standard" under the "Credit Card" category in the product database. For example, the following structured data is retrieved: Product Category="Credit Card", Card Level="Standard / Gold / Platinum Card", Parameter="Annual Fee Standard", Value="Standard Card: First year free, annual fee waived after 6 transactions in the second year, otherwise 100 yuan charged; Gold Card: First year free, annual fee waived after 12 transactions in the second year, otherwise 300 yuan charged; Platinum Card: Fixed annual fee of 600 yuan / year".
[0059] For unstructured text retrieval, the Sentence-BERT model is used to convert query intent into a 768-dimensional vector representation. All document segments in the knowledge base are pre-vectorized and indexed. During retrieval, the cosine similarity between the query vector and the document vector is calculated using the formula: Similarity = (Query Vector · Document Vector) / (||Query Vector|| × ||Document Vector||). The top 10 document segments with a similarity greater than 0.7 are returned as candidate search results. For example, a search in the customer service knowledge base might yield the following: "The annual fee for our credit cards varies depending on the card level. Standard and Gold cards enjoy a first-year annual fee waiver, and the annual fee can be waived in the following year by reaching a certain number of transactions. Platinum cards and above have a fixed annual fee that cannot be waived, but offer more value-added services and benefits."
[0060] To improve retrieval accuracy, a relevance-based ranking mechanism for knowledge entries was implemented. The ranking employs a weighted comprehensive scoring method, calculated as follows: Ranking Score = 0.4 × Semantic Similarity + 0.3 × Text Matching Degree + 0.2 × Authority Score + 0.1 × Timeliness Score. Here, semantic similarity is the cosine similarity between the query vector and the document vector; text matching degree is the coverage rate of query keywords in the document; the authority score is assigned based on the document source type: official product descriptions are 1.0, terms of service are 0.9, frequently asked questions are 0.7, and customer service training manuals are 0.6; the timeliness score is calculated based on the document's publication date, starting at 1.0 within the first year and decreasing by 0.1 for each additional year. Through relevance ranking, knowledge entries that directly describe the annual fee standard are returned first.
[0061] After retrieving relevant knowledge entries, an initial response is generated based on these entries. The generation process includes three steps: content extraction, information integration, and natural language generation. In the content extraction stage, key information points highly relevant to the query intent are extracted from the search results, such as card level, annual fee waiver conditions, and specific fee amounts.
[0062] During the information integration phase, numerical values or descriptions of the same attribute from different sources are extracted and compared. When discrepancies in numerical ranges are identified, the following conflict resolution strategy is adopted: if the numerical ranges overlap, the intersection is taken as the final value; if the numerical ranges do not overlap, the source with the higher authority score is prioritized; if the authority scores are the same, both statements are retained in the response with a note stating "the standard varies depending on the card type." For example, if source A states "Gold Card annual fee is 300 yuan" and source B states "Gold Card annual fee is 280-300 yuan," the intersection of 300 yuan is taken as the final value.
[0063] In the natural language generation stage, based on the extracted and integrated information, a pre-trained generative model is used to generate fluent and natural response text. For the example query, the generated initial response is: "Hello, our bank's credit card annual fee standards vary depending on the card level. The standard card has no annual fee for the first year, and the annual fee is waived in the second year if you make at least 6 transactions; otherwise, a fee of 100 yuan will be charged. The gold card has no annual fee for the first year, and the annual fee is waived in the second year if you make at least 12 transactions; otherwise, a fee of 300 yuan will be charged. The platinum card has a fixed annual fee of 600 yuan per year, but you can enjoy more value-added services. If you need more detailed information about the specific card type's benefits, I can provide you with further details."
[0064] To ensure the quality of generated responses, a response quality assessment mechanism was implemented. The assessment uses a four-dimensional scoring system: completeness (checking whether all key information points of the query are covered), accuracy (checking the accuracy of cited knowledge entries), relevance (checking the match between the response content and the query intent), and fluency (assessing text fluency using a language model's perplexity score). Each dimension's score is normalized to 0-1. The overall quality score is calculated as (completeness + accuracy + relevance + fluency) / 4. When the overall quality score is below 0.75, a response optimization process is triggered: if completeness is below 0.7, missing information points are retrieved; if accuracy is below 0.7, the source of knowledge entries is re-verified; if relevance is below 0.7, the content extraction strategy is adjusted to filter irrelevant information; and if fluency is below 0.7, natural language generation is re-executed.
[0065] This invention accurately understands user needs and finds relevant information, thereby providing a more precise initial response. The multimodal knowledge base includes structured data and unstructured text, expanding the scope of knowledge coverage, handling more diverse queries, enhancing the completeness and accuracy of responses, and effectively improving user experience and satisfaction.
[0066] In one alternative implementation, the step of constructing a counterexample generation network, identifying the conditional parameters that the initial response depends on, and performing a directional transformation on each conditional parameter includes:
[0067] A counterexample generation network is constructed, which includes a condition extraction module, a transformation rule base, and an inference verification module.
[0068] The initial response is subjected to causal dependency analysis by the condition extraction module, and a causal inference graph is constructed. The causal inference graph takes the conclusion of the initial response as the root node, and traces back to extract the preconditions as parent nodes and the upstream conditions as ancestor nodes to form a multi-layer causal chain. The critical path that directly affects the conclusion of the initial response is identified, and the variable parameters on the critical path are extracted as condition parameters. The importance weight is calculated according to the hierarchical depth of the condition parameters in the causal chain, and the set of condition parameters and their corresponding importance weights are output.
[0069] For each condition parameter in the set of condition parameters, the transformation priority is determined according to its importance weight. The transformation rule base is called to perform adversarial directional transformation, generating multiple candidate transformation values and sorting them from weakest to strongest transformation intensity, thus obtaining the set of transformation conditions and transformation intensity labels.
[0070] Combination Figure 2 The flowchart illustrating the construction and parameter transformation of the counterexample generation network is provided. The counterexample generation network comprises three core components: a condition extraction module, a transformation rule base, and an inference and verification module. The condition extraction module is responsible for analyzing the logical structure of the initial response, the transformation rule base stores various parameter transformation strategies, and the inference and verification module ensures that the generated counterexamples meet the logical consistency requirements.
[0071] When the condition extraction module performs causal dependency analysis, it first takes the initial response "Based on your average monthly deposit balance exceeding 50,000 yuan, you can apply for our bank's VIP card service" as input. Through semantic parsing, this response is decomposed into the conclusion part "You can apply for the VIP card service" and the condition part "Average monthly deposit balance exceeds 50,000 yuan". A causal reasoning graph is constructed, with the conclusion as the root node, and the direct premise "Average monthly deposit balance exceeds 50,000 yuan" is identified as the parent node through backward tracing. Further analysis is conducted to extract implicit conditions such as "VIP card application requires an average monthly deposit balance of 50,000 yuan" and "Account must be in normal status" as ancestor nodes, forming a multi-layered causal chain.
[0072] The critical path was identified as "deposit threshold requirement → customer deposit balance → VIP qualification determination," and "deposit balance of 50,000 yuan" and "deposit threshold for VIP application" were extracted as variable condition parameters. Importance weights were calculated based on hierarchy depth using the formula: Weight = 1 / (History Depth + 1). The direct condition "deposit balance of 50,000 yuan" was used as the parent node with a hierarchy depth of 1, and its base weight was 1 / (1 + 1) = 0.5. The implicit condition "deposit threshold" was used as the ancestor node with a hierarchy depth of 2, and its base weight was 1 / (2 + 1) = 0.33. The weight was adjusted based on the frequency of the condition's occurrence in the inference path, with the final weight being base weight × (1 + 0.5 × normalized frequency), where the normalized frequency is the number of times the condition appears in all critical paths divided by the maximum number of occurrences. In this example, "deposit balance" appears once in the unique critical path, with a normalized frequency of 1.0, and the final weight is 0.5 × (1 + 0.5 × 1.0) = 0.75. The final output condition parameter set includes these two items and their corresponding weights.
[0073] For the identified set of conditional parameters, the transformation priority is determined based on their importance weights. The parameter "deposit balance of 50,000 yuan," which has a higher weight, is transformed first. An adversarial directed transformation is then executed by calling the transformation rule library. The goal of the adversarial directed transformation is to generate conditional parameter values that invalidate the initial response conclusion.
[0074] The transformation rule base adopts a categorized organizational structure, storing different transformation rules according to parameter type. For numerical parameters, the rules include: linear transformation rules generate candidate values ±k% of the original value, where k∈{1,5,10,20}; critical value testing rules generate candidate values ±ε of the critical value when a known critical value exists; and interval boundary testing rules generate upper and lower bounds of the parameter's effective range. For enumerated parameters, the rules include: semantic similarity replacement rules find substitute values with semantic similarity in the range of 0.6-0.9; opposite value replacement rules find semantically opposite values; and random sampling rules randomly sample from the parameter's value range. For Boolean parameters, the rule is a negation transformation. The corresponding rule set is matched according to the parameter type, and then the rules are executed sequentially according to their priority until a sufficient number of candidate values are generated.
[0075] Specifically, for the numerical parameter "50,000 yuan", the transformation direction is first determined. Since the original value just meets the condition (50,000 yuan ≥ 50,000 yuan), a downward transformation strategy is adopted. Multiple candidate values are generated using linear transformation rules: weak transformation is original value × 0.99 = 50000 × 0.99 = 49500, rounded down to 49500 yuan; medium transformation is original value × 0.95 = 50000 × 0.95 = 47500, rounded down to 47500 yuan; strong transformation is original value × 0.90 = 50000 × 0.90 = 45000, rounded down to 45000 yuan. Candidate values near the critical value, such as 49800 yuan and 48000 yuan, are also generated.
[0076] The transformation strength is calculated for each candidate value using the formula: Transformation Strength = |Transformed Value - Original Value| / |Original Value|. For example, the transformation strength for 49,500 yuan is |49,500 - 50,000| / 50,000 = 0.01; the transformation strength for 47,500 yuan is |47,500 - 50,000| / 50,000 = 0.05; and the transformation strength for 45,000 yuan is |45,000 - 50,000| / 50,000 = 0.1. Transformation strength is then categorized as follows: transformation strength < 0.05 is labeled "weak transformation," 0.05 ≤ transformation strength < 0.15 is labeled "moderate transformation," and transformation strength ≥ 0.15 is labeled "strong transformation." A special rule applies: if the transformed value crosses a critical boundary value, regardless of the magnitude of the change, it is at least labeled as a "moderate transformation." In this example, 49,500 yuan is marked as "medium transformation" (because it crosses the critical value of 50,000), 47,500 yuan is marked as "medium transformation", and 45,000 yuan is marked as "medium transformation".
[0077] The generated candidate transformation values are sorted from weakest to strongest: 49,500 yuan (medium transformation, strength 0.01), 47,500 yuan (medium transformation, strength 0.05), and 45,000 yuan (medium transformation, strength 0.1). For the "VIP application deposit threshold" parameter, multiple transformation values are generated: "51,000 yuan" (weak transformation), "60,000 yuan" (medium transformation), and "80,000 yuan" (strong transformation), also sorted from weakest to strongest.
[0078] The reasoning verification module ensures that the generated counterexamples are logically valid. The verification process is as follows: First, the transformed parameter values replace the original conditions, constructing a new set of preconditions. For example, the original condition "deposit balance 50,000 yuan, threshold 50,000 yuan" is replaced with the new condition "deposit balance 50,000 yuan, threshold 60,000 yuan". Second, based on the new set of preconditions, a multimodal knowledge base is invoked to perform reasoning. The new conditions are encoded and input into the knowledge base, and relevant rules are retrieved (e.g., "deposit balance < threshold → not eligible for VIP status"), resulting in the new conclusion "you are not currently eligible to apply for a VIP card". Then, the core judgments of the initial conclusion "you can apply for VIP service" and the new conclusion "not eligible for VIP status" are extracted, and a natural language reasoning model (e.g., RoBERTa-NLI) is used to determine whether the two conclusions contradict each other. If the contradiction confidence is > 0.7, it is determined that the conclusions are "opposite", and the transformation constitutes a valid counterexample. Finally, the internal contradictions of the new condition set and whether the new conclusion conforms to the constraints of common sense in banking business are checked. Only counterexamples that pass the consistency check are retained.
[0079] When dealing with complex scenarios, the joint transformation of multiple conditional parameters is comprehensively considered. For cases involving multiple conditional parameters, a hierarchical joint transformation strategy is adopted. First, the dependencies between conditional parameters are identified based on the causal inference graph, classifying parameters into independent conditions (no dependency) and related conditions (dependent). Independent conditions can be transformed individually, while related conditions require joint transformation. Second, the joint transformation combinations are determined based on the logical relationships between parameters: if two parameters are in an "AND" relationship (meaning both must be satisfied), a combination is generated where one parameter satisfies the condition and the other does not; if two parameters are in an "OR" relationship, a combination is generated where neither parameter satisfies the condition. Finally, to avoid combination explosion, combinations involving high-weight parameters are prioritized, and a maximum of five of the most representative joint transformation combinations are retained.
[0080] For example, for the initial response "Because your credit score is AAA and you have had no overdue payments for 12 consecutive months, you can apply for our bank's ultra-low interest rate loan product," the two conditional parameters "credit score AAA" and "no overdue payments for 12 consecutive months" are identified. Since these two are ANDed, a joint transformation condition "credit score AA and no overdue payments for 6 consecutive months" is generated, making one or both conditions not fully satisfied, thus leading to the adversarial conclusion "you can apply for a standard interest rate loan product." The reasoning verification module is then invoked to verify the logical consistency of this adversarial conclusion, confirming that it constitutes a valid counterexample.
[0081] The counterexample generation network of this invention can automatically generate logically valid adversarial examples through accurate identification and targeted transformation of condition parameters. These examples can effectively verify the logical robustness of the initial response, improve the ability to handle boundary conditions and special cases, and thus enhance reasoning ability and reliability.
[0082] In one optional implementation, the step of determining the transformation priority based on the importance weight of each condition parameter in the aggregated set of condition parameters, and then calling the transformation rule base to perform the adversarial directional transformation includes:
[0083] For numerical conditional parameters, a gradient ascent algorithm is used to iteratively search for boundary values. In each iteration, the value of the conditional parameter is changed, and the multimodal knowledge base is called to re-execute the inference to obtain a confidence score. The gradient of the confidence score with respect to the value of the conditional parameter is calculated, and the value of the conditional parameter is updated along the gradient ascent direction. When the rate of decrease of the confidence score exceeds a preset decrease threshold, the current value of the conditional parameter is recorded as a candidate boundary value. Multiple initial search points are set to perform iterations in parallel, candidate boundary values are collected and sorted according to the rate of decrease of the confidence score, and the top N boundary values with the largest decrease are selected as replacement values.
[0084] For categorical condition parameters, the semantic vector of the original category is obtained in the pre-trained semantic embedding space. The cosine distance of the candidate categories is calculated by spherical search with the semantic vector of the original category as the center. For each candidate category, a replacement query condition is constructed, and the inference is re-executed by calling the multimodal knowledge base. When the new inference result logically contradicts the conclusion of the initial response, the candidate category is marked. Candidate categories with a cosine distance less than the similarity threshold and marked are selected. The category with the smallest distance is selected as the replacement value by sorting by cosine distance.
[0085] For example, for each condition parameter in the set of condition parameters, the transformation priority is determined based on its importance weight, with parameters having higher weight values being processed first. The importance weights have been calculated in the previous steps using the causal chain hierarchy, and the weight range is typically between 0.2 and 1.0. Parameters with weights exceeding 0.6 are preferentially processed using the transformation rule base for adversarial targeted transformation. The transformation rule base matches different transformation strategies based on the data type of the condition parameters, mainly including boundary search strategies for numerical parameters and semantic replacement strategies for categorical parameters.
[0086] The adversarial directed transformation for numerical conditional parameters is implemented as follows: First, the transformation priority is determined based on the importance weights of the conditional parameters, prioritizing parameters with higher weights. The transformation process employs a gradient ascent algorithm, iteratively searching for boundary values starting from the initial values. The effective range of the parameters is determined, automatically identified through a business rule base or historical parameter distribution data. For example, the effective range for a loan amount parameter is 5,000 to 5 million yuan, and the effective range for a customer age parameter is 18 to 70 years old. The number of intervals k is determined based on the range span. k is typically set to 4 to 6, with the specific value determined by the parameter's sensitivity. Parameters with higher sensitivity use a smaller k value to obtain denser initial search points. The range is evenly divided into k intervals, with the boundary value of each interval serving as the initial search point.
[0087] Taking the loan amount parameter as an example, if the initial query for a customer's loan amount is 300,000 yuan, and the valid range is 5,000 yuan to 5 million yuan, with k set to 4, then the intervals are 5,000 to 125,000, 125,000 to 250,000, 250,000 to 375,000, and 375,000 to 5 million yuan. The initial search points are 5,000, 125,000, 250,000, 375,000, and 5 million yuan, a total of 5 points. This loan amount value is used as part of the query conditions, and a multimodal knowledge base is invoked to perform inference. The specific invocation process is as follows: the query conditions are encoded into a vector representation, input into the retrieval module of the multimodal knowledge base for semantic matching, and relevant business rules and product information fragments are retrieved. These knowledge fragments are then input into the inference module for logical deduction. The inference module constructs a reasoning path from premise to conclusion based on the retrieved knowledge fragments, counts the number of valid reasoning paths supporting the current conclusion, and the confidence score is equal to the number of valid reasoning paths divided by the total number of reasoning paths. The final output is the reasoning conclusion and its corresponding confidence score, which ranges from 0 to 1. Given a limit of 300,000 yuan, assuming 20 reasoning paths are constructed, 18 of them support the conclusion that the loan product meets the standard interest rate, and 2 support other conclusions. The confidence score is 18 divided by 20, which equals 0.90.
[0088] A small step size adjustment is performed, with the default step size being 1% of the parameter's effective range. For the loan amount parameter, the step size is (5 million - 50 million) × 1%, approximately equal to 50,000 yuan. The amount is reduced by 50,000 yuan to 250,000 yuan, and the knowledge base is called again to execute the above reasoning process, resulting in a new confidence score, assumed to be 0.88. The difference between the two scores is calculated and divided by the parameter change to obtain the gradient at that point. A negative gradient indicates that a decrease in the loan amount leads to a decrease in confidence, and adjustments will continue in this direction. The amount is further reduced by 100,000 yuan to 200,000 yuan, and the knowledge base is called again for reasoning. Assuming 20 reasoning paths are constructed, 15 of which support the original conclusion, the new confidence score is 15 divided by 20, equal to 0.75. The rate of confidence decrease is calculated, which is the absolute value of the confidence change divided by the parameter change. The rate of decrease from 250,000 yuan to 200,000 yuan is 0.88 minus the absolute value of 0.75 divided by 50,000 yuan, equaling a confidence decrease of 0.026 per 10,000 yuan. When the rate of decline exceeds a preset decline threshold, the current loan amount is recorded as a candidate boundary value. The preset decline threshold is typically set to a confidence level decrease of 0.005 to 0.01 per unit change in the parameter; the specific value is determined based on the fault tolerance requirements of the business scenario. Assuming the threshold is a confidence level decrease of 0.01 per 10,000 yuan, when the rate of decline from 250,000 yuan to 200,000 yuan is found to be 0.026 per 10,000 yuan, exceeding the threshold, 200,000 yuan is recorded as a candidate boundary value, and the decline magnitude is recorded as 0.90 minus 0.75, which equals 0.15.
[0089] The above iterative process is executed in parallel from multiple initial points, for example, starting from 125,000 yuan. After each parameter adjustment, the multimodal knowledge base is invoked to re-execute the inference and obtain the confidence score. It is found that when the value drops to 100,000 yuan, 20 inference paths are constructed, of which 12 support the original conclusion. The confidence score drops from 0.75 to 12 divided by 20, which equals 0.60, with a decrease rate of 0.03 per 10,000 yuan, exceeding the threshold. Therefore, 100,000 yuan is also recorded as a candidate boundary value, with a corresponding decrease of 0.30. After a complete search, multiple candidate boundary values are collected, such as 200,000 yuan, 150,000 yuan, 100,000 yuan, and 80,000 yuan, with corresponding confidence decrease rates of 0.15, 0.25, 0.30, and 0.35, respectively. After sorting by the decrease rate, the top N boundary values with the most significant decrease are selected as the final replacement values. The value of N is dynamically determined based on the importance weight of the condition parameters; N is 3 when the importance weight is greater than 0.8, and 2 otherwise. Assuming the importance weight of this parameter is 0.75, then N is 2. Therefore, the 80,000 yuan and 100,000 yuan with the largest decreases are selected as the final replacement values.
[0090] Termination conditions during the iteration process include: reaching the boundary of the effective parameter range, a confidence score change of less than 0.001 over 10 consecutive iterations, or exceeding 100 iterations. An independent iteration state is maintained for each initial search point, including the current parameter value, current confidence score, historical gradient sequence, and iteration counter. Gradient calculation uses the central difference method to improve accuracy; that is, the confidence score is calculated at two positions: plus or minus the step size. The gradient equals the difference between the confidence scores at the two positions divided by twice the step size. When the absolute value of the gradient is less than 0.001, it is considered close to a local extremum, and the step size is halved to continue the search or the search is switched to another initial point.
[0091] The processing flow for categorical conditional parameters is as follows: The original category is converted into a high-dimensional vector representation using a pre-trained semantic embedding model. The embedding model adopts the Sentence-BERT architecture with a vector dimension of 768. For the "loan purpose" parameter, if the original value is "home purchase," the embedding model is called to obtain the semantic vector of "home purchase." A spherical search is performed in the semantic space centered on this vector to calculate the semantic similarity between the candidate category and the original category. Specifically, candidate categories are extracted from a predefined category vocabulary, which contains all legal values in the business domain to which the parameter belongs, typically containing 50 to 200 category values. The cosine distance between the semantic vector of each candidate category and the semantic vector of the original category is calculated. The cosine distance is equal to 1 minus the cosine similarity, which is the dot product of the two vectors divided by the product of their respective moduli. For example, candidate categories such as "car purchase," "renovation," "education," and "consumption" are found, and their cosine distances to "home purchase" are calculated to be 0.25, 0.45, 0.65, and 0.72, respectively.
[0092] For each candidate category, a replaced query condition is constructed, and the inference is re-executed using a multimodal knowledge base. Taking replacing "Loan Purpose: Home Purchase" with "Loan Purpose: Consumption" as an example, the query condition containing "consumption" is encoded and input into the knowledge base. The same retrieval and inference process as with numerical parameters is performed to obtain a new inference conclusion. The inference module also constructs an inference path and calculates a confidence score. The new inference result is compared with the initial response conclusion to determine if a logical contradiction exists. The determination of logical contradiction uses a pre-trained natural language inference model based on the RoBERTa architecture. The input is a premise-hypothesis pair, and the output is the probability distribution of three categories: implication, neutral, and contradiction. The initial conclusion and the new conclusion are used as premise-hypothesis pairs input to the model. When the confidence score of the contradictory category exceeds 0.7, it is determined that a logical contradiction exists, and the candidate category is labeled. For example, the initial response concludes that "you can apply for a housing loan with a maximum term of 30 years and enjoy the preferential interest rate for first-time homebuyers." However, after using "consumption" and calling the knowledge base for reasoning, the conclusion becomes "you can apply for a consumer loan with a maximum term of 5 years and apply the standard interest rate." When these two conclusions are input into the natural language reasoning model, the model outputs a confidence score of 0.82 for the contradictory category, which exceeds the threshold of 0.7. Therefore, it is determined that there is a logical contradiction, and "consumption" is marked as a valid candidate category.
[0093] As a supplementary method for determining logical contradictions, key attributes and their values are extracted from the conclusions for comparison. An attribute extractor based on dependency parsing is used to identify subject-verb-object triples and adjective modification relationships in the conclusions. For example, from the initial conclusion "You can apply for a housing loan with a maximum term of 30 years and enjoy a preferential interest rate for first-time homebuyers," attribute pairs are extracted, including the loan term value of 30 years and the interest rate type value of preferential interest rate. From the new conclusion "You can apply for a consumer loan with a maximum term of 5 years and apply a standard interest rate," attribute pairs are extracted, including the loan term value of 5 years and the interest rate type value of standard interest rate. A logical contradiction is also identified when a significant difference in the values of the same attribute is detected. Significant difference judgments are implemented through predefined business rules, such as a difference in loan term exceeding 10 years or a change in interest rate type from preferential to standard.
[0094] Candidate categories with a cosine distance less than a preset similarity threshold and already labeled are selected. The similarity threshold is typically set between 0.85 and 0.95, with the specific value determined through validation set optimization based on the business scenario. Assuming a threshold of 0.9, in this example, the cosine distance for "consumption" is 0.72, less than the threshold of 0.9, creating a logical contradiction, and therefore it is selected. Similarly, assuming the cosine distance for "renovation" is 0.45, also less than 0.9, and the conclusion generated after calling the knowledge base ("You can apply for a renovation loan with a maximum term of 10 years, applicable to the standard interest rate") differs from the initial conclusion in terms of loan term and interest rate type, resulting in a contradiction confidence level of 0.75, thus also meeting the selection criteria. All candidate categories meeting the criteria are sorted by cosine distance, and the category with the smallest distance is selected as the final replacement value; in this example, it is "renovation," because its cosine distance of 0.45 is less than that of "consumption" (0.72).
[0095] The processing of categorical parameters also includes the management of candidate category sources. Candidate categories can be obtained from multiple sources, including category thesaurus, business knowledge graphs, and parameter value distributions in historical customer service dialogue logs. Different priorities are assigned to candidate categories from different sources: standard business terms in the category thesaurus have the highest priority, entities in the knowledge graph have the second highest priority, and values in historical dialogue logs have the lowest priority. When the number of candidate categories exceeds 100, an initial screening is performed based on cosine distance, retaining candidates with a distance between 0.5 and 0.95, and filtering out categories that are too close (semantically too similar) or too far apart (semantically unrelated). The initial screening typically yields between 20 and 50 candidate categories, which are then subjected to reasoning and contradiction determination one by one.
[0096] For Boolean conditional parameters, a simplified negation transformation strategy is employed. If the original value is true, the replacement value is false; if the original value is false, the replacement value is true. The replacement value is then used to perform reasoning with the multimodal knowledge base to determine if the new conclusion contradicts the initial conclusion. For example, for the Boolean parameter "whether the account has mobile banking activated," if the original value is "yes," the replacement value is "no." The knowledge base is then invoked again to arrive at the new conclusion, "You cannot use mobile banking to make transfers; it is recommended that you activate mobile banking service first," which contradicts the initial conclusion, "You can complete transfers through mobile banking." Since Boolean parameters only have two possible values, there is no need for similarity search or boundary iteration; a unique replacement value is directly generated, and its adversarial nature is verified.
[0097] The transformation process records detailed intermediate states and metadata, including the confidence score, decrease magnitude or cosine distance, knowledge fragment identifiers retrieved during inference, confidence level of contradiction determination, and execution timestamp for each candidate replacement value. This metadata is used for subsequent counterexample verification and result ranking. The generated replacement values are labeled according to their adversarial strength, which comprehensively considers factors such as the decrease in confidence, the confidence level of logical contradiction, and semantic distance. For numerical parameters, the adversarial strength is mainly determined by the decrease in confidence; the larger the decrease, the stronger the adversarial strength. For categorical parameters, the adversarial strength is mainly determined by the confidence level of contradiction determination; the higher the contradiction confidence level, the stronger the adversarial strength. All generated replacement values and their adversarial strength labels are output as a transformation condition set for use in subsequent steps.
[0098] This invention employs differentiated processing strategies for different types of conditional parameters, achieving efficient and accurate boundary value detection. For numerical parameters, a gradient ascent algorithm is used to iteratively search for boundary values, quickly locating the critical points that cause changes in the answer. For categorical parameters, a spherical search is performed in the semantic space to find the closest but logically conflicting alternative category. This targeted transformation mechanism significantly improves the accuracy and efficiency of boundary detection, reducing resource waste caused by ineffective transformations.
[0099] In one optional implementation, knowledge retrieval and reasoning are re-executed for each transformed condition; when the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition; the steps of calculating the semantic distance between the critical condition and the original query condition to obtain the set of critical conditions and the semantic distance value include:
[0100] For each transformation condition in the set of transformation conditions, according to the transformation intensity label in ascending order, the knowledge retrieval and logical reasoning are re-executed by calling the multimodal knowledge base through the reasoning verification module to generate the transformed reasoning result and its conclusion credibility.
[0101] The logical consistency of the transformed reasoning result and the conclusion of the initial response is compared. When the two contradict each other and the credibility of the conclusion is higher than the conflict determination threshold, the corresponding transformation condition is marked as a critical condition, forming a set of critical conditions.
[0102] For each critical condition in the set of critical conditions, the edit distance between the keyword set of the critical condition and the original query condition is calculated as the lexical distance, the cosine distance is calculated as the semantic distance, and the structure difference is calculated as the logical distance after converting the semantic vector representation into a logical expression. The lexical distance, semantic distance and logical distance are weighted and fused to obtain the comprehensive semantic distance value, and the semantic distance value corresponding to each critical condition is obtained.
[0103] For example, upon receiving a user's original query, such as "Can I return an electronic product purchased 30 days ago if it has a quality problem?", an initial response is generated based on this query, concluding that "If the 7-day no-reason return period has expired, a quality problem repair process must be followed; returns are not supported," and this conclusion and its reasoning path are recorded. Subsequently, a set of transformation conditions is constructed, such as "Purchase duration becomes 5 days," "Purchase duration becomes 20 days," "Product type becomes food," "Problem type becomes received damaged goods," etc., and the transformation strength of each transformation condition is labeled and sorted from weakest to strongest.
[0104] For each condition in the set of transformation conditions, they are processed one by one in order of transformation strength from weakest to strongest. Taking the transformation condition "purchase duration becomes 20 days" as an example, the reasoning verification module is invoked to re-execute knowledge retrieval and logical reasoning. The reasoning verification module first retrieves relevant knowledge from the multimodal knowledge base, such as "7-day no-reason return policy for electronic products" and "warranty policy for quality issues," and then performs reasoning based on this knowledge, obtaining the transformed reasoning result "exceeding the 7-day no-reason return period, but a quality inspection application can be submitted," with a confidence level of 0.88. This transformed reasoning result is compared with the initial response "exceeding the 7-day no-reason return period, a quality issue repair process is required, and returns are not supported" for logical consistency. In this example, the core judgment of the two conclusions is consistent, both of which do not support direct returns, therefore "purchase duration becomes 20 days" is not marked as a critical condition.
[0105] Continuing with the next transformation condition, "purchase duration becomes 5 days," knowledge retrieval and reasoning are re-executed, yielding the conclusion, "within the 7-day no-reason return period, a return and refund can be requested," with a confidence level of 0.95. Comparing this conclusion with the initial response, a contradiction is found in the judgment of return feasibility. The initial response was "returns are not supported," while the transformed conclusion is "returns can be requested." Furthermore, the confidence level of 0.95 exceeds the preset conflict judgment threshold of 0.8. Therefore, "purchase duration becomes 5 days" is marked as a critical condition and added to the critical condition set.
[0106] For the identified critical condition "purchase duration changed to 5 days", we extracted the keyword sets for this condition and the original query condition. The original query keyword set was {purchase, 30 days, electronic products, quality issues, return}, and the critical condition keyword set was {purchase, 5 days, electronic products, quality issues, return}. Calculating the edit distance between the two sets revealed that only one keyword, "30 days" changed to "5 days", resulting in a lexical distance value of 0.2, indicating that only 20% of the vocabulary changed.
[0107] Simultaneously, a pre-trained semantic encoding model is invoked to convert the query conditions into semantic vector representations. This model adopts the Sentence-BERT architecture and outputs a 768-dimensional vector, which is simplified to a 4-dimensional vector for ease of explanation. The semantic vector of the original query condition is [0.68, 0.42, 0.55, 0.31], and the semantic vector of the critical condition is [0.66, 0.40, 0.54, 0.30]. The cosine similarity between the two vectors is calculated, which is the dot product of the two vectors divided by the product of their respective magnitudes. The dot product is 0.68×0.66+0.42×0.40+0.55×0.54+0.31×0.30, which is approximately equal to 0.88. The cosine distance is 1 minus the cosine similarity, resulting in a semantic distance value of 0.12, indicating that the two conditions are very close in semantic space.
[0108] Furthermore, the two conditions are converted into logical expressions and represented using a semantic frame. The original query can be represented as: [Query: Return Request] - [Object: Electronic Product] - [Time Condition: 30 days after purchase] - [Reason: Quality Issue] - [Expected Result: Return]. The critical condition is represented as: [Query: Return Request] - [Object: Electronic Product] - [Time Condition: 5 days after purchase] - [Reason: Quality Issue] - [Expected Result: Return]. By comparing the slot differences in the semantic frame, it was found that one of the five slots changed, and the calculated logical distance was 0.2, indicating a 20% difference in the logical structure.
[0109] A weighted fusion method was used to calculate the overall semantic distance, with a lexical distance weight of 0.3, a semantic distance weight of 0.4, and a logical distance weight of 0.3. The three distances were then summed using a weighted average: 0.3 × 0.2 + 0.4 × 0.12 + 0.3 × 0.2 = 0.06 + 0.048 + 0.06 = 0.168. The overall semantic distance between the critical condition "purchase duration changed to 5 days" and the original query condition was found to be 0.168.
[0110] Similarly, for the other critical condition, "the problem type changes to receiving damaged goods," the calculated lexical distance is 0.2, the semantic distance is 0.25, the logical distance is 0.4, and the overall semantic distance is 0.265, indicating that the change in problem type has a greater impact on the original query than the change in purchase duration. Through the above process, the critical condition set {purchase duration changes to 5 days, problem type changes to receiving damaged goods} and its corresponding semantic distance values {0.168, 0.265} were successfully identified. These critical conditions represent the boundary cases of the original query conditions. When the query conditions cross these boundaries, the inference results will change significantly or the logic will be reversed, for example, the return policy changes from "not supported" to "supported."
[0111] This invention reveals the sensitive parameters and thresholds of query conditions, providing users with a more comprehensive understanding of knowledge boundaries and offering quantitative indicators for robustness assessment. In practical applications, this method can be used in various fields such as autonomous driving decision boundary analysis, medical diagnostic risk assessment, and financial risk control threshold determination, helping users better understand the boundary conditions and risk points of knowledge application.
[0112] In one optional implementation, the steps of extracting the applicable premises implicit in the initial response, encoding the applicable premises and the set of critical conditions into a structured constraint expression, wherein the structured constraint expression includes the applicable condition range and the failure boundary conditions; and converting the applicable condition range and the failure boundary conditions into natural language form and incorporating them into the initial response to form the basic reconstruction response include:
[0113] The initial response is logically parsed to extract the implicit preconditions upon which the conclusion depends, and the parameter constraints and category constraints in the implicit preconditions are identified as applicable preconditions; a constraint dependency graph is constructed, with the applicable preconditions as nodes and the logical dependencies between applicable preconditions as edges to form a hierarchical structure; independent preconditions and composite preconditions are identified based on the constraint dependency graph;
[0114] The independent premises and the composite premises are semantically aligned with the set of critical conditions, and critical conditions with semantic overlap are identified as boundary conflict conditions. For each boundary conflict condition, the corresponding parameter constraint range is extracted as the applicable condition range, and the parameter replacement value of the boundary conflict condition is extracted as the failure boundary condition. A structured constraint expression is constructed, and predicate logic is used to connect the applicable condition range and the failure boundary condition through a negation operator to form a complementary relationship.
[0115] The applicable conditions are converted into restrictive modifier phrases, and the failure boundary conditions are converted into exclusionary explanatory statements. Semantically relevant insertion sites are identified in the initial response, and the restrictive modifier phrases and exclusionary explanatory statements are inserted into the insertion sites to form a basic reconstructed response.
[0116] For example, upon receiving the initial response, the logic parsing module is activated to perform deep semantic analysis on the response text. The logic parsing module employs a dependency parsing tree-based reasoning chain extraction algorithm to decompose the initial response into multiple atomic propositions, identifying causal, conditional, and implication relationships between them. By identifying linguistic features such as conditional conjunctions, hypothesis markers, and restrictive adverbs, the parsing module locates the preconditions necessary for the conclusion to hold but not explicitly stated in the response text. Taking the initial response "Exceeding the 7-day no-reason return period requires a quality issue repair process and returns are not supported" as an example, the explicit condition is identified as "Exceeding the 7-day no-reason return period." Through semantic reasoning, implicit preconditions are identified, including "The purchased product is an electronic product," "The problem type is a quality issue rather than damage," and "The purchase channel is a legitimate sales channel." Each implicit precondition is further categorized: conditions involving numerical ranges are marked as parameter constraints, such as "Purchase duration exceeding 7 days" being a time parameter constraint; conditions involving discrete values are marked as category constraints, such as "The product type is an electronic product" being a category constraint. For each constraint, extract the parameter name, constraint type, constraint value, and constraint relationship to form a structured representation of applicable premises. The constraint relationships for parameter constraints include greater than, less than, equal to, and between, while the constraint relationships for category constraints include belonging to, not belonging to, and containing.
[0117] A constraint dependency graph is constructed to express the logical dependencies between applicable premises. The constraint dependency graph adopts a directed acyclic graph structure, where each node represents an applicable premise and includes attributes such as the semantic representation of the premise, constraint type, and parameter range. Directed edges between nodes represent logical dependencies; if premise A requires premise B to be true first, then a path points from node B to node A. Edge connections are determined by analyzing the logical implication and temporal relationships of the applicable premises. For the premise "purchase duration exceeds 7 days," its validity requires the more fundamental premise "purchase behavior exists," therefore, a directed edge is established in the graph from "purchase behavior exists" to "purchase duration exceeds 7 days." The constraint dependency graph is topologically sorted, identifying nodes with an in-degree of zero as independent premises and nodes with an in-degree greater than zero as composite premises. Independent premises can be determined independently without relying on other premises, such as "purchase channel is a legitimate sales channel." Determining composite premises requires combining multiple independent premises or other composite premises, such as "exceeding the no-reason return period and the problem type is a quality problem," which requires both time and problem type conditions to be met simultaneously. For each composite premise, label the set of premise nodes it depends on, and record the logical relationship as one of AND, OR, NOT or a combination thereof.
[0118] The identified applicable prerequisites and critical conditions are semantically aligned. A two-layer matching strategy is employed: the first layer matches parameter names, identifying parameters pointing to the same entity through string similarity and a thesaurus; the second layer matches parameter value ranges, determining whether the critical condition's value overlaps with or touches the boundary of the applicable prerequisite's constraint range. For the applicable prerequisite "purchase duration exceeds 7 days" and the critical condition "purchase duration becomes 5 days," both involve the same parameter "purchase duration," and the critical condition's value of 5 days semantically overlaps with the applicable prerequisite's constraint boundary of 7 days. Therefore, this critical condition is marked as a boundary conflict condition. The semantic overlap between the boundary conflict condition and the applicable prerequisite is calculated, defined as the intersection of their parameter value ranges divided by their union. A significant semantic overlap is considered to exist when the overlap is greater than 0.3. For categorical constraints, overlap is determined through semantic vector similarity. A boundary conflict is marked when the cosine similarity between the critical condition's categorical value and the applicable prerequisite's categorical constraint in the semantic space is greater than 0.7. For each boundary conflict condition, record its corresponding applicable prerequisite node and establish a mapping relationship between conflict conditions and prerequisites.
[0119] For each boundary conflict condition, the parameter constraint range of its corresponding applicable premise is extracted as the applicable condition range. For the applicable premise "purchase duration exceeds 7 days", the parameter name is extracted as "purchase duration", the constraint relationship is "greater than", and the constraint value is "7 days". This triple is encoded as the applicable condition range. Simultaneously, the parameter replacement value in the boundary conflict condition is extracted as the failure boundary condition. For the critical condition "purchase duration becomes 5 days", the parameter name is extracted as "purchase duration", and the value is "5 days". This binary tuple is encoded as the failure boundary condition. The applicable condition range and the failure boundary condition are checked to ensure they are complementary; that is, the value of the failure boundary condition should fall within the complement region of the applicable condition range. For "purchase duration greater than 7 days" and "purchase duration equal to 5 days", since 5 days is less than 7 days, they are complementary. Conditions that do not satisfy the complementary relationship are adjusted by expanding the applicable condition range or modifying the value of the failure boundary condition to ensure that they form a logically contradictory or mutually exclusive relationship.
[0120] Construct structured constraint expressions, using predicate logic to represent the relationship between the applicable condition range and the failure boundary condition. Structured constraint expressions include predicate symbols, parameter variables, constraint operators, and logical connectors. For the applicable condition range "purchase duration greater than 7 days," it is represented as the predicate "purchase duration greater than 7 days is true." For the failure boundary condition "purchase duration equal to 5 days," it is represented as the predicate "purchase duration equal to 5 days is true." Connecting the two predicates with a negation operator forms the constraint expression "the conclusion is valid if and only if purchase duration greater than 7 days is true and purchase duration equal to 5 days is false." This expression indicates that the conclusion is true when purchase duration is greater than 7 days and not equal to 5 days. For scenarios with multiple conflicting boundary conditions, construct compound constraint expressions, using logical OR to combine multiple failure boundary conditions and logical AND to combine multiple applicable condition ranges. For cases with complex logical dependencies, introduce nested predicates and quantifiers, such as a universal quantifier indicating that all parameters must satisfy the constraint, and an existential quantifier indicating that at least one parameter satisfies the constraint. Assign a unique identifier to each structured constraint expression, record its corresponding applicable prerequisite nodes and boundary conflict conditions, and establish the association between the expression and the reasoning path of the knowledge base.
[0121] The natural language generation module is activated to convert the applicable conditions into restrictive modifier phrases. These restrictive modifier phrases, in the form of noun phrases or prepositional phrases, are inserted before the subject or predicate of the initial response to define the scope of application. For the applicable condition "purchase duration greater than 7 days," the restrictive modifier phrases "for goods purchased more than 7 days ago" or "after 7 days of purchase" are generated. The appropriate phrase form is selected based on the sentence structure of the initial response to ensure the sentence is fluent and semantically accurate after insertion. A template-based generation strategy is used to predefine phrase templates for different types of parameter constraints. For example, time-related parameters use the templates "within X time period" or "exceeding X time period," distance-related parameters use the templates "within X range" or "above X distance," and category-related parameters use the templates "for type X" or "belonging to X." Specific constraint values are then filled into the templates through parameter substitution to generate the final restrictive modifier phrases.
[0122] The failure boundary conditions are converted into exclusionary statements. These statements are complete sentences that explicitly state under what conditions the initial response's conclusion no longer holds. For the failure boundary condition "purchase duration equals 5 days," the exclusionary statement "if the purchase duration is 5 days or less, a return can be requested" is generated. An opposing conclusion is generated based on the semantic reversal of the failure boundary condition, and a new conclusion under the failure boundary condition is obtained by calling the knowledge base reasoning module. Exclusionary statements are organized using conjunctions or conditional sentence structures, such as words like "however," "but," "if," and "when" to mark conditional transformations. Emphasis markers are added to the exclusionary statements, such as using guiding words like "note" and "special notes" to increase user attention to the boundary conditions. For scenarios containing multiple failure boundary conditions, parallel or progressive exclusionary statements are generated, using commas, semicolons, or conjunctions to connect multiple condition items.
[0123] The insertion site identification algorithm, based on dependency parsing and semantic role labeling, locates the words or phrases with the highest semantic relevance to applicable conditions or invalidation boundary conditions. It prioritizes subject-verb-object components expressing the core conclusion in the initial response as candidate insertion sites, calculates the semantic similarity between these candidate sites and restrictive modifier phrases or exclusionary explanatory statements, and selects the site with the highest similarity as the final insertion site. For restrictive modifier phrases, they are typically inserted before the subject or predicate, forming relative or adverbial clauses. For exclusionary explanatory statements, they are typically inserted at the end of the sentence or paragraph in the initial response as supplementary or contrasting explanations. Punctuation and conjunctions are adjusted during insertion to ensure grammatical correctness and semantic coherence of the inserted text. The quality of the inserted text is evaluated using a language fluency scoring module. The fluency score calculates the perplexity of the text based on a pre-trained language model. If the perplexity is below a preset threshold, the insertion result is accepted; otherwise, the insertion site is adjusted or the expression of the inserted content is modified.
[0124] Finally, restrictive modifier phrases and exclusionary statements are inserted into the identified insertion points to form the basic reconstructed response. Taking the initial response "For electronic products purchased more than 7 days ago, the no-reason return period is exceeded, and a quality issue repair process is required; returns are not supported" as an example, the restrictive modifier phrase "For electronic products purchased more than 7 days ago" is inserted before the subject, and the exclusionary statement "However, if the purchase time is within 7 days or the problem type is 'received damaged goods,' a return and refund can be applied for" is inserted at the end of the sentence, generating the basic reconstructed response "For electronic products purchased more than 7 days ago, the no-reason return period is exceeded, and a quality issue repair process is required; returns are not supported. However, if the purchase time is within 7 days or the problem type is 'received damaged goods,' a return and refund can be applied for." Post-processing of the basic reconstructed response includes removing redundant words, merging adjacent synonymous expressions, and adjusting sentence structure to improve readability. Text compression algorithms are used to remove modifiers and conjunctions that do not affect semantic integrity, and long sentences are split into multiple short sentences or simplified using parallel structures. The readability score module calculates the readability index of the reconstructed response, which comprehensively considers factors such as sentence length, vocabulary difficulty, and sentence complexity. When the readability score falls below a preset threshold, sentence restructuring or vocabulary replacement optimization is triggered. Metadata tags are added to the basic reconstructed response to record the source of inserted restrictive modifier phrases and exclusionary explanatory statements, including the corresponding applicable prerequisite node identifiers, boundary conflict condition identifiers, and structured constraint expression identifiers, providing support for subsequent interpretability analysis and result traceability.
[0125] This invention extracts implicit preconditions from the initial response through logical parsing, constructs a constraint dependency graph to identify independent and composite preconditions, and thus makes implicit constraints explicit. By semantically aligning applicable preconditions with critical conditions, identifying boundary conflict conditions, and constructing structured constraint expressions, the applicable scope and failure boundaries of the answer can be clearly expressed. This constraint expression and natural language conversion mechanism presents complex logical relationships in a user-understandable form, enhancing transparency and interpretability.
[0126] In one optional implementation, the step of adding a conditional sensitivity prompt to the basic reconstruction response when the semantic distance value is less than a preset distance threshold, and then outputting the reconstructed response to the user, includes:
[0127] Obtain the semantic distance value corresponding to each critical condition in the set of critical conditions. When the semantic distance value is less than a preset distance threshold, it is determined to be a highly sensitive critical condition. Count the number and distribution of the highly sensitive critical conditions, calculate the sensitivity level, and trigger an enhanced prompt when the sensitivity level exceeds a preset level threshold.
[0128] For highly sensitive critical conditions that require enhanced prompts, the change range between the parameter replacement value and the original parameter value is calculated, the prompt intensity level is determined based on the change range, and condition-sensitive prompt text is generated. The alert level of the condition-sensitive prompt text is determined by the prompt intensity level.
[0129] The condition-sensitive prompt text is appended to the basic reconstructed response to obtain the reconstructed response, which is then output to the user.
[0130] For example, each critical condition and its corresponding semantic distance value are read from the critical condition set. The critical condition set is stored in key-value pairs, where the key is the text description of the critical condition and the value is the comprehensive semantic distance value between the condition and the original query condition. The set is traversed, and all semantic distance values are extracted and compared with a preset distance threshold. The preset distance threshold is typically set to 0.2, which represents the similarity boundary between the critical condition and the original query condition in the semantic space. When the distance value is less than this threshold, it indicates that the two are highly similar, and even a small change in the condition can lead to a reversal of the inference conclusion. Critical conditions with a semantic distance value less than 0.2 are marked as highly sensitive critical conditions, and these conditions and their distance values are stored in a highly sensitive condition list. For scenarios containing multiple critical conditions, the sensitivity attribute of each condition is determined one by one. Taking the critical condition "purchase duration changed to 5 days" with a semantic distance value of 0.168 as an example, since 0.168 is less than the preset distance threshold of 0.2, this condition is determined to be a highly sensitive critical condition. Taking the critical condition "problem type changes to receiving damaged goods" with a semantic distance value of 0.265 as an example, since 0.265 is greater than 0.2, it is not marked as a highly sensitive critical condition.
[0131] The system counts the number of highly sensitive critical conditions, starting with a counter of zero and incrementing by one for each identified condition. It also records the distribution of each highly sensitive critical condition within the original query conditions. This distribution is represented by the parameter type and its slot number within the query condition's semantic framework. The system analyzes the distribution of parameter types involved in the highly sensitive critical conditions, counting the number of highly sensitive conditions for different parameter types such as time, distance, amount, and category. The sensitivity level is calculated as the number of highly sensitive critical conditions divided by the total number of critical conditions, multiplied by one hundred. For scenarios with two critical conditions, one of which is highly sensitive, the sensitivity level is 1 divided by 2 multiplied by 100, equaling 50. The sensitivity level is compared to a preset threshold, typically set at 40. When the sensitivity level exceeds this threshold, a heightened alert mechanism is triggered. For a sensitivity level of 50, since 50 is greater than 40, a heightened alert is triggered. This heightened alert mechanism includes measures such as increasing the alert intensity of the alert text, prioritizing its display position, and expanding its content coverage.
[0132] For highly sensitive critical conditions requiring enhanced alerts, the parameter replacement value and the original parameter value from the original query conditions are extracted. For the critical condition "purchase duration becomes 5 days," the parameter replacement value is extracted as 5 days, and the original parameter value is extracted as 30 days from the original query condition "can electronic products purchased 30 days ago be returned if there are quality problems?" The magnitude of change between the parameter replacement value and the original parameter value is calculated, defined as the absolute value of the difference between the two divided by the original parameter value. For time parameters, the magnitude of change is the absolute value of 30 days minus 5 days divided by 30 days, which equals 25 divided by 30, approximately equal to 0.83. The alert intensity level is determined based on the magnitude of change, divided into three levels: low intensity (less than 0.3), medium intensity (between 0.3 and 0.6), and high intensity (greater than 0.6). For the scenario with a magnitude of 0.83, the alert intensity level is determined to be high. Predefined prompt text templates for different intensity levels: low intensity templates use mild prompts such as "Please note", medium intensity templates use emphasis prompts such as "Requires special attention", and high intensity templates use warning prompts such as "Important notice" or "Please pay attention".
[0133] Generate a condition sensitivity warning text, which includes three core elements: a warning label, a description of the sensitive parameter, and boundary triggering conditions. The warning label selects corresponding words based on the warning intensity level, using "Important Warning" as the opening for high-intensity levels. The sensitive parameter description clearly indicates which parameter's slight change will lead to a reversal of the conclusion, using the sentence structure "A slight adjustment to parameter X significantly changes the applicable conclusion." The boundary triggering conditions section specifies the critical point for the parameter's value, using the sentence structure "When parameter X changes to near the value of Y, the policy's applicability conditions will change." By replacing parameters with their names, critical values, and magnitudes of change, the complete condition sensitivity warning text is generated. For scenarios where the critical condition "purchase duration changes to 5 days" and the prompt intensity level is high, the generated prompt text is: "Important Notice: Minor adjustments to the purchase duration parameter significantly change the applicable conclusion of the return policy. When the purchase duration changes from 30 days to within 7 days, the applicable conditions of the return policy will change from not supporting returns to supporting returns." The prompt text is optimized for readability by removing redundant words and adjusting sentence structure to improve the clarity and accuracy of information delivery.
[0134] The placement of conditional sensitivity warning text within the basic restructuring response is determined. Three placement strategies are employed: pre-insertion, post-appendation, and embedded insertion. Pre-insertion places the warning text at the beginning of the basic restructuring response, suitable for high-intensity scenarios, ensuring users receive the sensitivity warning information first. Post-appendation places the warning text at the end of the basic restructuring response, suitable for medium or low-intensity scenarios, providing supplementary information to the user. Embedded insertion embeds the warning text into the position within the basic restructuring response most semantically relevant to the sensitive parameters, determining the optimal insertion point through semantic similarity calculation. The placement strategy is automatically selected based on the warning intensity level: pre-insertion for high-intensity levels and post-appendation for medium and low-intensity levels. Punctuation and paragraph structure are adjusted during the placement process to ensure semantic coherence and grammatical correctness between the warning text and the basic restructuring response.
[0135] The conditionally sensitive warning text is appended to the basic reconstructed response to form the reconstructed response output. Taking the basic reconstructed response, "For electronic products purchased more than 7 days ago, exceeding the no-reason return period, a quality issue repair process is required, and returns are not supported. However, if the purchase time is within 7 days or the issue type is 'received damaged goods,' a return and refund can be applied for," as an example, a high-intensity warning text is inserted at the beginning to generate the reconstructed response, "Important Note: Subtle adjustments to the purchase duration parameter significantly change the applicable conclusion of the return policy. When the purchase duration changes from 30 days to within 7 days, the applicable conditions of the return policy will change from not supporting returns to supporting returns. For electronic products purchased more than 7 days ago, exceeding the no-reason return period, a quality issue repair process is required, and returns are not supported. However, if the purchase time is within 7 days or the issue type is 'received damaged goods,' a return and refund can be applied for." The reconstructed response undergoes quality checks, including text length control, semantic integrity verification, readability scoring, and sensitive information coverage detection. Text length control ensures that the reconstructed response does not exceed the preset maximum character limit, typically set at 500 characters. Any excess is handled by compressing redundant expressions or displaying in segments. Semantic integrity verification uses a logical consistency check module to confirm that all statements in the reconstructed response are free from internal contradictions or logical conflicts. Readability scoring employs a perplexity-based evaluation method; if the perplexity is below a preset threshold, the check passes; otherwise, sentence restructuring optimization is triggered. Sensitive information coverage detection confirms that all highly sensitive critical conditions are reflected in the reconstructed response; coverage integrity is verified through keyword matching and semantic similarity calculation.
[0136] If the semantic distance value is not less than a preset distance threshold, the basic reconstructed response is directly output. The output interface supports text and structured data formats. The text format directly returns the string content of the reconstructed response, suitable for conversational interaction scenarios. The structured data format decomposes the reconstructed response into multiple fields, including basic response content, conditional sensitivity prompt text, a list of highly sensitive critical conditions, semantic distance value, prompt strength level, and other metadata, suitable for application scenarios requiring further processing or display. A complete processing log is recorded before output, including the critical condition determination result, sensitivity level calculation value, prompt text generation timestamp, and additional location strategy selection basis, providing data support for performance monitoring and problem diagnosis. A version management mechanism for output content is provided, assigning a unique version identifier to each output, recording the parameter configuration and model status at the time of output, and supporting the traceability and comparative analysis of output results.
[0137] This invention establishes a condition-sensitive hierarchical early warning mechanism. It determines the warning intensity level based on the magnitude of parameter changes and generates corresponding warning text, achieving refined control of risk warnings. This dynamically adjusted condition-sensitive warning strategy can maintain smooth response while specifically highlighting high-risk boundary conditions, helping users understand the applicability limitations of their answers and preventing decision-making risks caused by misuse.
[0138] A second aspect of this invention provides an intelligent customer service dialogue interaction system based on natural language, comprising:
[0139] The first unit is used to obtain the natural language query statement input by the user and generate an initial response based on the multimodal knowledge base.
[0140] The second unit is used to construct a counterexample generation network, identify the condition parameters on which the initial response depends, and perform targeted transformation on each condition parameter. The targeted transformation includes replacing numerical parameters with boundary values and categorical parameters with opposing concepts. Knowledge retrieval and reasoning are re-executed for each transformed condition. When the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition. The semantic distance between the critical condition and the original query condition is calculated to obtain a set of critical conditions and semantic distance values.
[0141] The third unit is used to extract the applicable premises implicit in the initial response, encode the applicable premises and the set of critical conditions into a structured constraint expression, which includes the applicable condition range and the failure boundary condition; convert the applicable condition range and the failure boundary condition into natural language form and integrate them into the initial response to form a basic reconstruction response; when the semantic distance value is less than a preset distance threshold, add a condition sensitivity prompt to the basic reconstruction response, and output the reconstructed response to the user.
[0142] A third aspect of the present invention provides an electronic device, comprising:
[0143] processor;
[0144] Memory used to store processor-executable instructions;
[0145] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0146] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0147] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
Claims
1. A natural language-based intelligent customer service dialogue interaction method, characterized in that, include: Obtain the user's natural language query and generate an initial response based on a multimodal knowledge base; A counterexample generation network is constructed to identify the condition parameters upon which the initial response depends. Each condition parameter undergoes a targeted transformation, including replacing numerical parameters with boundary values and categorical parameters with opposing concepts. Knowledge retrieval and reasoning are re-executed for each transformed condition. When the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition. The semantic distance between the critical condition and the original query condition is calculated to obtain a set of critical conditions and their semantic distance values. Extract the applicable premises implicit in the initial response, encode the applicable premises and the set of critical conditions into a structured constraint expression, the structured constraint expression includes the applicable condition range and the failure boundary condition; convert the applicable condition range and the failure boundary condition into natural language form respectively and integrate them into the initial response to form a basic reconstruction response; when the semantic distance value is less than a preset distance threshold, add a condition sensitivity prompt to the basic reconstruction response, and output the reconstructed response to the user.
2. The method according to claim 1, characterized in that, The steps for obtaining the user's natural language query and generating an initial response based on a multimodal knowledge base include: The natural language query statement is semantically parsed to extract the query intent; knowledge entries matching the query intent are retrieved from a multimodal knowledge base, which contains structured data and unstructured text; and an initial response is generated based on the retrieved knowledge entries.
3. The method according to claim 1, characterized in that, The steps of constructing a counterexample generation network, identifying the conditional parameters on which the initial response depends, and performing directional transformation on each conditional parameter include: A counterexample generation network is constructed, which includes a condition extraction module, a transformation rule base, and an inference verification module. The initial response is subjected to causal dependency analysis by the condition extraction module, and a causal inference graph is constructed. The causal inference graph takes the conclusion of the initial response as the root node, and traces back to extract the preconditions as parent nodes and the upstream conditions as ancestor nodes to form a multi-layer causal chain. The critical path that directly affects the conclusion of the initial response is identified, and the variable parameters on the critical path are extracted as condition parameters. The importance weight is calculated according to the hierarchical depth of the condition parameters in the causal chain, and the set of condition parameters and their corresponding importance weights are output. For each condition parameter in the set of condition parameters, the transformation priority is determined according to its importance weight. The transformation rule base is called to perform adversarial directional transformation, generating multiple candidate transformation values and sorting them from weakest to strongest transformation intensity, thus obtaining the set of transformation conditions and transformation intensity labels.
4. The method according to claim 3, characterized in that, For each condition parameter in the aggregated set of condition parameters, the step of determining the transformation priority based on its importance weight and calling the transformation rule base to perform adversarial directional transformation includes: For numerical conditional parameters, a gradient ascent algorithm is used to iteratively search for boundary values. In each iteration, the value of the conditional parameter is changed, and the multimodal knowledge base is called to re-execute the inference to obtain a confidence score. The gradient of the confidence score with respect to the value of the conditional parameter is calculated, and the value of the conditional parameter is updated along the gradient ascent direction. When the rate of decrease of the confidence score exceeds a preset decrease threshold, the current value of the conditional parameter is recorded as a candidate boundary value. Multiple initial search points are set to perform iterations in parallel, candidate boundary values are collected and sorted according to the rate of decrease of the confidence score, and the top N boundary values with the largest decrease are selected as replacement values. For categorical condition parameters, the semantic vector of the original category is obtained in the pre-trained semantic embedding space. The cosine distance of the candidate categories is calculated by spherical search with the semantic vector of the original category as the center. For each candidate category, a replacement query condition is constructed, and the inference is re-executed by calling the multimodal knowledge base. When the new inference result logically contradicts the conclusion of the initial response, the candidate category is marked. Candidate categories with a cosine distance less than the similarity threshold and marked are selected. The category with the smallest distance is selected as the replacement value by sorting by cosine distance.
5. The method according to claim 3, characterized in that, For each transformed condition, knowledge retrieval and reasoning are re-executed; when the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition; the steps of calculating the semantic distance between the critical condition and the original query condition to obtain the set of critical conditions and the semantic distance value include: For each transformation condition in the set of transformation conditions, according to the transformation intensity label in ascending order, the knowledge retrieval and logical reasoning are re-executed by calling the multimodal knowledge base through the reasoning verification module to generate the transformed reasoning result and its conclusion credibility. The logical consistency of the transformed reasoning result and the conclusion of the initial response is compared. When the two contradict each other and the credibility of the conclusion is higher than the conflict determination threshold, the corresponding transformation condition is marked as a critical condition, forming a set of critical conditions. For each critical condition in the set of critical conditions, the edit distance between the keyword set of the critical condition and the original query condition is calculated as the lexical distance, the cosine distance is calculated as the semantic distance, and the structure difference is calculated as the logical distance after converting the semantic vector representation into a logical expression. The lexical distance, semantic distance and logical distance are weighted and fused to obtain the comprehensive semantic distance value, and the semantic distance value corresponding to each critical condition is obtained.
6. The method according to claim 1, characterized in that, The steps of extracting the implicit applicable premises from the initial response, encoding the applicable premises and the set of critical conditions into a structured constraint expression, wherein the structured constraint expression includes the applicable condition range and the failure boundary conditions; and converting the applicable condition range and the failure boundary conditions into natural language form and incorporating them into the initial response to form the basic reconstructed response include: The initial response is logically parsed to extract the implicit preconditions upon which the conclusion depends, and the parameter constraints and category constraints in the implicit preconditions are identified as applicable preconditions; a constraint dependency graph is constructed, with the applicable preconditions as nodes and the logical dependencies between applicable preconditions as edges to form a hierarchical structure; independent preconditions and composite preconditions are identified based on the constraint dependency graph; The independent premises and the composite premises are semantically aligned with the set of critical conditions, and critical conditions with semantic overlap are identified as boundary conflict conditions. For each boundary conflict condition, the corresponding parameter constraint range is extracted as the applicable condition range, and the parameter replacement value of the boundary conflict condition is extracted as the failure boundary condition. A structured constraint expression is constructed, and predicate logic is used to connect the applicable condition range and the failure boundary condition through a negation operator to form a complementary relationship. The applicable conditions are converted into restrictive modifier phrases, and the failure boundary conditions are converted into exclusionary explanatory statements. Semantically relevant insertion sites are identified in the initial response, and the restrictive modifier phrases and exclusionary explanatory statements are inserted into the insertion sites to form a basic reconstructed response.
7. The method according to claim 1, characterized in that, When the semantic distance value is less than a preset distance threshold, a conditional sensitivity prompt is added to the basic reconstruction response, and the reconstructed response is output to the user. The steps include: Obtain the semantic distance value corresponding to each critical condition in the set of critical conditions. When the semantic distance value is less than a preset distance threshold, it is determined to be a highly sensitive critical condition. Count the number and distribution of the highly sensitive critical conditions, calculate the sensitivity level, and trigger an enhanced prompt when the sensitivity level exceeds a preset level threshold. For highly sensitive critical conditions that require enhanced prompts, the change range between the parameter replacement value and the original parameter value is calculated, the prompt intensity level is determined based on the change range, and condition-sensitive prompt text is generated. The alert level of the condition-sensitive prompt text is determined by the prompt intensity level. The condition-sensitive prompt text is appended to the basic reconstructed response to obtain the reconstructed response, which is then output to the user.
8. A natural language-based intelligent customer service dialogue interaction system, used to implement the method of any one of claims 1-7, characterized in that, include: The first unit is used to obtain the natural language query statement input by the user and generate an initial response based on the multimodal knowledge base. The second unit is used to construct a counterexample generation network, identify the condition parameters on which the initial response depends, and perform targeted transformation on each condition parameter. The targeted transformation includes replacing numerical parameters with boundary values and categorical parameters with opposing concepts. Knowledge retrieval and reasoning are re-executed for each transformed condition. When the transformed reasoning result logically conflicts with the conclusion of the initial response, the transformed condition is marked as a critical condition. The semantic distance between the critical condition and the original query condition is calculated to obtain a set of critical conditions and semantic distance values. The third unit is used to extract the applicable premises implicit in the initial response, encode the applicable premises and the set of critical conditions into a structured constraint expression, which includes the applicable condition range and the failure boundary condition; convert the applicable condition range and the failure boundary condition into natural language form and integrate them into the initial response to form a basic reconstruction response; when the semantic distance value is less than a preset distance threshold, add a condition sensitivity prompt to the basic reconstruction response, and output the reconstructed response to the user.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.