Method for generating machine learning model, electronic device, program product
Through graph neural network encoding decision trees and generating corresponding problems, combined with natural language text generation machine learning models, the cumbersome navigation problems of decision trees in customer service are solved, and more efficient customer service solutions are achieved.
Patent Information
- Application Number
- CN202311198552.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-03-18
AI Technical Summary
Prior art When applying decision trees to customer service, technicians need to manually navigate the decision trees and need to adapt the questions and answers in the decision trees to natural language, resulting in cumbersome and inefficient processes.
By encoding the decision tree using a graph neural network, and inputting the encoded decision tree into the machine learning model, generating problems corresponding to the decision tree nodes, and then using natural language text and generated problems to generate the machine learning model.
It realizes the provision of solutions based on input text faster and more accurate, improves customer service efficiency and customer satisfaction, and reduces the operational complexity of technicians.
Smart Images

Figure CN119647617A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to methods, electronic devices, and computer program products for generating machine learning models. Background Art
[0002] Decision Tree is a widely used decision analysis method. It has a hierarchical tree structure consisting of a root node, edges, internal nodes, and leaf nodes. In machine learning, a decision tree is a prediction model that represents a mapping relationship between object attributes and object values. Decision trees are widely used in many fields such as medicine, health care, and education, and are used to make complex decisions based on a set of rules or criteria.
[0003] Typically, decision trees can be applied to customer service, but the traditional approach of using decision trees for customer service has some limitations and disadvantages, such as technicians need to manually navigate the decision tree by asking the customer each question and following each branch of the decision tree, which can be tedious and inefficient. The technician agent needs to adapt the questions and answers corresponding to the decision tree to natural language and interpret them according to the customer's situation, which can be challenging. Summary of the invention
[0004] The embodiments of the present disclosure relate to methods, electronic devices, and computer program products for generating machine learning models.
[0005] According to a first aspect of the present disclosure, a method for generating a machine learning model is provided, the method comprising: encoding a decision tree using a graph neural network; inputting the encoded decision tree into a machine learning model; using the machine learning model to generate questions corresponding to the root node and each of the internal nodes of the decision tree; inputting natural language text into the machine learning model; and generating the machine learning model using the input natural language text and the generated questions.
[0006] According to a second aspect of the present disclosure, an electronic device for generating a machine learning model is provided. The electronic device includes: a processor; and a memory, the memory being coupled to the processor and storing instructions, which, when executed by the processor, causes the device to perform the following actions: encoding a decision tree using a graph neural network; inputting the encoded decision tree into a machine learning model; using the machine learning model to generate questions corresponding to each of the root node and internal nodes of the decision tree; inputting natural language text into the machine learning model; and generating the machine learning model using the input natural language text and the generated questions.
[0007] According to a third aspect of the present disclosure, there is provided a computer program product, which is tangibly stored on a non-volatile computer-readable medium and includes machine-executable instructions, which when executed cause a machine to perform the steps of the method implemented in the first aspect of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like elements throughout the exemplary embodiments of the present disclosure.
[0009] Figure 1 Schematic diagrams showing examples in which the apparatus and / or method of embodiments of the present disclosure may be implemented.
[0010] Figure 2 A flowchart of a method for generating a machine learning model according to an embodiment of the present disclosure is shown.
[0011] Figure 3 A schematic diagram of a process of training a machine learning model according to an embodiment of the present disclosure is shown.
[0012] Figure 4 A schematic diagram of a decision tree according to an embodiment of the present disclosure is shown.
[0013] Figure 5 A schematic diagram showing a chain of questions and decisions generated by a machine learning model according to an embodiment of the present disclosure is shown.
[0014] Figure 6 A schematic diagram of a method for adjusting a machine learning model using a decision tree and a decision chain according to an embodiment of the present disclosure is shown.
[0015] Figure 7 A schematic diagram showing a usage scenario of a trained machine learning model according to an embodiment of the present disclosure is shown.
[0016] Figure 8 A schematic block diagram of an example device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0017] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some specific embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0018] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects, unless explicitly indicated to be different.
[0019] When applying decision trees to customer service, technical personnel need to manually match the corresponding nodes in the decision tree according to the text entered by the customer, and search the decision tree for solutions that match the text entered by the customer. This can easily lead to errors when the decision tree is complex, requires a lot of labor costs, and makes it difficult to provide customers with satisfactory services.
[0020] Based on the above problems, the present application provides a method for generating a machine learning model, which encodes a decision tree through a graph neural network and inputs it into the machine learning model, then enables the machine learning model to generate questions corresponding to the root node and each node in the internal node of the decision tree, and finally generates the machine learning model using natural language text and the decision tree. The machine learning model generated by this method can realize a machine learning model that provides solutions based on the input text faster, more accurately and more satisfactorily.
[0021] In addition, when applying this machine learning model to customer service, it has many advantages over the above solution of applying decision trees to customer service. For example, technicians do not need to store or find decision trees for each server model and configuration because they are already encoded into the machine learning model, which can be retrieved more easily and quickly. Technicians do not need to manually navigate the decision tree by asking each question and following each branch of the decision tree.
[0022] The basic principles and several exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Figure 1 A schematic diagram of an example 100 is shown in which the apparatus and / or method of embodiments of the present disclosure may be implemented.
[0023] Figure 1 It may include natural language text 102, decision tree 104, encoded decision tree 106, electronic device 108, and machine learning model 110. It should be understood that Figure 1The types and numbers of models, data transmission processes, arrangements, etc. shown are only exemplary, and the example 100 may include models of different numbers and arranged in different ways, data transmission processes, and various additional elements, etc. It should be understood that the above examples are only used to illustrate the application of the target machine learning model 102. With the development of technology, the target machine learning model 102 may include various known or unknown applications in various fields and aspects.
[0024] In the example environment 100, the target machine learning model 102 can be installed in any electronic device with processing computing resources or storage resources. For example, the electronic device can have common capabilities such as receiving and sending data requests, real-time data analysis, local data storage, and real-time network connection. Electronic devices can generally include various types of devices. Examples of electronic devices may include, but are not limited to: desktop computers, laptops, smart phones, wearable devices, security equipment, smart manufacturing equipment, smart home devices, Internet of Things devices, smart cars, drones, etc., and the present disclosure does not impose any restrictions on this.
[0025] According to an embodiment of the present disclosure, the machine learning model 110 may be a machine learning model including a large language model such as GPT-3. Figure 1 As shown, the machine learning model 110 is trained by inputting the encoded decision tree 106 and the natural language text 102 into the machine learning model 110 included in the electronic device 108. The encoded decision tree 106 is obtained by encoding the decision tree 104 using a graph neural network. The specific encoding method will be described in detail in the Figure 3 Detailed description is given in the description.
[0026] Figure 2 A flow chart of a method for generating a machine learning model according to an embodiment of the present disclosure is shown. Figure 2 The method in can generate Figure 1 The machine learning model 110 shown in .
[0027] In block 202, the decision tree is encoded using a graph neural network. In some embodiments, the decision tree needs to be converted into a directed acyclic graph (DAG). The decision tree in the form of a directed acyclic graph is then encoded using a graph neural network so that it can be input into the machine learning model as an embedding of the machine learning model.
[0028] At block 204, the encoded decision tree is input into the machine learning model. In some embodiments, the encoded decision tree can be directly input into the machine learning model as an embedding after being encoded using a graph neural network, or can be input into the machine learning model as an embedding together with the natural language text when executing the steps of block 208. At this time, the embedding input into the machine learning model contains information about all edges and all nodes of the decision tree.
[0029] In block 206, questions corresponding to the root node and each of the internal nodes of the decision tree are generated using the machine learning model. In this embodiment, the decision tree includes leaf nodes, internal nodes, and root nodes, wherein the leaf nodes are nodes with the highest depth in the decision tree, and each leaf node includes a solution that may be related to the natural language text. In other embodiments, questions corresponding to only the root node and a portion of the internal nodes of the decision tree may also be generated.
[0030] At block 208, the natural language text is input to the machine learning model. In some embodiments, the natural language text may include information corresponding to a portion of the questions generated at block 206. Information corresponding to any of the questions generated at block 206 may also not be included.
[0031] In block 210, a machine learning model is generated using the input natural language text and the generated questions. The machine learning model generated in the above manner can provide solutions based on the input text faster, more accurately and more satisfactorily. This can obviously enhance the performance and efficiency of various customer services and improve the comfort of customers when using it.
[0032] The following will combine Figures 3 to 7 The embodiments of the present disclosure are described in detail. For ease of understanding, the specific embodiments mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It is understood that the embodiments described below may also include additional actions not shown and / or may omit the actions shown, and the scope of the present disclosure is not limited in this respect.
[0033] Figure 3 A schematic diagram of a process of training a machine learning model according to an embodiment of the present disclosure is shown. Figure 4 A schematic diagram of a decision tree according to an embodiment of the present disclosure is shown. Figure 5 FIG. 1 is a schematic diagram showing a question and decision chain generated by a machine learning model according to an embodiment of the present disclosure. Figures 3 to 5 Give a description.
[0034] like Figure 3As shown, according to some embodiments, the process 300 of training a machine learning model includes a pre-training process 302 and an inference process 322.
[0035] In the first step 304 of the pre-selection process 302, the decision tree 400 (see Figure 4 ) is converted into a directed acyclic graph.
[0036] Before further explanation of step 304, please refer to Figure 4 Describe the structure of a decision tree. Figure 4 As shown, decision tree 400 includes root node 402, multiple internal nodes 412, 414, 422, 424, 426, 428 and multiple leaf nodes 432, 434, 436, 438, 440, 442, 444, 446. Root node 402 is the node with the shallowest depth in decision tree 400, and leaf node is the node with the deepest depth in decision tree 400. The depth of the node gradually increases from the root node to the leaf node. Nodes are connected by edges (e.g., 403, 416, 418, 430, 431, 433, 435, etc.), and each leaf node includes a solution for solving each target problem. Figure 4 The decision tree 400 shown in FIG. 4 is only an example, and the number and structure of nodes may be modified as needed.
[0037] Now, back to Figure 3 Step 304, in order to Figure 4 The decision tree 400 shown is used as an embedding input into a machine learning model. The decision tree needs to be converted into a directed acyclic graph of the form G = (V, E). Where V is a node set and E is an edge set. The node set represents the set of the root node and all internal nodes. The edge set represents the set of all edges in the decision tree. Each node v∈V has an associated label l representing the rule or criterion used to make the decision. v , and each edge e = (u, v) ∈ E has an associated label l representing a possible outcome or choice of the rule or criterion at node u e The root node r∈V is the starting point of the decision-making process, while the leaf nodes are the final solutions or decisions.
[0038] After executing step 304, step 306 of encoding the decision tree using a graph neural network is performed. Specifically, in order to encode the decision tree into a compact and meaningful representation that can be fed to a machine learning model (such as a large language model of GPT-3), a graph neural network (GNN) that can learn node embeddings based on the graph structure and node labels is used to encode the decision tree converted into a directed acyclic graph form. GNN consists of two main parts: a message passing function and an aggregation function. The message passing function calculates the message of each node based on the embeddings of its neighboring nodes (neighboring in the depth direction) and the associated labels of the edges, and the aggregation function updates the embedding of each node by aggregating messages from its neighboring nodes. The message passing and aggregation functions are iteratively applied for a fixed number of steps or until convergence. Formally, denotes the embedding of node v at step t, and let h e represents the embedding of edge e. And and h e =g(l e ), where f and g are some embedding functions (e.g., one-hot encoding or word embedding). Then, at each step t, compute:
[0039]
[0040] where N(v) is the set of neighboring nodes of node v, ⊙ is the element-wise product, σ is a nonlinear activation function (e.g., ReLU), and W and b are learnable parameters. After T steps, the final node embedding for each node v∈V can be obtained
[0041] At step 306, the final node embedding of each node v∈V is obtained. Afterwards, step 308 of inputting the encoded decision tree into the machine learning model is performed. Input to the machine learning model.
[0042] Next, the step 310 of generating a question based on a decision tree is performed using a machine learning model. Specifically, the machine learning model generates a question based on the input node embedding. Generate natural language questions corresponding to the root node 402 and all internal nodes in the decision tree 400. As mentioned above, an example of a machine learning model can be GPT-3. GPT-3 is a large-scale pre-trained language model that can generate coherent and diverse text given some initial tokens or prompts. As an example only, GPT-3 is used as a conditional text generator based on node embeddings. Generate natural language questions corresponding to the root node 402 and all internal nodes in the decision tree 400. As shown above, GPT-3 can also generate questions corresponding to only the root node of the decision tree and some of the internal nodes. As an embodiment, the machine learning model can generate questions starting from the questions corresponding to the root node in a depth-first manner. At each node, the machine learning model uses some predefined templates or formats (e.g., "Is...?", "What is...?", "How...?"). For example, if Figure 4 The root node 402 in is "age>18", and the machine learning model can generate a root question 502 such as "Is this person over 18 years old?"
[0043] It is worth noting that the encoded decision tree input in step 308 includes information about the leaf nodes of the decision tree, but only questions about the root node and internal nodes of the decision tree are generated in step 310. The questions generated in step 310 are as follows: Figure 5 shown.
[0044] See also Figure 5 , the root question 502 generated by the machine learning model is related to Figure 4 The root node 402 of the decision tree 400 corresponds to the internal question 512, and the internal question 512 corresponds to the internal node 412. Similarly, the internal nodes 414, 422, 424, 426, and 428 correspond to the internal questions 514, 522, 524, 526, and 528, respectively. However, the machine learning model does not generate questions corresponding to leaf nodes, and the highest depth internal questions still point to Figure 4 That is, internal question 522 points to solutions 532 and 534, internal question 524 points to solutions 536 and 538, internal question 524 points to solutions 536 and 538, internal question 526 points to solutions 540 and 542, and internal question 528 points to solutions 544 and 546.
[0045] After generating a natural language question corresponding to the root node 402 and all internal nodes in the decision tree 400, performing the task of combining the question and the nodes (such as Figure 4 The root node 402 and Figure 5 The root problem 502 in step 312 is stored in the stack.
[0046] Steps 304, 306, 308, 310, and 312 are referred to as pre-training steps. After executing these steps, the machine learning model has completed pre-training and can execute the solution combined with natural language text output.
[0047] At step 314, the natural language text and the decision tree are input to the machine learning model. Specifically, the root node embedding is concatenated with the natural language text embedding to form a combined input for the machine learning model:
[0048]
[0049] where e t is the embedding of natural language text obtained by some pre-trained language model (e.g., BERT). However, since the node embedding Input to the machine learning model, in step 314, only the natural language text embedding e t .
[0050] After receiving the input x, the machine language model can obtain an answer based on the natural language text and the decision tree (step 316). Here, the root question 502 generated in step 310, "Is this person over 18 years old?", is used as an example for explanation. If the input natural language text is "Alice is a 19-year-old student who has been vaccinated and is not allergic to vaccines.", the machine learning model can obtain the answer 503 "Yes, Alice is over 18 years old" based on the natural language text.
[0051] After obtaining the answer 503, step 318 of determining the next question based on the answer is performed. Since the answer 503 corresponds to the edge 403 in the decision tree 400, the next question is the internal question 512 corresponding to the internal node 412. For example, the internal node 412 may be "vaccine allergy", and the corresponding internal question 512 is "Is this person allergic to vaccines?", and then steps 316 and 318 are repeatedly performed until a leaf node in the decision tree is reached, or until an answer to the current question cannot be obtained from the input natural language text.
[0052] Continue to explain with the input natural language text "Alice is a 19-year-old student who has been vaccinated and is not allergic to vaccines." as an example. The machine learning model obtains the answer 518 "No, Alice is not allergic to vaccines" about the internal question 512 "Is this person allergic to vaccines?" from the natural language text "Alice is a 19-year-old student who has been vaccinated and is not allergic to vaccines." Since the answer 518 corresponds to the edge 418 in the decision tree 400, it is determined that the next question is the internal question 524 "Has this person been vaccinated?" corresponding to the internal node 424 "Vaccinated". The machine learning model obtains the answer 533 "Yes, Alice has been vaccinated" about the internal question 524 from the natural language text. At this time, since the answer 533 corresponds to the edge 433 connected to the leaf node 436, the leaf node in the decision tree has been reached. If the natural language text input to the machine learning model is "Alice is a 19-year-old student who is not allergic to vaccines.", the answer to the internal question 524 "Has this person been vaccinated?" cannot be obtained from the natural language text. Therefore, the next step is performed to output the solution or specific text (step 320).
[0053] In step 320, in the case of reaching a leaf node in the decision tree, in this example, the output solution may be solution 526 "Not suitable for vaccination" corresponding to leaf node 436. In the case where the answer to the current question cannot be obtained from the input natural language text, the output specific text may be "Sorry, it is not possible to determine whether vaccination is suitable".
[0054] The questions, nodes corresponding to the questions, and answers generated during the execution of steps 316 and 318 can be represented as a sequence of tokens y=[y 1 ,y 2 ,...,y n ] and is output.
[0055] pass Figures 3 to 5 The described method for generating a machine learning model is not only easy to operate, but also has the advantages of fast retrieval speed and high accuracy. In order to further improve the quality and accuracy of the solutions provided based on the input natural language text, other embodiments of the present disclosure also provide a technical solution for further adjusting the machine learning model using a decision tree and a decision chain.
[0056] Reference below Figure 6 A method 600 for adjusting a machine learning model using decision trees and decision chains is specifically described. Figure 6 Steps 604, 606, and 608 in Figure 3 The steps 314, 316, and 318 in FIG. 314 correspond to those in FIG. Therefore, they will not be described again here.
[0057] Step 606 of obtaining an answer based on the natural language text and the decision tree and step 608 of determining the next question based on the answer are repeated until a leaf node in the decision tree is reached, or until the answer to the current question cannot be obtained from the input natural language text, a decision chain including all determined questions and all answers corresponding to the questions is generated (step 610). Figure 5 As shown in 500.
[0058] The generated decision chain 500 is then compared with all paths in the decision tree 400 (step 612). The path in the decision tree 400 represents all nodes and edges included from the root node to any leaf node. Specifically, the decision chain is output from the machine learning model by parsing the question and answer into triples in the form of (s, p, o), where s is the subject, p is the predicate, and o is the object. For example, the root question 502 "Is this person under 18 years old?" The answer is "Yes, Alice's age is over 18 years old", we can generate two triples: (person, age, >18) and (Alice, age, >18). The generated decision chain is then compared with the original decision tree by finding out whether there is a path identical to the generated decision chain. For example, if the original decision tree has a path like (r, age>18, v 1 ) and (v 1 , v 2 , not suitable for vaccination), where r is the root node, v 1 and v 2 If there are some internal nodes (internal node 412 and internal node 422), we can check whether the generated contains these triples. If so, it is judged that the generated questions and answers are correct and consistent with the decision tree. Otherwise, it is judged that there are some errors or inconsistencies in the generation process. Figure 4 and Figure 5 It can be seen that the decision chain 500 is consistent with the path 401 of the decision tree 400. Therefore, it is determined that the question and answer generated this time are correct.
[0059] Next, step 614 of adjusting the machine learning model using the loss function is performed. Specifically, the comparison in step 612 is used as the loss function to guide the training of the machine learning model. The parameters of the machine learning model and the graph neural network are updated by using back propagation and gradient descent to minimize the difference between the generated knowledge graph and the original decision tree. As an alternative embodiment, some auxiliary loss functions, such as cross entropy or mutual interference, can also be used to measure the fluency and coherence of the generated text. By minimizing these loss functions, the quality and accuracy of the generated questions and answers are improved.
[0060] Figure 7FIG. 7 is a schematic diagram of a usage scenario 700 of a trained machine learning model according to an embodiment of the present disclosure. Figure 3 After generating a machine learning model in a certain way or after completing Figure 6 After the adjustment shown, the generated machine learning model can provide a solution 706 matching the natural language text when receiving the input of the natural language text 702, or ask additional questions 708 when the answer to the generated question cannot be obtained. Such a machine learning model can enhance the performance and efficiency of various customer services and improve the comfort of customers when using it.
[0061] This trained machine learning model can be applied to the following scenarios. For example, a customer calls a technician to report a problem with their power supply server. The technician needs to identify the cause of the problem and provide a solution or workaround. In this scenario, the machine learning model generated using the method of the present application has the following advantages.
[0062] First, the technician does not need to look up the decision tree corresponding to the power supply server that the customer asked the question about, because it has already been encoded into the machine learning model. Second, because the machine learning model determines the questions corresponding to the nodes of the decision tree and obtains the answers based on the graph neural network embedding and the input natural language text, the technician does not need to manually determine the path of the decision tree by asking each question and following each edge of the decision tree. Third, the technician does not need to adapt the questions and answers to natural language and edit the generated answers according to the specific situation of the customer, because the machine learning model produces fluent and coherent text customized to the customer's needs.
[0063] In addition to the above advantages, the machine learning model generated by the method of the present application also has higher accuracy, efficiency, consistency and customer satisfaction than the prior art. Specifically, since the method of the present application uses graph neural network embedding technology to capture the structure and semantics of the decision tree, and uses machine learning models (such as large language models of GPT-3) to generate technology using input natural language text and large pre-trained knowledge, the accuracy of server problem identification and resolution is improved, which can reduce errors or inconsistencies that may be caused by manual search or navigation of decision trees, or manual adjustment or interpretation of questions and answers, and can save time and energy that may be spent on storing or searching decision trees, or manually asking and tracking questions and answers. It can also enable technicians to provide the same service quality and service standards for different customers and situations, which makes it possible to enhance communication and interaction between customers and technicians, and increase the possibility of finding and providing satisfactory solutions or workarounds.
[0064] Figure 8A schematic block diagram of an example device 800 that may be used to implement embodiments of the present disclosure is shown. Figure 1 The electronic device in can be implemented by device 800. As shown in the figure, device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or computer program instructions loaded from a storage unit 808 to a random access memory (RAM) 803. In RAM 803, various programs and data required for the operation of storage device 800 can also be included. CPU 801, ROM 802 and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to bus 804.
[0065] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage page 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0066] The various processes and processing described above, such as method 200, may be performed by processing unit 801. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by CPU 801, one or more actions of method 200 described above may be performed.
[0067] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0068] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0069] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0070] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0071] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0072] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0073] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0074] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0075] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for generating a machine learning model, the method comprising: Encoding decision trees using graph neural networks; Inputting the encoded decision tree into a machine learning model; generating, using the machine learning model, questions corresponding to a root node and each of the internal nodes of the decision tree; Inputting natural language text into the machine learning model; as well as The machine learning model is generated using the input natural language text and the generated questions.
2. The method according to claim 1, further comprising: Obtaining an answer to a question corresponding to a root node of the decision tree from the natural language text using the machine learning model; Based on the answer to the question corresponding to the root node, determining a first internal node question corresponding to a first internal node which is a node at a depth next to the root node, and acquiring an answer to the first internal node question from the natural language text; as well as Repeat the steps of obtaining the answer to the question corresponding to the current node from the natural language text and determining the question corresponding to the node at the next depth based on the answer, until the answer to the question corresponding to the node at the previous depth of the leaf node of the decision tree is obtained from the natural language text, or the answer to the current question cannot be obtained from the natural language text.
3. The method according to claim 2, further comprising: constructing a decision chain using the answers obtained from the natural language text and the corresponding questions; comparing the decision chain to the decision tree; as well as It is determined whether there is a path in the decision tree that is consistent with the decision chain.
4. The method according to claim 3, further comprising: In the case where there is no path in the decision tree that is consistent with the decision chain, the machine learning model is adjusted using a loss function to minimize the path deviation between the decision tree and the decision chain.
5. The method according to claim 2, further comprising: In the event that the answer to the current question cannot be obtained from the natural language text, a statement indicating that no solution matching the natural language text can be found is output; in response to obtaining the answer to the question corresponding to the node at the previous depth of the leaf node from the natural language text, a solution for the leaf node in the decision tree is output based on the answer to the question corresponding to the node at the previous depth of the leaf node.
6. The method of claim 1, wherein encoding the decision tree with a graph neural network comprises: Converting the decision tree into a directed acyclic graph form; as well as The directed acyclic graph form is encoded as an embedding of the machine learning model using a graph neural network.
7. The method according to claim 2, further comprising: After completing the repeating step, the answer and the corresponding question obtained by using the natural language text are output.
8. The method according to claim 1, further comprising: Inputting a target natural language text into the machine learning model; as well as A scheme for causing the machine learning model to output leaf nodes in the decision tree that match the target natural language text.
9. The method according to claim 8, further comprising: In the event that the machine learning model cannot find the solution that matches the target natural language text, additional questions required to find the solution that matches the target natural language text are output.
10. An electronic device, comprising: processor; as well as A memory is coupled to the processor and stores instructions that, when executed by the processor, cause the device to perform the following actions: Encoding decision trees using graph neural networks; Inputting the encoded decision tree into a machine learning model; generating, using the machine learning model, questions corresponding to a root node and each of the internal nodes of the decision tree; Inputting natural language text into the machine learning model; as well as The machine learning model is generated using the input natural language text and the generated questions.
11. The electronic device of claim 10, wherein the memory further causes the device to perform the following actions: Obtaining an answer to a question corresponding to a root node of the decision tree from the natural language text using the machine learning model; Based on the answer to the question corresponding to the root node, determining a first internal node question corresponding to a first internal node which is a node at a next depth of the root node, and acquiring an answer to the first internal node question from the natural language text; and Repeat the steps of obtaining the answer to the question corresponding to the current node from the natural language text and determining the question corresponding to the node at the next depth based on the answer, until the answer to the question corresponding to the node at the previous depth of the leaf node of the decision tree is obtained from the natural language text, or the answer to the current question cannot be obtained from the natural language text.
12. The electronic device of claim 11, wherein the memory further causes the device to perform the following actions: constructing a decision chain using the answers obtained from the natural language text and the corresponding questions; comparing the decision chain to the decision tree; and It is determined whether there is a path in the decision tree that is consistent with the decision chain.
13. The electronic device of claim 12, wherein the memory further causes the device to perform the following actions: In the case where there is no path in the decision tree that is consistent with the decision chain, the machine learning model is adjusted using a loss function to minimize the path deviation between the decision tree and the decision chain.
14. The electronic device of claim 11, wherein the memory further causes the device to perform the following actions: When the answer to the current question cannot be obtained from the natural language text, a statement indicating that no solution matching the natural language text can be found is output; when the answer to the question corresponding to the node at the previous depth of the leaf node is obtained from the natural language text, the solution in the leaf node in the decision tree is output based on the answer to the question corresponding to the node at the previous depth of the leaf node.
15. The electronic device of claim 10, wherein encoding the decision tree with a graph neural network comprises: Converting the decision tree into a directed acyclic graph form; as well as The directed acyclic graph form is encoded as an embedding of the machine learning model using a graph neural network.
16. The electronic device of claim 11, wherein the memory further causes the device to perform the following actions: After completing the repeating step, the answer and the corresponding question obtained by using the natural language text are output.
17. The electronic device of claim 10, wherein the memory further causes the device to perform the following actions: Inputting a target natural language text into the machine learning model; and A scheme for causing the machine learning model to output leaf nodes of the decision tree that match the target natural language text.
18. The electronic device of claim 17, wherein the memory further causes the device to perform the following actions: In the event that the machine learning model cannot find the solution that matches the target natural language text, additional questions required to find the solution that matches the target natural language text are output.
19. A computer program product tangibly stored on a non-transitory computer readable storage medium and comprising computer executable instructions that, when executed, cause a computer to: Encoding decision trees using graph neural networks; Inputting the encoded decision tree into a machine learning model; generating, using the machine learning model, questions corresponding to a root node and each of the internal nodes of the decision tree; inputting natural language text into the machine learning model; and The machine learning model is generated using the input natural language text and the generated questions.
20. The computer program product of claim 19, wherein the computer executable instructions, when executed, further cause a computer to: Obtaining an answer to a question corresponding to a root node of the decision tree from the natural language text using the machine learning model; Based on the answer to the question corresponding to the root node, determining a first internal node question corresponding to a first internal node which is a node at a next depth of the root node, and acquiring an answer to the first internal node question from the natural language text; and Repeat the steps of obtaining the answer to the question corresponding to the current node from the natural language text and determining the question corresponding to the node at the next depth based on the answer, until the answer to the question corresponding to the node at the previous depth of the leaf node of the decision tree is obtained from the natural language text, or the answer to the current question cannot be obtained from the natural language text.