Thought chain text generation method and device, equipment, medium and program product

CN122927243APending Publication Date: 2026-10-16INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610907561.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-23
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]然而,当前思维链文本的构建方式存在明显局限:一方面,人工构建成本高、耗时长,难以规模化,且规则表达受限,无法高效处理复杂条件逻辑;另一方面,大模型自生成的思维链逻辑一致性难以保障,幻觉问题导致推理错误率居高不下

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927243A_ABST
    Figure CN122927243A_ABST
Patent Text Reader

Abstract

The application provides a thinking chain text generation method and device, equipment, medium and program product, which can be applied to the fields of artificial intelligence and big data technology. The method comprises the following steps: in response to receiving a service request, determining a thinking chain generation template matched with the service request, the thinking chain generation template comprising a symbolic logic expression converted from a natural language clause in a system document; substituting instance data corresponding to the service request into the symbolic logic expression to obtain a deduction dependency relationship between each sub-expression under the constraint of the symbolic logic expression, and generating a thinking chain reasoning path, wherein the thinking chain reasoning path is stored in a data structure of a directed acyclic graph, and at least comprises a condition evaluation result, an intermediate conclusion and a corresponding reference clause identifier; based on the directed acyclic graph, the symbolic logic expression in the node is semantically encoded and spliced in topological order to obtain a thinking chain text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence and big data technology, and more specifically to a method, apparatus, device, medium and program product for generating thought chain text. Background Technology

[0002] As a core element supporting the reasoning process of large models, the quality of thought chain data directly determines the logic and accuracy of large models in handling complex tasks.

[0003] However, current methods for constructing thought chain texts have significant limitations: on the one hand, manual construction is costly and time-consuming, difficult to scale, and the expression of rules is limited, making it unable to efficiently handle complex conditional logic; on the other hand, the consistency of thought chain logic generated by large models is difficult to guarantee, and the illusion problem leads to a high reasoning error rate. In addition, existing solutions lack a mechanism for linking with original institutional provisions, making it impossible to trace and audit the reasoning steps, and making it difficult to meet compliance requirements in scenarios such as financial regulation.

[0004] Therefore, there is an urgent need to provide a method for generating thought chain text, which can generate high-quality thought chain data at low cost and on a large scale, and supports logical traceability and compliance auditing. Summary of the Invention

[0005] In view of the above problems, embodiments of this application provide a method, apparatus, device, medium, and program product for generating thought chain text.

[0006] According to a first aspect of this application, a method for generating thought chain text is provided, comprising: in response to receiving a business request, determining a thought chain generation template matching the business request, the thought chain generation template including symbolic logic expressions obtained by converting natural language clauses in a policy document; substituting instance data corresponding to the business request into the symbolic logic expressions to obtain the derivation dependencies between sub-expressions under the constraints of the symbolic logic expressions, and generating a thought chain reasoning path, wherein the thought chain reasoning path is stored using a directed acyclic graph data structure, including at least condition evaluation results, intermediate conclusions, and corresponding reference clause identifiers; and based on the directed acyclic graph, semantically encoding the symbolic logic expressions in the nodes and concatenating them according to topological order to obtain the thought chain text.

[0007] According to an embodiment of this application, the symbolic logic expression is obtained in the following manner: based on the semantic parsing results of the natural language clauses in the regulatory document, a conditional conclusion logic tree is obtained; the conditional conclusion logic tree is converted into a first symbolic logic expression, wherein the leaf nodes of the conditional conclusion logic tree represent the judgment conclusions, and the non-leaf nodes represent the judgment conditions; the first symbolic logic expression is subjected to semantic back-translation verification to obtain a second symbolic logic expression, wherein the semantic back-translation verification is used to verify the semantic consistency between the first symbolic logic expression and the natural language clauses; the second symbolic logic expression is subjected to bidirectional verification by forward reasoning and backward reasoning to obtain the symbolic logic expression.

[0008] According to an embodiment of this application, performing semantic back-translation verification on a first symbolic logical expression to obtain a second symbolic logical expression includes: back-translating the first symbolic logical expression into verification text using a natural language generation model; calculating a semantic consistency score between the verification text and the natural language clause, the semantic consistency score being used to characterize the accuracy of the verification text in semantically reproducing the natural language clause; in response to a semantic consistency score lower than a preset threshold, correcting the first symbolic logical expression based on the differences between the verification text and the natural language clause; and using the corrected first symbolic logical expression as the second symbolic logical expression.

[0009] According to embodiments of this application, before performing bidirectional verification of the second symbolic logic expression through forward and backward reasoning, the method further includes: obtaining symbolic logic expressions from multiple institutional documents, wherein the symbolic logic expressions include the second symbolic logic expression extracted from the current institutional document and candidate premise expressions extracted from other institutional documents; obtaining the conditional concepts involved in the judgment conditions and the conclusion concepts involved in the judgment conclusions in the symbolic logic expressions; generating a directed dependency graph using the symbolic logic expressions as nodes and the directed relationship where the conclusion concept contains the conditional concept of another symbolic logic expression as edges; calculating the dependency confidence of each directed edge in the directed dependency graph, wherein the dependency confidence is determined based on concept similarity and rule logic depth, wherein the rule logic depth refers to the number of nesting levels of the conclusion concept in the symbolic logic expression; filtering directed edges that meet a preset threshold based on the dependency confidence, and determining the reachable paths in the directed dependency graph to the corresponding nodes of the second symbolic logic expression; and logically fusing the candidate premise expressions on the reachable paths with the second symbolic logic expression to generate the completed second symbolic logic expression.

[0010] According to an embodiment of this application, before filtering directed edges that meet a preset threshold based on dependency confidence, the process includes: performing node reachability analysis on the directed dependency graph to determine at least one strongly connected component in the directed dependency graph; for each strongly connected component, calculating the disruption cost of each node within the strongly connected component, wherein the disruption cost is determined based on the priority of the policy document and the dependency confidence; and removing all outgoing edges corresponding to the node with the smallest disruption cost within the strongly connected component in the directed dependency graph.

[0011] According to an embodiment of this application, before performing bidirectional verification of the second symbolic logical expression using forward and reverse reasoning, the method includes: comparing the condition branches in the second symbolic logical expression pair by pair to identify contradictory condition branch pairs with logical conflicts, wherein a contradictory condition branch pair refers to two condition branches that derive opposite conclusions under the same or inclusive conditions; in response to identifying a contradictory condition branch pair, calculating the retention priority of each condition branch in the contradictory condition branch pair, wherein the retention priority is determined based on the granularity of the condition branch and the priority of the policy document, wherein the granularity of the condition branch is determined according to the number of sub-conditions of the condition branch; and removing condition branches with low retention priority from the second symbolic logical expression.

[0012] According to embodiments of this application, the method further includes: obtaining the reference clause identifier in the thought chain text;

[0013] Based on the referenced clause identifier, the system version evolution graph is queried to determine the effective status of the system clause corresponding to the referenced clause identifier; the system version evolution graph is used to record the evolution relationship and effective status between different versions of system clauses; in response to the repeal of system clauses, the repealed clauses in the symbolic logical expression are replaced with the corresponding latest effective clauses according to the evolution relationship in the system version evolution graph.

[0014] According to a second aspect of this application, a mind chain text generation apparatus is provided, comprising: a mind chain generation template matching module, configured to, in response to receiving a business request, determine a mind chain generation template matching the business request, the mind chain generation template including symbolic logic expressions obtained by converting natural language clauses in a policy document; a mind chain reasoning path generation module, configured to substitute instance data corresponding to the business request into the symbolic logic expressions to obtain the derivation dependencies between sub-expressions under the constraints of the symbolic logic expressions, and generate a mind chain reasoning path, wherein the mind chain reasoning path is stored using a directed acyclic graph data structure, including at least condition evaluation results, intermediate conclusions, and corresponding reference clause identifiers; and a mind chain text generation module, configured to, based on the directed acyclic graph, semantically encode the symbolic logic expressions in the nodes and concatenate them according to topological order to obtain the mind chain text.

[0015] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0016] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

[0017] According to a fifth aspect of this application, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description

[0018] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0019] Figure 1 The illustrations depict application scenarios of the thought chain text generation method, apparatus, device, medium, and program product according to embodiments of this application.

[0020] Figure 2 A flowchart illustrating a thought chain text generation method according to an embodiment of this application is shown schematically.

[0021] Figure 3 A flowchart illustrating the process of obtaining symbolic logical expressions according to an embodiment of this application is shown.

[0022] Figure 4 A flowchart illustrating semantic back-translation verification according to an embodiment of this application is shown schematically;

[0023] Figure 5 A flowchart illustrating expression completion according to an embodiment of this application is shown schematically;

[0024] Figure 6 A flowchart illustrating contradictory branch processing according to an embodiment of this application is shown schematically;

[0025] Figure 7 This schematic diagram illustrates the structural block diagram of a mind chain text generation apparatus according to an embodiment of this application;

[0026] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing a mind chain text generation method according to an embodiment of this application. Detailed Implementation

[0027] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0029] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0030] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0031] In one or more embodiments described herein, the term "large model" can refer to a deep learning model with a large number of model parameters, which can include hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. Large models can also be called foundational models or basic models. They are pre-trained using large-scale unlabeled corpora to produce pre-trained models with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability, such as large language models and multimodal pre-trained models. It should be understood that in practical applications, large models only require a small number of samples to fine-tune the pre-trained model before being applied to different tasks. Large models can be widely used in natural language processing, computer vision, and other fields. Specifically, they can be applied to computer vision tasks such as visual question answering, image captioning, and image generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. Major application scenarios for large models can include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.

[0032] Figure 1 The illustrations depict application scenarios of the thought chain text generation method, apparatus, device, medium, and program product according to embodiments of this application. For example... Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send information, etc.

[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal devices. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, and it can include, but is not limited to, applications, mini-programs, etc., installed on the terminal devices, and can also be in the form of web pages.

[0034] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and basic cloud computing services such as big data. The server can be the backend server of the aforementioned target application, used to provide backend services to the clients of the target application.

[0035] It should be noted that the thought chain text generation method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-103. Accordingly, the thought chain text generation device provided in this application embodiment can generally be set in server 105 and / or terminal devices 101-103.

[0036] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0037] Figure 2 A flowchart illustrating a thought chain text generation method according to an embodiment of this application is shown. Figure 2 As shown, the thought chain text generation method 200 according to the embodiments of this application may include steps S210 to S230.

[0038] In step S210, in response to receiving a business request, a thought chain generation template matching the business request is determined.

[0039] In embodiments of this application, the mind chain generation template includes symbolic logic expressions obtained by converting natural language clauses in institutional documents.

[0040] Institutional documents can refer to authoritative and standardized official rule documents, including natural language documents such as corporate compliance systems, internal regulations, and operation manuals. Business requests can be user-initiated instructions that require logical reasoning and judgment on a target entity (such as a company or individual) based on specific institutional documents. For example, according to the "Administrative Measures for Enterprise Credit Granting Business," determine whether Company A meets the credit requirements or determine Company A's credit limit.

[0041] Symbolic logic expressions use semantic parsing to transform the conditions, conclusions, and inherent logical relationships of natural language clauses within institutional documents, ultimately mapping various institutional clauses into IF-THEN-ELSE structures (e.g., using first-order predicate logic). This expression contains at least three basic elements: condition variables, logical operators, and conclusion variables. Condition variables represent the premises upon which the reasoning depends, such as age > 60 years old; logical operators include AND, OR, NOT, and nested combinations, used to express complex relationships between multiple conditions; and conclusion variables represent the judgment result derived from the condition variables, such as meeting the creditworthiness condition.

[0042] A thought chain generation template can refer to a pre-built, structured framework adapted to different business scenarios to guide the reasoning process. This template contains symbolic logic expressions derived from natural language clauses in policy documents. In these expressions, condition variables and conclusion variables can be placed as placeholders to indicate the specific locations where instance data to be populated should be placed.

[0043] For example, the structure of the mind chain generation template can be configured as follows:

[0044] Template number: T001.

[0045] Business scenario: Corporate credit granting business.

[0046] Logical expression:

[0047] IF({establishment time}≥2 years)AND({tax rating}IN[A,B])AND({credit history}!=bad)AND({application amount}≤{last year's tax amount}×3)THEN({approved, amount = last year's tax amount×2.5})ELSE({supplementary guarantee required or rejected}).

[0048] Reference clause: Article 5 of the "Administrative Measures for Enterprise Credit Granting Business".

[0049] Effective date: 2026-01-01.

[0050] Repeal date: 2026-12-31.

[0051] Priority: P0.

[0052] Source document ID: 0001.

[0053] Specifically, a fixed priority level (e.g., P0, P1, P2, P4, with lower values ​​indicating higher priority) can be assigned to the mind chain generation templates based on the authority of the policy documents themselves (e.g., mandatory clauses > company policies > departmental regulations > operational guidelines). When multiple mind chain generation templates match the current business scenario, the template with the highest priority is selected for execution.

[0054] For example, a mapping table between a business scenario and a corresponding thought chain generation template can be created in advance. In a one-to-many manner, a business scenario can be associated with multiple thought chain generation templates. When a business request is received, the business type field in the request message header is parsed, or the corresponding business scenario is obtained by analyzing the request content. Then, the mapping table is retrieved based on the business scenario to determine the template number. Subsequently, the corresponding thought chain generation template is read from the distributed storage system and deserialized based on the template number, thereby ensuring that the thought chain text generated based on the template complies with the institutional and regulatory requirements of the business scenario in terms of logical structure and reference clauses.

[0055] In step S220, the instance data corresponding to the business request is substituted into the symbolic logic expression to obtain the derivation dependency relationship between each sub-expression under the constraint of the symbolic logic expression, and to generate the thought chain reasoning path.

[0056] In the embodiments of this application, the reasoning path of the thought chain is stored using a Directed Acyclic Graph (DAG) data structure, which includes at least the condition evaluation results, intermediate conclusions, and corresponding reference clause identifiers.

[0057] For example, based on a business request, a query statement can be constructed using the unique identifier of the target entity carried in the request to retrieve instance data bound to that entity from heterogeneous data sources (such as business databases and file systems). For instance, in a corporate credit granting scenario, instance data may include information such as the company's establishment year, tax level, and tax amount. Then, all condition variables participating in the logical judgment within the symbolic logic expression are retrieved. Next, field matching is performed on the retrieved instance data based on the condition variables to locate the business fields corresponding to each condition variable and read the actual values ​​of the fields. Afterward, these values ​​are substituted into the condition variable placeholders in the symbolic logic expression, and logical operations are performed. On this basis, a thought chain reasoning path with a DAG as the underlying data structure can be constructed. In this DAG, each node corresponds to a sub-expression, intermediate conclusion, or condition evaluation result, and is labeled with the referenced institutional clauses. Directed edges represent the data flow and logical sequence relationship between sub-expressions, thus forming a complete logical evolution trajectory from the original input to the final condition evaluation result. By using a DAG structure to store the reasoning path, the dependencies of reasoning can be clearly displayed, supporting the tracing and reuse of intermediate conclusions.

[0058] In step S230, based on the directed acyclic graph, the symbolic logical expressions in the nodes are semantically encoded and concatenated in topological order to obtain the thought chain text.

[0059] In embodiments of this application, semantic encoding can refer to the encoding process of converting machine-readable symbolic logical expressions into standardized natural language statements, thereby realizing the conversion from machine logic to readable text. Topological order can refer to the node access sequence obtained after topologically sorting a DAG, ensuring that each node is visited after all its predecessor nodes.

[0060] For example, a depth-first search algorithm can be used to traverse a Directed Acyclic Graph (DAG) to obtain a node access sequence, such as [A, B, C, D]. Based on this, semantic encoding is performed on each node in the sequence, converting it into a corresponding natural language statement. Subsequently, these statements are concatenated according to the order of the nodes in the original sequence to form a linearized sequence. This sequence constitutes the thought chain text for the reasoning process oriented towards the target entity. This thought chain text may further include citation markers to trace the source of the citations.

[0061] For example, steps S220 and S230 can be performed by a large language model. The large model generates a template based on the matched thought chain, substitutes the instance data into the condition variables of the symbolic logical expression in the template; then, it performs multi-step progressive logical reasoning and generates a complete thought chain text containing intermediate derivation paths and the final evaluation result.

[0062] Optionally, for each business scenario, multiple sets of synonymous expressions can be maintained for reasoning actions such as condition judgment, clause reference, and risk assessment. For example, the condition satisfaction class can be configured with expressions such as: "{condition description} meets the requirements", "{condition description} meets the admission criteria", "After verification, the situation of {condition description} is true", etc., to cover different expression habits. Based on this, a natural language expression template library can be built, with each template corresponding to one of the above multiple sets of synonymous expressions. When generating the thought chain text, the appropriate natural language expression template is first determined based on the profile information of the target user initiating the business request (such as user role, historical interaction preferences, etc.). Subsequently, the instantiated symbolic logic expressions in the thought chain reasoning path are filled into the variable placeholders in the natural language expression template, dynamically generating the thought chain text adapted to the target user. In this way, the logic layer and the language layer can be decoupled: the logic layer is responsible for generating structured reasoning paths to ensure the rigor and computability of rule expression; the language layer converts the results of the logic layer into easily understandable natural language text through natural language expression templates. The loose coupling between the two layers ensures that language layer adjustments (such as terminology replacement, sentence optimization, or multilingual adaptation) do not interfere with the logic layer, thereby improving the maintainability and scalability of the system.

[0063] Optionally, after generating the thought chain text, each thought chain text can be labeled with complete metadata such as source template ID, applicable scenario, effective date range, and version status to ensure traceability throughout the entire chain.

[0064] According to embodiments of this application, by performing structured parsing of natural language clauses in institutional documents and converting them into symbolic logic expressions, the automated parsing and formal representation of institutional rules can be achieved quickly and accurately, thereby significantly reducing manual construction costs and improving the efficiency of thought chain generation. Simultaneously, by constructing a DAG-like reasoning path using instance data and ultimately outputting the thought chain text in natural language form, the dependencies of each derivation step can be accurately recorded using a directed acyclic graph, ensuring the traceability of the entire reasoning logic chain.

[0065] Figure 3 A flowchart illustrating the process of obtaining symbolic logical expressions according to an embodiment of this application is shown.

[0066] like Figure 3 As shown, the method 300 of this embodiment includes steps S310 to S340.

[0067] In step S310, based on the semantic parsing results of the natural language clauses in the policy document, a conditional conclusion logic tree is obtained.

[0068] In the embodiments of this application, the leaf nodes of the conditional conclusion logic tree represent the judgment conclusion, and the non-leaf nodes represent the judgment conditions.

[0069] For example, firstly, the natural language clauses in the policy document undergo word segmentation, part-of-speech tagging, syntactic analysis, and logical connector identification. Specifically, a domain-specific named entity recognition model can be used to identify entity units in the continuous text of the natural language clauses, such as company names, amounts, and proportions. A part-of-speech tagging model can be used to tag each word according to its context, such as nouns, verbs, and conjunctions. A dependency parsing model can also be used to analyze the syntactic dependencies between components in the natural language clauses, identifying subjects, predicates, objects, and modifiers, thereby determining the core semantic structure of the clauses. Furthermore, the identification of logical connectors can be achieved by matching a predefined logical relation lexicon and its variants. This lexicon may include common logical connector forms such as "if…then…", "and", "or", and "unless," to extract logical structure keywords from the natural language clauses. Based on this, a condition-conclusion logic tree is constructed using the semantic parsing results of the natural language clauses. In this tree, non-leaf nodes represent judgment conditions, and leaf nodes correspond to judgment conclusions.

[0070] In step S320, the conditional conclusion logic tree is converted into a first symbolic logic expression.

[0071] For example, a post-order traversal algorithm for the tree can be used: directly output the symbolic representation of the leaf nodes, and combine the symbolic expressions of the child nodes of the non-leaf nodes according to their logical types (such as AND, OR, NOT), thereby converting the logic tree into a first symbolic logical expression of a programming language-like structure.

[0072] In step S330, the first symbolic logical expression is semantically back-translated and verified to obtain the second symbolic logical expression.

[0073] In embodiments of this application, semantic back-translation verification is used to verify the semantic consistency between the first symbolic logical expression and the natural language clause.

[0074] For example, the first symbolic logical expression is back-translated into verification text using a natural language generation model; then, the similarity between the verification text and the original natural language clause is determined, which can be calculated using a semantic similarity measurement method, and a consistency threshold is set; when the similarity is lower than the threshold, the first symbolic logical expression is regenerated based on the original natural language clause, and semantic back-translation verification is performed on it again. This process is iterated and optimized until the semantic similarity between the verification text and the original clause meets the preset standard, and finally, the second symbolic logical expression that passes the semantic back-translation verification is output.

[0075] In step S340, the second symbolic logic expression is verified by both forward and backward reasoning to obtain the symbolic logic expression.

[0076] In the embodiments of this application, forward reasoning can refer to the process of deriving a conclusion from known premises using logical rules. Reverse reasoning can refer to the process of finding the premises that support the target conclusion from the opposite direction. Bidirectional verification can refer to performing both forward and reverse reasoning simultaneously to detect redundant conditions, missing necessary conditions, and logical circular dependencies.

[0077] For example, firstly, forward reasoning is performed on the second symbolic logic expression based on known premises to obtain a forward conclusion set; secondly, reverse reasoning is performed starting from the target conclusion to obtain a reverse minimal premise set; then, the forward conclusion set is compared with the target conclusion on which the reverse reasoning depends to check whether the forward conclusion set completely covers the target conclusion; simultaneously, it is checked whether the reverse minimal premise set is consistent with the known premises and has no conflict or redundancy. If the forward conclusion set covers the target conclusion, and the reverse minimal premise set is consistent with the known premises and has no logical conflict or redundant conditions, it indicates that the second symbolic logic expression is logically self-consistent and complete, and the bidirectional reasoning results corroborate each other. At this point, the expression is determined to have passed bidirectional verification and is used as the final output symbolic logic expression. If inconsistencies or conflicts are found during bidirectional verification, the second symbolic logic expression needs to be regenerated and bidirectional verification re-performed until it passes.

[0078] Optionally, during bidirectional verification, boundary value test cases can be designed for the critical conditions in the second symbolic logical expression (such as "application amount ≤ last year's tax amount × 3"). Specifically, based on the decision boundary of this critical condition, positive and negative examples are generated near the boundary value: positive examples correspond to the case where the condition is met (such as application amount = last year's tax amount × 3), and negative examples correspond to the case where the condition is not met (such as application amount = last year's tax amount × 3 + 0.1). By comparing the output results of positive and negative examples in forward and backward reasoning, the logical correctness and robustness of the expression near the boundary can be further verified, and potential numerical deviations or logical omissions can be identified.

[0079] Optionally, the Rete algorithm (i.e., the network algorithm) can be used to perform bidirectional verification of the second symbolic logical expression through forward and backward reasoning. By using pattern matching and result caching mechanisms, redundant calculations can be avoided, thereby significantly improving the reasoning efficiency under large-scale rule sets.

[0080] By employing two-way verification, we can ensure the logical correctness and robustness of symbolic logic expressions, and avoid erroneous conclusions in subsequent reasoning due to logical flaws.

[0081] According to the embodiments of this application, a conditional conclusion logic tree is constructed through semantic parsing and converted into a symbolic logic expression. Then, after semantic back-translation verification and bidirectional reasoning verification, a symbolic logic expression is finally formed. This method can effectively solve the problems of semantic deviation, logical incompleteness, and numerous logical defects in traditional manual translation, thereby improving the accuracy of rule conversion, ensuring logical integrity, and providing a high-quality template for the generation of thought chain text.

[0082] Figure 4 A flowchart illustrating semantic back-translation verification according to an embodiment of this application is shown schematically.

[0083] like Figure 4 As shown, the method 400 of this embodiment includes steps S410 to S450.

[0084] In step S410, the first symbolic logical expression is translated into verification text using a natural language generation model.

[0085] For example, for the first symbolic logical expression, a pre-trained language model based on a converter architecture can be used as the natural language generation model. The first symbolic logical expression is taken as input data, and the corresponding natural language statement is generated word-by-word through an encoder-decoder mechanism. To improve the matching degree between the generated verification text and the style of the original natural language clauses, a small amount of "logical expression-natural language clause" pairing data from the original policy document can be used for supervised fine-tuning. Simultaneously, length penalty and repetition suppression mechanisms are introduced into the decoding strategy. Length penalty prevents the model from generating sentences that are too short or too long; repetition suppression prevents the model from repeatedly outputting the same words or phrases during the generation process. Through these methods, a balance is achieved between semantic fidelity and syntactic fluency in the generated verification text, thus providing a high-quality reference text for subsequent semantic back-translation verification steps.

[0086] In step S420, the semantic consistency score between the verification text and the natural language clause is calculated.

[0087] In embodiments of this application, the semantic consistency score is used to characterize the accuracy of the verification text in semantically reproducing natural language terms.

[0088] For example, the verification text and the natural language terms can be input into a pre-trained semantic encoder and mapped into semantic vectors of fixed dimensions; then, the semantic consistency score can be obtained by calculating the cosine similarity between the two vectors.

[0089] In another embodiment, a weighted comprehensive semantic consistency score can be calculated by combining the core policy keyword matching rate and the global semantic similarity. Specifically, firstly, core policy keywords (such as "application amount," "tax amount," and "approval authority") are extracted from the original natural language clauses; then, the recall and precision of these keywords in the verification text are calculated, and their F1 scores (i.e., F-scores) are calculated based on the recall and precision, with the F1 score used as the keyword matching rate; next, the verification text and the original natural language clauses are respectively input into a pre-trained semantic encoder, mapped into fixed-dimensional semantic vectors, and the global semantic similarity is obtained by calculating the cosine similarity between the two vectors; then, the global semantic similarity and the keyword matching rate are weighted and summed according to preset weights (e.g., semantic similarity weight 0.6, keyword matching rate weight 0.4) to obtain the comprehensive consistency score.

[0090] In step S430, it is determined whether the semantic consistency score is lower than a preset threshold.

[0091] For example, a preset threshold can be used as the criterion for judging semantic consistency. For institutional clauses with high risk or strong rule constraints, the threshold can be set to a higher value to reduce the risk of rule misjudgment caused by semantic deviation; for clauses with relatively broad wording or that allow a certain degree of flexibility, the threshold can be appropriately lowered to a lower value.

[0092] In step S440, the first symbolic logical expression is modified based on the difference fragments between the verification text and the natural language clause, and the modified first symbolic logical expression is used as the second symbolic logical expression.

[0093] In an embodiment of this application, in response to a semantic consistency score lower than a preset threshold, the first symbolic logical expression is modified based on the difference segments between the verified text and the natural language clause.

[0094] For example, dependency parsing is used to convert the validation text and natural language clauses into dependency parsing trees. The minimum edit distance algorithm is then used to compare the nodes of the two dependency parsing trees layer by layer, identifying replaced nodes (e.g., the logical connector "AND" is mistranslated as "OR"), deleted nodes (i.e., missing constraints), and inserted nodes (i.e., illusory redundancy, extra elements in the validation text but not in the original natural language clause). These differing nodes and their corresponding subtree segments are treated as differing segments, which are then mapped to the corresponding nodes in the conditional conclusion logic tree. This leads to the sub-expressions in the first symbolic logic expression, where targeted corrections are implemented: for deleted nodes, missing logical clauses or conditional terms are added to the expression; for inserted nodes, redundant logical components are located and removed; for replaced nodes, the corresponding logical operators or operands are adjusted based on the semantic differences before and after the replacement. The corrected first symbolic logic expression is then used as the second symbolic logic expression.

[0095] In step S450, the first symbolic logic expression is directly used as the second symbolic logic expression.

[0096] In the embodiments of this application, in response to a semantic consistency score higher than a preset threshold, the first symbolic logical expression is directly used as the second symbolic logical expression.

[0097] According to embodiments of this application, semantic back-translation verification can effectively detect and correct semantic deviations generated during the conversion process, ensuring that the generated symbolic logic expression accurately reflects the meaning of the original natural language clause, thereby significantly improving the reliability of rule conversion.

[0098] Figure 5 A flowchart illustrating expression completion according to an embodiment of this application is shown schematically.

[0099] like Figure 5As shown, the method 500 of this embodiment includes steps S510 to S560.

[0100] In step S510, symbolic logical expressions obtained from multiple policy documents are acquired.

[0101] In embodiments of this application, the symbolic logic expression includes a second symbolic logic expression extracted from the current policy document and candidate premise expressions extracted from other policy documents.

[0102] A system of policy documents typically consists of multiple related documents (such as the "Credit Granting Management Measures" and the "Guarantee Management Measures"). The rules in a single document often implicitly depend on the preconditions or basic rules defined in other documents. If reasoning and verification are based solely on the current document, it can easily lead to a disjointed reasoning process or a lack of necessary supporting evidence for certain assumptions.

[0103] Candidate premise expressions refer to symbolic logical expressions extracted from other related institutional documents that can serve as preconditions or supplementary conditions for the current rule. Their conclusion concepts are semantically related to the condition concepts of the current rule and can provide necessary premise support or boundary constraints for the current rule.

[0104] In step S520, the conditional concepts involved in the judgment conditions and the conclusion concepts involved in the judgment conclusions in the symbolic logic expression are obtained.

[0105] For example, for symbolic logic expressions, the logical structure is first analyzed to determine the judgment condition part and the judgment conclusion part. Then, the conditional concepts involved in the judgment condition and the conclusion concepts involved in the judgment conclusion are extracted. For example, for a symbolic logic expression "IF({establishment time}≥2 years)AND({tax grade}IN[A,B])AND({credit}!=bad)THEN({approved, quota=last year's tax amount×2.5})", the conditional concepts involved in the judgment condition include "establishment time", "tax grade", and "credit", and the conclusion concept involved in the judgment conclusion is "quota". That is, entity nouns or attribute nouns in the symbolic logic expression are extracted as concepts.

[0106] Optionally, a predefined domain dictionary can be used to standardize the mapping of concepts, for example, mapping "application amount" and "credit limit" to the concept of "amount".

[0107] In step S530, a directed dependency graph is generated, using symbolic logic expressions as nodes and directed relationships where the conclusion concept contains the condition concept of another symbolic logic expression as edges.

[0108] In the embodiments of this application, a directed graph structure is constructed, where each node represents a symbolic logic expression. If the conclusion of one expression semantically includes the conditional concept of another expression (i.e., the conclusion output by the former can serve as a premise required for the reasoning of the latter), then a directed edge is established from the former to the latter. For example, if the conclusion of node A is "qualified for credit granting" and the conditional concept of node B is "qualified for credit granting", then a directed edge is generated from node A to node B.

[0109] For example, the existence of an inclusion relationship between two concepts can be determined based on the semantic similarity between the concepts. Specifically, the conditional concept and the conclusion concept are mapped to semantic vectors (such as those obtained through encoding by a pre-trained language model), and the cosine similarity or Euclidean distance between them is calculated. When the similarity exceeds a preset threshold (e.g., 0.8), it is determined that the conclusion concept semantically "includes" the conditional concept, that is, the semantic category of the conclusion concept can cover or be equivalent to the conditional concept.

[0110] In step S540, the dependency confidence of each directed edge in the directed dependency graph is calculated. The dependency confidence is determined based on the concept similarity and the rule logic depth.

[0111] In the embodiments of this application, the rule logic depth refers to the number of nesting levels of the conclusion concept in the symbolic logic expression.

[0112] For example, for each edge (A) in a directed dependency graph (B) The dependency confidence score can be calculated to quantify the reliability of the conclusion concept of node A as a premise for the condition concept of node B. This dependency confidence score can be determined by weighting conceptual similarity and rule logic depth. Conceptual similarity is determined by the semantic similarity (such as cosine similarity or Euclidean distance) between the conclusion concept of node A and the condition concept of node B. Higher similarity indicates that the output of node A has a stronger semantic basis as the input of node B. Rule logic depth refers to the nesting level of the conclusion concept of node A in the symbolic logic expression of node B. In complex conditional structures, deeply nested concepts usually have stronger constraints and higher dependency value.

[0113] In step S550, directed edges that meet a preset threshold are filtered based on dependency confidence, and reachable paths to the node corresponding to the second symbolic logical expression in the directed dependency graph are determined.

[0114] For example, based on a preset confidence threshold (e.g., 0.75), directed edges with low dependency confidence are filtered out, retaining high-confidence edges as valid dependencies. Building on this, using the node corresponding to the second symbolic logical expression as the target node, a forward or backward path search is performed in the graph to find all reachable paths that originate from other expression nodes and reach the target node via high-confidence edges, recording the sequence of intermediate nodes along the path. Each reachable path represents a logical deduction chain across institutional documents. Through reachable paths, it is possible to discover which candidate premise expressions have traceable logical support relationships with the current expression.

[0115] In step S560, the candidate premise expression on the reachable path is taken as the target premise expression and logically fused with the second symbolic logic expression to generate the completed second symbolic logic expression.

[0116] In the embodiments of this application, all candidate premise expressions located on the reachable path are extracted as target premise expressions and logically fused with the current second symbolic logical expression.

[0117] For example, the target premise expression is "IF({Registered Capital}<500,000)THEN Small and Micro Enterprises"; the second symbolic logical expression is "IF({Establishment Time}≥2 Years AND {Small and Micro Enterprises})THEN{Applicable Preferential Tax Rate}". In the logical fusion stage, firstly, the conclusion concept "small and micro enterprises" in the target premise expression is semantically matched with the condition concept "small and micro enterprises" in the second symbolic logical expression to confirm their consistency; then, the premise condition (registered capital <500,000) in the target premise expression is expanded to the corresponding condition item in the second symbolic logical expression, generating the complete expression: "IF({Establishment Time}≥2 Years AND {Registered Capital}<500,000)THEN{Applicable Preferential Tax Rate}".

[0118] According to the embodiments of this application, by automatically identifying and completing the original implicit and unwritten preconditions, the problem of "knowledge silos" that may exist in symbolic logical expressions in a single institutional document can be solved. This method can avoid logical omissions and reasoning interruptions caused by missing dependencies, and can complete the automatic identification and completion of implicit dependencies across expressions without manual intervention.

[0119] In embodiments of this application, before filtering directed edges that meet a preset threshold based on dependency confidence, the method may further include: performing node reachability analysis on the directed dependency graph to determine at least one strongly connected component in the directed dependency graph; calculating the disruption cost of each node within the strongly connected component for each strongly connected component, wherein the disruption cost is determined based on the priority of the policy document and the dependency confidence; and removing all outgoing edges corresponding to the node with the smallest disruption cost within the strongly connected component in the directed dependency graph.

[0120] Strongly connected components can refer to a set of nodes in a directed dependency graph that have closed cycles, where nodes within the set are mutually reachable, forming a logical loop. For example, node A... Node B Node C Node A. The cost of breaking a cycle can refer to the price paid for breaking a circular dependency. The priority of policy documents can refer to pre-defined hierarchical values ​​based on document type, release level, update time, etc., such as mandatory clauses > company policies > departmental regulations > operational guidelines.

[0121] For example, firstly, node reachability analysis can be performed using the Tajan algorithm to identify all logical loops in the directed dependency graph and obtain the node set for each strongly connected component. Then, for each strongly connected component, the cost of breaking the loop for each node within it is calculated. This cost can be determined by weighting the priority of the policy document and the dependency confidence. Specifically, the higher the priority of the policy document corresponding to a node, the greater its cost of breaking the loop; the higher the dependency confidence of a node, the more critical it is in the logical dependency, and the greater its cost of breaking the loop. Based on this, in the directed dependency graph, all outgoing edges corresponding to the node with the lowest cost of breaking the loop within the strongly connected component are removed, thereby breaking the logical loop with minimal cost while preserving high-priority, high-confidence dependencies as much as possible. This method effectively eliminates circular references formed by cross-document dependencies while ensuring the overall structural stability of the dependency graph, preventing subsequent path searches from falling into infinite loops or generating invalid reachable paths.

[0122] According to embodiments of this application, by performing loop detection on directed dependency graphs, identifying and eliminating circular dependencies in the graphs, inference deadlock can be effectively avoided, ensuring the continuity and reliability of the thought chain derivation process.

[0123] Figure 6 A flowchart illustrating contradictory branch processing according to an embodiment of this application is shown schematically.

[0124] like Figure 6 As shown, the method 600 of this embodiment includes steps S610 to S650.

[0125] In step S610, the condition branches in the second symbolic logical expression are compared pairwise to identify contradictory condition branch pairs that have logical conflicts.

[0126] In the embodiments of this application, a conditional branch can refer to a sub-expression in a symbolic logic expression corresponding to different conditional paths. A contradictory conditional branch pair refers to two conditional branches that derive opposite conclusions under the same or inclusive conditions. For example, one conditional branch derives "requires advanced approval" under the condition "application amount > 1 million," while another branch derives "no advanced approval required" under the condition "application amount > 1 million AND registration time > 3 years." The latter condition's antecedent includes the former, and the conclusions are mutually exclusive, forming a logical conflict. The essence of this type of contradiction lies in the hierarchical misalignment of the granularity of institutional documents or clauses, where the applicable domains of coarse-grained rules and fine-grained rules overlap, and the conclusions point to opposite business effects.

[0127] For example, when identifying contradictory conditional branch pairs, the judgment condition part and judgment conclusion part of each conditional branch can be extracted. The conditional branches are then paired, and it is determined whether there is an inclusion relationship or an equivalence relationship between the conditional parts, and whether the conclusion parts are mutually exclusive (such as "requires approval" and "no approval required", "pass" and "reject", etc.). If the conditional part of branch A logically implies the conditional part of branch B (i.e., the conditional range of A is a subset of the conditional range of B or equivalent to it), and the conclusion parts of the two constitute a negative relationship semantically, then the branch pair is marked as a contradictory conditional branch pair.

[0128] In step S620, it is determined whether contradictory conditional branch pairs have been identified.

[0129] In the embodiments of this application, the judgment is based on the comparison result of step S610: if the set of contradictory condition branches is empty, it is determined that no contradictory condition branches have been identified, the second symbolic logic expression passes the consistency check, and the process proceeds to step S650; if the set of contradictory condition branches is not empty, it is determined that a contradictory condition branch pair has been identified, the conflict resolution process needs to be triggered, and the process proceeds to step S630.

[0130] In step S630, the retention priority of each condition branch in the contradictory condition branch pair is calculated.

[0131] In the embodiments of this application, retention priority can refer to an indicator that determines which conditional branch to retain when a contradiction occurs. Retention priority is determined based on the granularity of the conditional branch and the priority of the policy document, wherein the granularity of the conditional branch is determined according to the number of sub-conditions of the conditional branch. The granularity of the conditional branch can refer to the number of sub-conditions contained in the branch; the more sub-conditions, the finer the granularity and the more precise the rule constraints.

[0132] For example, retention priorities can be determined by weighting the granularity of conditional branches with the priority of policy documents, which is used to quantitatively assess the retention value of each conditional branch in the conflict resolution process. Through weighted calculation, a quantifiable decision-making basis can be provided for the selective retention of conflicting branches.

[0133] In step S640, conditional branches with low priority are removed.

[0134] In the embodiments of this application, for each identified pair of contradictory condition branches, the retention priorities of the two condition branches are compared, and the condition branch with the lower retention priority is eliminated. If the retention priorities are the same, further decisions can be made based on a preset conflict resolution strategy (such as retaining the branch with a smaller condition range, retaining the branch from a higher authority document, or triggering manual review).

[0135] In step S650, there is no contradictory branch.

[0136] In the embodiments of this application, if no contradictory conditional branch pairs are found after conflict detection, it is determined that the internal logic of the current second symbolic logical expression is consistent and there is no rule conflict.

[0137] According to embodiments of this application, by performing logical conflict detection at the conditional branch level, it is possible to avoid contradictions between more specific conditional branch conclusions and more general conditional branch conclusions under the same or inclusive conditions.

[0138] In embodiments of this application, the method further includes: obtaining reference clause identifiers in the thought chain text; querying the system version evolution graph based on the reference clause identifiers to determine the effective status of the system clauses corresponding to the reference clause identifiers; wherein, the system version evolution graph is used to record the evolution relationship and effective status between different versions of system clauses; in response to the repeal of a system clause, replacing the repealed clause in the symbolic logic expression with the corresponding latest effective clause according to the evolution relationship in the system version evolution graph.

[0139] The referenced clause identifier can refer to the code in the thought chain text used to point to a specific institutional clause, such as "Article 12, Paragraph 3 of the 'Administrative Measures for Enterprise Credit Granting Business'". The institutional version evolution graph can be a graph data structure used to manage the relationship between institutional clause versions. Nodes represent clauses, and edges represent relationships such as predecessor / successor, revision, and repeal. This graph is the core infrastructure for realizing the timeliness verification and automatic replacement of clauses.

[0140] For example, the determination of the validity of a clause can be performed periodically: after confirming that a clause has been repealed by querying the system version evolution map, the repealed clause in the symbolic logical expression is automatically replaced with the latest valid clause, and the relevant logical conditions are adjusted accordingly. This mechanism ensures that the symbolic logical expression is always based on the currently valid rules, avoiding logical errors caused by referencing repealed clauses.

[0141] Optionally, when a clause has been repealed, it may be optional not to automatically replace it, but to handle it flexibly according to the business scenario: it may be marked as "applicable to historical versions" to clarify that the reasoning is still based on the original rules; or it may be marked as "pending manual review" so that a human can determine whether to continue using the repealed clause or choose a replacement clause.

[0142] According to the embodiments of this application, by detecting repealed clauses and automatically replacing them with the latest valid versions, it can be ensured that the institutional clauses referenced by the thinking chain are always current and valid rules, avoiding reasoning errors or compliance risks caused by the repeal of the system, thereby achieving automatic synchronization and dynamic adaptation of system updates.

[0143] Optionally, the generated thought chain text can be subjected to a multi-dimensional quality score, and high-quality samples can be selected and stored according to scenario classification to form a thought chain training dataset that can be used for supervised fine-tuning of large models. This multi-dimensional quality score covers four dimensions: logical completeness, language fluency, scenario matching degree, and compliance risk level.

[0144] For example, logical completeness is determined by the ratio of the actual number of evaluation conditions to the number of conditions defined in the template. This is calculated as the coverage ratio of the actual number of expanded condition evaluation nodes in the thought chain text to the total number of condition nodes defined in the symbolic logic expression template. A coverage ratio closer to 1 indicates a more complete logical expansion and fewer missing conditions. Language fluency is calculated based on the perplexity of the thought chain text using a pre-trained language model. The perplexity value is normalized and converted into a fluency score. A lower perplexity indicates a more standardized grammatical structure and stronger semantic coherence. Scenario matching is achieved by encoding the thought chain text and the standard description text of the target scenario, calculating the cosine similarity of their sentence vectors. A higher similarity indicates a more closely aligned thought chain with the target business scenario. Compliance risk levels can be categorized as no risk, low risk, and high risk, determined by the frequency of sensitive keyword hits in the thought chain text. Specifically, no risk corresponds to no sensitive keyword hits; low risk corresponds to a few sensitive keyword hits; and high risk corresponds to high-frequency sensitive keyword hits. The above four dimensions can be weighted to obtain a comprehensive score for the thought chain text.

[0145] Optionally, it can monitor cases of model misjudgment, collect corrective actions from business personnel and expert review evaluations, store them in a feedback database and sort them by priority, and analyze the reasons for the feedback. The corrected reasoning logic is converted into a new template or an existing template is revised, supporting version management. After an update, affected data is marked as "awaiting re-verification." Regarding policy synchronization, it can monitor policy document updates, automatically trigger rule re-extraction; compare new and old templates to identify change points; update affected historical data and mark it as "awaiting re-verification"; and simultaneously send update reports to ensure a closed-loop and controllable process.

[0146] Based on the above-described method for generating thought chain text, embodiments of this application also provide a device for generating thought chain text. The following will combine... Figure 7 The device is described in detail.

[0147] Figure 7 A schematic diagram of a mind chain text generation apparatus according to an embodiment of this application is shown.

[0148] like Figure 7 As shown, the thought chain text generation device 700 of this embodiment includes a thought chain generation template matching module 710, a thought chain reasoning path generation module 720, and a thought chain text generation module 730.

[0149] The thought chain generation template matching module 710 is used to determine a thought chain generation template that matches the business request in response to receiving the business request. The thought chain generation template includes symbolic logic expressions obtained by converting natural language clauses in policy documents. In one embodiment, the thought chain generation template matching module 710 can be used to perform step S210 described above, which will not be repeated here.

[0150] The thought chain reasoning path generation module 720 is used to substitute the instance data corresponding to the business request into the symbolic logic expression, so as to obtain the derivation dependency relationship between each sub-expression under the constraint of the symbolic logic expression, and generate the thought chain reasoning path. The thought chain reasoning path is stored using a directed acyclic graph data structure, and includes at least the condition evaluation result, intermediate conclusions, and corresponding reference clause identifiers. In one embodiment, the thought chain reasoning path generation module 720 can be used to execute step S220 described above, which will not be repeated here.

[0151] The thought chain text generation module 730 is used to semantically encode the symbolic logical expressions in the nodes based on a directed acyclic graph and concatenate them according to topological order to obtain the thought chain text. In one embodiment, the thought chain text generation module 730 can be used to execute the step S230 described above, which will not be repeated here.

[0152] According to embodiments of this application, the mind chain text generation device 700 may further include: a symbolic logic expression acquisition module and a timeliness verification module.

[0153] The symbolic logic expression acquisition module is used to obtain a conditional conclusion logic tree based on the semantic parsing results of natural language clauses in the institutional document; convert the conditional conclusion logic tree into a first symbolic logic expression, where the leaf nodes of the conditional conclusion logic tree represent the judgment conclusion and the non-leaf nodes represent the judgment condition; perform semantic back-translation verification on the first symbolic logic expression to obtain a second symbolic logic expression, where the semantic back-translation verification is used to verify the semantic consistency between the first symbolic logic expression and the natural language clause; and perform bidirectional verification of the second symbolic logic expression through forward and backward reasoning to obtain the symbolic logic expression.

[0154] The symbolic logic expression acquisition module may include a semantic back-translation and verification module, an expression completion module, and a contradiction branch handling module.

[0155] The semantic back-translation verification module is used to translate the first symbolic logical expression into verification text through a natural language generation model; calculate the semantic consistency score between the verification text and the natural language clause, which is used to characterize the accuracy of the verification text in semantically reproducing the natural language clause; in response to the semantic consistency score being lower than a preset threshold, the first symbolic logical expression is corrected based on the differences between the verification text and the natural language clause; and the corrected first symbolic logical expression is used as the second symbolic logical expression.

[0156] The expression completion module is used to obtain symbolic logic expressions from multiple policy documents. These expressions include a second symbolic logic expression extracted from the current policy document and candidate premise expressions extracted from other policy documents. It retrieves the conditional concepts involved in the judgment conditions and the conclusion concepts involved in the judgment conclusions within the symbolic logic expressions. Using symbolic logic expressions as nodes and directed relationships where the conclusion concept contains the conditional concept of another symbolic logic expression as edges, it generates a directed dependency graph. It calculates the dependency confidence of each directed edge in the directed dependency graph, which is determined based on concept similarity and rule logic depth, where rule logic depth refers to the nesting level of the conclusion concept in the symbolic logic expression. Based on the dependency confidence, it filters directed edges that meet a preset threshold and determines the reachable paths in the directed dependency graph to the corresponding nodes of the second symbolic logic expression. It then uses the candidate premise expressions on the reachable paths as target premise expressions and logically merges them with the second symbolic logic expression to generate the completed second symbolic logic expression.

[0157] The expression completion module is also used to perform node reachability analysis on the directed dependency graph to identify at least one strongly connected component in the directed dependency graph; for each strongly connected component, the destruction cost of each node in the strongly connected component is calculated, wherein the destruction cost is determined based on the priority of the policy document and the dependency confidence; in the directed dependency graph, all outgoing edges corresponding to the node with the smallest destruction cost in the strongly connected component are removed.

[0158] The contradictory branch processing module is used to compare the condition branches in the second symbolic logical expression pairwise to identify contradictory condition branch pairs with logical conflicts. A contradictory condition branch pair refers to two condition branches that derive opposite conclusions under the same or inclusive conditions. In response to the identification of contradictory condition branch pairs, the retention priority of each condition branch in the contradictory condition branch pair is calculated. The retention priority is determined based on the granularity of the condition branch and the priority of the institutional document. The granularity of the condition branch is determined according to the number of sub-conditions of the condition branch. Condition branches with lower retention priority are removed from the second symbolic logical expression.

[0159] The timeliness verification module is used to obtain the reference clause identifiers in the thought chain text; based on the reference clause identifiers, it queries the system version evolution graph to determine the effective status of the system clauses corresponding to the reference clause identifiers; among them, the system version evolution graph is used to record the evolution relationship and effective status between different versions of system clauses; in response to the repeal of system clauses, according to the evolution relationship in the system version evolution graph, the repealed clauses in the symbolic logic expression are replaced with the corresponding latest effective clauses.

[0160] According to embodiments of this application, any multiple modules among the thought chain generation template matching module 710, thought chain reasoning path generation module 720, and thought chain text generation module 730 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the thought chain generation template matching module 710, thought chain reasoning path generation module 720, and thought chain text generation module 730 can be at least partially implemented as hardware circuitry, such as field-programmable gate arrays, programmable logic arrays, systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits, or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods, or in a suitable combination of any of them. Alternatively, at least one of the thought chain generation template matching module 710, the thought chain reasoning path generation module 720, and the thought chain text generation module 730 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0161] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing a mind chain text generation method according to an embodiment of this application.

[0162] like Figure 8 As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory 802 or a program loaded from a storage portion 808 into a random access memory 803. The processor 801 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.

[0163] Random access memory 803 stores various programs and data required for the operation of electronic device 800. Processor 801, read-only memory 802, and random access memory 803 are interconnected via bus 804. Processor 801 executes various steps of the method flow according to embodiments of this application by executing programs stored in read-only memory 802 and / or random access memory 803. It should be noted that the programs may also be stored in one or more memories other than read-only memory 802 and random access memory 803. Processor 801 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0164] According to embodiments of this application, the electronic device 800 may further include an input / output interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card, such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.

[0165] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0166] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 802 described above, and / or random access memory 803, and / or one or more memories other than read-only memory 802 and random access memory 803.

[0167] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.

[0168] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0169] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0170] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

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

[0172] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A method for generating thought chain text, characterized in that, The method includes: In response to receiving a business request, a thought chain generation template matching the business request is determined, the thought chain generation template including symbolic logic expressions obtained by converting natural language clauses in institutional documents; Substitute the instance data corresponding to the business request into the symbolic logic expression to obtain the derivation dependency relationship between each sub-expression under the constraint of the symbolic logic expression, and generate a thought chain reasoning path. The thought chain reasoning path is stored in a directed acyclic graph data structure and includes at least the condition evaluation result, intermediate conclusion and corresponding reference clause identifier. Based on the directed acyclic graph, the symbolic logical expressions in the nodes are semantically encoded and concatenated in topological order to obtain the thought chain text.

2. The method according to claim 1, characterized in that, The symbolic logical expression is obtained in the following way: Based on the semantic parsing results of the natural language clauses in the aforementioned policy document, a conditional conclusion logic tree is obtained; The conditional conclusion logic tree is converted into a first symbolic logic expression, wherein the leaf nodes of the conditional conclusion logic tree represent the judgment conclusion and the non-leaf nodes represent the judgment condition. The first symbolic logical expression is subjected to semantic back-translation verification to obtain the second symbolic logical expression, wherein the semantic back-translation verification is used to verify the semantic consistency between the first symbolic logical expression and the natural language clause; The second symbolic logic expression is verified by both forward and backward reasoning to obtain the symbolic logic expression.

3. The method according to claim 2, characterized in that, The step of performing semantic back-translation verification on the first symbolic logical expression to obtain the second symbolic logical expression includes: The first symbolic logical expression is translated into verification text using a natural language generation model. Calculate the semantic consistency score between the verification text and the natural language clause, the semantic consistency score being used to characterize the accuracy with which the verification text semantically reproduces the natural language clause; In response to the semantic consistency score being lower than a preset threshold, the first symbolic logical expression is modified based on the difference segments between the verified text and the natural language clause; The modified first symbolic logic expression is used as the second symbolic logic expression.

4. The method according to claim 2, characterized in that, Before performing bidirectional verification of the second symbolic logical expression using both forward and backward reasoning, the process also includes: Obtain symbolic logic expressions from multiple policy documents, wherein the symbolic logic expressions include a second symbolic logic expression extracted from the current policy document and candidate premise expressions extracted from other policy documents; Obtain the conditional concepts involved in the judgment conditions and the conclusion concepts involved in the judgment conclusions in the symbolic logic expression; Using the symbolic logic expressions as nodes and the directed relationships where the conclusion concept contains the condition concept of another symbolic logic expression as edges, a directed dependency graph is generated. Calculate the dependency confidence of each directed edge in the directed dependency graph. The dependency confidence is determined based on concept similarity and rule logic depth, where rule logic depth refers to the number of nesting levels of the conclusion concept in the symbolic logic expression. Based on the dependency confidence, directed edges that meet a preset threshold are filtered, and reachable paths to the node corresponding to the second symbolic logical expression in the directed dependency graph are determined. The candidate premise expression on the reachable path is taken as the target premise expression and logically fused with the second symbolic logic expression to generate the completed second symbolic logic expression.

5. The method according to claim 4, characterized in that, Before filtering directed edges that meet the preset threshold based on the dependency confidence, the process includes: Perform node reachability analysis on the directed dependency graph to determine at least one strongly connected component in the directed dependency graph; For each strongly connected component, the disruption cost of each node within the strongly connected component is calculated, wherein the disruption cost is determined based on the policy document priority and the dependency confidence. In the directed dependency graph, remove all outgoing edges corresponding to the node with the minimum disruption cost within the strongly connected component.

6. The method according to claim 2, characterized in that, Before performing bidirectional verification of the second symbolic logical expression using both forward and backward reasoning, the process also includes: The condition branches in the second symbolic logical expression are compared pairwise to identify contradictory condition branch pairs that have logical conflicts. The contradictory condition branch pairs refer to two condition branches that derive opposite conclusions under the same or inclusive conditions. In response to the identification of the contradictory condition branch pair, the retention priority of each condition branch in the contradictory condition branch pair is calculated respectively. The retention priority is determined based on the condition branch granularity and the priority of the policy document, wherein the condition branch granularity is determined according to the number of sub-conditions of the condition branch. The conditional branches with lower priority are removed from the second symbolic logical expression.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the reference clause identifiers in the thought chain text; Based on the cited clause identifier, the system version evolution graph is queried to determine the effective status of the system clause corresponding to the cited clause identifier; wherein, the system version evolution graph is used to record the evolution relationship and effective status between different versions of system clauses; In response to the repeal of the aforementioned policy provisions, the repealed provisions in the symbolic logical expression are replaced with the corresponding latest valid provisions according to the evolution relationship in the policy version evolution diagram.

8. A thought chain text generation device, characterized in that, The device includes: The thought chain generation template matching module is used to respond to a received business request and determine a thought chain generation template that matches the business request. The thought chain generation template includes symbolic logic expressions obtained by converting natural language clauses in policy documents. The thought chain reasoning path generation module is used to substitute the instance data corresponding to the business request into the symbolic logic expression to obtain the derivation dependencies between the sub-expressions under the constraints of the symbolic logic expression, and generate a thought chain reasoning path. The thought chain reasoning path is stored using a directed acyclic graph data structure and includes at least the condition evaluation results, intermediate conclusions, and corresponding reference clause identifiers. The thought chain text generation module is used to semantically encode the symbolic logical expressions in the nodes and concatenate them in topological order based on the directed acyclic graph to obtain the thought chain text.

9. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.