Intelligent question answering method, apparatus, device, medium, and program product
Patent Information
- Application Number
- CN202611038391.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本申请实施例提供一种智能问答方法、装置、设备、介质及程序产品,用以解决现有技术面对需要多步骤逻辑推理的复杂问题时,缺乏对业务逻辑链路的建模能力,导致难以满足金融业务场景对精准回答的需求,从而影响了业务处理质量的问题
[0071] The intelligent question-answering method, apparatus, device, medium, and program products provided in this application embodiment obtain a query body by semantically parsing the business question input by the user, and obtains candidate subgraphs matching the query body from a pre-constructed knowledge graph, which can effectively correspond natural language questions with structured business knowledge. By inputting the candidate subgraphs into a graph neural network for multi-hop reasoning, the updated feature vectors corresponding to each node in the candidate subgraphs are obtained. Based on the feature vectors of the current node, neighboring nodes, and relationships between nodes, the transition probability is calculated, and a knowledge path is formed by hop-by-hop search. This realizes the modeling of complex business logic links, enhances the reasoning ability of multi-layer business associations, extracts the association links related to the question from scattered knowledge, and then determines the target knowledge path from at least one knowledge path and generates the answer to the business question based on the target knowledge path. This improves the accuracy of the question-answering results for complex business in banks, thereby helping to improve the quality of business processing.
Smart Images

Figure CN122925546A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an intelligent question-answering method, apparatus, device, medium, and program product. Background Technology
[0002] In the field of banking fintech, employees frequently need to access product information, business processes, compliance requirements, customer information, and other relevant knowledge during their daily operations. However, internal bank knowledge is typically scattered across multiple systems, documents, emails, and unstructured data.
[0003] Existing technologies implement question-and-answer systems for financial transactions using keyword matching or simple rule engines. For example, after a user inputs a natural language question, the answer is retrieved from a predefined knowledge base using keyword extraction and matching algorithms, or an answer is generated using a preset rule template.
[0004] However, when faced with complex problems that require multi-step logical reasoning, existing technologies lack the ability to model business logic chains, making it difficult to meet the demand for accurate answers in financial business scenarios, thus affecting the quality of business processing. Summary of the Invention
[0005] This application provides an intelligent question-answering method, apparatus, device, medium, and program product to address the problem that existing technologies lack the ability to model business logic links when faced with complex problems requiring multi-step logical reasoning, making it difficult to meet the demand for accurate answers in financial business scenarios and thus affecting the quality of business processing.
[0006] In a first aspect, embodiments of this application provide an intelligent question-answering method, the method comprising:
[0007] Semantic parsing is performed on the business question input by the user to obtain the query body;
[0008] Obtain candidate subgraphs that match the query body from a pre-built knowledge graph;
[0009] The candidate subgraph is input into the graph neural network for multi-hop inference to obtain the updated feature vectors corresponding to each node in the candidate subgraph.
[0010] Input multiple updated feature vectors into the path decoder to obtain at least one knowledge path;
[0011] Identify the target knowledge path from at least one knowledge path, and generate answers to business questions based on the target knowledge path;
[0012] The path decoder includes a transition probability calculation module and a path search module. The transition probability calculation module is used to calculate the transition probability of the current node jumping to each neighbor node based on the updated feature vector of the current node in the candidate subgraph, the updated feature vector of each neighbor node, and the feature vector of the relationship between the current node and each neighbor node. The path search module is used to select the next hop node hop by hop according to the transition probability until the target node type is reached or the preset maximum step size is reached, and the traversed nodes and relationships are concatenated into a knowledge path according to the access order.
[0013] In one possible embodiment, the semantic parsing of the business question input by the user yields a query body, including:
[0014] Identify the business category and at least one financial entity from the business question, and extract at least one contextual keyword from the business question;
[0015] Construct a query body based on business category, at least one financial entity, and at least one contextual keyword.
[0016] In one possible embodiment, determining a target knowledge path from at least one knowledge path and generating an answer to a business question based on the target knowledge path includes:
[0017] Calculate the path score for each candidate knowledge path. The path score is determined based on at least one of the following: path length, semantic matching degree with the query body, and time weight of knowledge in the path.
[0018] The knowledge path corresponding to the maximum path score is determined as the target knowledge path;
[0019] Reasoning and analysis are performed based on the target knowledge path to obtain answers to business questions.
[0020] In one possible embodiment, obtaining candidate subgraphs matching the query body from a pre-built knowledge graph includes:
[0021] Multiple candidate triples that semantically match the query body are obtained from a pre-built knowledge graph; the candidate triples include a head entity, a relation, and a tail entity.
[0022] Using the head and tail entities of each candidate triple, as well as the entities in the query body, as seed nodes, at least one connected subgraph in the knowledge graph that contains all seed nodes and satisfies the preset hop count condition is obtained.
[0023] Calculate the semantic similarity between each node and edge in each connected subgraph and the query body;
[0024] Nodes and / or edges with semantic similarity below a preset threshold are deleted from each connected subgraph to obtain at least one candidate subgraph.
[0025] In one possible embodiment, after inputting multiple updated feature vectors into the path decoder to obtain at least one knowledge path, the method further includes:
[0026] Obtain the context information of the user's current business and generate a context vector;
[0027] By fusing the context vector with each knowledge path, at least one updated knowledge path is obtained.
[0028] In one possible embodiment, the method further includes:
[0029] Obtain a standardized business dataset, which is generated from multi-source heterogeneous business data;
[0030] Perform entity recognition on text in a standardized business dataset and generate entity labels for each text.
[0031] Extract relationships from entity tags to generate relationship tags between entities;
[0032] Based on multiple entity tags and relation tags between entities, construct multiple triples; each triple includes a head entity, a relation, and a tail entity.
[0033] A knowledge graph is constructed based on multiple triples.
[0034] In one possible embodiment, entity recognition is performed on text in a standardized business dataset to generate entity labels, including:
[0035] Context encoding is performed on the text to obtain a context feature vector;
[0036] The context feature vector is input into the bidirectional long short-term memory network to obtain the bidirectional context feature vector;
[0037] Conditional random fields are used to perform sequence labeling on bidirectional contextual feature vectors to generate entity labels.
[0038] Secondly, embodiments of this application provide an intelligent question-answering device, the device comprising:
[0039] The parsing module is used to perform semantic parsing on the business questions input by the user to obtain the query body;
[0040] The acquisition module is used to retrieve candidate subgraphs that match the query body from a pre-built knowledge graph;
[0041] The inference module is used to input the candidate subgraph into the graph neural network for multi-hop inference to obtain the updated feature vectors corresponding to each node in the candidate subgraph.
[0042] The input module is used to input multiple updated feature vectors into the path decoder to obtain at least one knowledge path.
[0043] The generation module is used to determine the target knowledge path from at least one knowledge path and generate answers to business questions based on the target knowledge path.
[0044] The path decoder includes a transition probability calculation module and a path search module. The transition probability calculation module is used to calculate the transition probability of the current node jumping to each neighbor node based on the updated feature vector of the current node in the candidate subgraph, the updated feature vector of each neighbor node, and the feature vector of the relationship between the current node and each neighbor node. The path search module is used to select the next hop node hop by hop according to the transition probability until the target node type is reached or the preset maximum step size is reached, and the traversed nodes and relationships are concatenated into a knowledge path according to the access order.
[0045] In one possible embodiment, the above-described apparatus further includes: an identification module and a construction module;
[0046] The identification module is used to identify the business category and at least one financial entity from the business question, and to extract at least one contextual keyword from the business question.
[0047] The building module is used to construct the query body based on the business category, at least one financial entity, and at least one contextual keyword.
[0048] In one possible embodiment, the above-described apparatus further includes: a calculation module and a determination module;
[0049] The calculation module is used to calculate the path score of each candidate knowledge path. The path score is determined based on at least one of the following: path length, semantic matching degree with the query body, and time weight of knowledge in the path.
[0050] The determination module is used to identify the knowledge path corresponding to the maximum path score as the target knowledge path.
[0051] The reasoning module is also used to perform reasoning analysis based on the target knowledge path to obtain answers to business questions.
[0052] In one possible embodiment, the above-described apparatus further includes: a processing module;
[0053] The acquisition module is also used to obtain multiple candidate triples that semantically match the query body from a pre-built knowledge graph; the candidate triples include head entity, relation and tail entity;
[0054] The acquisition module is also used to take the head and tail entities of each candidate triple, as well as the entities in the query body, as seed nodes, and to acquire at least one connected subgraph in the knowledge graph that contains all seed nodes and satisfies the preset hop count condition.
[0055] The calculation module is also used to calculate the semantic similarity between each node and edge in each connected subgraph and the query body;
[0056] The processing module is used to delete nodes and / or edges with semantic similarity lower than a preset threshold from each connected subgraph to obtain at least one candidate subgraph.
[0057] In one possible embodiment, the acquisition module is further configured to acquire context information of the user's current business and generate a context vector;
[0058] The processing module is also used to fuse the context vector with each knowledge path to obtain at least one updated knowledge path.
[0059] In one possible embodiment, the above-described apparatus further includes: a construction module;
[0060] The acquisition module is also used to acquire a standardized business dataset, which is generated from multi-source heterogeneous business data;
[0061] The generation module is also used to perform entity recognition on text in standardized business datasets and generate entity labels for each text.
[0062] The generation module is also used to extract relationships from entity tags and generate relationship tags between entities;
[0063] The building module is used to construct multiple triples based on multiple entity tags and relationship tags between entities; each triple includes a head entity, a relationship, and a tail entity.
[0064] The building module is also used to construct knowledge graphs based on multiple triples.
[0065] In one possible embodiment, the processing module is further configured to perform context encoding on the text to obtain a context feature vector;
[0066] The input module is also used to input the context feature vector into the bidirectional long short-term memory network to obtain the bidirectional context feature vector;
[0067] The generation module is also used to perform sequence labeling on bidirectional context feature vectors using conditional random fields to generate entity labels.
[0068] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0069] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0070] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0071] The intelligent question-answering method, apparatus, device, medium, and program products provided in this application embodiment obtain a query body by semantically parsing the business question input by the user, and obtains candidate subgraphs matching the query body from a pre-constructed knowledge graph, which can effectively correspond natural language questions with structured business knowledge. By inputting the candidate subgraphs into a graph neural network for multi-hop reasoning, the updated feature vectors corresponding to each node in the candidate subgraphs are obtained. Based on the feature vectors of the current node, neighboring nodes, and relationships between nodes, the transition probability is calculated, and a knowledge path is formed by hop-by-hop search. This realizes the modeling of complex business logic links, enhances the reasoning ability of multi-layer business associations, extracts the association links related to the question from scattered knowledge, and then determines the target knowledge path from at least one knowledge path and generates the answer to the business question based on the target knowledge path. This improves the accuracy of the question-answering results for complex business in banks, thereby helping to improve the quality of business processing. Attached Figure Description
[0072] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0073] Figure 1 Flowchart of the intelligent question-answering method provided in the embodiments of this application Figure 1 ;
[0074] Figure 2 Flowchart of the intelligent question-answering method provided in the embodiments of this application Figure 2 ;
[0075] Figure 3 Flowchart of the intelligent question-answering method provided in the embodiments of this application Figure 3 ;
[0076] Figure 4This is a schematic diagram of the structure of the intelligent question-answering device provided in the embodiments of this application;
[0077] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0078] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0079] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0080] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.
[0081] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0082] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0083] In the embodiments of this application, the use of terms such as "first" and "second" is to distinguish between identical or similar items that have essentially the same function and effect. For example, "first electronic device" and "second electronic device" are merely used to distinguish different electronic devices and do not limit their order of execution. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0084] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0085] It should be noted that the intelligent question-answering method, device, equipment, medium and program products provided in this application can be used in the field of fintech, or in any field other than fintech. The application fields of the intelligent question-answering method, device, equipment, medium and program products in this application are not limited.
[0086] In the field of banking fintech, employees typically need to conduct knowledge searches and Q&A support related to customer information, product rules, process requirements, and regulatory policies when handling loan approvals, transaction reviews, customer inquiries, and compliance verifications. This relevant knowledge is often distributed across multiple data sources, including customer management systems, credit systems, compliance databases, and internal documents, creating a business scenario where multi-source knowledge is used collaboratively.
[0087] Existing solutions typically employ knowledge base retrieval, keyword matching question answering, or rule engines for response. The basic approach involves first extracting terms from the user-input business question, then searching for corresponding content in a pre-defined knowledge base, rule table, or document index, or outputting results based on a fixed rule template. While these solutions provide basic query capabilities for standardized, single-target questions, their retrieval and response processes heavily rely on manually pre-defined vocabulary, rule conditions, and static knowledge organization methods.
[0088] However, banking business questions often involve complex semantics, explicit intent, and multi-layered entity relationships, such as continuous relationship chains between customers, products, rules, and approval conclusions. Existing technologies lack the ability to model the business logic chain when faced with complex questions requiring multi-step logical reasoning, making it difficult to meet the demand for accurate answers in financial business scenarios, thus affecting the quality of business processing.
[0089] In view of this, embodiments of this application provide an intelligent question-answering method that generates at least one knowledge path associated with a business question through semantic parsing and multi-hop reasoning mechanisms. This enables the modeling of complex business logic links and then gradually infers the answer to the business question based on the knowledge path, thereby improving the accuracy of question-answering results in financial business scenarios and helping to improve the quality of business processing.
[0090] The technical solutions of this application will be described in detail below with reference to specific embodiments. The specific embodiments described below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0091] The intelligent question-answering method provided in this application embodiment can be deployed in the bank's internal network environment and connect with the customer management system, credit system and compliance data source through interfaces, thereby providing more accurate and more relevant question-answering support for complex business issues and improving the quality of business processing.
[0092] Figure 1 Flowchart of the intelligent question-answering method provided in the embodiments of this application Figure 1 The execution subject of this method can be an electronic device with corresponding data storage and computing capabilities, such as a computer, server, or server cluster. Figure 1 As shown, the method includes:
[0093] S101: Perform semantic parsing on the business question input by the user to obtain the query body.
[0094] In this process, business questions serve as the input to the intelligent question-answering method and are submitted to the question-answering service interface by the business terminal in the form of natural language.
[0095] Specifically, the executing entity can be an application server. After receiving the business question text, the application server performs normalization and semantic analysis on the business question, extracts semantic information related to the business question, and generates a query body. This query body carries the semantic representation of the business question, transforming the original natural language question into a computable expression capable of performing matching and reasoning in the subsequent knowledge graph. This query body can be represented, for example, as key-value pairs, graph query objects, or a set of semantic slots.
[0096] S102: Obtain candidate subgraphs that match the query body from the pre-built knowledge graph.
[0097] The knowledge graph is stored in the intelligent question-answering system in the form of a graph data structure. This knowledge graph also has a corresponding vector index library, which encodes each triple or node and relation in the knowledge graph into a fixed-length dense vector (e.g., 768 dimensions), storing it as an independent vector index file. The triples in the knowledge graph include (head entity, relation, tail entity), for example, (customer A, application, loan X).
[0098] Specifically, based on the query body, nodes and relationships related to the business problem are located in the knowledge graph. Then, the relevant graph structures are matched and filtered based on the query body to obtain candidate subgraphs that match the query body. The candidate subgraphs formed after filtering retain the nodes, relationships, and their connection information for subsequent reasoning and are passed to the subsequent graph neural network module.
[0099] For example, the complete semantic representation of the query body is encoded into a query vector, and at least one triplet matching the query vector is retrieved from a pre-built triplet vector index library. The at least one triplet includes nodes and relationships related to the business question.
[0100] Furthermore, the financial entities in the query body, and the financial entities in at least one of the aforementioned triples, are used as the initial node set. Subgraph expansion is then performed in the knowledge graph to extract at least one connected subgraph containing the initial node set and its associated structures. Each connected subgraph is then considered a candidate subgraph.
[0101] Understandably, if the same entity name matches multiple nodes, disambiguation is performed by combining contextual keywords in the query body to determine a unique seed node.
[0102] In this step, the candidate subgraph converges the knowledge in the knowledge graph related to the current business problem into a locally connected structure, thereby limiting the scope of reasoning and preserving the association information between nodes.
[0103] S103: Input the candidate subgraph into the graph neural network for multi-hop inference to obtain the updated feature vectors corresponding to each node in the candidate subgraph.
[0104] Graph neural networks are used to perform information propagation, relation aggregation, and representation updates on candidate subgraphs, so that node representations include not only the node's own information, but also multi-hop semantic information passed from neighboring nodes and relation edges.
[0105] Specifically, the candidate subgraph is input into a graph neural network. Through multiple rounds of information propagation and feature updates, the features of each node in the candidate subgraph are inferred and calculated to obtain the updated feature vector for each node. This updated feature vector represents the node state after inference by the graph neural network and serves as the input for the subsequent path decoder to generate knowledge paths.
[0106] After processing by the graph neural network, the updated feature vectors corresponding to each node integrate the node's own information, neighbor information, and relationship information, and form a semantic association with the query body.
[0107] Understandably, the updated feature vector, along with the corresponding relational features and graph connection structure, serves as the input to the path decoder to obtain the business logic links related to the business problem.
[0108] This step encodes business semantics scattered across different nodes and relationships into node representations by performing multiple rounds of information propagation and relationship modeling on candidate subgraphs, enabling subsequent path search to reason based on representations containing multi-hop context.
[0109] S104: Input multiple updated feature vectors into the path decoder to obtain at least one knowledge path.
[0110] The path decoder is used to recover the node access order and relation connection order in the candidate subgraph based on multiple updated feature vectors output by the graph neural network, thereby forming a knowledge path that can represent the reasoning process. The path decoder includes a transition probability calculation module and a path search module. The transition probability calculation module calculates the transition probability of the current node jumping to each neighbor node based on the updated feature vector of the current node in the candidate subgraph, the updated feature vectors of each neighbor node, and the relation feature vectors between the current node and each neighbor node. The path search module selects the next hop node hop-by-hop according to the transition probability until the target node type is reached or the preset maximum step size is reached, and then concatenates the traversed nodes and relations according to the access order to form a knowledge path.
[0111] Specifically, nodes related to the query body are used as initial nodes, and the target information corresponding to the business problem is used as the termination condition. For the current node at any search time, the transition probability calculation module reads the updated feature vector of the current node, the updated feature vectors of all neighboring nodes, and edge relationship features to form a candidate jump set, and calculates a transition score for each candidate neighbor. Then, a normalization function is used to convert the scores of each candidate neighbor into transition probabilities, so that the selection result of each hop reflects the relative matching degree of different neighbors in the current semantic state. The path search module selects the next hop node according to the transition probability in each hop to form at least one knowledge path. During the search process, the node access sequence and relationship access sequence are continuously recorded, and a termination judgment is executed. For example, when the current node meets the termination condition or the path length reaches the preset maximum step size, the path expansion stops.
[0112] After stopping path expansion, the nodes and relationships traversed in the path are concatenated in the order of access to generate a knowledge path.
[0113] Understandably, for the same business problem, the path decoder can output one or more knowledge paths. In this step, the path decoder further transforms the graph representation into an explicit sequence of node relationships to obtain the reasoning chain for the business problem based on the local graph structure.
[0114] It should be noted that the preset maximum step size is dynamically adjusted based on the complexity of the business problem. For example, for complex problems involving multiple layers of entity relationships (such as analyzing the reasons for loan application rejection), the preset maximum step size can be set to 5 hops; while for simple problems (such as querying basic product information), the preset maximum step size can be set to 3 hops. This dynamic adjustment mechanism ensures that the knowledge path can cover complex logical links while avoiding redundant expansion.
[0115] S105: Determine the target knowledge path from at least one knowledge path, and generate answers to business questions based on the target knowledge path.
[0116] Understandably, a knowledge path represents a sequential link that starts from a starting entity and accesses a target entity or target node type via several relational edges.
[0117] If the number of knowledge paths obtained in step S104 is one, then that knowledge path is taken as the target knowledge path.
[0118] If the number of knowledge paths obtained in step S104 is greater than one, the confidence of multiple knowledge paths is analyzed, and then the target knowledge path is selected based on the confidence.
[0119] For example, for any knowledge path among multiple knowledge paths, a weighted sum is calculated based on the path's length and its semantic relevance to the query body to obtain a confidence score. The shorter the knowledge path and the higher its semantic relevance to the query body, the higher the calculated confidence score. The knowledge path corresponding to the highest confidence score is then selected as the target knowledge path.
[0120] After obtaining the target knowledge path, the system generates an answer to the business question based on the node and relationship information within that path. Finally, the generated answer is returned to the business terminal via a question-and-answer service interface.
[0121] This step, by identifying the target knowledge path from at least one knowledge path and generating an answer accordingly, can converge the associative reasoning results in the knowledge graph into an explanatory link corresponding to the business problem, making the output answer have clear basis and the path traceable.
[0122] This application provides an intelligent question-answering method that obtains a query body by semantically parsing a user-input business question, and acquires candidate subgraphs matching the query body from a pre-constructed knowledge graph. These candidate subgraphs are then input into a graph neural network for multi-hop reasoning to obtain updated feature vectors for each node in the candidate subgraphs. Transition probabilities are calculated based on the feature vectors of the current node, neighboring nodes, and relationships between nodes, and a knowledge path is formed through hop-by-hop search. This method models complex business logic chains, enhances the reasoning ability for multi-layered business relationships, and is therefore suitable for complex question-answering processing. Furthermore, by determining a target knowledge path from at least one knowledge path and generating an answer to the business question based on the target knowledge path, the accuracy of the question-answering results for complex banking business is improved, thereby contributing to improved business processing quality.
[0123] Figure 2 Flowchart of the intelligent question-answering method provided in the embodiments of this application Figure 2 The embodiments of this application are... Figure 1 Based on the embodiments, a possible intelligent question-answering method is described in detail. For example... Figure 2 As shown, the method includes:
[0124] S201: Identify the business category and at least one financial entity from the business problem, and extract at least one contextual keyword from the business problem.
[0125] Specifically, after receiving the business question input by the user, the text is first segmented, part-of-speech tagging and entity recognition are performed, and the business category to which the question belongs is determined by combining a pre-set business vocabulary and a domain semantic model. Then, one or more financial entities and context keywords are extracted from the business question.
[0126] In some embodiments, the user's input is processed using an NLP (Natural Language Processing) pipeline to perform word segmentation, part-of-speech tagging, and analysis to generate a standardized text sequence. Then, based on a fine-tuned BERT (Bidirectional Encoder Representations from Transformers) classification model, the business category in the financial field is identified, which represents the business purpose of the user's question.
[0127] For example, the business category corresponding to a business problem can be determined using the following formula:
[0128]
[0129] in, A standardized text sequence corresponding to a business problem. This is the classification weight matrix. For bias, For the probability distribution of business categories, the category with the highest probability is usually taken as the business category corresponding to the business problem.
[0130] In some embodiments, a BERT-BiLSTM-CRF (BERT-Bidirectional Long Short-Term Memory-Conditional Random Field) architecture is used to extract financial entities from business problems. These financial entities can be, for example, customers, products, and rules.
[0131] First, as shown in the following equation, BERT-BiLSTM is used to obtain the context feature vector of the business problem:
[0132]
[0133] in, It is the first in the business problem The contextual representation of each word, It is the first output of BiLSTM The process involves generating bidirectional contextual feature vectors for each word. Specifically, a standardized text sequence of the business problem is input into a BERT layer for encoding, yielding a contextual representation for each word. After obtaining the contextual representation for each word, all word contextual representations are input into a BiLSTM to obtain a bidirectional contextual feature vector for each word.
[0134] Furthermore, following the order of multiple words in the standardized text sequence described above, a vector set is constructed based on the bidirectional contextual feature vectors of multiple words. This vector set is then input into the CRF layer, which determines the entity label for each word. The result is shown in the following equation:
[0135]
[0136] in, The first output of BiLSTM The bidirectional contextual feature vector of each word. It is a sequence of entity labels, including the entity labels of all words in the normalized text sequence.
[0137] Entity tags are used to indicate the entity type of a word, such as user, product, etc.
[0138] In some embodiments, at least one contextual keyword is extracted from a business problem using preset keyword extraction rules. These rules may, for example, identify time-related keywords in the business problem by matching a preset time pattern library using regular expressions, or obtain financial keywords from the business problem using a preset financial keyword database. Specific keyword rules can be set based on keyword extraction requirements, and this application does not impose any limitations on them.
[0139] S202: Construct a query body based on the business category, at least one financial entity, and at least one contextual keyword.
[0140] After obtaining the business category, at least one financial entity, and at least one context keyword, the business category, financial entity, and context keyword are organized into a query body according to preset fields. This query body can be in structured key-value format, vector representation, or a hybrid of both. The structured key-value format facilitates precise alignment with node and relationship types in the knowledge graph, while the vector representation facilitates similarity calculations with the subsequent semantic matching module.
[0141] For example, the query body structure is as follows:
[0142]
[0143] in, Fields represent the business category of the business issue, such as "Loan Application Inquiry", "Compliance Review", "Risk Assessment", and "Interest Rate Inquiry". This is a list of financial entities extracted from business questions entered by the user, including but not limited to customers, products, rules, institutions, and accounts. The context keyword list includes auxiliary constraints extracted from user input, used to limit the scope of entity queries or supplement semantic information, enabling subsequent knowledge graph retrieval to accurately match subgraphs that meet all conditions. For example, it can include time range, monetary threshold, geographical restrictions, comparison relationships, and action words.
[0144] Understandably, the query body serves as the input for subsequent knowledge retrieval and reasoning, uniformly expressing the business scenario, core objects, and contextual conditions of the problem. This enables the subsequent location of matching candidate nodes and their relationships within the knowledge graph, and further formation of candidate subgraphs.
[0145] This step maintains the semantic integrity of the question by incorporating business categories, financial entities, and contextual keywords into the query body. This allows subsequent matching to move beyond relying solely on isolated terms and instead focus on related retrieval and path reasoning around a clear business intent, thereby improving the consistency and accuracy of business question-and-answer responses.
[0146] S203: Obtain multiple candidate triples that semantically match the query body from a pre-built knowledge graph.
[0147] Specifically, the complete semantic representation of the query body is encoded into a query vector, and at least one candidate triple matching the query vector is retrieved from the vector index library corresponding to the pre-built knowledge graph. The candidate triple includes a head entity, a relation, and a tail entity. The vector index library is as explained in step S102 above, and will not be repeated here.
[0148] For example, using an embedding-based semantic matching method, the query vector of the business question is mapped to the same vector space as the triples in the vector index (the similarity of triples related to the question is calculated, usually by selecting candidate triples through semantic matching). The similarity between the query vector and the triples is calculated using the following formula:
[0149]
[0150] in, For the above query vector, The similarity is calculated for triple vectors in the vector index library. The value range is [0, 1].
[0151] In some embodiments, multiple triple vectors in the vector index library are stored in groups, with each group corresponding to an index triple vector. Since the index triple vector is the center of each cluster obtained by clustering all triple vectors, in the process of matching candidate triples, the similarity between the query vector and the index triple vector can be calculated first, and the groups with similarity greater than a first similarity threshold can be identified as candidate groups. Then, for any triple vector in the candidate groups, the similarity between the query vector and the triple vector can be calculated, and the triples associated with the triple vectors with similarity greater than a second similarity threshold can be identified as candidate triples.
[0152] The first similarity threshold and the second similarity threshold can be adjusted according to the business type and application scenario corresponding to the business problem, and this application does not impose any restrictions on them.
[0153] S204: Using the head and tail entities of each candidate triple, as well as the entities in the query body, as seed nodes, obtain at least one connected subgraph in the knowledge graph that contains all seed nodes and satisfies the preset hop count condition.
[0154] The entities in the query body, the head entity and the tail entity in the candidate triples are used as seed nodes. Initial entity nodes corresponding to financial entities are determined in the knowledge graph. A local expansion search is performed in the knowledge graph to ensure that the search results simultaneously include all seed nodes. At least one connected subgraph is obtained if the nodes in the search results satisfy a preset hop count condition. The preset hop count condition includes, but is not limited to, limiting the shortest path length between any two nodes to no more than the preset hop count.
[0155] For example, a preset number of hops L is set. Starting from each initial entity node, the system traverses outwards along the relational edges in the knowledge graph, collecting all nodes and edges within L hops of the starting point. The expansion direction is not restricted by the relational direction, and both outgoing and incoming edges are traversed to ensure that no reverse relations that may be related to the user's question are missed. Here, L can be, for example, 3.
[0156] For example, a seed node set is constructed based on the head and tail entities of each candidate triple, as well as the entities in the query body. When the seed node set contains multiple entities, extended queries are performed using each entity as an anchor. If multiple entities are connected within a preset hop count, a single connected subgraph containing all multiple entities is extracted. If multiple entities are not connected within a preset hop count, target entities are filtered according to the intent category, and a connected subgraph is extracted using the filtered entities as anchors, or multiple independent subgraphs are extracted separately.
[0157] S205: Calculate the semantic similarity between each node and edge in each connected subgraph and the query body; delete nodes and / or edges with semantic similarity lower than a preset threshold from each connected subgraph to obtain at least one candidate subgraph.
[0158] For each node and edge in the connected subgraph, calculate its semantic similarity to the query body. This semantic similarity can be determined by the cosine value of the text-encoded vector, the attention matching score, or a fusion of both. Furthermore, nodes and / or edges below a preset threshold are removed from the corresponding connected subgraph, retaining structures with high relevance to the query body, thus obtaining at least one candidate subgraph.
[0159] The preset threshold can be set based on the graph density, query body length, and retrieval recall scale. It can use a uniform threshold or set different thresholds for each node and edge. In practical applications, this threshold can also be adaptively calibrated based on historical question-and-answer samples; this application does not impose limitations on this.
[0160] Understandably, the extracted candidate subgraphs can also be validated for size and validity. If the number of nodes in a candidate subgraph exceeds a preset limit, the subgraph extraction is re-executed by increasing the similarity threshold or reducing the preset expansion hop count until the subgraph size meets the requirements.
[0161] If the candidate subgraph is empty or does not contain any valid paths, it is determined that there is no knowledge in the knowledge graph that matches the query body, and the aforementioned preset threshold is downgraded. For example, the aforementioned preset threshold is lowered by a preset value.
[0162] This step dynamically trims the entire knowledge graph into local subgraphs that only contain information relevant to the user's question. While ensuring the integrity of the information, this significantly reduces the computational complexity of subsequent reasoning and improves the system's response speed and reasoning accuracy.
[0163] S206: Input the candidate subgraph into the graph neural network for multi-hop inference to obtain the updated feature vectors corresponding to each node in the candidate subgraph.
[0164] In some embodiments, a GNN (Graph Neural Network) is used for multi-hop inference to update the features of each node in the candidate subgraph. Specifically, the graph neural network includes an input layer, multiple graph convolutional layers, and an output layer. Each graph convolutional layer in the multiple layers is used to aggregate and update the features based on the feature vectors of each node in the current layer and the feature vectors of its neighboring nodes. The last graph convolutional layer in the multiple layers outputs the updated feature vector.
[0165] Optionally, the updated feature vector for each node can be obtained using the following formula:
[0166]
[0167] in, For the first The node at the th The updated feature vector obtained from the layered graph convolutional layer. Characterizing the first The set of neighboring nodes of a node. Representation Nodes Belonging to the aforementioned set of neighboring nodes With the The union of nodes, Characterizing the first Nodes output by the layer graph convolutional layer eigenvectors, For the first The weight matrix of the layered graph convolutional layer, For the first The bias matrix of the layer graph convolutional layer, This is the activation function.
[0168] S207: Input multiple updated feature vectors into the path decoder to obtain at least one knowledge path.
[0169] For example, the knowledge path could be "Customer A → Loan Product X → Rule 1".
[0170] In some embodiments, after the path decoder outputs at least one knowledge path, the context information of the user's current business can be obtained, a context vector can be generated, and the context vector can be fused with each knowledge path to obtain at least one updated knowledge path.
[0171] After obtaining at least one knowledge path, the context retrieval interface corresponding to the business question-answering service is invoked to read the customer identifier, business type, channel identifier, timestamp, and current operation status from the current session. These are then input together with the current question text into the encoder for representation learning to generate a context vector. The encoder can be the output layer of a pre-trained language model or a sequence encoding network with an attention mechanism, so as to map business process information, customer status information, and question semantics to the same vector space.
[0172] Each knowledge path typically consists of a sequence of nodes and a sequence of relations. The context vector is concatenated with, weighted, or gated with the path representation vectors in the knowledge path to obtain at least one updated knowledge path. The fusion parameters can be determined by the trained mapping matrix or gated units.
[0173] For example, the gating unit uses context feature vectors With knowledge path feature vector The concatenated input is used to calculate the fusion weights. The gating weights can be calculated, for example, using the following formula:
[0174]
[0175] in, It is the Sigmoid activation function. , is a trainable weight matrix.
[0176] Based on gating weight The context vector and the knowledge path vector are weighted and summed to generate the final semantic representation. This mechanism ensures dynamic adaptation of context information and knowledge paths.
[0177] Understandably, the knowledge path output by the path decoder reflects the structural relationships between nodes, and the context vector further constrains the matching relationship between the path and the current business scenario, ensuring that the updated knowledge path retains both the graph reasoning results and the semantics of the business scenario. Subsequently, the path scores can be recalculated on the fused paths, and paths with higher scores can be retained as the basis for generating subsequent answers.
[0178] This method incorporates current business information into the path layer, making the target path more aligned with the business processing stage and regulatory context. By adopting this approach, the knowledge path no longer relies solely on graph structures and local node relationships, but is modified in conjunction with the current business context. This ensures the output path remains consistent with scenarios such as bank loan approval, transaction review, customer consultation, and compliance verification, thereby improving the scenario relevance of the path explanation and the accuracy of the answer's basis.
[0179] S208: Calculate the path score for each candidate knowledge path; determine the knowledge path corresponding to the highest path score as the target knowledge path.
[0180] The path score is determined based on at least one of the following: path length, semantic matching degree with the query body, and time weight of knowledge in the path.
[0181] Understandably, the node sequence and relation sequence of each path are normalized and then combined with the business category, financial entity, and contextual keywords in the query body to calculate the semantic matching degree. This semantic matching degree can be obtained by fusing the similarity between the node vector and the query vector, and the similarity between relation words and business types. Specifically, the node-level similarity is obtained by calculating the cosine similarity between the text representation vector of each node in the path and the semantic vector of the query body and taking the average value; the similarity between relation words and business types is determined by judging the semantic consistency between the type of each relation edge in the path and the action keywords or intent categories extracted from the query body.
[0182] Furthermore, path length reflects the number of inference hops and is determined by counting the number of relations (edges) in the path. Each hop is counted as one relation edge, and the path length is the total number of relation edges in the path. For a path containing only a head entity and a tail entity that are directly connected, its length is 1; for a path that requires N intermediate nodes to reach the tail entity from the head entity, its length is N+1. Further, the path length is normalized to map it to the [0, 1] interval. Path scores are calculated based on the mapped path length data to ensure the comparability of scores for paths of different lengths.
[0183] The time weight of knowledge in the path is used to reflect the timeliness of knowledge, and is generated based on the update time, rule effective time, or event occurrence time corresponding to the node. Specifically, the update time (such as the last modification time of customer information, the release time of product information), rule effective time (such as the effective date of KYC rules, the implementation date of regulatory policies), or event occurrence time (such as the occurrence date of transaction records, the submission date of application records) associated with each node in the path is extracted as a time benchmark. Then, based on the time difference between the time benchmark of each node and the current query time, the time decay factor of each node is calculated through a preset time decay function (such as exponential decay or piecewise linear decay). Subsequently, the time weight is obtained by weighted fusion of the time decay factors of all nodes in the path (such as taking the mean, minimum value, or summing after assigning different weights according to node type).
[0184] In some embodiments, the path score for each knowledge path is calculated using the following formula:
[0185]
[0186] in, Representing knowledge paths, , , These are the weight parameters corresponding to path length, semantic matching degree, and time weight, respectively, which can be adjusted according to the financial scenario. For knowledge paths Path length, For knowledge paths Semantic match with the query body For knowledge paths The time weight of knowledge corresponding to each node is used to characterize the timeliness of knowledge such as financial rules and product information.
[0187] For example, the weighted average of each time decay factor in the path can be adaptively adjusted based on the business category in the query body. For instance, when the business category is compliance review or policy query, the weight parameter of the time weight is increased. This gives newly released rules and the latest updated product information a higher ranking advantage; when the business category is historical record query, the weight of time can be reduced or even ignored.
[0188] Optionally, during the scoring process, the path length is normalized to map the actual length value to a unified scoring range, thus avoiding scoring bias caused by differences in path length distribution across different business scenarios. After obtaining the normalized score, it is determined whether the path length is less than a preset lower limit and whether it is greater than a preset upper limit. If the path length is less than the preset lower limit, an information coverage constraint factor is applied to the normalized score to reduce the score of this path. For example, the normalized score is multiplied by an information coverage constraint factor of 0.3 to obtain the first score corresponding to the path length. If the path length is greater than the preset upper limit, a decreasing coefficient is applied to the normalized score, causing its score to decrease exponentially or linearly with the increase of path length.
[0189] When calculating the path score for the knowledge path, the first score mentioned above can be used to replace the path score calculation formula. .
[0190] After calculating the path score, the knowledge path corresponding to the maximum path score is taken as the target knowledge path.
[0191] S209: Based on the target knowledge path, perform reasoning analysis to obtain answers to business questions.
[0192] The system sequentially reads knowledge nodes, relationship types, and attribute information along the target knowledge path. Combining this with the constraints between the path's starting and ending points, it performs reasoning analysis to generate conclusions, supporting evidence, and related explanations corresponding to the business question, outputting the answer as the business question's response. When the target knowledge path contains multiple equally high-scoring candidates, these paths can be merged into a unified reasoning result, or the main path and supplementary paths can be retained according to a preset threshold to improve the completeness of the response.
[0193] This application provides an intelligent question-answering method that identifies business categories and at least one financial entity from business questions, extracts at least one contextual keyword from the business questions, and then constructs a query body based on the business category, at least one financial entity, and at least one contextual keyword. This allows the query body to more completely retain the scenario information, object information, and constraint information in the business questions, thereby helping to improve the accuracy of subsequent knowledge graph matching and providing clearer semantic basis for subsequent multi-hop reasoning and target knowledge path search, thus improving the response consistency and accuracy of complex banking business questions and answers.
[0194] Furthermore, multiple candidate triples semantically matching the query body are obtained from a pre-constructed knowledge graph. The head and tail entities of each candidate triple, along with entities in the query body, are used as seed nodes. At least one connected subgraph containing all seed nodes and satisfying a preset hop count condition is obtained from the knowledge graph. Subsequently, the semantic similarity between each node and edge in each connected subgraph and the query body is calculated. Nodes and / or edges with semantic similarity below a preset threshold are deleted from each connected subgraph, resulting in at least one candidate subgraph. In this method, the candidate subgraph can retain relevant multi-hop associations of the query body while eliminating low-relevance noise nodes and edges, making the graph structure entering subsequent graph neural network inference more compact and semantically more focused, thereby improving the accuracy of association graph construction and the quality of subsequent inference for complex banking business problems.
[0195] Subsequently, the candidate subgraphs are input into a graph neural network for multi-hop inference to obtain updated feature vectors corresponding to each node in the candidate subgraphs. These updated feature vectors are then input into a path decoder to obtain at least one knowledge path. The path score of each candidate knowledge path is calculated, and the knowledge path with the highest path score is determined as the target knowledge path. Inference analysis is then performed based on the target knowledge path to obtain an answer to the business question. The path score is determined based on at least one of the following: path length, semantic matching degree with the query body, and time weight of knowledge within the path. This method automatically selects the target knowledge path from multiple candidate knowledge paths that has a higher matching degree with the query body and better meets the timeliness requirements of the business. Based on this path, associative inference is performed to generate a clear, coherent, and accurate business answer.
[0196] Figure 3 Flowchart of the intelligent question-answering method provided in the embodiments of this application Figure 3 The embodiments of this application are... Figure 1-2 Based on the embodiments, a method for constructing a knowledge graph for intelligent question answering is described in detail. For example... Figure 3 As shown, the method includes:
[0197] S301: Obtain standardized business datasets.
[0198] The standardized business dataset is generated from multi-source heterogeneous business data. This multi-source heterogeneous data includes structured and unstructured data, such as internal bank documents, emails, system logs, and user interaction records, which are used to provide data support for subsequent knowledge graph construction.
[0199] Understandably, in practice, heterogeneous data from multiple sources, such as structured messages, semi-structured records, and unstructured documents, are obtained from various business systems connected to the bank's internal network.
[0200] After obtaining multi-source heterogeneous data, it is preprocessed to obtain a standardized business dataset. This standardized business dataset includes multiple text sequences. Entity recognition is performed on the text in this standardized business dataset to obtain the entity label corresponding to each text content. Each text sequence in the standardized business dataset serves as the input text sequence for subsequent entity recognition.
[0201] It should be noted that preprocessing includes, but is not limited to, data cleaning, encoding mapping, and sequence standardization. Data cleaning includes deleting knowledge records containing NULL markers (except for business scenario identifiers) and filtering records without entities. NULL markers are used to indicate null values, invalid values, etc. Encoding mapping maps user IDs, document IDs, entity IDs, and relation IDs to unique numbers, sorted by collection time. The formula for determining the missing mask value is shown below:
[0202]
[0203] Sequence standardization, for example, unifies the length of the acquired sequence to 500 characters, truncating excessively long sequences and padding with zeros if necessary. The text length constraint formula is shown below:
[0204]
[0205] in, The preset maximum sequence length, This represents the length of the original sequence. The length of the sequence after standardization.
[0206] S302: Perform entity recognition on text in the standardized business dataset and generate entity labels for each text.
[0207] The text is context-encoded, and context-dependent features are extracted using a bidirectional long short-term memory network. Then, sequence labeling is performed using a conditional random field to generate entity labels and corresponding entity identifiers for each text.
[0208] For example, the text is context-encoded to obtain a context feature vector, which is then input into a bidirectional long short-term memory network to obtain a bidirectional context feature vector. Subsequently, a conditional random field is used to perform sequence labeling on the bidirectional context feature vector to generate entity labels.
[0209] Specifically, the text from multi-source heterogeneous data is first segmented into words, characters, or sub-words, and the segmentation results are mapped into vector representations. These vector representations are then processed by a context encoding module to generate context feature vectors. The context encoding module can employ a pre-trained language model, a word vector encoding layer, or a combination of embedding and positional encoding layers to ensure that the output vector retains the semantic relationships between terms within and outside the sentence. Subsequently, this context feature vector is input into a bidirectional long short-term memory (LSTM) network. The LSM network models the sequence information bidirectionally through forward and backward memory units, resulting in a bidirectional context feature vector containing both preceding and following contextual information. This bidirectional LSM network can be configured as a single-layer or multi-layer structure, and the hidden state dimension can be configured according to the text length and entity complexity.
[0210] After obtaining the bidirectional contextual feature vectors, they are input into a conditional random field (CRF) layer for sequence labeling. The CRF performs joint decoding on the label sequence based on the transition relationships between adjacent labels to output entity identifiers corresponding to each position in the text. Entity identifiers can be represented using "B-entity," "I-entity," "O," or other preset labeling systems to determine the start and end boundaries and entity categories. This labeling result can be further used to construct the head and tail entities in triples, or as input for subsequent relation extraction to support knowledge graph construction and question-answering retrieval.
[0211] By adopting the above method, the entity recognition process in the text can simultaneously utilize local word meaning, contextual dependencies, and label sequence constraints, enabling entities such as customers, products, rules, institutions, and approval conclusions in financial business texts to obtain more stable recognition results. This provides accurate input for subsequent relation extraction and multi-source knowledge association, and improves entity consistency and labeling reliability during cross-system knowledge fusion.
[0212] For example, the BERT-BiLSTM-CRF model, combined with a pre-trained language model and a sequence labeling model, can be used to improve the accuracy of entity recognition. First, text from a standardized business dataset (e.g., "Customer Zhang San applied for a credit card product.") is input into the BERT model to obtain the contextual representation of each word, as shown in the formula below:
[0213]
[0214] in, Indicates the first character in the input text. One word, Indicates the first The context feature vector of each word.
[0215] Then, the context feature vectors of multiple words corresponding to the BERT output text are arranged according to the sequence of each word in the text to obtain the first sequence. This first sequence is then input into BiLSTM to capture the features of bidirectional context information and obtain the bidirectional context feature vector.
[0216] Finally, the CRF loss function and probability formula are used to constrain and decode the labels of the sequence annotations. The loss function is as follows:
[0217]
[0218] in, The input text sequence for the CRF model, To provide the input text Under these conditions, the model predicts the label sequence. The conditional probability.
[0219] The conditional probability mentioned above can be obtained, for example, by the following formula:
[0220]
[0221] in, This represents the sequence of entity labels, indicating the entity category corresponding to each word (such as "customer", "product", "rule", etc.), and is the output of entity recognition. Given the above input text sequence, As the normalization factor, For the first Each feature function is a binary function used to characterize the input text sequence. Middle The tags for each word are , No. Each word Whether the feature function satisfies the preset labeling rules. For the first The weights of each feature function, Given the length of the input text sequence, The number of predefined characteristic functions.
[0222] Understandably, the preset labeling rules are used to indicate adjacent labels. arrive Does the transfer conform to the annotation specifications (e.g., the entity start tag B must be followed by an inner tag I or an end tag E); current word Does the feature support its being labeled? (e.g., the character "Zhang" is suitable as the start tag B-Customer of a customer entity); whether the joint relationship among the previous tag, the current word and the current tag is reasonable. All the three types of feature functions take a value of 0 or 1, and take a value of 1 when a preset tag rule is satisfied, otherwise take a value of 0.
[0223] S303: Performing relation extraction on entity tags to generate relation tags between entities.
[0224] For the identified entities, relation extraction is further performed based on entity pairs and their contextual features, and relation tags between the entities are output. The relation tags may be used to indicate the association relationships between a customer and a product, between a product and a rule, and between a service and an approval conclusion.
[0225] Specifically, in the above step S303, a first text labeled with entity tags is obtained. After obtaining the entity tag of each word in the text, the entities in the text are combined in pairs to obtain at least one entity combination. For any entity combination, the entity combination and the first text are input into a BERT model to obtain a sentence-level semantic vector, which is shown in the following formula:
[0226]
[0227] wherein, is the input text constructed by the entity combination and the first text.
[0228] Then, the identified entities are taken as nodes and candidate relations are taken as edges to construct a heterogeneous graph, and node features are updated through a GNN information propagation formula to enhance the structural association between entities:
[0229]
[0230] wherein, is the th node in the th hidden layer of the GNN to obtain the updated feature vector, represents the th node's neighbor node set, represents the union of the node belonging to the aforementioned neighbor node set and the th node, , represents the feature vector of the node output by the th hidden layer, is the weight matrix of the th hidden layer, is the bias matrix of the th hidden layer, is the activation function.
[0231] Furthermore, the updated feature data of each entity pair output by the GNN is input into the Softmax classifier to obtain the probability of the relation label to which each entity pair belongs, as shown in the following formula:
[0232]
[0233] in, This is the classification weight matrix. The bias matrix, The updated feature data for entity pairs output by the GNN. Relationship label probability matrix. In this matrix, the relationship label corresponding to the highest probability is determined as the relationship label between entity pairs.
[0234] S304: Construct multiple triples based on multiple entity tags and relationship tags between entities; construct a knowledge graph based on multiple triples.
[0235] Multiple entity tags are combined with relation tags to construct multiple triples in the format of "head entity, relation, tail entity". These triples are then written into a graph database and / or graph storage structure to form a knowledge graph. Each triple includes a head entity, a relation, and a tail entity.
[0236] In some embodiments, firstly, the TransE (Translating Embeddings) model is used to map entities from different sources to the same vector space, and then inputs this vector space into the scoring function. In the following formula:
[0237]
[0238] in, It is the head entity vector. It is a relation vector. It is the tail entity vector. It is an L2 norm.
[0239] Scoring function Used to evaluate triplet Does it conform to actual business logic? (Scoring function) The smaller the value, the more likely it is a triplet. The closer it is to the actual business logic.
[0240] The scoring function for obtaining multiple triples After the value, filter the scoring function. Triples with values greater than a preset function value are considered as pending triples. The relation vectors in these pending triples are then normalized to unify the standard definitions of various relations. Specifically, vector mean clustering or semantic similarity alignment methods are used to map semantically similar but differently expressed relation vectors (such as "application" and "apply for," "purchase" and "buy") to the same standard relation category. This ensures that all relations in the knowledge graph have a unified semantic representation, avoiding inaccurate queries and inference errors caused by inconsistent relation names. For example, by calculating the cosine similarity between relation vectors, when the similarity exceeds a preset threshold (such as 0.85), the corresponding relations are classified as belonging to the same relation category, and the vector of the cluster center is used as the unified representation vector for that standard relation category.
[0241] Furthermore, for multiple entities, clustering algorithms are used to merge similar entities, eliminating duplication and ambiguity. Specifically, the name text and attribute information of each entity are encoded into vectors. A clustering algorithm is then used to cluster these entity vectors, merging highly similar entities within the same cluster into a single standard entity node. This node is assigned a unique standardized name and identifier, while retaining the attribute information of each original entity as the attribute set of this standard entity. For example, different expressions referring to the same natural person customer, such as "Zhang San," "Mr. Zhang," and "Zhang San," are clustered and determined to be the same entity, merged into a single standard customer node "Zhang San," and associated with a unified customer ID and identity information.
[0242] Finally, the merged entities and relations are assembled into standard triples of <head entity, relation, tail entity>, and then a knowledge graph is constructed based on multiple standard triples.
[0243] During model training, to ensure that positive samples score higher than negative samples, thereby achieving entity alignment and relation alignment, we will use a loss function to train the TransE model. This loss function is:
[0244]
[0245] in, It is a positive sample set. It is a negative sample set. It is the interval hyperparameter. .
[0246] Understandably, the positive sample set Correct triples derived from manual annotation or historical knowledge graphs, negative sample set Negative samples are generated by extracting known correct triples from historical data as positive samples and replacing entities. For example, replacing the tail entity "credit card" in the positive sample <Zhang San, application, credit card> with "house" results in <Zhang San, application, house>. The loss function is used to train the TransE model so that the positive samples score higher than the negative samples, thereby achieving entity alignment and relation alignment.
[0247] Finally, the output is a structured financial knowledge graph G and a vector index library.
[0248] It should be noted that when building a vector index library for a knowledge graph, cluster analysis is performed on multiple triple vectors to obtain centroids. The centroids are used as index items, and the physical addresses (pointers) of other triple vectors in the cluster are stored under the index items.
[0249] This knowledge graph construction method transforms business knowledge scattered across different systems into a unified graph structure, enabling entities, relationships, and knowledge units to be interconnected, searchable, and reasonable. Based on this structure, candidate subgraphs matching the query can be directly retrieved from the knowledge graph, supporting multi-hop path search and answer generation.
[0250] This application provides an intelligent question-answering method that acquires a standardized business dataset, performs entity recognition on the text within the dataset to generate entity tags for each text, extracts relationships from these entity tags to generate relational tags between entities, and constructs multiple triples based on these entity tags and relational tags. A knowledge graph is then built upon these triples. In this method, unstructured text from multi-source heterogeneous data is transformed into standardized triples and aggregated into a knowledge graph. Entity relationships are explicitly expressed, the knowledge organization within the graph is more complete, and a stable data foundation is provided for subsequent semantic matching, relational reasoning, and question-answering generation.
[0251] Figure 4 This is a schematic diagram of the structure of the intelligent question-answering device provided in the embodiments of this application, as shown below. Figure 4 As shown, this application embodiment provides an intelligent question-answering device, the device 40 including:
[0252] Parsing module 401 is used to perform semantic parsing on the business question input by the user to obtain the query body;
[0253] The acquisition module 402 is used to acquire candidate subgraphs that match the query body from a pre-built knowledge graph;
[0254] The inference module 403 is used to input the candidate subgraph into the graph neural network for multi-hop inference to obtain the updated feature vectors corresponding to each node in the candidate subgraph.
[0255] Input module 404 is used to input multiple updated feature vectors into the path decoder to obtain at least one knowledge path;
[0256] The generation module 405 is used to determine the target knowledge path from at least one knowledge path and generate an answer to the business question based on the target knowledge path.
[0257] The path decoder includes a transition probability calculation module and a path search module. The transition probability calculation module is used to calculate the transition probability of the current node jumping to each neighbor node based on the updated feature vector of the current node in the candidate subgraph, the updated feature vector of each neighbor node, and the feature vector of the relationship between the current node and each neighbor node. The path search module is used to select the next hop node hop by hop according to the transition probability until the target node type is reached or the preset maximum step size is reached, and the traversed nodes and relationships are concatenated into a knowledge path according to the access order.
[0258] In one possible embodiment, the above-described apparatus further includes: an identification module 406 and a construction module 407;
[0259] The identification module 406 is used to identify the business category and at least one financial entity from the business question, and to extract at least one contextual keyword from the business question.
[0260] Module 407 is used to construct a query body based on a business category, at least one financial entity, and at least one contextual keyword.
[0261] In one possible embodiment, the above-described apparatus further includes: a calculation module 408 and a determination module 409;
[0262] The calculation module 408 is used to calculate the path score of each candidate knowledge path. The path score is determined based on at least one of the following: path length, semantic matching degree with the query body, and time weight of knowledge in the path.
[0263] Module 409 is used to determine the knowledge path corresponding to the maximum path score as the target knowledge path.
[0264] The reasoning module 403 is also used to perform reasoning analysis based on the target knowledge path to obtain answers to business questions.
[0265] In one possible embodiment, the above-described apparatus further includes: a processing module 410;
[0266] The acquisition module 402 is also used to acquire multiple candidate triples that semantically match the query body from a pre-built knowledge graph; the candidate triples include a head entity, a relation, and a tail entity;
[0267] The acquisition module 402 is also used to take the head entity and tail entity of each candidate triple, as well as the entity in the query body, as seed nodes, and acquire at least one connected subgraph in the knowledge graph that contains all seed nodes and satisfies the preset hop count condition.
[0268] The calculation module 408 is also used to calculate the semantic similarity between each node and edge in each connected subgraph and the query body;
[0269] Processing module 410 is used to delete nodes and / or edges with semantic similarity lower than a preset threshold from each connected subgraph to obtain at least one candidate subgraph.
[0270] In one possible embodiment, the acquisition module 402 is further configured to acquire context information of the user's current business and generate a context vector;
[0271] The processing module 410 is also used to fuse the context vector with each knowledge path to obtain at least one updated knowledge path.
[0272] In one possible embodiment, the above-described apparatus further includes: a construction module 411;
[0273] The acquisition module 402 is also used to acquire a standardized business dataset, which is generated from multi-source heterogeneous business data;
[0274] The generation module 405 is also used to perform entity recognition on the text in the standardized business dataset and generate entity labels for each text.
[0275] The generation module 405 is also used to extract relationships from entity tags and generate relationship tags between entities;
[0276] Module 407 is used to construct multiple triples based on multiple entity tags and relation tags between entities; each triple includes a head entity, a relation, and a tail entity.
[0277] Module 407 is also used to build knowledge graphs based on multiple triples.
[0278] In one possible embodiment, the processing module 410 is further configured to perform context encoding on the text to obtain a context feature vector;
[0279] The input module 404 is also used to input the context feature vector into the bidirectional long short-term memory network to obtain the bidirectional context feature vector;
[0280] The generation module 405 is also used to perform sequence labeling on the bidirectional context feature vector using a conditional random field to generate entity labels.
[0281] The intelligent question-answering device provided in this application can be used to execute the technical solution of the intelligent question-answering method in any of the above embodiments of this application. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.
[0282] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, the electronic device 50 of this embodiment may include at least one processor 501 and a memory 502. Optionally, the electronic device 50 may also include a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0283] In the specific implementation process, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to execute the above-mentioned intelligent question answering method.
[0284] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0285] Optionally, the memory 502 can be either standalone or integrated with the processor 501.
[0286] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0287] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of any of the foregoing embodiments.
[0288] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the foregoing embodiments.
[0289] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0290] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0291] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU) or other general-purpose processors. The processor can also be a Digital Signal Processor (DSP) or an Application Specific Integrated Circuit (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0292] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be various media that can store program code, such as USB flash drives, portable hard drives, read-only memory (ROM), disks or optical discs.
[0293] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof. Examples of storage media include Static Random-Access Memory (SRAM) or Electrically Erasable Programmable Read Only Memory (EEPROM).
[0294] Storage media can be, for example, erasable programmable read-only memory (EPROM) or programmable read-only memory (PROM). Storage media can also be read-only memory (ROM), magnetic storage, flash memory, magnetic disks, or optical disks. Storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0295] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside within an application-specific integrated circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components within an electronic device or host device.
[0296] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0297] The sequence numbers of the embodiments in this application are merely for description and do not represent the superiority or inferiority of the embodiments. Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0298] Based on this understanding, the technical solution of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0299] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
[0300] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all 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, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0301] It should be further noted that although the steps in the flowchart are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated in this document, there is no strict order requirement for the execution of these steps, and they can be executed in other orders.
[0302] Furthermore, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0303] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0304] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0305] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. An intelligent question-answering method, characterized in that, include: Semantic parsing is performed on the business question input by the user to obtain the query body; Obtain candidate subgraphs that match the query body from a pre-constructed knowledge graph; The candidate subgraph is input into a graph neural network for multi-hop inference to obtain the updated feature vectors corresponding to each node in the candidate subgraph. The updated feature vectors are input into the path decoder to obtain at least one knowledge path. Determine a target knowledge path from the at least one knowledge path, and generate an answer to the business question based on the target knowledge path; The path decoder includes a transition probability calculation module and a path search module. The transition probability calculation module is used to calculate the transition probability of the current node jumping to each of the neighboring nodes based on the updated feature vector of the current node in the candidate subgraph, the updated feature vector of each neighboring node, and the relationship feature vector between the current node and each neighboring node. The path search module is used to select the next hop node hop by hop according to the transition probability until the target node type is reached or the preset maximum step size is reached, and to concatenate the traversed nodes and relationships into the knowledge path according to the access order.
2. The method according to claim 1, characterized in that, The semantic parsing of the user-input business question to obtain the query body includes: Identify the business category and at least one financial entity from the business question, and extract at least one contextual keyword from the business question; A query body is constructed based on the business category, the at least one financial entity, and the at least one context keyword.
3. The method according to claim 1, characterized in that, The step of determining a target knowledge path from the at least one knowledge path and generating an answer to the business question based on the target knowledge path includes: Calculate the path score for each candidate knowledge path, the path score being determined based on at least one of the following: path length, semantic matching degree with the query body, and time weight of knowledge in the path; The knowledge path corresponding to the maximum path score is determined as the target knowledge path; Based on the target knowledge path, reasoning and analysis are performed to obtain the answer to the business question.
4. The method according to claim 1, characterized in that, The step of obtaining candidate subgraphs matching the query body from a pre-constructed knowledge graph includes: Multiple candidate triples that semantically match the query body are obtained from a pre-constructed knowledge graph; the candidate triples include a head entity, a relation, and a tail entity. Using the head and tail entities of each candidate triple, as well as the entities in the query body, as seed nodes, at least one connected subgraph in the knowledge graph that contains all seed nodes and satisfies a preset hop count condition is obtained. Calculate the semantic similarity between each node and edge in each of the connected subgraphs and the query body; Nodes and / or edges with semantic similarity below a preset threshold are deleted from each of the connected subgraphs to obtain at least one candidate subgraph.
5. The method according to any one of claims 1-4, characterized in that, After inputting the multiple updated feature vectors into the path decoder to obtain at least one knowledge path, the method further includes: Obtain the context information of the user's current business and generate a context vector; The context vector is fused with each of the knowledge paths to obtain at least one updated knowledge path.
6. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtain a standardized business dataset, which is generated from multi-source heterogeneous business data; Entity recognition is performed on the text in the standardized business dataset to generate entity labels for each text. Relationships are extracted from the entity tags to generate relationship tags between entities; Based on the multiple entity tags and the relation tags between the entities, multiple triples are constructed; each triple includes a head entity, a relation, and a tail entity. The knowledge graph is constructed based on the multiple triples.
7. The method according to claim 6, characterized in that, The step of performing entity recognition on the text in the standardized business dataset and generating entity labels includes: The text is then subjected to context encoding to obtain a context feature vector; The context feature vector is input into a bidirectional long short-term memory network to obtain a bidirectional context feature vector; The bidirectional context feature vector is sequence-labeled using a conditional random field to generate entity labels.
8. An intelligent question-and-answer device, characterized in that, include: The parsing module is used to perform semantic parsing on the business questions input by the user to obtain the query body; The acquisition module is used to acquire candidate subgraphs that match the query body from a pre-built knowledge graph; The inference module is used to input the candidate subgraph into the graph neural network for multi-hop inference to obtain the updated feature vector corresponding to each node in the candidate subgraph. The input module is used to input multiple updated feature vectors into the path decoder to obtain at least one knowledge path; A generation module is used to determine a target knowledge path from the at least one knowledge path and generate an answer to the business question based on the target knowledge path; The path decoder includes a transition probability calculation module and a path search module. The transition probability calculation module is used to calculate the transition probability of the current node jumping to each of the neighboring nodes based on the updated feature vector of the current node in the candidate subgraph, the updated feature vector of each neighboring node, and the relationship feature vector between the current node and each neighboring node. The path search module is used to select the next hop node hop by hop according to the transition probability until the target node type is reached or the preset maximum step size is reached, and to concatenate the traversed nodes and relationships into the knowledge path according to the access order.
9. An electronic device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.