Text parsing method, system, and related device

By using a data processing system to obtain a logic tree for text parsing, the problem of errors caused by relying on experience in enterprise tax operations has been solved, achieving efficient and accurate tax analysis.

WO2026145477A1PCT designated stage Publication Date: 2026-07-09HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-12-29
Publication Date
2026-07-09

Smart Images

  • Figure CN2025146869_09072026_PF_FP_ABST
    Figure CN2025146869_09072026_PF_FP_ABST
Patent Text Reader

Abstract

A text parsing method, a system, and a related device. The method comprises: a data processing system first obtains a parsing request for instructing parsing of a text to be parsed, and then obtains a first logic tree from a logic tree library on the basis of the parsing request, wherein the first logic tree comprises a plurality of nodes, each node represents an element, and the element represented by each node is associated with an element value, the plurality of nodes included in the first logic tree constitute a plurality of paths, and nodes corresponding to a same element but different element values are included between two paths among the plurality of paths; and finally, the data processing system determines, on the basis of the text and the first logic tree, a parsing path from the first logic tree, the parsing path being used for instructing a parsing process of the text, and the parsing path being one of the plurality of paths included in the first logic tree. Thus, the efficiency and accuracy of text parsing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

A text parsing method, system, and related device

[0001] This application claims priority to two Chinese patent applications filed on December 31, 2024, with application number 202411999121.1 and entitled "A Method and Related Device for Interpreting Knowledge-Based Text" and filed on April 2, 2025, with application number 202510417217.0 and entitled "A Text Parsing Method, System and Related Device", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of computer technology, and in particular to a text parsing method, system and related equipment. Background Technology

[0003] In the course of business operations, all business activities must comply with relevant regulations, such as laws, regulations, policy documents, industry technical standards, or international treaties. However, even when business operations are conducted in accordance with these regulations, current business personnel often lack the ability to provide a clear and logical analysis of the transactions based on these provisions. For example, in the financial field, businesses involve paying various taxes, which requires determining tax rates based on various tax-related laws and regulations. However, there are many types of taxes, resulting in numerous applicable laws and regulations. Furthermore, the regulations for the same tax vary from country to country or region to region. Business personnel often cannot accurately grasp the different tax laws of different countries or regions. Therefore, when dealing with tax-related matters, the methods described above mainly rely on the experience of business personnel, which is prone to human error and cannot provide an accurate analysis of tax issues based on relevant laws and regulations. Summary of the Invention

[0004] This application provides a text parsing method, system, and related equipment that can improve the efficiency and accuracy of parsing knowledge-based texts.

[0005] In a first aspect, this application provides a text parsing method, which includes: a data processing system acquiring a parsing request, the parsing request indicating the parsing of text to be parsed; then the data processing system acquiring a first logical tree from a logical tree library according to the parsing request; wherein the first logical tree includes multiple nodes, each node representing a feature, each node representing a feature associated with a feature value, the multiple nodes included in the first logical tree constituting multiple paths, and the two paths of the multiple paths including nodes with the same feature but different feature values; finally, the data processing system 2 determines a parsing path in the first logical tree according to the text to be parsed and the first logical tree, the parsing path indicating the process of parsing the text to be parsed, and the parsing path being one of the multiple paths included in the first logical tree.

[0006] In this method, when an analysis of a text to be interpreted is required, the data processing system only needs to obtain the text to be parsed to determine the corresponding rule logic tree in the logic tree library. Then, based on the rule logic tree, the text to be parsed is parsed to obtain the parsing result based on the rule logic tree. This method can improve the efficiency and accuracy of text parsing and can output a logically clear parsing process based on the rule logic tree.

[0007] In one possible implementation, the data processing system retrieves a first logical tree from the logical tree library based on the parsing request. This includes: the data processing system obtaining the target business scenario corresponding to the text to be parsed; and retrieving the first logical tree from the logical tree library based on the target business scenario and the mapping relationship. The mapping relationship indicates the association between each of the various business scenarios and the rule logical trees included in the logical tree library. Each business scenario is associated with at least one rule logical tree in the logical tree library, and the first logical tree is one of the at least one rule logical trees associated with the target business scenario.

[0008] During the operation of an enterprise, different business scenarios are involved, such as procurement scenarios and sales scenarios. Different scenarios are associated with one or more rule logic trees. After the data processing system obtains the text to be parsed, it determines the business scenario to which the text belongs based on the text. It can quickly and accurately obtain the rule logic tree corresponding to the text to be parsed from the logic tree library based on the correspondence between the business scenario and the rule logic tree, and then parse the text to be parsed based on the rule logic tree, which can improve parsing efficiency.

[0009] In one possible implementation, the first logical tree includes a reference node that indicates where the first logical tree connects to the second logical tree. The first and second logical trees are two distinct rule-based logical trees in a logical tree library, and the reference node is one of multiple nodes included in the first logical tree.

[0010] In the above method, the first logic tree can reference other rule logic trees in the logic tree library, realize the reuse of rule logic trees in the logic tree library, reduce the path depth of some rule logic trees, and reduce the occupation of storage space.

[0011] In one possible implementation, the data processing system determines the parsing path based on the text to be parsed and the first logic tree, including: the data processing system first obtains the input element values ​​corresponding to k elements in the text to be parsed from the multiple elements included in the first logic tree and the text to be parsed, thus obtaining k input element values; wherein, the k elements are some or all of the multiple elements included in the first logic tree; then, the data processing system determines the parsing path based on the k elements, the k input element values, and the element values ​​associated with each element in the multiple elements included in the first logic tree; wherein, the input element value corresponding to the first element in the parsed text is the same as the element value associated with the first element in the parsing path, and the first element is an element in the parsing path.

[0012] In one possible implementation, before obtaining the parsing request, the data processing system further includes: obtaining knowledge-type text; obtaining a corresponding domain logic tree based on the knowledge-type text, the domain logic tree including m elements; obtaining n elements from the m elements included in the knowledge-type text based on the knowledge-type text and the m elements; wherein, in the knowledge-type text, each of the n elements is associated with at least one element value, and n is less than or equal to m; and constructing a first logic tree corresponding to the knowledge-type text based on the domain logic tree, the n elements, and the at least one element value associated with each element.

[0013] In one possible implementation, the data processing system constructs a first logical tree corresponding to the knowledge-type text based on a domain logical tree, n elements, and at least one element value associated with each element. This includes: the data processing system constructing a third logical tree corresponding to the knowledge-type text based on the domain logical tree, the aforementioned n elements, and at least one element value associated with each element; wherein, a second element among the aforementioned n elements is associated with i element values, the third logical tree includes i second elements, the i second elements are located in i paths of the third logical tree, and the element value associated with the second element in each of the i paths corresponds one-to-one with the aforementioned i element values, where i is an integer greater than 1; and the first logical tree corresponding to the knowledge-type text is obtained based on the third logical tree.

[0014] In one possible implementation, the data processing system obtains the first logical tree corresponding to the knowledge-type text based on the third logical tree, including: the data processing system obtaining a second logical tree; wherein the second logical tree is a rule logical tree already existing in the aforementioned logical tree library; determining a target path in the third logical tree based on the second logical tree and the third logical tree; wherein the target path includes at least one of the multiple paths included in the third logical tree, and the multiple nodes included in the first path in the third logical tree include the multiple nodes included in the second path in the second logical tree, or the multiple nodes included in the first path are included in the multiple nodes included in the second path; wherein the first path is one of the target paths; determining the matching degree between the third logical tree and the second logical tree based on the number of target paths, the number of paths included in the third logical tree, and the number of paths included in the second logical tree; if the matching degree is greater than or equal to a first threshold, replacing the target path in the third logical tree with the second logical tree to obtain the first logical tree.

[0015] In one possible implementation, the data processing system replaces the target path in the third logical tree with the second logical tree to obtain the first logical tree, including: if there are no nodes with the same element in the third path in the logical tree obtained after replacing the target path in the third logical tree with the second logical tree, the rule logical tree obtained by replacing the target path in the third logical tree with the second logical tree is used as the first logical tree; the third path is any path in the logical tree obtained after replacing the target path in the third logical tree with the second logical tree.

[0016] In one possible implementation, the aforementioned knowledge-based texts include laws, regulations, or policy documents.

[0017] Secondly, this application provides a data processing system, which includes an acquisition module and a processing module. The acquisition module is used to acquire a parsing request, which includes text to be parsed; the processing module is used to acquire a first logical tree from a logical tree library according to the parsing request; wherein, the first logical tree includes multiple nodes, each node represents a feature, each feature represented by a node is associated with a feature value, the multiple nodes constitute multiple paths, and the two paths include nodes with the same feature but different feature values; the processing module is also used to determine a parsing path based on the text to be parsed and the first logical tree; the parsing path is used to indicate the process of parsing the text to be parsed, and the parsing path is one of the multiple paths included in the first logical tree.

[0018] In one possible implementation, the processing module is specifically used to: obtain the target business scenario corresponding to the text to be parsed; and obtain a first logic tree from the logic tree library based on the target business scenario and the mapping relationship. The mapping relationship is used to indicate the association between each business scenario in the multiple business scenarios and the rule logic trees included in the logic tree library. Each business scenario is associated with at least one rule logic tree in the logic tree library, and the first logic tree is one of the at least one rule logic trees associated with the target business scenario.

[0019] In one possible implementation, the first logic tree includes a reference node that indicates where the first logic tree connects to the second logic tree; wherein the first logic tree and the second logic tree are two different rule logic trees in a logic tree library, and the reference node is one of a plurality of nodes included in the first logic tree.

[0020] In one possible implementation, the processing module is specifically used to: obtain the input element values ​​corresponding to k elements in the text to be parsed, based on the multiple elements included in the first logic tree and the text to be parsed, to obtain k input element values; wherein, the k elements are some or all of the multiple elements included in the first logic tree; determine the parsing path based on the k elements, the k input element values, and the element value associated with each element in the multiple elements included in the first logic tree; wherein, the input element value corresponding to the first element in the parsed text is the same as the element value associated with the first element in the parsing path, and the first element is an element in the parsing path.

[0021] In one possible implementation, the system further includes an extraction module and a construction module. The acquisition module is also used to acquire knowledge-type text and obtain a corresponding domain logic tree based on the knowledge-type text. The domain logic tree includes m elements. The extraction module is also used to acquire n elements from the m elements included in the knowledge-type text based on the knowledge-type text and the m elements. In the knowledge-type text, each of the n elements is associated with at least one element value, and n is less than or equal to m. The construction module is also used to construct a first logic tree corresponding to the knowledge-type text based on the domain logic tree, the n elements, and the at least one element value associated with each element.

[0022] In one possible implementation, the construction module is specifically used to: construct a third logical tree corresponding to the knowledge text based on the domain logical tree, n elements, and at least one element value associated with each element; wherein, the second element among the n elements is associated with i element values, the third logical tree includes i second elements, the i second elements are located in i paths of the third logical tree, and the element value associated with the second element in each of the i paths corresponds one-to-one with the i element values, where i is an integer greater than 1; and obtain the first logical tree corresponding to the knowledge text based on the third logical tree.

[0023] In one possible implementation, the construction module is specifically used to include: obtaining a second logical tree; wherein the second logical tree is a rule logical tree that already exists in a logical tree library; determining a target path in the third logical tree based on the second logical tree and the third logical tree; the target path includes at least one of multiple paths included in the third logical tree, wherein multiple nodes included in the first path in the third logical tree include multiple nodes included in the second path in the second logical tree, or, multiple nodes included in the first path are included in multiple nodes included in the second path; wherein the first path is one of the target paths; determining the matching degree between the third logical tree and the second logical tree based on the number of target paths, the number of paths included in the third logical tree, and the number of paths included in the second logical tree; if the matching degree is greater than or equal to a first threshold, replacing the target path in the third logical tree with the second logical tree to obtain the first logical tree.

[0024] In one possible implementation, the building module is specifically used to: if there are no nodes with the same elements in the third path in the rule logic tree obtained after replacing the target path in the third logic tree with the second logic tree, the rule logic tree obtained by replacing the target path in the third logic tree with the second logic tree is used as the first logic tree; the third path is any path in the rule logic tree obtained after replacing the target path in the third logic tree with the second logic tree.

[0025] In one possible implementation, knowledge-based texts include laws, regulations, or policy documents.

[0026] Thirdly, this application provides a computing device including a processor and a memory, wherein the processor is configured to execute instructions stored in the memory to cause the computing device to perform some or all of the methods described in the first aspect and any possible implementation thereof.

[0027] Fourthly, this application provides a computing device cluster including at least one computing device, each computing device including a processor and a memory, the processor of each computing device being configured to execute instructions stored in the memory to cause the computing device cluster to implement some or all of the methods described in the first aspect and any possible implementation thereof.

[0028] Fifthly, this application provides a computer-readable storage medium storing computer program instructions that, when executed by a computing device or a cluster of computing devices, implement some or all of the methods described in the first aspect and any possible implementation thereof.

[0029] Sixthly, this application provides a computer program product comprising a computer program that, when executed by a computing device or a cluster of computing devices, implements some or all of the methods described in the first aspect and any possible implementation thereof.

[0030] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0031] Figure 1 is a schematic diagram of a tree structure provided in this application;

[0032] Figure 2 is a schematic diagram of a domain logic tree provided in this application;

[0033] Figure 3 is a schematic diagram of a rule logic tree provided in this application;

[0034] Figure 4 is a schematic diagram of a management system provided in this application;

[0035] Figure 5 is a flowchart illustrating a text parsing method provided in this application;

[0036] Figure 6 is a schematic diagram of a first logic tree provided in this application;

[0037] Figure 7 is a schematic diagram of one of the analysis results provided in this application;

[0038] Figure 8 is a flowchart illustrating a rule logic tree provided in this application;

[0039] Figure 9 is a schematic diagram of a generation rule logic tree provided in this application;

[0040] Figure 10 is a schematic diagram of a data processing system provided in this application;

[0041] Figure 11 is a schematic diagram of a computing device provided in this application;

[0042] Figure 12 is a schematic diagram of a computing device cluster provided in this application;

[0043] Figure 13 is a schematic diagram of a connection between computing devices provided in this application. Detailed Implementation

[0044] Currently, business operations often involve the analysis and processing of a large amount of knowledge-based texts, such as laws and regulations, policy documents, industry technical specifications, and international treaties, to help businesses address problems encountered in real-world business scenarios. For example, during business operations, companies need to analyze various laws, regulations, and policy documents, and then, based on specific business operations, determine the taxes payable in accordance with the relevant laws and regulations. While all business operations must comply with relevant regulations, current business personnel, even when conducting business according to these regulations or reaching certain conclusions, rely heavily on their experience, which can easily introduce human error and fail to provide a clear and logical derivation process based on the relevant regulations. For instance, business operations involve paying various taxes, which requires determining tax rates based on various tax-related laws and regulations. However, there are many types of taxes, resulting in numerous relevant laws and regulations, and different countries or regions have different regulations for the same tax. Business personnel often cannot accurately grasp the different tax laws of different countries or regions, and therefore cannot provide accurate derivation processes and conclusions based on relevant tax laws when dealing with tax-related matters.

[0045] To address the aforementioned issues, this application provides a text parsing method that improves the efficiency and accuracy of business logic parsing. The following section first introduces the tree structure, domain logic tree, and rule logic tree involved in this application.

[0046] A tree is a structure consisting of multiple nodes and directed edges between them. See Figure 1, which is a schematic diagram of a tree structure provided in this application. A tree consists of multiple nodes and directed edges between them. The tree structure shown in Figure 1 includes 9 nodes, A to I. Each node includes a root node and leaf nodes. In Figure 1, node A is the root node, and nodes B to I are leaf nodes. Each node has an in-degree and an out-degree. The in-degree of a node is the number of directed edges pointing to that node, and the out-degree is the number of directed edges originating from that node. In Figure 1, node A has an in-degree of 0 and an out-degree of 2. Each tree includes multiple paths. A path is a passage from the root node to a leaf node with an out-degree of zero. Each path includes at least one node. For example, the tree in Figure 1 includes 5 paths. Nodes A, B, and D form one path; nodes A, C, F, and I form another path; and other paths are not listed here. Each path has a path depth, which refers to the number of nodes included in a path. In the tree shown in Figure 1, the path depth from node A to node I is 3.

[0047] A domain logic tree is a logic tree built based on extracting multiple keywords from a large amount of knowledge-based text within the same domain. Alternatively, a domain logic tree can be built based on extracting keywords from a large amount of knowledge-based text of a specific type. For example, in the business operations of a company, the financial field involves tax categories such as turnover tax, income tax, property tax, resource tax, and behavior tax. In this application, a domain logic tree can be built based on these tax categories included in the financial field, or a separate domain logic tree can be built for each of the turnover tax, income tax, property tax, resource tax, and behavior tax categories. For instance, laws, regulations, policy documents, and analytical articles related to turnover tax constitute a type of knowledge-based text, and the data processing system can build a domain logic tree corresponding to value-added tax (VAT) based on such knowledge-based text; similarly, laws, regulations, policy documents, and analytical articles related to income tax constitute a type of knowledge-based text, and the data processing system can build a domain logic tree corresponding to VAT based on such knowledge-based text. It should be noted that the methods for building domain logic trees, building rule logic trees, and parsing text based on rule logic trees provided later in this application can be applied to the parsing of knowledge-based texts in different fields, such as finance, financial analysis, scientific research, and medicine. Knowledge-based texts include laws and regulations, policy documents, industry technical specifications, and international treaties. For ease of understanding, an example related to finance and taxation will be used.

[0048] In this application, each keyword is referred to as a preset element. The data processing system generates a domain logic tree corresponding to the domain based on these preset elements. For example, the data processing system acquires a large number of tax-related laws, regulations, policy documents, and text or audio / video files containing analyses of these laws, regulations, and policy documents. It analyzes these files and extracts keywords to obtain multiple preset elements, and then generates a domain logic tree based on these preset elements. See Figure 2, which is a schematic diagram of a domain logic tree provided in this application. For the financial domain, the preset elements include taxable objects, taxpayers, transaction nature, transaction location, holding time, tax rate, etc. The data processing system constructs the domain logic tree corresponding to the financial domain as shown in Figure 2 based on these multiple preset elements. Each node in this domain logic tree corresponds to one preset element. It should be noted that the domain logic tree for the financial domain shown in Figure 2 is only an example and should not be construed as a specific limitation. The domain logic tree for the financial field constructed by the data processing system can also take other forms. For example, the transaction location in Figure 2 is at the second level of the domain logic tree, but it can also be at the third or fourth level. The domain logic tree for the financial field shown in Figure 2 includes four levels, but it can also have more or fewer levels. This application does not make any specific limitations on this.

[0049] A rule-based logic tree is a logical relationship between data generated based on a specific type of knowledge text. Specific knowledge texts include laws and regulations, policy documents, industry technical specifications, international treaties, etc.

[0050] The differences between rule-based logic trees and domain-based logic trees include:

[0051] (1) Domain logic tree is built based on a large number of related knowledge texts of a domain, while rule logic tree is built based on a specific knowledge text of a domain. For example, a domain logic tree is built for turnover tax, which includes value-added tax, consumption tax and customs duty. Value-added tax is regulated by the Provisional Regulations on Value-Added Tax, so a rule logic tree for value-added tax is built for the Provisional Regulations on Value-Added Tax. Customs duty is regulated by the Regulations on Import and Export Customs, so a rule logic tree for customs duty is built for the Regulations on Import and Export Customs.

[0052] (2) Each node in the rule logic tree represents an element, and each element represented by a node is associated with an element value. Each node in the domain logic tree corresponds to an element, but the elements in the domain logic tree are not associated with element values. The elements included in a rule logic tree are some or all of the elements included in the domain logic tree of the same domain.

[0053] (3) Each node in the domain logic tree corresponds to a different element, that is, the domain logic tree does not include the same element; different paths in the rule logic tree include nodes with the same element, different paths can include nodes with the same element but different element values, and different paths can also include nodes with the same element and the same element value, but there is at least one node with a different element and / or a different element value between different paths.

[0054] For example, see Figure 3, which is a schematic diagram of a rule logic tree provided in this application. Turnover taxes include value-added tax (VAT), consumption tax, and customs duties. For VAT, related laws, regulations, policy documents, and analytical articles constitute a type of knowledge text. The data processing system can establish a rule logic tree corresponding to VAT based on this knowledge text. For consumption tax, related laws, regulations, policy documents, and analytical articles constitute a type of knowledge text. The data processing system can establish a rule logic tree corresponding to consumption tax based on this knowledge text. For example, for property tax, a rule logic tree as shown in Figure 3 can be established. In the rule logic tree in Figure 3, the taxable object, tax subject, holding time, and tax rate are elements. The house is the element value of the taxable object; legal persons and natural persons are the element values ​​of the tax subject; less than 2 years and more than 2 years are the element values ​​of the holding time; and 5%, 0.5%, and 1% are the element values ​​of the tax rate.

[0055] The rule logic tree shown in Figure 3 includes the following three paths: (1) Taxable object (house) -> Taxpayer (legal person) -> Tax rate (5%); (2) Taxable object (house) -> Taxpayer (natural person) -> Holding time (less than 2 years) -> Tax rate (0.5%); (3) Taxable object (house) -> Taxpayer (natural person) -> Holding time (more than 2 years) -> Tax rate (1%). Paths (2) and (3) both include the element "taxpayer", and the element values ​​associated with "taxpayer" in paths (2) and (3) are the same. However, the element values ​​of "holding time" in paths (2) and (3) are different. All three paths include the element "tax rate", but the element values ​​associated with "tax rate" in the three paths are different.

[0056] To address the aforementioned issues, this application provides a text parsing method. In this method, when parsing a business scenario, the data processing system determines one or more rule logic trees corresponding to that scenario by analyzing the text to be parsed, which describes the business scenario. Then, based on these rule logic trees, the business scenario is parsed to obtain a parsing result based on the rule logic trees. This method improves the efficiency and accuracy of business scenario parsing and outputs a logically clear parsing process based on rule logic trees. Specifically, in this method, the data processing system pre-sets rule logic trees corresponding to different business scenarios. Each rule logic tree includes multiple nodes forming a tree structure. Each node represents an element, and each element represented by a node is associated with an element value. The multiple nodes in a rule logic tree constitute multiple paths. When the data processing system receives a text to be parsed, it first determines the first logic tree corresponding to the text. Then, based on the multiple elements included in the first logic tree, it extracts the input element values ​​corresponding to these elements from the text. Next, it matches these input element values ​​with the element values ​​of these elements in the first logic tree to determine a path matching the text. This path represents the parsing process and conclusion of the text. Using this method, for a given business transaction, the user only needs to input a description of the transaction, and the data processing system can parse it based on the user's input to obtain the parsing process and conclusion, thus improving the efficiency and accuracy of parsing. The first logic tree is a rule-based logic tree as described above.

[0057] The parsing method and related system provided in this application are described in detail below with reference to the accompanying drawings.

[0058] First, the management system provided in this application is introduced. Referring to Figure 4, Figure 4 is a schematic diagram of a management system provided in this application. The management system includes a client 100, a data processing system 200, and a database 300. The number of clients 100 and databases 300 that establish communication connections with the data processing system 200 in this architecture can be one or more; this application does not make a specific limitation. Figure 4 illustrates this using one client 100 as an example. The aforementioned communication connection can be a wired connection or a wireless connection. Wired connections include Ethernet, wired lines, cables, etc., while wireless connections include wireless local area networks (Wi-Fi), cellular networks, etc. It can also include the Internet, local area networks (LANs), etc., which simultaneously support wired and wireless connections, and of course, other connection types can also be included; this application does not make a specific limitation.

[0059] Client 100 acquires knowledge-type text and uploads it to data processing system 200. Data processing system 200 parses the knowledge-type text, retrieves the first domain logic tree corresponding to the knowledge-type text from the domain logic tree library of database 300, and, based on multiple preset elements included in the first domain logic tree, searches for multiple elements corresponding to the preset elements in the knowledge-type text, as well as at least one element value for each of these elements. Then, based on the multiple elements found in the knowledge-type text, the element values ​​corresponding to these elements in the knowledge-type text, and the domain logic tree, it generates the first logic tree corresponding to the knowledge-type text and saves the first logic tree to the logic tree library. Specifically, different paths in the first logic tree include nodes with the same elements but different element values; different paths in the first logic tree can include nodes with the same elements and element values, but at least one node in each path must have different elements and / or different element values.

[0060] When a user needs to parse a text based on knowledge-based text, the user inputs the text to be parsed through client 100. After obtaining the text, client 100 uploads it to data processing system 200. Data processing system 200 then parses the text, retrieving the first logic tree corresponding to the text from the logic tree library. Based on the multiple elements included in the first logic tree, it searches the text for multiple input elements corresponding to the elements included in the first logic tree, along with the element values ​​corresponding to each input element. Here, an input element in the text corresponding to an element in the first logic tree refers to an element whose semantics are the same or similar to the input element. Then, data processing system 200 matches these multiple input elements and their corresponding element values ​​with the multiple elements and element values ​​included in the first logic tree. If the element value of an input element is the same as the element value of a corresponding element in the first logic tree, then the input element is matched. Through this matching process, a path can be determined in the first logic tree; this path is the parsing path for parsing the text. In this parsing path, each element corresponds to an input element, and the element value of each element is the same as the element value of its corresponding input element. Finally, the data processing system 200 sends the parsing result, including the first logic tree and indication information, to the client 100. The indication information indicates the nodes included in the parsing path. After receiving the parsing result, the client 100 displays the first logic tree and the parsing path to the user.

[0061] The data processing system 200 can be deployed on a single computing device or on a cluster of computing devices including multiple computing devices. The computing device can be a server, which can be a server in a cloud data center, an edge server, or a local server in an enterprise's local data center. This application does not make any specific limitations. A server may include one or more central processing units (CPUs), and may also include CPUs and other hardware chips. These hardware chips may be graphics processing units (GPUs), data processing units (DPUs), neural network processing units (NPUs), application-specific integrated circuits (ASICs), microprocessors (MPs), digital signal processors (DSPs), systems on chips (SoCs), or programmable logic devices (PLDs), etc. Among them, PLDs include field-programmable gate arrays (FPGAs), complex programmable logical devices (CPLDs), or generic array logic (GALs). The computing device may include one or more of the above-mentioned types of hardware chips, or may include multiple types of the above-mentioned hardware chips. This application does not specifically limit the embodiments.

[0062] Computing devices can also be virtual machines or containers. A virtual machine refers to a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. Any task that can be performed on a physical computer can also be performed in a virtual machine. When creating a virtual machine on a computing device, a portion of the physical machine's hard drive and memory capacity is used as the virtual machine's hard drive and memory capacity. Each virtual machine has its own independent basic input / output system, hard drive, and operating system, allowing it to be operated just like a physical machine. Containers are a lightweight virtualization technology that allows multiple isolated application instances to run within the same operating system. They can combine an application and all its dependencies into a single software package, which is not limited by the underlying host operating system. This eliminates the need to build complex environments, simplifying the application development and deployment process.

[0063] Client 100 is deployed on terminal devices, computing devices, or edge computing devices to enable human-computer interaction. Client 100 can be software or an application running on the user's terminal device, such as a client for a personal computer (PC), a browser-based client or browser plugin, an application (APP) running on a mobile terminal, or a console for a cloud platform; this application does not specifically limit its scope. Terminal devices include personal computers, smartphones, wearable devices, handheld processing devices, tablets, mobile laptops, augmented reality (AR) devices, virtual reality (VR) devices, smart conferencing devices, etc., and are not specifically limited here.

[0064] Database 300 can be deployed on computing devices or clusters of computing devices, or on storage devices or storage arrays composed of multiple storage devices. The descriptions of computing devices and computing device clusters are as described above and will not be repeated here. Storage devices can be hard disk drives (HDDs), solid-state drives (SSDs), mechanical hard disks (HDDs), USB flash drives (USB), flash memory, SD cards (Secure Digital Memory Cards), Memory Sticks, etc., and this application does not impose specific limitations. Storage arrays can be redundant arrays of independent disks (RAID), network attached storage (NAS), storage area networks (SANs), etc., and this application does not impose specific limitations.

[0065] In one possible implementation, client 100 is a client of a cloud platform provided by a cloud service provider. The cloud platform is used to provide various cloud services to users, who can purchase or rent cloud services through client 100. The domain logic tree construction method, rule logic tree construction method, and text parsing method based on rule logic tree provided in this application can all be one of the cloud services. The data processing system 200 is deployed on computing equipment in a cloud data center to provide users with cloud services that implement the above methods, and users can use these cloud services through client 100.

[0066] In another possible implementation, the data processing system 200 is deployed on computing devices in the enterprise's local data center. The data processing system 200 is a solution provided by the enterprise itself or a third party for constructing domain logic trees, constructing rule logic trees corresponding to knowledge-type texts, and parsing text based on the rule logic trees. The client 100 is deployed on terminal devices used by users within the enterprise, such as desktop computers and laptops. Users can use the services provided by the data processing system 200 through the client 100 to construct domain logic trees, construct rule logic trees corresponding to knowledge-type texts, and parse text based on the rule logic trees.

[0067] In another possible implementation, the data processing system 200 and the client 100 can also be deployed on a computing device, which can be a terminal device used by the user. When the data processing system 200 and the client 100 are deployed on a computing device, the data processing system 200 and the client 100 can also be integrated into a single application.

[0068] The following describes a method for parsing text based on a rule-based logic tree, with reference to the accompanying drawings. See Figure 5, which is a flowchart illustrating a text parsing method provided in this application.

[0069] S501. Client 100 obtains the text to be parsed, generates a parsing request based on the text to be parsed, and sends the parsing request to data processing system 200.

[0070] In this application, the text to be parsed is a description of a business transaction input by the user. When a user needs to parse a business transaction, they input a description of that transaction, which is the aforementioned text to be parsed. After obtaining the text to be parsed, the client 100 generates a parsing request based on the text, which includes the text to be parsed. Then, the client 100 sends the parsing request to the data processing system 200, so that the data processing system 200 needs to parse and deduce the parsing result based on the text to be parsed. For example, after completing a sales transaction, a user needs to know the tax rate payable for that sales transaction. The user can input the following text to be parsed: "Company A is a company registered in country Z, with tax jurisdiction in country Z. In August 2024, it sold a batch of self-developed and manufactured smart wearable devices to company B in country Y. The total contract amount was 2 million yuan (including tax), and the production cost of the batch of devices was 700,000 yuan."

[0071] In one possible implementation, the text to be parsed could be a piece of text input by the user on the client side. For example, the text to be parsed could be: "Company A, registered in Country Z with tax jurisdiction in Country Z, sold a batch of self-developed and manufactured smart wearable devices to Company B in Country Y in August 2024. The total contract amount was 2 million yuan (including tax), and the production cost of the devices was 700,000 yuan." Another example is: "Company A, registered in Country Z with tax jurisdiction in Country Z, purchased a property in Country B in February 2021 for 5 million yuan. The property is freehold, and the funds were remitted through compliant foreign exchange channels. The transaction was completed in June 2022, and the property registration has been completed."

[0072] In another possible implementation, the text to be parsed can also be the text generated after the user inputs corresponding data according to the prompt fields on the input interface. For example, the data processing system 200 provides an input interface to the client, which includes multiple prompt fields to prompt the user to input information corresponding to the prompt fields. For example, the prompt fields include the company's registered address, tax jurisdiction, company code, sales and procurement, transaction location, sales / procurement, etc. After the user inputs the corresponding information according to the prompt fields, the client 100 obtains the information input by the user and generates a parsing request based on the prompt fields and the information input by the user. The text to be parsed in the parsing request includes the aforementioned prompt fields and the information input by the user according to the prompt fields. Optionally, the aforementioned prompt fields also include scenario fields to prompt the user to input the corresponding business scenario, such as sales scenarios, procurement scenarios, real estate purchase scenarios, etc.

[0073] S502. The data processing system 200 obtains a parsing request and retrieves the first logic tree from the logic tree library according to the parsing request.

[0074] After receiving a parsing request, the data processing system 200 obtains the text to be parsed included in the parsing request and parses the text. First, it determines the target business scenario to which the text belongs. After determining the target business scenario, the data processing system 200 determines one or more rule logic trees associated with that target business scenario based on the target business scenario and mapping relationships, and then retrieves these one or more rule logic trees from the logic tree library of the database 300. The aforementioned mapping relationships indicate the association between each business scenario and the rule logic trees included in the logic tree library. The mapping relationships include one or more rule logic trees associated with each business scenario. It should be noted that one business scenario is associated with one or more rule logic trees. This application uses one rule logic tree associated with one business scenario as an example to illustrate the process by which the data processing system 200 parses the text based on the rule logic trees.

[0075] For example, the above business scenarios include sales scenarios, procurement scenarios, and real estate purchase scenarios. For instance, if the text to be parsed is "Company A and Company B are both registered in Country Z, with tax jurisdiction in Country Z. In August 2024, Company A sold a batch of self-developed and manufactured smart wearable devices to Company B. The total contract amount was 2 million yuan (including tax), and the production cost of the devices was 700,000 yuan," then the business scenario to which this text belongs is a sales scenario. If the text to be parsed is "Company A is a company registered in Country Z, with tax jurisdiction in Country Z. In February 2021, it purchased a property in Country Y for 5 million yuan. The property type is freehold. The purchase funds were remitted through compliant foreign exchange channels. The transaction was completed in June 2022, and the property registration has been completed," then the business scenario to which this text belongs is a real estate purchase scenario. In sales-related business scenarios, this may involve paying value-added tax, surtaxes, and corporate income tax; in procurement-related business scenarios, it may involve customs duties and stamp duty; and in real estate purchase scenarios, it may involve property tax, deed tax, and land use tax. In the examples above, a corresponding rule logic tree can be built based on the relevant knowledge text for each tax type. Therefore, a business scenario can be associated with one or more rule logic trees.

[0076] In this application, database 300 stores a logic tree library, which includes multiple rule logic trees. Each business scenario is associated with one or more rule logic trees in the logic tree library. After determining the target business scenario corresponding to the text to be parsed in the parsing request, data processing system 200 determines that the target business scenario is associated with one or more rule logic trees based on the mapping relationship between business scenarios and rule logic trees. For example, if the target business scenario is associated with the first logic tree in the logic tree library, then data processing system 200 retrieves the first logic tree from the logic tree library. A description of the rule logic trees can be found in Figure 3 above, and will not be repeated here.

[0077] S503. The data processing system 200 determines a parsing path for the text to be parsed in the first logic tree based on the text to be parsed and the first logic tree, and obtains the parsing result.

[0078] After the data processing system 200 obtains the first logic tree from the logic tree library, when determining the parsing path for the text to be parsed based on the text to be parsed and the first logic tree, the data processing system 200 obtains the input element values ​​in the text to be parsed for k elements from the multiple elements included in the first logic tree, thus obtaining k input element values. These k elements are some or all of the multiple elements included in the first logic tree that can be found in the text to be parsed. Then, the data processing system 200 determines the parsing path based on the k elements, the k input element values, and the element values ​​associated with each element in the multiple elements included in the first logic tree. This parsing path constitutes the parsing process for the text to be parsed. For any element in the parsing path, such as the first element, the input element value corresponding to the first element in the parsed text is the same as the element value associated with the first element in the parsing path of the first logic tree.

[0079] Optionally, the data processing system 200 obtains the first element represented by the leaf node of the next level below the root node in the first logical tree. Then, it obtains the first input element that is semantically the same as or similar to the first element and the first input element value b corresponding to the first input element from the text to be parsed. If the out-degree value of the root node is 3, that is, there are three branches under the root node, the first element value of the first element of the first branch is a, the first element value of the first element of the second branch is b, and the first element value of the first element of the third branch is c, then the first input element value of the first input element matches the first element value of the second branch. The node corresponding to the second branch under the root node is a target node included in the parsing path. The parsing path includes the root node and the node corresponding to the second branch under the root node. Then, the data processing system 200 obtains the second element under the second branch and obtains the second input element that is semantically the same as or similar to the second element and the second input element value corresponding to the second input element from the text to be parsed. A target node is determined according to the same method as above. Then, the parsing path includes the root node and the two target nodes mentioned above. This process continues until a target node with an out-degree of zero is found. The parsing path for the text to be parsed in the parsing request is the path from the root node to the target node with an out-degree of zero. This parsing path indicates the parsing process and the parsing conclusion for the text to be parsed. The parsing conclusion is the element represented by the last node in the path and the element value associated with that element.

[0080] It should be understood that some elements included in the first logic tree may not exist in the text to be parsed. The data processing system 200 can obtain the input element values ​​corresponding to some elements from the text to be parsed based on the semantic understanding of the text. For example, the first logic tree includes the element "taxpayer", but there is no word with the same or similar meaning as "taxpayer" in the text to be parsed. However, the text to be parsed includes the word "Company A". Then, the data processing system 200 determines that the taxpayer is a legal person based on the semantic information.

[0081] For example, Figure 6 is a schematic diagram of a first logic tree provided in this application. If the text to be parsed in the parsing request is "C, a citizen of country Z, purchased a property in country Y in February 2021 for 5 million yuan. The property type is freehold. The purchase funds were remitted through compliant foreign exchange channels. The transaction was completed in June 2022 and the property registration has been completed." The data processing system 200 retrieves the first logic tree from the logic tree library based on the knowledge text, as shown in Figure 6. The data processing system 200 first obtains the element "Taxpayer" at the next level of the root node of the first logic tree. Then, based on the text to be parsed, it determines that the taxpayer is C, i.e., a natural person. Therefore, it determines the "Taxpayer (Natural Person)" node in the first logic tree as the target node. Next, the data processing system 200 determines that the next level element of "Taxpayer (Natural Person)" is "Holding Time." Based on the current time and the transaction completion time in the text to be parsed, the data processing system 200 determines the holding time to be 1 year and 8 months, i.e., less than 2 years. Therefore, the data processing system 200 determines the "Holding Time (Less than 2 Years)" node in the first logic tree as the target node. The node is the target node; the data processing system 200 then determines that the next level element of "holding time (less than 2 years)" is "transaction location". Based on the text to be parsed, the transaction location is determined to be country Y, that is, the value of the transaction location is "overseas". Therefore, the data processing system 200 determines that the node "transaction location (overseas)" in the first logic tree is the target node. The node with the element value "overseas" corresponds to only one branch, that is, the node with the tax rate of 2.5%. Therefore, the node "tax rate (2.5%)" is the target node. Since the out-degree value of this target node is 0, the parsing of the above text to be parsed is completed. The parsing path is "taxable object (house) -> taxpayer (natural person) -> holding time (less than 2 years) -> transaction location (overseas) -> tax rate (2.5%)".

[0082] In one possible implementation, the data processing system 200 may not be able to complete the aforementioned parsing process based on the text to be parsed in the parsing request. For example, the data processing system 200 may be unable to extract the input elements corresponding to one or more elements in the first logic tree from the text to be parsed, or the data processing system 200 may be unable to extract the input element values ​​of the input elements based on the obtained text to be parsed. For instance, during the parsing process of the data processing system 200 based on the first logic tree, one element may be the transaction location, but it may be impossible to determine from the text to be parsed whether the transaction location is domestic or overseas.

[0083] Therefore, the data processing system 200 sends a prompt message to the client 100, which includes one or more supplementary elements to prompt the user to provide the element values ​​of these one or more supplementary elements. Upon receiving the prompt message, the client 100 displays the one or more supplementary elements on its input interface to prompt the user to input the corresponding supplementary element values. The user inputs the corresponding supplementary element values ​​on the input interface. After obtaining these values, the client 100 generates supplementary information and sends it to the data processing system 200. This supplementary information includes the one or more supplementary elements and their corresponding values. Upon receiving the supplementary information, the data processing system 200 completes the parsing process based on the text to be parsed and the supplementary information.

[0084] S504. Data processing system 200 sends parsing results to client 100.

[0085] After determining the parsing path for the text to be parsed, the data processing system 200 sends the parsing result to the client 100. The parsing result includes a first logic tree and indication information. The indication information is used to indicate the parsing path in the first logic tree. For example, the indication information includes each element in the parsing path and the element value associated with each element.

[0086] After receiving the parsing result, client 100 displays the first logic tree to the user on the display interface and highlights the nodes included in the parsing path according to the indication information to indicate the parsing process of the text to be parsed. See Figure 7, which is a schematic diagram of a parsing result provided in this application. The display interface includes a canvas area 710 and a node information area 720. The canvas area 710 is used to display the rule logic tree, and the node information area 720 is used to display the information of each node in the rule logic tree. The user can select a node in the canvas area, and the node information area can display the information of that node, including node type, feature name, and feature value. The node types include derived nodes and reference nodes. A derived node corresponds to a feature and a feature value. A reference node indicates that the current rule logic tree references another rule logic tree at that node. The reference node corresponds to the name or identifier of the referenced rule logic tree and is used to indicate the rule logic tree referenced by the current rule logic tree. If the first logical tree references the second logical tree, it means that some paths in the second logical tree have nodes that are identical to some paths in the first logical tree. Nodes being identical means that the element represented by a node and the value of the element associated with that element are the same. The second logical tree belongs to the aforementioned rule-based logical tree. The concept of rule-based logical trees referencing each other will be explained in detail later. The node name refers to the element represented by that node, and the element value is the value of the element associated with that element. It should be understood that Figure 7 above is only an example and should not be construed as a limitation. The interface used by the client 100 to display the parsing results may include more or fewer elements. For example, the display interface may also include a toolbar, which may include zoom tools, landscape display tools, portrait display tools, and full-screen display tools, etc.

[0087] As shown in Figure 7, client 100 displays the first logic tree in the canvas area and highlights the path "Taxable Object (House) -> Taxpayer (Natural Person) -> Holding Time (Less than 2 years) -> Transaction Location (Overseas) -> Tax Rate (2.5%)", indicating that this path represents the parsing process of the text to be parsed in the aforementioned knowledge-based parsing request. After the user selects the node representing "Transaction Location (Overseas)," the relevant information of that node can be displayed in the node information area. As shown in Figure 7, the node type is a derivation node, the element name is transaction location, and the element value is overseas.

[0088] After confirming that the parsing process is correct through the client 100, the user can trigger the submit button. After detecting the user's submission operation, the client 100 generates a confirmation message and sends the confirmation message to the data processing system 200. The data processing system 200 saves the text to be parsed and the parsing result in the parsing request.

[0089] It should be noted that S501 to S504 above refer to the parsing process based on the first logic tree after the text to be parsed is matched with the first logic tree in the logic tree library. The data processing system 200 can match multiple rule logic trees corresponding to the text to be parsed in the logic tree library according to the scenario to which the text to be parsed belongs and the above mapping relationship. The parsing process of the text to be parsed based on each of these multiple rule logic trees is described in the embodiments corresponding to Figures 5 to 7, and will not be repeated here. When the data processing system 200 matches multiple rule logic trees from the logic tree library, the above parsing result includes these multiple rule logic trees and the indication information corresponding to each rule logic tree.

[0090] Using the above method, for a given business, the user only needs to input a description of that business, and the data processing system 200 can parse the business based on the user's input description and obtain the parsing result. This improves the efficiency and accuracy of parsing, and the parsing process of the text to be parsed can be visualized through the rule logic tree.

[0091] The above, with reference to Figures 1 to 7, describes the method by which the data processing system 200 parses the text to be parsed submitted by the client 100 based on a rule logic tree. The following, with reference to the figures, describes the method for establishing a rule logic tree provided in this application. See Figure 8, which is a flowchart of a rule logic tree establishment method provided in this application.

[0092] S801. Data Processing System 200 acquires knowledge-based text.

[0093] Knowledge-based texts are files that require the creation of corresponding rule logic trees. These can be laws and regulations, policy documents, industry technical specifications, international treaties, etc. For example, in the course of business operations, the tax categories involved may include turnover tax, income tax, property tax, resource tax, and behavior tax, each of which includes different tax types. For example, turnover tax includes value-added tax, consumption tax, and customs duties; income tax includes corporate income tax and personal income tax; property tax includes real estate tax, deed tax, and vehicle and vessel tax; resource tax includes environmental protection tax, land resource tax, and mineral tax; and behavior tax includes stamp duty, land value-added tax, and urban maintenance and construction tax. Different tax types are regulated by relevant laws and regulations, such as the Provisional Regulations on Value-Added Tax, the Provisional Regulations on Consumption Tax, the Customs Law, the Regulations on Import and Export Duties, the Corporate Income Tax Law, the Personal Income Tax Law, the Provisional Regulations on Real Estate Tax, the Deed Tax Law, and the Vehicle and Vessel Tax Law. In the field of intellectual property, this may involve the Patent Law, the Trademark Law, the Patent Law, the Regulations on the Protection of Integrated Circuit Layout Designs, and the Implementing Regulations of the Patent Law. For example, different industries may involve different industry standards for companies in different sectors. For instance, in manufacturing, there are quality management system standards; in information technology and communications, there are 5G mobile communication technology specifications and information security management system standards; and in the medical industry, there are medical device quality management systems and pharmaceutical production management standards. Knowledge-based texts can be any of the specific laws, regulations, policy documents, industry technical specifications, or international treaties mentioned above.

[0094] The aforementioned knowledge-based text can be text uploaded by users through client 100. For example, if a new regulation is introduced, it is necessary to parse the new regulation and establish a corresponding rule logic tree. The user uploads the regulation file to data processing system 200 through client 100. Knowledge-based text can also be text already saved in data processing system 200. Knowledge-based text can also be crawled by data processing system 200 from the Internet. For example, new tax-related regulations crawled by data processing system 200 from relevant websites using data crawling tools. This application does not make specific limitations on this.

[0095] S802. Data processing system 200 obtains the corresponding first domain logic tree based on knowledge-type text.

[0096] After acquiring knowledge-type text, data processing system 200 first parses the text to determine its type. For example, data processing system 200 can parse the text using a large language model (LLM) to determine its type, or it can determine the type based on the text's title. For instance, if data processing system 200 determines the text is related to value-added tax (VAT), it retrieves the corresponding domain logic tree from the domain logic tree library; if it determines the text is related to property tax, it retrieves the corresponding domain logic tree. Based on the text's type, data processing system 200 retrieves the first domain logic tree corresponding to that text from the domain logic tree library, enabling it to generate a first logic tree for that knowledge-type text based on the first domain logic tree and the text itself.

[0097] In this application, the domain logic tree library includes domain logic trees corresponding to different types of knowledge texts. That is, the domain logic tree library includes multiple domain logic trees, each constructed based on a type of knowledge text. For a type of knowledge text, the data processing system 200 first acquires a large number of knowledge texts of the same type, extracts multiple keywords corresponding to that type of knowledge text from the same type of knowledge text, and uses these multiple keywords as multiple preset elements for constructing the domain logic tree corresponding to that type of knowledge text; then, it constructs the domain logic tree corresponding to these multiple preset elements according to the priority of each preset element. The priority of the preset elements can be assigned to each preset element by the data processing system 200, or it can be set by domain experts based on experience; this application does not make specific limitations. In the domain logic tree, the priority of the preset element located at level j is higher than the priority of the preset element located at level j+1, and preset elements with the same priority have different priorities. In the domain logic tree shown in Figure 2, the taxpayer, transaction nature, and transaction location are located at the second level of the domain logic tree and have the same priority; the holding time is located at the third level of the domain logic tree, and the priority of the taxpayer is higher than that of the holding time.

[0098] S803. The data processing system 200 generates a first logic tree corresponding to the knowledge text based on the first domain logic tree and the knowledge text.

[0099] After obtaining the first domain logic tree corresponding to the knowledge text, the data processing system 200 constructs a first logic tree corresponding to the knowledge text based on the first domain logic tree and the knowledge text. The data processing system 200 searches for elements in the knowledge text that correspond to the elements included in the first domain logic tree, as well as the element values ​​associated with those elements, based on the elements and element values ​​obtained from the knowledge text. Then, it generates the first logic tree corresponding to the knowledge text based on these elements and element values.

[0100] Specifically, the data processing system 200, based on the m elements included in the first domain logic tree, searches for elements corresponding to these m elements in the knowledge text, obtaining n elements, and then extracts at least one element value associated with each of these n elements from the knowledge text. Here, n is less than or equal to m, meaning that the n elements obtained by the data processing system 200 from the knowledge text correspond to some or all of the m preset elements included in the first domain logic tree, and each of the n elements corresponds to at least one element value. For example, for the element "taxpayer," the element values ​​include both legal person and natural person element values. Then, the data processing system 200 constructs the first logic tree corresponding to the knowledge text based on the n elements, the element values ​​corresponding to each element, and the first domain logic tree. It should be understood that the names of elements in the knowledge text may not be the same as the names of preset elements in the first domain logic tree. When the data processing system 200 searches for elements in the knowledge text that correspond to elements in the first domain logic tree, it does so through semantic information. For example, in the logic tree of the first domain, there is an element called "taxpayer". In the knowledge text, the element corresponding to "taxpayer" is "taxpayer".

[0101] After extracting the aforementioned n elements and at least one element value associated with each element from the aforementioned knowledge-type text, the data processing system 200 prunes the first domain logic tree based on the n elements, retaining the aforementioned n elements in the first domain logic tree to obtain an intermediate logic tree. Then, for the aforementioned n elements included in the intermediate logic tree, at least one element value corresponding to each element extracted from the knowledge-type text is assigned to the n elements included in the intermediate logic tree to obtain the first logic tree. When assigning values ​​to the n preset elements based on at least one element value associated with each element, the data processing system 200 can assign values ​​sequentially from top to bottom in the intermediate logic tree. When an element is associated with multiple element values, for example, if the first element corresponds to i element values, the data processing system 200, based on semantic information, draws out i-1 additional branches at the layer where the first element is located. Each branch includes a first element, and the first element of each branch corresponds to one element value of that element. That is, if the first element corresponds to i element values, then the final generated first logic tree includes i first elements, and the i first elements are located on i branches of the first logic tree, that is, the i first elements are located on i paths of the first logic tree.

[0102] For example, as shown in Figure 9, which is a schematic diagram of a generation rule logic tree provided in this application, if the knowledge text is a policy document related to property tax, the first domain logic tree corresponding to property tax is shown in Figure 2. The data processing system 200 extracts the elements and element values ​​from the knowledge text according to the preset elements in the first domain logic tree, as shown in Table 1 below.

[0103] Table 1

[0104] After obtaining the elements and element values ​​described in Table 1, the data processing system 200 constructs a first logical tree corresponding to the knowledge-type text based on the elements and element values ​​described in Table 1 and the semantic information obtained from semantic parsing of the knowledge-type text. For example, the semantic information determined by the data processing system 200 based on the large language model (LLM) is as follows:

[0105] (1) The object of taxation for knowledge-based texts is houses;

[0106] (2) Taxpayers are divided into legal persons and natural persons;

[0107] (3) When the taxpayer is a legal person, the tax rate is 5%;

[0108] (4) When the taxpayer is a natural person, if the holding period is more than 2 years, the tax rate is 1%; if the holding period is less than 2 years, the tax rate is 0.5% if the transaction is within the territory and 2.5% if the transaction is outside the territory.

[0109] Based on the elements and element values ​​described in Table 1 above, the semantic information, and the first domain logic tree, the data processing system 200 generates the first logic tree shown in Figure 9. It should be understood that the elements included in the rule logic tree are part or all of those in the domain logic tree; for example, the transaction nature in the first domain logic tree may not be included in the first logic tree. The same elements in the rule logic tree and the domain logic tree may not be located in the same layer. When constructing the rule logic tree based on knowledge-type text, the data processing system 200 can adjust the relationships between preset elements according to semantic information. For example, in the first domain logic tree above, the transaction location is located in the second layer. After parsing the knowledge-type text, the data processing system 200 determines that the tax rate is only related to the transaction location when the taxpayer is a natural person and the holding period is less than 2 years. Therefore, in the established first rule logic tree, the transaction location, the tax-collecting entity, and the holding period are listed after the transaction location.

[0110] In one possible implementation, the data processing system 200 constructs a third logic tree based on the elements and element values ​​described in Table 1 above, combined with the semantic information obtained from semantic parsing of the knowledge-type text. This third logic tree belongs to the aforementioned rule-based logic trees. After obtaining the third logic tree, the data processing system 200 matches it with existing rule-based logic trees in the logic tree library to determine if any rule-based logic tree in the library has a matching degree greater than a first threshold. If a rule-based logic tree in the logic tree library has a matching degree greater than or equal to the first threshold, it indicates that the third logic tree shares many identical parts with existing rule-based logic trees in the logic tree library. Therefore, parts of the third logic tree can be replaced with rule-based logic trees from the logic tree library, achieving the reuse of rule-based logic trees in the logic tree library.

[0111] The data processing system 200 acquires a second logical tree from the logical tree library. The system then matches multiple paths included in the third logical tree with the same paths included in the second logical tree to determine the matching paths between the third and second logical trees. These matching paths in the third logical tree are called target paths, and each target path includes one or more paths from the third logical tree. The system 200 first determines the number of target paths included in the third logical tree, and then, based on the number of target paths, the data of the paths included in the third logical tree, and the number of paths included in the second logical tree, determines the matching degree between the third and second logical trees. For ease of description, this application uses elements and their associated element values ​​to represent a node.

[0112] Specifically, for a path in the third logical tree, such as the first path, if multiple nodes included in the first path include multiple nodes included in the second path in the second logical tree, or if multiple nodes included in the first path are contained within multiple nodes included in the second path, then the first path is a target path. That is, if multiple nodes with the same features and values ​​are present in both paths, and these nodes are in the same order, then the first path in the third logical tree matches the second path in the second logical tree, and the first path is a target path. Then, the data processing system 200 determines the matching degree between the second and third logical trees based on the number of target paths, the data of the paths included in the third logical tree, and the number of paths included in the second logical tree. If the matching degree is greater than or equal to a first threshold, then the target path in the third logical tree can be replaced by the second logical tree. The first node in the third logical tree is set as a reference node, and the corresponding value of this node is set as the name or identifier of the second logical tree, resulting in the first logical tree corresponding to the knowledge text. This reference node is used to indicate that the third logical tree references other rule logical trees at the first node. In this application, the node types of the rule logic tree include deduced feature nodes and reference nodes. If a node's node type is a deduced feature node, then the node represents a feature and the feature value associated with that feature. If a node's node type is a reference node, then the node corresponds to the name or identifier of a rule logic tree, indicating the rule logic tree referenced by this node.

[0113] If the matching degree is less than the first threshold, it indicates a significant difference between the second and third logic trees, and the second logic tree cannot be used to replace the target path in the third logic tree. In this case, other rule logic trees are retrieved from the logic tree library, and the matching degree between two rule logic trees is determined using the same method. It is then determined whether there is a rule logic tree whose matching degree with the third logic tree is greater than or equal to the first threshold. If no rule logic tree in the logic tree library has a matching degree greater than or equal to the first threshold with the third logic tree, the third logic tree is used as the first logic tree corresponding to the aforementioned knowledge text, and the first logic tree is saved to the logic tree library.

[0114] In this application, the matching degree between two rule logic trees is determined by the following formula: p=2r / (x+y) (Formula 1)

[0115] Where p is the matching degree, r is the number of target paths in the third logic tree, and x and y are the number of paths included in the two rule logic trees, respectively.

[0116] For example, if the above third logical tree includes the following four paths:

[0117] (1) Taxable object (house) -> Taxpayer (legal person) -> Tax rate (5%)

[0118] (2) Taxable object (house) -> Taxpayer (natural person) -> Holding period (less than 2 years) -> Transaction location (domestic) -> Tax rate (0.5%)

[0119] (3) Taxable object (real estate) -> Taxpayer (natural person) -> Holding period (less than 2 years) -> Transaction location (overseas) -> Tax rate (2.5%)

[0120] (4) Taxable object (house) -> Taxpayer (natural person) -> Holding period (more than 2 years) -> Tax rate (1%)

[0121] The second logic tree includes the following three paths:

[0122] (1) Taxpayer (natural person) -> Holding period (less than 2 years) -> Transaction location (domestic) -> Tax rate (0.5%)

[0123] (2) Taxpayer (natural person) -> Holding period (less than 2 years) -> Transaction location (overseas) -> Tax rate (2.5%)

[0124] (3) Taxpayer (natural person) -> Holding period (more than 2 years) -> Tax rate (1%)

[0125] Among the paths included in the second and third logical trees, path (2) of the third logical tree and path (1) of the second logical tree contain multiple identical elements. The element values ​​associated with the identical elements are also the same, and the order of these multiple elements on the path is also the same. Therefore, path (2) of the third logical tree and path (1) of the second logical tree match. Similarly, path (3) of the third logical tree matches path (2) of the second logical tree, and path (4) of the third logical tree matches path (3) of the second logical tree, that is, the number of target paths is 3. Then, according to formula (1), the matching degree between the third logical tree and the second logical tree is determined to be 0.85. If the matching degree is greater than or equal to the first threshold, then the second logical tree is used to replace the nodes in the three paths (2), (3) and (4) of the third logical tree except for "taxable object (house)". The node in the third logical tree that represents "taxable subject (natural person)" is set as a reference node. The type of the node is set as a reference node. The element value in the node is set as the name or identifier of the second logical tree to obtain the first logical tree.

[0126] It should be noted that in the above example, the third logic tree includes the second logic tree, that is, the second logic tree is contained in the third logic tree. For example, the path (2) of the third logic tree includes the path (1) of the second logic tree, and the path (3) of the third logic tree includes the path (2) of the second logic tree. In one possible implementation, the second logic tree may also include elements or paths that do not exist in the third logic tree. For example, the second logic tree may also include a fourth path: "(4) Taxpayer (natural person) -> Holding time (greater than 4 years) -> Tax rate (1.5%)". At this time, the matching path between the third logic tree and the second logic tree is the same as in the above example. If the matching degree between the third logic tree and the second logic tree is greater than or equal to the first threshold, the second logic tree can still be used to replace the nodes in the three paths (2), (3) and (4) of the third logic tree except for "taxable object (house)" to obtain the first logic tree. The first logic tree includes the second logic tree and the part of the third logic tree that has not been replaced by the second logic tree.

[0127] In the example above, the second logic tree replaces the nodes in paths (2), (3), and (4) of the third logic tree except for "taxable object (house)". The second logic tree replaces the nodes in a portion of the paths in the third logic tree. In one possible implementation, the second logic tree may also include paths that do not exist in the third logic tree. For example, the second logic tree may also include a fourth path: "(4) Taxpayer (natural person) -> Holding time (greater than 4 years) -> Tax rate (1.5%)". In this case, the matching paths between the third logic tree and the second logic tree are the same as in the example above. If the matching degree between the third logic tree and the second logic tree is greater than or equal to the first threshold, the nodes in paths (2), (3), and (4) of the third logic tree except for "taxable object (house)" can be replaced by the three paths (1), (2), and (3) in the second logic tree to obtain the first logic tree. The first logic tree includes a portion of the paths in the second logic tree and the portion of the third logic tree that was not replaced by the second logic tree.

[0128] The above method allows for the replacement of some path elements in the third logical tree with the second logical tree, thereby enabling the reuse of the second logical tree, reducing the path depth of the first logical tree, and reducing the storage space occupied.

[0129] In one possible implementation, if it is determined through the path matching method described above that the second logical tree can replace some path nodes in the third logical tree, the second logical tree is first used to perform AND replacement on some path nodes in the third logical tree to obtain a fourth logical tree. If the fourth logical tree is missing one or more elements compared to the third logical tree, and / or an element in the fourth logical tree is the same as an element at the same position in the third logical tree, but with a different element value, it indicates that the logical relationship between the elements in the fourth logical tree is inconsistent with the logical relationship between the elements included in the knowledge text, or that under the same business conditions, the parsing result obtained by parsing the business based on the fourth logical tree is different from the parsing result obtained by parsing based on the knowledge text. Therefore, the data processing system 200 determines that the second logical tree cannot be used to replace some path nodes in the third logical tree, and the data processing system 200 uses the third logical tree as the first logical tree and saves the first logical tree to the logical tree library. If the fourth logical tree is not missing one or more elements compared to the third logical tree, and an element in the fourth logical tree is identical to an element at the same position in the third logical tree, and the element value is also the same, then the data processing system 200 determines to use the fourth logical tree as the first logical tree corresponding to the aforementioned knowledge-type text. The fourth logical tree belongs to the aforementioned rule-based logical tree.

[0130] For example, in the second logic tree above, if the value of the tax rate in the node representing the tax rate in path (2) is 1.5, that is, path (2) is: (2) Taxable object (house) -> Taxpayer (natural person) -> Holding time (less than 2 years) -> Transaction location (overseas) -> Tax rate (1.5%), the matching degree between the second logic tree and the third logic tree is greater than the first threshold. After replacing some path elements in the third logic tree with the second logic tree to obtain the fourth logic tree, the path (3) of the fourth logic tree is replaced with the path (2) in the second logic tree. At this time, if the business condition is "a natural person buys a property overseas and holds it for less than 2 years", the tax rate obtained by parsing the path (2) of the fourth logic tree is 1.5%, but the tax rate obtained by parsing the path (3) of the third logic tree is 2.5%. Therefore, the second logic tree cannot be used to replace some path elements in the third logic tree. The third logic tree is used as the first logic tree, and the first logic tree is saved to the logic tree library.

[0131] In one possible implementation, if the path matching method determines that the second logical tree can replace some nodes in the third logical tree, the second logical tree is first used to perform AND-substitution on some nodes in the third logical tree to obtain the fourth logical tree. If any path in the fourth logical tree contains the same element, it indicates that the logical relationship between the fourth logical tree and the elements included in the knowledge text is inconsistent. The data processing system 200 determines that the second logical tree cannot be used to replace some nodes in the third logical tree, and saves the third logical tree as the first logical tree to the logical tree library. If no path in the fourth logical tree contains the same element, the data processing system 200 determines that the fourth logical tree is the first logical tree corresponding to the knowledge text.

[0132] For example, if there is a path (4) in the second logic tree, and the path (4) is: (2) taxpayer (natural person) -> taxable object (real estate) -> holding time (less than 4 years) -> tax rate (2%), then after replacing the elements of some paths in the third logic tree with the second logic tree to obtain the fourth logic tree, the fourth logic tree will have the following path: taxable object (house) -> taxpayer (natural person) -> taxable object (real estate) -> holding time (less than 4 years) -> tax rate (2%). There are two taxable objects in this path, and the element values ​​of the taxable objects are different. Then the data processing system 200 determines that the second logic tree cannot be used to replace the nodes of some paths in the third logic tree. The data processing system 200 uses the third logic tree as the first logic tree and saves the first logic tree to the logic tree library.

[0133] In one possible implementation, if it is determined through the path matching method described above that the second logical tree can replace some path nodes in the third logical tree, the second logical tree is first used to replace some path nodes in the third logical tree to obtain the fourth logical tree. Since the fourth logical tree includes the second logical tree, and the second logical tree may also reference other rule logical trees, the fourth logical tree includes multiple existing rule logical trees. The mutual reference between these multiple rule logical trees may lead to loops in the fourth logical tree. Therefore, after generating the fourth logical tree, the data processing system 200 performs directed graph loop detection on the fourth logical tree. If there is a loop in the fourth logical tree, it may cause the parsing of a text to be parsed based on the fourth logical tree to enter the loop and circumvent the loop, resulting in the inability to obtain the parsing result based on the fourth logical tree. In this case, the data processing system 200 determines that the second logical tree cannot be used to replace some path nodes in the third logical tree, and saves the third logical tree as the first logical tree to the logical tree library. If there is no loop in the fourth logic tree, the data processing system 200 determines that the fourth logic tree is the first logic tree corresponding to the above-mentioned knowledge class text.

[0134] In one possible implementation, after generating the first logical tree, the data processing system 200 sends the first logical tree to the client 100. The client 100 displays the first logical tree generated by the data processing system 200 in a preview interface for the user to view. The user can modify the rule logical tree in the preview interface. Modifications include one or more of the following operations: modifying feature names, modifying feature values, adding nodes and configuring the corresponding features and feature values, deleting nodes, or adjusting the position of nodes in the rule logical tree. This embodiment does not specifically limit the modifications. After confirming that the first logical tree is correct, the user can trigger a submit button. After detecting the user's submission action, if the user has modified the first logical tree, the client 100 submits the modified first logical tree to the data processing system 200, which updates the first logical tree and saves it to the logical tree library. If the user has not modified the first logical tree, the client generates a confirmation message and sends it to the data processing system 200, which then saves the first logical tree to the logical tree library.

[0135] For other knowledge-based texts, the data processing system 200 can generate a corresponding rule logic tree according to the method described in the embodiment corresponding to Figure 8 above, and then save it to the logic tree library.

[0136] For the sake of simplicity, the above method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application. Other reasonable combinations of steps that those skilled in the art can conceive of based on the above description also fall within the scope of protection of this application. Again, those skilled in the art should be familiar with the fact that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application.

[0137] The above text, with reference to the accompanying drawings, describes in detail the method for establishing a rule logic tree and the method for parsing text based on the rule logic tree provided in this application. The following text, with reference to the accompanying drawings, introduces the data processing system and related equipment provided in this application.

[0138] Referring to Figure 10, which is a schematic diagram of a data processing system provided in this application, the data processing system 200 includes an acquisition module 110 and a processing module 120. The acquisition module 110 is used to acquire a parsing request, which includes text to be parsed. The processing module 120 is used to acquire a first logic tree from a logic tree library based on the parsing request. The first logic tree includes multiple nodes, each node representing a feature, and each feature represented by a node is associated with a feature value. Multiple nodes constitute multiple paths, and the paths between multiple paths include nodes with the same feature but different feature values. The processing module 120 is also used to determine a parsing path based on the text to be parsed and the first logic tree. The parsing path indicates the process of parsing the text to be parsed, and the parsing path is one of the multiple paths included in the first logic tree.

[0139] In one possible implementation, the processing module 120 is specifically used to: obtain the target business scenario corresponding to the text to be parsed; and obtain a first logic tree from the logic tree library based on the target business scenario and the mapping relationship. The mapping relationship is used to indicate the association relationship between each business scenario in the multiple business scenarios and the rule logic trees included in the logic tree library. Each business scenario is associated with at least one rule logic tree in the logic tree library, and the first logic tree is one of the at least one rule logic trees associated with the target business scenario.

[0140] In one possible implementation, the first logic tree includes a reference node that indicates where the first logic tree connects to the second logic tree; wherein the first logic tree and the second logic tree are two different rule logic trees in a logic tree library, and the reference node is one of a plurality of nodes included in the first logic tree.

[0141] In one possible implementation, the processing module 120 is specifically used to obtain the input element values ​​corresponding to k elements in the text to be parsed, based on the multiple elements included in the first logic tree and the text to be parsed, to obtain k input element values; wherein, the k elements are some or all of the multiple elements included in the first logic tree; and to determine the parsing path based on the k elements, the k input element values, and the element values ​​associated with each element in the multiple elements included in the first logic tree; wherein, the input element value corresponding to the first element in the parsed text is the same as the element value associated with the first element in the parsing path, and the first element is an element in the parsing path.

[0142] Specifically, the method and process by which the acquisition module 110 and the processing module 120 parse a text to be parsed based on the rule logic tree in the logic tree library can be referred to the relevant description in the embodiment corresponding to Figure 5, and will not be repeated here.

[0143] In one possible implementation, the data processing system 200 further includes an extraction module 130 and a construction module 140. The acquisition module 110 is further used to acquire knowledge-type text and acquire a corresponding domain logic tree based on the knowledge-type text. The domain logic tree includes m elements. The extraction module 130 is further used to acquire n elements from the m elements included in the knowledge-type text based on the knowledge-type text and the m elements. In the knowledge-type text, each of the n elements is associated with at least one element value, and n is less than or equal to m. The construction module 140 is further used to construct a first logic tree corresponding to the knowledge-type text based on the domain logic tree, the n elements, and the at least one element value associated with each element.

[0144] In one possible implementation, the construction module 140 is specifically used to construct a third logical tree corresponding to the knowledge text based on the domain logical tree, n elements, and at least one element value associated with each element; wherein, the second element among the n elements is associated with i element values, the third logical tree includes i second elements, the i second elements are located in i paths of the third logical tree, and the element value associated with the second element in each of the i paths corresponds one-to-one with the i element values, where i is an integer greater than 1; and the first logical tree corresponding to the knowledge text is obtained based on the third logical tree.

[0145] In one possible implementation, the construction module 140 is specifically used to include: obtaining a second logical tree; wherein the second logical tree is a rule logical tree that already exists in a logical tree library; determining a target path in the third logical tree based on the second logical tree and the third logical tree; the target path includes at least one of multiple paths included in the third logical tree, wherein multiple nodes included in the first path in the third logical tree include multiple nodes included in the second path in the second logical tree, or, multiple nodes included in the first path are contained in multiple nodes included in the second path; wherein the first path is one of the target paths; determining the matching degree between the third logical tree and the second logical tree based on the number of target paths, the number of paths included in the third logical tree, and the number of paths included in the second logical tree; if the matching degree is greater than or equal to a first threshold, replacing the target path in the third logical tree with the second logical tree to obtain the first logical tree.

[0146] In one possible implementation, the construction module 140 is specifically used to replace the target path in the third logical tree with the second logical tree in the rule logical tree obtained after replacing the target path in the third logical tree with the second logical tree, and if there are no nodes with the same elements in the third path, then the rule logical tree obtained after replacing the target path in the third logical tree with the second logical tree is used as the first logical tree; the third path is any path in the rule logical tree obtained after replacing the target path in the third logical tree with the second logical tree.

[0147] The method for obtaining the rule logic tree by module 110, extracting the rule logic tree by module 130 and constructing the rule logic tree can be referred to the relevant description in the embodiment corresponding to Figure 8 above, and will not be repeated here. It should be noted that the above division of the modules included in the data processing system is only illustrative and should not be construed as a specific limitation. In some possible implementations, the division of the modules included in the data processing system 200 may also include other methods, which are not limited in this application.

[0148] The aforementioned acquisition module 110, processing module 120, extraction module 130, and construction module 140 can all be implemented in software or in hardware. For example, the implementation of processing module 120 will be described below; the implementation of other modules can refer to the implementation of processing module 120.

[0149] Processing module 120, as an example of a software functional unit, includes code running on a computing instance. The computing instance includes at least one of a physical host, a virtual machine, and a container. Further, the aforementioned computing instance can be one or more. For example, processing module 120 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically proximate data centers. A region may include multiple AZs.

[0150] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0151] As an example of a hardware functional unit, the processing module 120 may include at least one computing device, such as a server. Alternatively, the processing module 120 may be implemented using a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system-on-chip (SoC), an offload card, an accelerator card, or any combination thereof.

[0152] The processing module 120 includes multiple computing devices that can be distributed within the same region or in different regions. Similarly, the processing module 120 can be distributed within the same Availability Zone (AZ) or in different AZs. Likewise, the processing module 120 can be distributed within the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offloading cards, and accelerator cards.

[0153] This application also provides a computing device, as shown in FIG11, which is a schematic diagram of a computing device provided in this application. The computing device 110 includes a bus 112, a processor 114, a memory 116, and a communication interface 118. The processor 114, the memory 116, and the communication interface 118 communicate with each other via the bus 112. The computing device 110 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 110.

[0154] The processor 114 may be a central processing unit (CPU), or may include the CPU and other hardware chips. The aforementioned hardware chips may be of various types, such as graphics processing unit (GPU), data processing unit (DPU), neural network processing unit (NPU), application-specific integrated circuit (ASIC), microprocessor (MP), digital signal processor (DSP), system on chip (SoC), or programmable logic device (PLD), etc. Among them, PLD includes field-programmable gate array (FPGA), complex programmable logical device (CPLD), or generic array logic (GAL). The computing device 110 may include one or more of the aforementioned hardware chips, or may include one or more of any one of the aforementioned types of hardware chips, or may include multiple types of the aforementioned hardware chips. This application does not make specific limitations.

[0155] The memory 116 may include volatile memory, such as random access memory (RAM). The memory 116 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD). Furthermore, the memory 116 may also be implemented using storage class memory (SCM), phase change memory (PCM), or other types of storage media. It should be noted that the same type of storage media can be configured in the same computing device to implement the function of the memory 116, or two or more types of storage media can be configured to implement the function of the memory 116; this application does not limit this.

[0156] The memory 116 stores executable program code, and the processor 114 executes the executable program code to implement the methods described in the embodiments corresponding to Figures 4 to 9. That is, the memory 116 stores program code for implementing the functions of the data processing system 200, thereby implementing the methods described in the embodiments corresponding to Figures 4 to 9. The program code includes one or more software modules, including the acquisition module 110, processing module 120, extraction module 130, and construction module 140 shown in Figure 10. The processor 114 executes the executable program code to implement the corresponding flow of the methods described in the embodiments corresponding to Figures 3 to 9, which will not be elaborated further here.

[0157] Bus 112 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The Unified Bus is also known as the Lingqu Bus. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one line is used in Figure 11, but this does not imply that there is only one bus or one type of bus. Bus 112 can include pathways for transmitting information between various components of computing device 110 (e.g., memory 116, processor 114, communication interface 118).

[0158] Communication interface 118 can be a wired interface or a wireless interface, used for communicating with other modules or devices. For example, it can receive the aforementioned parsing request and send the parsing result. The wired interface can be an Ethernet interface, a local interconnect network (LIN), etc., while the wireless interface can be a cellular network interface or a wireless LAN interface.

[0159] This application also provides a computing device cluster. The computing device cluster includes multiple computing devices 110. The computing devices can be servers, such as central servers, edge servers, local servers in a local data center, or servers in a cloud environment data center. In some embodiments, the computing devices can also be terminal devices such as desktop computers, laptops, or smartphones.

[0160] As shown in Figure 12, which is a schematic diagram of a computing device cluster provided in this application, the memory 116 of the multiple computing devices 110 in the computing device cluster can store the same operational steps for implementing the methods described in the method embodiments corresponding to Figures 4 to 9.

[0161] In some possible implementations, the memories 116 of multiple computing devices 110 in the computing device cluster may each store partial program code for implementing the above-described methods. That is, the memories 116 of different computing devices 110 in the computing device cluster may store different program codes, which are respectively used to execute partial operations of the methods described in the method embodiments corresponding to Figures 4 to 9. The combination of multiple computing devices 110 can jointly implement the methods described in the method embodiments corresponding to Figures 4 to 9. For example, one computing device 110 is used to implement the text parsing method in the embodiment corresponding to Figure 5, and another computing device 110 is used to implement the method of building a rule logic tree in the embodiment corresponding to Figure 8.

[0162] In some possible implementations, one or more computing devices 110 in a computing device cluster can be connected via a network, which can be a wide area network (WAN) or a local area network (LAN). Figure 13 is a schematic diagram of a connection between computing devices provided in this application. Computing device 110A and computing device 110B are connected via a network. Specifically, they are connected to the network through communication interfaces in computing devices 110A and 110B. In this implementation, the memory 116 in computing device 110A stores program code for implementing text parsing in the embodiment corresponding to Figure 5, i.e., it stores program code for implementing the functions of the acquisition module 110 and the processing module 120; the memory 116 in computing device 110B stores program code for implementing the method of building a rule logic tree in the embodiment corresponding to Figure 8, i.e., it stores program code for implementing the functions of the extraction module 130 and the construction module 140.

[0163] The connection method between computing devices 110 in the computing device cluster shown in Figure 13 can be as follows: considering that the establishment of rule logic tree and the parsing of text based on rule logic tree are two different functions provided in this application, the functions of acquisition module 110 and processing module 120 are handed over to computing device 110A, and the functions of establishment extraction module 130 and construction module 140 are handed over to computing device 110B.

[0164] It should be understood that the functions of computing device 110A shown in Figure 13 can also be performed by multiple computing devices 110. Similarly, the functions of computing device 110B can also be performed by multiple computing devices 110.

[0165] This application also provides a chip or a chip system including multiple chips. The chip may include a processing unit and a power supply circuit. The power supply circuit can supply power to the processing unit, so that the power supply unit performs the relevant operation steps described in the embodiments corresponding to Figures 4 to 9 above.

[0166] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, the at least one computing device implements the methods described in the method embodiments corresponding to Figures 4 to 9.

[0167] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium, or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to implement the methods described in the method embodiments corresponding to Figures 4-9.

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A text parsing method, characterized in that, The method is executed by a data processing system and includes: Obtain a parsing request, which indicates the text to be parsed; According to the parsing request, a first logical tree is obtained from the logical tree library; wherein, the first logical tree includes multiple nodes, each node represents an element, each element represented by a node is associated with an element value, the multiple nodes constitute multiple paths, and the two paths of the multiple paths include nodes with the same element but different element values. A parsing path is determined based on the text to be parsed and the first logic tree; the parsing path is used to indicate the process of parsing the text to be parsed, and the parsing path is one of the multiple paths included in the first logic tree.

2. The method according to claim 1, characterized in that, The step of obtaining the first logic tree from the logic tree library according to the parsing request includes: Obtain the target business scenario corresponding to the text to be parsed, and obtain the first logic tree from the logic tree library according to the target business scenario and the mapping relationship; wherein, the mapping relationship is used to indicate the association between each business scenario in multiple business scenarios and the rule logic trees included in the logic tree library, each business scenario is associated with at least one rule logic tree in the logic tree library, and the first logic tree is one of the at least one rule logic trees associated with the target business scenario.

3. The method according to claim 1 or 2, characterized in that, The first logic tree includes a reference node, which is used to indicate that the first logic tree connects to the second logic tree at the reference node; wherein the first logic tree and the second logic tree are two different rule logic trees in the logic tree library, and the reference node is one of a plurality of nodes included in the first logic tree.

4. The method according to claim 3, characterized in that, The step of determining the parsing path based on the text to be parsed and the first logic tree includes: Based on the multiple elements included in the first logic tree and the text to be parsed, obtain the input element values ​​corresponding to k elements among the multiple elements in the text to be parsed, and obtain k input element values; wherein, the k elements are some or all of the multiple elements included in the first logic tree, and k is an integer greater than 1; The parsing path is determined based on the k elements, the k input element values, and the element values ​​associated with each element in the plurality of elements included in the first logic tree; wherein, the input element value corresponding to the first element in the parsed text is the same as the element value associated with the first element in the parsing path, and the first element is an element in the parsing path.

5. The method according to claim 3 or 4, characterized in that, Before obtaining the parsing request, it also includes: Obtain knowledge-type text, and obtain the corresponding domain logic tree based on the knowledge-type text. The domain logic tree includes m elements; wherein each of the m elements has no associated element value, and m is an integer greater than 1. Obtain n elements from the m elements included in the knowledge text; wherein, in the knowledge text, each of the n elements is associated with at least one element value, and n is an integer greater than 1 and n is less than or equal to m; Construct a first logic tree corresponding to the knowledge-type text based on the domain logic tree, the n elements, and at least one element value associated with each element.

6. The method according to claim 5, characterized in that, The step of constructing the first logic tree corresponding to the knowledge-type text based on the domain logic tree, the n elements, and at least one element value associated with each element includes: A third logic tree corresponding to the knowledge text is constructed based on the domain logic tree, the n elements, and at least one element value associated with each element; wherein, the second element among the n elements is associated with i element values, the third logic tree includes i second elements, the i second elements are located in i paths of the third logic tree, and the element value associated with the second element in each of the i paths corresponds one-to-one with the i element values, where i is an integer greater than 1; The first logic tree corresponding to the knowledge-type text is obtained based on the third logic tree.

7. The method according to claim 6, characterized in that, The step of obtaining the first logic tree corresponding to the knowledge-type text based on the third logic tree includes: Obtain the second logic tree; wherein the second logic tree is a rule logic tree that already exists in the logic tree library; The target path in the third logic tree is determined based on the second logic tree and the third logic tree. The target path includes at least one of the multiple paths included in the third logic tree. The multiple nodes included in the first path in the third logic tree are the same as the multiple nodes included in the second path in the second logic tree. The nodes being the same in the two paths means that the elements represented by the nodes and the element values ​​associated with the elements are the same. The first path is one of the target paths. The matching degree between the third logic tree and the second logic tree is determined based on the number of target paths, the number of paths included in the third logic tree, and the number of paths included in the second logic tree. If the matching degree is greater than or equal to the first threshold, the target path in the third logical tree is replaced with the second logical tree to obtain the first logical tree.

8. The method according to claim 7, characterized in that, The step of replacing the target path in the third logic tree with the second logic tree to obtain the first logic tree includes: If the target path in the third logic tree is replaced with the second logic tree, and there are no nodes with the same element in the third path, then the rule logic tree obtained by replacing the target path in the third logic tree with the second logic tree is used as the first logic tree; the third path is any path in the rule logic tree obtained by replacing the target path in the third logic tree with the second logic tree.

9. The method according to any one of claims 5-8, characterized in that, The knowledge-based texts include laws, regulations, or policy documents.

10. A data processing system, characterized in that, include: The acquisition module is used to acquire a parsing request, wherein the parsing request includes the text to be parsed; The processing module is used to obtain a first logical tree from the logical tree library according to the parsing request; wherein the first logical tree includes multiple nodes, each node represents a feature, each feature represented by a node is associated with a feature value, the multiple nodes constitute multiple paths, and the two paths of the multiple paths include nodes with the same feature but different feature values. The processing module is further configured to determine a parsing path based on the text to be parsed and the first logic tree; the parsing path is used to indicate the process of parsing the text to be parsed, and the parsing path is one of the multiple paths included in the first logic tree.

11. The system according to claim 10, characterized in that, The processing module is specifically used for: Obtain the target business scenario corresponding to the text to be parsed, and obtain the first logic tree from the logic tree library according to the target business scenario and the mapping relationship. The mapping relationship is used to indicate the association relationship between each business scenario in the multiple business scenarios and the rule logic trees included in the logic tree library. Each business scenario is associated with at least one rule logic tree in the logic tree library, and the first logic tree is one of the at least one rule logic trees associated with the target business scenario.

12. The system according to claim 10 or 11, characterized in that, The first logic tree includes a reference node, which is used to indicate that the first logic tree connects to the second logic tree at the reference node; wherein the first logic tree and the second logic tree are two different rule logic trees in the logic tree library, and the reference node is one of a plurality of nodes included in the first logic tree.

13. The system according to claim 12, characterized in that, The processing module is specifically used for: Based on the multiple elements included in the first logic tree and the text to be parsed, obtain the input element values ​​corresponding to k elements among the multiple elements in the text to be parsed, and obtain k input element values; wherein, the k elements are some or all of the multiple elements included in the first logic tree; The parsing path is determined based on the k elements, the k input element values, and the element values ​​associated with each element in the plurality of elements included in the first logic tree; wherein, the input element value corresponding to the first element in the parsed text is the same as the element value associated with the first element in the parsing path, and the first element is an element in the parsing path.

14. The system according to claim 12 or 13, characterized in that, The system also includes an extraction module and a construction module. The acquisition module is also used to acquire knowledge-type text and acquire the corresponding domain logic tree based on the knowledge-type text. The domain logic tree includes m elements, and each of the m elements has no associated element value. The extraction module is further configured to obtain n elements from the m elements included in the knowledge text; wherein, in the knowledge text, each of the n elements is associated with at least one element value, and n is less than or equal to m; The construction module is further configured to construct a first logic tree corresponding to the knowledge-type text based on the domain logic tree, the n elements, and at least one element value associated with each element.

15. The system according to claim 14, characterized in that, The building module is specifically used for: A third logic tree corresponding to the knowledge text is constructed based on the domain logic tree, the n elements, and at least one element value associated with each element; wherein, the second element among the n elements is associated with i element values, the third logic tree includes i second elements, the i second elements are located in i paths of the third logic tree, and the element value associated with the second element in each of the i paths corresponds one-to-one with the i element values, where i is an integer greater than 1; The first logic tree corresponding to the knowledge-type text is obtained based on the third logic tree.

16. The system according to claim 15, characterized in that, The building module is specifically used to include: Obtain the second logic tree; wherein the second logic tree is a rule logic tree that already exists in the logic tree library; The target path in the third logic tree is determined based on the second logic tree and the third logic tree. The target path includes at least one of the multiple paths included in the third logic tree. The multiple nodes included in the first path in the third logic tree are the same as the multiple nodes included in the second path in the second logic tree. The nodes being the same in the two paths means that the elements represented by the nodes and the element values ​​associated with the elements are the same. The first path is one of the target paths. The matching degree between the third logic tree and the second logic tree is determined based on the number of target paths, the number of paths included in the third logic tree, and the number of paths included in the second logic tree. If the matching degree is greater than or equal to the first threshold, the target path in the third logical tree is replaced with the second logical tree to obtain the first logical tree.

17. The system according to claim 16, characterized in that, The building module is specifically used for: If the target path in the third logic tree is replaced with the second logic tree and the resulting rule logic tree does not contain nodes with the same element, then the rule logic tree obtained by replacing the target path in the third logic tree with the second logic tree shall be used as the first logic tree. The third path is any path in the rule logic tree obtained by replacing the target path in the third logic tree with the second logic tree.

18. The system according to any one of claims 14-17, characterized in that, The knowledge-based texts include laws, regulations, or policy documents.

19. A computing device, characterized in that, The computing device includes a processor and a memory, the processor being configured to execute instructions stored in the memory to cause the computing device to perform the method as described in any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a computing device, cause the computing device to perform the method as described in any one of claims 1 to 9.

21. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device, the computing device cluster causes the computing device cluster to perform the method as described in any one of claims 1 to 9.