Feedback generation method and device based on business knowledge graph, equipment and medium
By collecting, cleaning, segmenting, and constructing a business knowledge graph, the problems of information dispersion and insufficient semantic association were solved, achieving efficient knowledge retrieval and accurate question answering.
Patent Information
- Application Number
- CN202610253734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-03
- Publication Date
- 2026-04-17
AI Technical Summary
Existing knowledge management technologies suffer from fragmented information and a lack of structured semantic connections, resulting in low retrieval efficiency and an inability to understand users' natural language query intent, thus failing to provide accurate and intelligent question answers.
Collect multi-source business data, clean and segment it to generate standardized text fragments; perform entity recognition and relation extraction to construct a business knowledge graph; receive natural language query instructions, extract query intent features and key entity references; map entities in the knowledge graph and perform relational traversal, and use a pre-trained language generation model to generate feedback information.
It achieves semantic structuring of textual knowledge, combines query semantics for reasoning, improves knowledge retrieval efficiency, and provides accurate question answers.
Smart Images

Figure CN121880531A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, and in particular to a feedback generation method, apparatus, device, and medium based on business knowledge graphs. Background Technology
[0002] In actual business operations, knowledge content such as rules, policies, cases, and operational guidelines accumulates and changes frequently. Business personnel need to quickly understand the logical relationships between rules and their specific applicable scenarios when making daily judgments and handling matters. However, existing knowledge management and retrieval methods mostly rely on scattered document systems or simple keyword search tools, which make it difficult to structure the semantic information in the text, and also fail to combine contextual semantics for understanding and reasoning during retrieval. This often forces business personnel to repeatedly search, compare, and judge from a large amount of information, resulting in low efficiency and a high risk of misunderstanding. Especially when there are complex relationships between rules, traditional retrieval methods cannot reveal the logical links between rules, making it difficult to meet the needs of accurate question answering and semantic retrieval in business scenarios.
[0003] In the fintech sector, particularly in insurance operations, numerous operational rules, claims guidelines, risk control strategies, and compliance requirements are scattered across different systems and documents, lacking unified semantic association and structured management. Existing systems primarily provide document-level retrieval through keyword matching, failing to understand the complex questions posed by business personnel in natural language, nor can they provide targeted answers based on the relationships between rules. When business personnel need to query the applicability of a rule in a specific context, they often only obtain a few fragmented documents, still requiring manual interpretation of the relationships between rules for inference, resulting in search results that significantly deviate from actual business needs.
[0004] In the healthcare sector, a large number of treatment guidelines, operational guidelines, case experiences, and management systems exist in scattered text form. These documents exhibit strong semantic connections and logical dependencies, but existing retrieval methods cannot effectively express and utilize these implicit relationships. When healthcare administrators or professionals search for a specific operational standard or judgment criterion, the system can only return superficially matching document content. It struggles to automatically locate the most relevant knowledge links based on the query's semantics, resulting in a cumbersome information retrieval process that easily overlooks key related content, failing to meet the needs for semantic understanding and accurate question answering. Summary of the Invention
[0005] The main objective of this invention is to provide a feedback generation method, apparatus, device, and storage medium based on business knowledge graphs, aiming to solve the technical problems in existing knowledge management technologies, such as low retrieval efficiency and inability to understand users' natural language query intent and provide accurate intelligent question answering, due to information dispersion and lack of structured semantic association.
[0006] To achieve the above objectives, this invention provides a feedback generation method based on a business knowledge graph, comprising: Collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments; Entity recognition and relation extraction are performed on the standardized text fragments, and a business knowledge graph containing entity nodes and connection edges is constructed based on the entity recognition results and relation extraction results. Receive natural language query instructions, use a semantic analysis model to extract features from the natural language query instructions, and generate query intent features and key entity references; The key entity designations are mapped to the business knowledge graph to determine anchor nodes. Based on the query intent features, an association traversal is performed in the business knowledge graph starting from the anchor nodes to obtain an association knowledge subgraph. The associated knowledge subgraph is serialized into a knowledge background context, and the knowledge background context and the natural language query instruction are jointly input into a pre-trained language generation model. The pre-trained language generation model is then used to generate natural language feedback information.
[0007] Furthermore, to achieve the above objectives, the present invention provides a feedback generation device based on a business knowledge graph, comprising: The text preprocessing module is used to collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments. The knowledge graph construction module is used to perform entity recognition and relation extraction on the standardized text fragments, and to construct a business knowledge graph containing entity nodes and connection edges based on the entity recognition results and relation extraction results; The query understanding module is used to receive natural language query instructions, extract features from the natural language query instructions using a semantic analysis model, and generate query intent features and key entity references; The graph retrieval module is used to map the key entity references to the business knowledge graph to determine anchor nodes, and to perform association traversal in the business knowledge graph based on the query intent features, starting from the anchor nodes, to obtain the associated knowledge subgraph. The answer generation module is used to serialize the associated knowledge subgraph into a knowledge background context, input the knowledge background context and the natural language query instruction into a pre-trained language generation model, and use the pre-trained language generation model to generate natural language feedback information.
[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a feedback generation program based on a business knowledge graph stored in the memory and executable on the processor, wherein when the feedback generation program based on the business knowledge graph is executed by the processor, it implements the steps of the feedback generation method based on the business knowledge graph as described above.
[0009] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a feedback generation program based on a business knowledge graph, wherein when the feedback generation program based on the business knowledge graph is executed by a processor, it implements the steps of the feedback generation method based on the business knowledge graph as described above.
[0010] Beneficial Effects: This invention relates to the field of data analysis technology and discloses a feedback generation method, apparatus, device, and medium based on a business knowledge graph. The method includes: collecting multi-source business data, cleaning and segmenting it into standardized text fragments; performing entity recognition and relation extraction on the text fragments to construct a business knowledge graph; receiving natural language query instructions, extracting query intent features and key entity references, mapping the key entity references to the business knowledge graph, and performing association traversal under the guidance of query intent features to obtain associated knowledge subgraphs; serializing the associated knowledge subgraphs into a knowledge background context, and jointly inputting it with the natural language query instructions into a pre-trained language generation model to generate natural language feedback information. This invention can be applied to business scenarios such as fintech and healthcare. By semantically structuring text knowledge and combining it with query semantics to perform reasoning in knowledge association, it achieves accurate question answering and improves knowledge retrieval efficiency. Attached Figure Description
[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of an application environment for a feedback generation method based on business knowledge graphs according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an embodiment of the feedback generation method based on business knowledge graph of the present invention. Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the feedback generation device based on business knowledge graph of the present invention; Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0013] The feedback generation method based on business knowledge graphs provided in this invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can collect multi-source business data from the client, clean and segment it into standardized text fragments, perform entity recognition and relation extraction on the text fragments to construct a business knowledge graph; receive natural language query commands, extract query intent features and key entity references, map the key entity references to the business knowledge graph, and perform association traversal under the guidance of query intent features to obtain associated knowledge subgraphs; serialize the associated knowledge subgraphs into knowledge background context, and input them together with the natural language query commands into a pre-trained language generation model to generate natural language feedback information. This invention can be applied to business scenarios such as fintech and healthcare, by semantically structuring text knowledge and combining it with query semantics to perform reasoning in knowledge association, achieving accurate question answering and improving knowledge retrieval efficiency. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The following detailed description of specific embodiments further illustrates this invention.
[0014] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the feedback generation method based on business knowledge graph provided by the present invention. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0015] like Figure 2 As shown, the feedback generation method based on business knowledge graph proposed in this invention includes the following steps: S10, collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments; In this embodiment, collecting multi-source business data refers to the operation of obtaining raw business information from multiple independent information sources with different data structures. These information sources include, but are not limited to, internal databases of running business systems, which typically provide application programming interfaces (APIs) to output structured or semi-structured query results; various document management systems for storing policy documents, operational guidelines, etc., containing a large number of unstructured or semi-structured files; and various information publishing sites and platforms accessible via public internet protocols. In practice, this operation requires constructing or configuring specific data connection programs. These programs establish communication links based on database connection protocols or network service interface specifications to automatically initiate data requests and receive returned data streams. For document data stored in a file system, the corresponding parsing library needs to be called according to its specific file format to read its underlying content. For publicly available network resources, automated acquisition can be achieved by deploying a crawler program with targeted crawling capabilities and configuring access cycles and target address matching rules. The raw data streams obtained from each source will converge in a designated temporary storage area or memory buffer, forming a collection containing data from multiple sources.
[0016] The goal of cleaning aggregated multi-source business data is to eliminate errors, inconsistencies, and redundancy in the original dataset, thus providing quality-compliant input for subsequent processing. The cleaning process comprises a series of ordered sub-operations. Deduplication identifies and removes data records with identical content or highly similar core semantic expressions by calculating the digital fingerprint of text content or comparing the distance between text semantic representation vectors. Completion targets missing key descriptive fields in data records, such as information source identifiers, data generation timestamps, or version identifiers, using logical inference and filling by analyzing information from other related fields within the record, or applying predefined default value assignment rules. Format normalization converts data content from different sources, potentially using different character encodings, into a specified character encoding format, and transforms information with various expression conventions, such as date and time strings, currency amounts, and numerical units of measurement, into a preset standard expression. Furthermore, for data containing HTML, XML, and other markup language tags, tag stripping tools or pattern-matching-based text processing techniques are needed to remove all non-content-related markup symbols, retaining only human-readable plain text character sequences. Simultaneously, based on predefined lists of invalid characters or common language stop words, garbled character sequences and frequently used function words lacking substantial semantic meaning are filtered out. These cleaning sub-operations are typically completed by writing a series of data transformation scripts with specific functions or integrating specialized data quality processing tools, executed in a predetermined order.
[0017] Segmentation operates on the clean, coherent text sequence obtained after cleaning. Its goal is to break potentially lengthy continuous text into smaller, more easily analyzed and managed text units based on their inherent logical structure and semantic integrity boundaries. One approach to segmentation is based on predefined rules, such as identifying inherent paragraph delimiters or specific punctuation marks as potential segmentation points, combined with an assessment of the physical length of text blocks. When a text block exceeds a predefined threshold for the number of characters or words, it is truncated at a point that conforms to grammatical integrity and contextual coherence. A more sophisticated approach utilizes trained natural language processing models, such as models specifically designed to identify sentence boundaries or those capable of understanding and segmenting semantic blocks, to identify more natural semantic unit boundaries within the text, thereby performing segmentation. The segmentation operation ultimately produces a set of shorter text segments that are semantically and logically relatively self-contained.
[0018] Generating standardized text fragments is the final normalization operation performed after segmentation. Its purpose is to ensure consistency in expression and terminology across all output text units, eliminating multiple different expressions of the same concept within the domain. This includes terminology standardization, which involves establishing a domain-specific standard terminology dictionary or synonym mapping table, uniformly mapping and replacing synonyms, near-synonyms, industry abbreviations, and colloquialisms in the text with verified standard terms. It also includes standardizing the text's surface form, such as converting all Latin letters to uniform uppercase and lowercase, converting full-width punctuation and numbers to half-width, and standardizing the written expression of numbers and units of measurement. Furthermore, to maintain data traceability in subsequent processes, each text fragment is typically associated with and encapsulated with its related source description information. The resulting data structure can be a data object containing multiple attribute key-value pairs. After this series of sequential processing steps, the final output is a set of standardized text fragments that are structurally consistent, clean in content, semantically clear, and accompanied by necessary source description information.
[0019] This embodiment systematically performs a series of processes, from acquiring multi-source heterogeneous data, to deep cleaning to remove noise and inconsistencies, then segmenting data according to logic and semantics, and finally standardizing terminology and format. This successfully transforms initially scattered, formatted, redundant, and erroneous raw business information into a set of text fragments with uniform formatting, clean and accurate content, clear structure, and complete source traceability information. This process fundamentally solves the problems of data silos, format conflicts, and inconsistent quality encountered when integrating multi-source data, providing a reliable and consistent data foundation for any deep semantic analysis and knowledge-based processing requiring high-quality text input.
[0020] S20, Entity recognition and relation extraction are performed on the standardized text fragments, and a business knowledge graph containing entity nodes and connection edges is constructed based on the entity recognition results and relation extraction results; In this embodiment, entity recognition of standardized text fragments refers to the process of automatically locating and classifying continuous word sequences representing specific categories of real-world objects in the text using a computational model. These object categories are predefined according to the needs of specific application domains; for example, in business activities, they may include product models, corporate entities, technical terms, and geographic location identifiers. Implementing this process typically requires performing basic language unit segmentation on the input text, that is, cutting the character stream into independent word units and labeling each unit with its grammatical function category. Based on this, a trained sequence labeling model is applied. This model can analyze the sequence features of the text and assign a label to each word unit to indicate whether it belongs to the beginning, internal continuation, or external part of a predetermined entity category. Commonly used model architectures include models combining bidirectional recurrent neural networks and conditional random fields, which can effectively utilize the contextual information of words; or language models based on the Transformer architecture and pre-trained on a large amount of text, with fine-tuning done after adapting their output layer to the sequence labeling task. The label sequence output by the model after word-by-word analysis of the text can be parsed to extract all text fragments that conform to the specific category definition and their corresponding category information, forming a structured entity list.
[0021] After obtaining the entity list, relation extraction refers to the process of automatically identifying and determining the semantic relationships between entity pairs found by the entity recognition process in the text, which conform to predetermined categories. These semantic relationship categories are also predefined based on domain knowledge, such as "belonging to," "occurring in," "research and development," and "cooperation." A common way to implement relation extraction is to construct the task as a classification problem. For each entity pair appearing in the text, the local text range containing these two entities is extracted as the analysis context. This context text, along with auxiliary information such as the type or location of the two entities, is input into a relation classification model. This model is responsible for encoding the input information and extracting features, and finally outputting a probability distribution to represent the probability that the entity pair belongs to each predefined relation type. The model can be built based on convolutional neural networks to capture local key patterns in the text; it can also use attention-based neural networks to better model the interaction between entities and contextual words; or it can use pre-trained language models specifically designed for relation understanding tasks. By traversing all possible combinations of entities that constitute a relation in the text and classifying them, a series of structured assertions describing how entities are related can be obtained.
[0022] Constructing a business knowledge graph containing entity nodes and connecting edges based on entity recognition and relation extraction results is the process of transforming the discrete factual information extracted from text into a unified, networked, structured knowledge representation capable of complex queries and reasoning. The construction process first requires the normalization and unified labeling of entities, that is, merging multiple entity mentions identified from different text fragments that may point to the same object in the real world, and assigning a global identifier to each unique real-world object. These global identifiers serve as nodes in the knowledge graph, and each node can be attached with a series of attributes, which can be derived from other descriptions of the entity in the text or external knowledge sources. Subsequently, the relation assertions extracted are mapped to edges connecting nodes in the graph, with the relation type serving as the edge label, and the two entities connected by the relation corresponding to the starting and target nodes of the edge, respectively. During this process, confidence assessment or domain-based logic-based verification can be performed on the extracted relations. The resulting graph structure can be persistently stored in a dedicated graph database. This type of database provides efficient storage, indexing, and support for complex graph pattern querying and traversal operations for nodes, edges, and their attributes, thereby forming a structured business domain knowledge graph rich in semantic relationships.
[0023] This embodiment, through automated entity recognition of standardized text fragments, systematically locates and categorizes key business elements contained within the text. Further, through relation extraction, it clearly defines the various semantic connections between these elements. Finally, through standardized entity integration and structured graph construction, it transforms scattered textual facts into a highly interconnected business knowledge network with clearly defined semantic relationships. This series of processes enables the automated extraction of structured knowledge from unstructured text sources and its organization into a computable, queryable, and reasonable graph model. It not only explicitly presents the implicit object relationship network within the data but also provides a directly usable structured knowledge foundation for relation-based deep retrieval, association analysis, and complex reasoning.
[0024] S30, receive a natural language query instruction, use a semantic analysis model to extract features from the natural language query instruction, and generate query intent features and key entity references; In this embodiment, receiving a natural language query instruction refers to the process of obtaining a user's question or request expressed in free text form through an interactive interface. This instruction is typically typed by the user in a text input box or converted using speech recognition technology; its content is a direct expression of human language, containing a complete grammatical structure and rich semantic information. After obtaining the raw text string, initial preprocessing operations are usually required to eliminate noise and form a standardized model input. These preprocessing operations include removing special characters or extra spaces that the user may have entered incorrectly, converting all characters in the text to lowercase or uppercase to eliminate inconsistencies caused by case differences, and converting elements with multiple expression forms, such as numbers and dates, to a standard format, thereby generating a grammatically correct and uniformly formatted query text sequence.
[0025] Feature extraction from processed query text using semantic analysis models refers to the process of transforming human-readable text sequences into machine-processable numerical representations containing semantic information. A semantic analysis model is a computational model trained on a large amount of text data, its core being the learning of deep semantic relationships and patterns between words, phrases, and sentences in a language. A typical implementation path employs a pre-trained language model based on the Transformer architecture. This process first inputs the text sequence into the model's embedding layer, which maps each independent word in the sequence into a dense vector in a high-dimensional space. These initial vectors encode the static semantics of the words to some extent. Subsequently, these word vectors are input into an encoder consisting of a multi-layered self-attention mechanism and a feedforward neural network. The self-attention mechanism dynamically calculates the association weights between each word in the sequence and all other words, thereby capturing long-distance lexical dependencies and complex contextual information, generating a feature vector sequence containing rich contextual semantic information. The entire encoding process is end-to-end differentiable, enabling the model to automatically learn the mapping function from surface symbols to deep semantics from massive amounts of text.
[0026] Generating query intent features is the process of further summarizing and abstracting the fundamental purpose or target category of a user's query based on the deep semantic representation output by the semantic analysis model. In terms of model architecture, this is typically achieved by adding a dedicated intent classification component at the top layer of the encoder. A common approach is to input the aggregate representation corresponding to the entire sequence (e.g., the final hidden state with a special marker at the beginning of the sequence) output by the encoder into a fully connected neural network layer. This fully connected layer is responsible for mapping the high-dimensional semantic vector to a vector space with dimensions equal to the number of predefined intent categories, and then converting it into a probability distribution vector using a normalization function such as Softmax. This probability distribution vector is the query intent feature, where the value of each dimension represents the confidence that the query belongs to that specific intent category (e.g., "asking for definition," "requesting comparison," "seeking operational steps," etc.), thus accurately characterizing the user's query purpose in a numerical form.
[0027] Generating key entity references is the process of accurately identifying and extracting named entities that are relevant to a specific domain and serve as the core objects of the query from natural language queries, while simultaneously leveraging the capabilities of semantic analysis models. This function is typically achieved through sequence labeling techniques, where a sequence labeling layer, such as a conditional random field layer, is overlaid on the contextual feature vectors corresponding to each word output by the encoder. This labeling layer takes the feature vector at each word position as input and assigns a label to each word, indicating the word's role in the entity (e.g., "beginning of the entity," "inside the entity," "non-entity," etc.) and the entity's type (e.g., "product name," "person's name," "location," etc.). By labeling and decoding the entire sequence, all consecutive word fragments labeled with specific entity categories can be extracted. These extracted text fragments are the key entity references; they directly point to the specific objects involved in the query, providing clear retrieval anchors for subsequent precise location of relevant information in the knowledge base.
[0028] This embodiment receives and preprocesses natural language queries, transforming unstructured user input into standardized text. It then utilizes a deep semantic analysis model to perform multi-level feature encoding on this text, capturing its complex contextual semantics. Based on this, a dedicated task layer extracts an intent feature vector summarizing the macro-level purpose of the query and a list of entity references identifying the specific objects involved in the query. This process achieves a deep and structured understanding of the user's natural language query, accurately deconstructing ambiguous language expressions into computable intent categories and entity identifiers. This provides crucial and highly reliable semantic input for subsequent targeted retrieval and accurate answer generation in a structured knowledge base.
[0029] S40, map the key entity designation to the business knowledge graph to determine anchor nodes, and perform an association traversal in the business knowledge graph based on the query intent features, starting from the anchor nodes, to obtain an association knowledge subgraph; In this embodiment, mapping key entity references to a business knowledge graph to determine anchor nodes refers to the process of establishing an accurate correspondence between the entity name string extracted from the query text and the existing entity nodes in the knowledge graph that represent unique real-world objects. Key entity references are text fragments obtained through entity recognition processing, which may contain ambiguities, synonyms, or abbreviations. The mapping process first requires retrieving all possible candidate nodes in the knowledge graph, typically done quickly using indexes of node attributes (such as names, aliases, and unique identifiers). Subsequently, the degree of matching is evaluated by calculating the similarity between the entity reference string and the standard name of each candidate node. Similarity calculation can combine multiple metrics, including edit distance based on character sequences, Jaccard similarity based on vocabulary overlap, and cosine similarity based on semantic embedding vectors (such as converting names into vectors using a pre-trained language model). To improve accuracy, the mapping process can also incorporate contextual information, i.e., analyzing the surrounding vocabulary of the entity reference in the original query sentence and jointly considering it with the neighbor node types or associations of the candidate nodes in the knowledge graph, using graph context similarity for ranking. Finally, the candidate node with the highest similarity score that exceeds the preset reliability threshold is selected and identified as the anchor node corresponding to this query in the knowledge graph. If there are multiple entity claims, this process will be executed in parallel, determining the corresponding anchor node for each claim.
[0030] Query intent traversal in a business knowledge graph, starting from an anchor node, refers to a search process initiated on the graph structure of the knowledge graph, with the initial exploration position at the anchor node, and the path, depth, and direction of the exploration guided and constrained by the query intent features. A query intent feature is a numerical vector or category label representing the user's macro-level query purpose. The core of relational traversal is to transform the intent features into preference weights or search constraints for different types of relationship edges in the graph. For example, if the intent feature indicates that the query purpose is "to find causal relationships," then during the traversal process, relationship edges labeled with types such as "cause" or "influence" will be given higher selection priority. Traversal algorithms typically employ improved graph search algorithms, such as weighted breadth-first search or depth-first search. At each step of expansion, the algorithm evaluates all outgoing and incoming edges of the current node, calculating the relevance score between the relationship type of each edge and the current query intent feature. This score can be used as an edge weight or selection probability. The algorithm tends to expand along edges with high relevance scores. The traversal process is also subject to resource constraints such as the maximum number of hops and the maximum number of nodes in the subgraph to prevent the search space from expanding indefinitely. Furthermore, traversal can start from multiple points simultaneously, exploring the paths connecting them in the graph. The entire traversal process dynamically collects all visited nodes and traversed edges.
[0031] Obtaining the related knowledge subgraph refers to extracting a coherent substructure containing all relevant nodes and edges from the graph regions explored during the aforementioned related traversal process, and using it as an independent graph object representing the most relevant knowledge fragment to the original query. During or after the traversal, the system needs to record the set of all nodes accessed by the algorithm and considered relevant to the query, as well as the set of edges connecting these nodes. The construction of the subgraph not only includes these directly accessed elements, but sometimes, to maintain the connectivity or semantic integrity of the subgraph, "bridging edges" that are not on the traversal path but directly connect multiple key nodes within the subgraph are automatically added. The generated subgraph strictly preserves the topological connections between these nodes and edges in the original knowledge graph. This subgraph may be a connected graph or multiple connected components (if paths originating from different anchors do not meet). Finally, this structured, semantically rich related knowledge subgraph is output as a condensed, query-highly-relevant knowledge context, directly serving the subsequent answer generation stage.
[0032] The mapping technique between entity references and graph nodes can be adjusted according to the graph size and accuracy requirements. For domains with standardized names and few aliases, precise matching or fuzzy string matching based on inverted indexes can be used to quickly locate candidates. For cases with a large number of synonyms, it is necessary to integrate a domain thesaurus or terminology standardization service to convert entity references into standard terms before matching. More advanced mapping can use entity linking models based on deep learning. These models encode the reference and its context, as well as the candidate node and its graph context, together for end-to-end matching decisions. In scenarios with extremely high real-time requirements, a pre-computed mapping table of entity references to node IDs can be used.
[0033] The strategy for associative traversal can be diversified based on the complexity of the query intent and the graph structure. For categorical queries with clear intent (such as "query attribute"), a predefined path template can be used, for example, starting from the anchor node and traversing only one hop along the edges of the "has attribute" category. For queries requiring exploratory discovery (such as "find associations"), a personalized PageRank algorithm can be used, transforming query intent features into biases on the probability of random jumps on specific types of edges. The importance score of nodes related to the query intent is calculated iteratively, and high-scoring nodes are selected to form a subgraph. Another approach is a graph traversal agent based on reinforcement learning. The agent learns to select the next edge to traverse based on the current node state and query intent features to maximize the reward for obtaining the relevance between the subgraph and the query. The depth and breadth limits of the traversal can be dynamically adjusted according to the response time requirements of the interactive interface.
[0034] The generation and pruning methods for knowledge subgraphs can be optimized. A simple subgraph is simply a set of all visited nodes and edges. To improve subgraph quality, nodes can be reordered based on their semantic relevance to the query intent after traversal, retaining only the top-K nodes and their edges. Alternatively, community detection algorithms can be used to find the most tightly connected subgraphs within the graph of visited nodes. For large graphs, subgraph extraction can be compressed, for example, by folding a long path connected by intermediate nodes into direct virtual edges between anchor nodes, while preserving the path's semantic summary.
[0035] This embodiment ensures the accuracy of the information retrieval starting point by precisely mapping the entity references in the query to specific nodes in the knowledge graph. Furthermore, it dynamically guides the graph traversal process using query intent features, transforming the search from a blind expansion into a focused exploration with clear semantic guidance. Finally, it efficiently extracts structurally complete sub-image segments closely related to the query intent from the vast knowledge network. This series of processes achieves a leap from coarse keyword-based matching to precise positioning based on semantics and graph structure, providing highly condensed, highly relevant, and structured knowledge base for generative answer synthesis, greatly improving the accuracy and depth of question answering.
[0036] S50, the associated knowledge subgraph is serialized into a knowledge background context, the knowledge background context and the natural language query instruction are jointly input into a pre-trained language generation model, and the pre-trained language generation model is used to generate natural language feedback information.
[0037] In this embodiment, serializing the associated knowledge subgraph into a knowledge context refers to the process of transforming graph structure data, i.e., network segments composed of nodes and edges, into a coherent, machine-readable, and human-understandable natural language text description. The associated knowledge subgraph contains a set of entity nodes and labeled relational edges connecting these nodes. The serialization operation first traverses all components of the subgraph. For each entity node, its stored core attribute information is extracted, typically including at least the entity's standardized name, and possibly also its type, key attribute values, etc. This information is then filled in according to a predefined natural language sentence template to generate a statement describing the entity's existence, such as "There exists an entity of type [X]". For each connecting edge, its relational type label and the names of the head and tail entity nodes it connects to are extracted, and similarly filled in according to a predefined sentence template describing the existence of a relation to generate a statement describing the relationship between entities, such as "There exists a [relationship type] relationship between [head entity name] and [tail entity name]". All the generated descriptive statements about nodes and edges constitute an unordered set. Subsequently, based on the subgraph's internal logic or externally defined rules, these independent statements need to be organized into a coherent and logically sound text paragraph. The organization can be based on the connection order of nodes in the graph, such as starting with the anchor node, describing its directly associated edges and neighboring nodes sequentially, and then extending to the next level; or it can be based on a sorting algorithm, such as sorting by entity type or statement length and then directly concatenating the sentences. The resulting coherent text paragraph constitutes the knowledge context, which reproduces the structured knowledge encoded in the subgraph using natural language.
[0038] Integrating knowledge context with natural language query instructions into a pre-trained language generation model involves constructing a text sequence that conforms to the model's input format requirements. This sequence contains both relevant background knowledge supporting the answer to the question and the original question to be answered. Pre-trained language generation models are typically trained to predict subsequent text based on given text prefixes. Therefore, background knowledge and the question need to be combined into a complete text prefix in a specific format. This is usually achieved through a predefined prompt template. This template is a text string containing placeholders, such as "Based on the following knowledge: [Knowledge Context] Question: [Natural Language Query Instruction] Answer:". During construction, the serialized knowledge context text is filled into the corresponding placeholders, and the user's initial natural language query instruction is filled into the question placeholders, thus concatenating to generate a structured input text sequence for the model. This input text explicitly instructs the model to answer the question based on the provided background knowledge. Some implementations also add system instructions to the template, such as "You are an assistant, please answer the question based on the given information," to further guide the model's behavior.
[0039] Generating natural language feedback using a pre-trained language generation model refers to driving this computational model to automatically generate a text as an answer based on the input sequence containing context and a question, as described above. The pre-trained language generation model is a deep neural network based on the Transformer architecture, trained on a massive and diverse corpus of text using a self-supervised objective. The model's training employs an autoregressive language modeling objective, predicting the next token based on a given preceding sequence. During training, the AdamW optimizer is used, with an initial learning rate typically set between 1e-4 and 5e-5, and a cosine annealing strategy is employed for scheduling. The batch size is dynamically adjusted based on available hardware memory, typically between 32 and 128. The model is trained on a diverse corpus containing hundreds of billions of tokens, with training steps ranging from hundreds of thousands to millions of steps, to fully learn the language's syntax, semantics, and contextual relationships. When applied to specific business domains (such as finance and healthcare), the model can be further fine-tuned using domain-related corpora (such as financial reports and medical literature) under supervised instruction. During fine-tuning, sample data in an "instruction-input-output" format needs to be constructed. For example, the input is "Based on the following knowledge: [Background] Question: [Query]", and the output is the corresponding standard answer. Fine-tuning uses a low learning rate (e.g., 1e-5) for thousands of training steps to adapt the model to domain terminology, knowledge structure, and question-answering style. During the inference phase, the model receives the input text sequence and converts it into a series of high-dimensional vector representations. Through its internal multi-layer self-attention mechanism and feedforward network, the model predicts the next most likely word word by word and appends the predicted word word to the input sequence in an autoregressive manner as part of the new input, continuing to predict the next word word, and so on iteratively. This process continues until the model generates a special symbol indicating the end of the sequence, or reaches the preset maximum generation length. This continuation text generated by the model, starting after "Answer:", is considered the initial response text sequence to the original query. To ensure output quality, post-processing of this initially generated text may be necessary. Post-processing includes trimming potentially duplicated parts, removing irrelevant formatting tags, performing basic syntax checks, and quickly verifying consistency with the provided knowledge context to ensure that the generated content does not significantly deviate from the given basis. The final text obtained after necessary processing is the natural language feedback information returned to the user.
[0040] This implementation systematically serializes the associated knowledge subgraph into a coherent natural language description, transforming structured graph data into textual context that the generative model can directly process. Then, through a carefully designed prompt template, this context is integrated with the original query instruction into a structured input sequence, explicitly providing the basis for the answer. Finally, a powerful pre-trained language generation model is driven to autoregressively synthesize a fluent, accurate, and closely related natural language response based on this evidence-rich input. This process achieves end-to-end conversion from structured knowledge fragments to fluent and credible natural language answers, effectively utilizing the powerful language synthesis capabilities of the generative model. Simultaneously, by providing precise knowledge context, the generation process is constrained, ensuring that the final feedback information possesses both accuracy and naturalness of expression.
[0041] In one embodiment, step S10 above includes: S101, establish a communication connection with the business system database, document management server and public data source on the Internet through a preset data interface, acquire the original business file stream at a preset frequency through the communication connection, and aggregate the original business file stream into multi-source business data; S102, identify the file format type of the multi-source business data, use the optical character recognition module to extract the text content in the image format file, integrate the text content with the text content of the non-image format file, and generate a text set to be cleaned; S103, use a preset regular expression pattern to traverse the text set to be cleaned, and remove HTML web page tags, garbled characters and stop words to obtain a clean text sequence; S104, based on preset punctuation mark separators and semantic integrity length thresholds, the clean text sequence is truncated according to semantic boundaries to generate multiple independent text paragraphs; S105, extract the source metadata information of the multi-source business data, append the source metadata information to the attribute field of each independent text segment, and encapsulate the independent text segment containing the attribute field into a key-value pair object to generate a standardized text fragment.
[0042] In this embodiment, establishing communication connections with the business system database, document management server, and publicly available internet data sources through preset data interfaces refers to programmatically initializing and maintaining data exchange channels with different data sources according to pre-configured connection parameters and protocol specifications. For the business system database, this typically involves loading a specific database driver, using a connection string containing the server address, port, database name, and authentication credentials, and establishing a session through standard interfaces such as JDBC and ODBC. For the document management server, remote directories may be mounted via the WebDAV protocol, a dedicated RESTful API, or the SMB / CIFS file sharing protocol. For publicly available internet data sources, request headers are constructed using an HTTP / HTTPS client library, and cookies and session management are handled to simulate browser access. After the connection is established, the raw business file stream is acquired through the communication connection at a preset frequency. This frequency is controlled by a scheduling framework, such as using the operating system's scheduled tasks, Quartz, or listening to specific topics in a message-driven architecture that responds to external events. The acquisition action may involve executing SQL queries to return result sets, calling API endpoints to return JSON / XML response streams, or downloading complete document files. These raw byte or character streams arriving from different channels are buffered or temporarily stored in real time, and then aggregated into multi-source business data. The aggregation process may involve decoding the stream data into a unified character encoding format and injecting it into a stream processing pipeline or batch processing queue with a backpressure mechanism to ensure the manageability and order of the data stream.
[0043] Identifying the file format type of multi-source business data is an operation that automatically determines the original storage format of each data unit by using file extensions, MIME type detection, or binary file header feature analysis. For specific implementation, content analysis tool libraries such as Apache Tika can be called, which can identify hundreds of formats through magic number sequence matching. For entries identified as image format files, an optical character recognition module is used to extract the text content therein. This module is an integrated or external OCR engine processing pipeline. The pipeline preprocesses the image, including grayscale conversion, binarization, noise reduction, layout analysis, and text region detection, and then uses a trained character recognition model, such as the Tesseract engine based on convolutional neural network and recurrent neural network or its commercial cloud version, to convert image pixels into encoded text. The recognition result is usually accompanied by a confidence score and can be post-processed, such as dictionary correction. At the same time, for non-image format files, such as PDF, DOCX, HTML, TXT, etc., corresponding parsing libraries, such as PDFBox, Apache POI, Jsoup, are called to extract the embedded text character sequences and ignore the format and style information. Finally, the two types of text content from image recognition and document parsing are merged. The merging operation is to add all text strings to a unified data structure, such as a string list in memory or an aggregated text file in a distributed file system, to generate a text set to be cleaned.
[0044] Traversing the text set to be cleaned using a preset regular expression pattern is a process of pattern matching and filtering for structural noise and lexical noise existing in the text. The preset regular expression pattern is a set of predefined regular expression strings that describe specific noise patterns. For HTML web page tags, patterns such as <[^>] > can match and remove all tags and their attributes within the angle brackets. For garbled symbols, the pattern may be defined based on the Unicode character range. For example, it can match and remove all characters outside the common character sets of the target language (such as basic ASCII or Chinese character range). For stop words, a list containing common function words, auxiliary words, and modal particles is constructed and converted into a regular expression pattern for matching the entire word, such as \b(的|了|在|是)\b. The traversal operation sequentially applies these compiled regular expression objects to each text entry in the text set to perform replacement or deletion operations. To improve efficiency, regular expressions are usually compiled into reusable Pattern objects during program initialization. This process processes the text item by item, removes all matched noise patterns, and outputs a character sequence containing only substantial words and punctuation marks to obtain a pure text sequence.
[0045] Based on preset punctuation delimiters and a semantic integrity length threshold, the clean text sequence is truncated according to semantic boundaries. This process divides potentially lengthy continuous text streams into relatively self-sufficient short text units that are semantically and grammatically self-contained. Preset punctuation delimiters typically include markers indicating sentence endings, such as periods, question marks, and exclamation marks. The processing logic involves scanning the text sequence and performing initial segmentation at the locations of these delimiters to form candidate sentences. Subsequently, a semantic integrity length threshold is applied for judgment; this threshold is a pre-defined maximum allowed number of characters or words. For each initially segmented sentence, if its length exceeds the threshold, it is considered that it may still contain multiple semantic units and requires secondary segmentation. Secondary segmentation may look for secondary punctuation marks such as semicolons and commas, or identify clause boundaries based on dependency parsing, further truncating the sentence without disrupting the core grammatical structure. If the sentence length does not exceed the threshold, it is directly retained as an independent unit. All units that have passed the final judgment are arranged in their original order, generating multiple independent text paragraphs, each carrying a relatively complete semantic expression.
[0046] Extracting source metadata information from multi-source business data refers to capturing descriptive attributes from the accompanying information of the original data stream or file to describe the background of the data's origin. This metadata information may include a unique identifier of the data source, a timestamp of data acquisition, the path or URL of the original file, the file's creator or last modifier, the data's version number, etc. The extraction operation is performed synchronously during the data acquisition or parsing phase, obtained by reading HTTP response headers, metadata from database query result sets, file system attributes, or parsing the metadata portion of documents. Appending source metadata information to the attribute fields of each individual text segment involves dynamically adding a set of key-value pair attributes describing its source to each text segment object generated by logical truncation processing. For example, adding fields such as `source_id`, `fetch_time`, and `original_path` and assigning values to a programming language object (such as a Python dictionary or a Java class instance) representing a text segment. Finally, the individual text segments containing these attribute fields are encapsulated into key-value pair objects. Encapsulation refers to combining the segment text content with its associated attribute fields into a serializable data structure. This data structure can be a standard JSON object, where the keys are attribute names and the values are the corresponding attribute values, with the text content itself also serving as a value for a special key (e.g., `content`). Alternatively, it can be a message structure based on a specific serialization protocol. This encapsulated object is a standardized text fragment, possessing a unified external interface that facilitates subsequent storage, indexing, and processing.
[0047] This embodiment transforms the original, scattered, and disorganized business data into a batch of standardized text fragments with uniform format, clean content, complete semantic units, and complete traceability information by automatically establishing multi-source connections and data aggregation, intelligently identifying formats and converting text, cleaning noise, segmenting according to semantic rules, binding source metadata and encapsulating the data. This provides a reliable and directly usable structured data foundation for subsequent deep processing workflows that rely on high-quality text input.
[0048] In one embodiment, step S20 above includes: S201, Input the standardized text fragment into a pre-trained named entity recognition model to identify the business proper nouns and category attributes in the standardized text fragment, obtain entity recognition results, and generate candidate entity nodes based on the entity recognition results; S202, determine the text similarity between different candidate entity nodes, and fuse and deduplicate candidate entity nodes whose text similarity exceeds the entity fusion similarity threshold to obtain a unique set of entity nodes; S203, construct entity pairs based on the position information of entities in the standardized text fragment in the unique entity node set, input the entity pairs into the relation classification model to determine the relation type, and obtain the relation extraction result; S204, Based on the relation extraction result, generate connection edges connecting the corresponding entities in the unique entity node set, and assemble the entities in the unique entity node set and the corresponding connection edges into triplet data; S205, store the triplet data into a graph database to construct a business knowledge graph.
[0049] In this embodiment, standardized text fragments are input into a pre-trained named entity recognition model. This model is a deep neural network pre-trained on a large-scale general text corpus and fine-tuned on domain-specific labeled data. For example, it may employ an architecture combining a bidirectional long short-term memory network and a conditional random field, or a model based on a Transformer architecture with its output layer adapted for sequence labeling tasks. The model receives input consisting of a sequence of word indices and, through its internal multi-layer nonlinear transformations, outputs a label probability distribution for each word position in the input sequence. The label system follows a labeling scheme such as BIO (Start, Inside, Outside) and expands to indicate specific entity categories. The model performs forward propagation computation, assigning the most probable label to each word based on the probability distribution. By parsing continuous label sequences with the same entity category identifier, it extracts all continuous word fragments and their corresponding predefined entity categories from the original text, such as product names, organizations, and technical terms. Based on these extraction results, a data structure instance is created for each identified entity mention. This instance records the text content, category label, and start and end character offsets of the entity mention in the original text. The set of these instances constitutes the candidate entity node set, where each node is a preliminary representation of a potential entity node in the knowledge graph.
[0050] Determining the text similarity between different candidate entity nodes quantifies the likelihood that they refer to the same real-world entity by calculating the proximity between vectors or strings representing the text content of entity mentions. Text similarity calculation can be based on character-level metrics, such as edit distance, which measures the minimum number of single-character edits required to convert one string into another; or on lexical-level metrics, such as the Jaccard similarity coefficient, which calculates the ratio of the intersection to the union of the word sets after segmentation of two strings; or on semantic-level metrics, using pre-trained word embedding or sentence embedding models to convert entity mention text into high-dimensional vectors and then calculating the cosine similarity between vectors. The system performs pairwise similarity calculations on all candidate entity nodes, generating a similarity matrix. The entity fusion similarity threshold is a pre-set value used to determine whether two mentions are similar enough to be merged. Traversing the similarity matrix, for each pair of candidate entity nodes with a similarity value exceeding the threshold, a fusion and deduplication operation is performed. This is typically implemented using disjoint-set data structures or hierarchical clustering algorithms to group multiple mentions into the same cluster. Each final cluster is assigned a globally unique identifier, and the representative reference text in that cluster is used as the normalized name, thereby generating a unique set of entity nodes with redundant references removed.
[0051] Entity pairs are constructed based on the positional information of entities in a standardized text fragment from a set of unique entity nodes. This involves filtering for combinations of entities that may exist within the same semantic context based on the position of entity mentions in the text. Positional information includes the start and end character offsets of entity mentions. The construction logic typically limits the selection to entity combinations that co-occur within the same sentence or adjacent sentences, ensuring potential semantic relationships between entity pairs. In practice, the text fragment is traversed, identifying all mentions of unique entity nodes. For any two different entities within the same predetermined window, an unordered or ordered entity pair is generated. Each constructed entity pair, along with its original text context, is then used as input to a relation classification model. The relation classification model is another trained deep neural network, such as a convolutional neural network that captures local features or an attention mechanism that models long-distance dependencies. The input is typically specially formatted, for example, by inserting special markers at corresponding positions in the text context of entity mentions to highlight entities, before the entire sequence is fed into the model. The model outputs a probability distribution across all predefined relation types. The relation type with the highest probability is selected as the predicted relation for that entity pair in the current context. If the highest probability is below a preset threshold or belongs to the "no relation" category, it is determined to be a invalid relation. This classification process is performed on all entity pairs, and the resulting set of relation type assertions is the relation extraction result.
[0052] Generating connection edges connecting corresponding entities in the unique entity node set based on relation extraction results instantiates the classified relation assertions into edge structures in a knowledge graph. For each entity pair predicted to have a valid relation type, the system locates the corresponding two entity nodes in the unique entity node set according to the relation type. Then, an edge data structure instance is created, which records the relation type, confidence score, and explicitly points to unique identifiers of the head and tail entity nodes. The direction of the edge is usually predefined according to the relation type semantics; for example, the "subsidiary" relation points from the parent company to the subsidiary. Assembling the entities in the unique entity node set with their corresponding connection edges into triples means organizing all valid relation assertions and their associated entities into a standardized structured representation. Each triple consists of a head entity identifier, a relation type identifier, and a tail entity identifier. These triples are collected into a list or batch data structure for subsequent persistent storage. This process integrates discrete entity mentions and relation classification results into an internally consistent set of knowledge representations based on triples.
[0053] Storing triplet data in a graph database involves persisting structured triplet data through an interface provided by the graph database management system, thereby constructing a queryable and traversable graph structure. A graph database is a database specifically designed for storing and querying graph data models, whose data model uses nodes and edges as core elements. The operation first establishes a connection with the graph database server and may initialize an empty transaction. For each triplet, the system translates it into a database write operation: checking if the head and tail entity nodes already exist in the database; if not, creating new nodes with corresponding attributes (such as name and type); then, creating an edge with a specified relation type label between the two nodes (existing or newly created). To improve write efficiency, batch transaction commits are typically used. During this process, the system may simultaneously build indexes based on node type, attributes, or relation type to accelerate subsequent queries. Once all triplet data has been successfully written, a network of interconnected entity nodes and relation edges is formed in the database, completing the construction of the business knowledge graph, which becomes a structured knowledge base supporting complex graph queries and reasoning.
[0054] This embodiment automatically extracts key business elements from text and generates candidate nodes using a named entity recognition model. It ensures the uniqueness of entity references by fusing text similarity calculation and threshold determination to remove duplicates. Entity pairs are constructed using co-occurrence locations, and their semantic relationships are accurately determined using a relation classification model. The identified entities and relationships are then instantiated as nodes and edges in a graph and assembled into triples. Finally, the structured triple data is persisted to a graph database. This series of operations achieves automated and high-precision extraction of a structured entity-relationship network from unstructured text, constructing it into an internally consistent, semantically rich business knowledge graph capable of performing complex relational queries and reasoning. This provides a reliable core data structure for knowledge-based intelligent applications.
[0055] In one embodiment, step S30 above includes: S301, Receive a natural language query command sent by a user terminal, perform word segmentation and noise reduction processing on the natural language query command, and generate a word segmentation sequence; S302, the word segmentation sequence is input into the vector embedding layer of the semantic analysis model to obtain a high-dimensional word vector matrix; S303, the global semantic weights of the high-dimensional word vector matrix are determined using the attention mechanism network of the semantic analysis model, and the high-dimensional word vector matrix is weighted and aggregated based on the global semantic weights to generate query intent features that represent global semantic information; S304, using the sequence labeling layer of the semantic analysis model to predict the entity category of the high-dimensional word vector matrix, extracting the word fragments predicted as business entity categories, and generating key entity references.
[0056] In this embodiment, receiving a natural language query command sent by a user terminal refers to capturing a data packet encoded as freely input text transmitted from the client application through an application programming interface endpoint or message queue listener deployed on a network server. This data packet typically follows a structured format such as JSON or XML, containing the query text string and metadata such as possible session identifiers. The system parses the data packet to extract the original query text string. Subsequently, word segmentation is performed on this string. Word segmentation is the process of cutting a continuous sequence of characters into the smallest unit sequence with independent semantic or syntactic functions. For languages without explicit delimiters, such as Chinese, this process relies on a pre-trained word segmentation model based on a statistical language model or dictionary matching algorithm to segment the string into a sequence of words. For languages separated by spaces, such as English, basic word segmentation can be performed by spaces and punctuation, but further processing of sub-word units is required to adapt to the pre-trained model. For example, byte pair encoding or the WordPiece algorithm can be applied to split the vocabulary into smaller sub-word units that exist in the model's vocabulary. Simultaneously, denoising is performed, including using regular expression patterns to remove invisible control characters, filtering Unicode symbols outside the basic multilingual plane, converting full-width characters to half-width characters, unifying all alphabetic characters to lowercase, and filtering and replacing content based on a predefined list of sensitive words. After word segmentation and denoising, the original query text is converted into an ordered sequence of word or sub-word unit identifiers, i.e., a word segmentation sequence, which serves as the normalized input for subsequent semantic analysis.
[0057] The segmented sequence is input into the vector embedding layer of the semantic analysis model. This layer is a queryable matrix or function that maps discrete symbolic identifiers to continuous high-dimensional vectors. Each unique word or sub-word unit is assigned a fixed integer index during model training. The embedding layer is essentially a floating-point matrix with the number of rows equal to the model vocabulary size and the number of columns equal to the preset embedding dimension. When a segmented sequence is input, the system retrieves the corresponding row vector from this matrix based on the integer index of each unit in the sequence. For modern semantic analysis models based on Transformer, the embedding process is more comprehensive, including not only word embeddings but also positional embedding vectors to encode the order information of words in the sequence, and sometimes sentence type embeddings. The positional embedding vectors of all words are generated using sine and cosine functions or obtained from a trainable parameter matrix. The word embedding vectors and positional embedding vectors are added element-wise to form the initial vector representation for each input position. The initial vectors of all positions in the entire sequence are stacked in order to form a three-dimensional tensor. Its shape is the sequence length multiplied by the batch size and then by the embedding dimension. When the batch size is 1, it is a high-dimensional word vector matrix. Each row in this matrix corresponds to a dense numerical representation of an input word.
[0058] The global semantic weights of a high-dimensional word vector matrix are determined using an attention mechanism network within a semantic analysis model. This attention mechanism network is a core component of the model's encoder and is typically composed of stacked multi-layer, multi-head self-attention modules in a feedforward network. The self-attention computation first transforms the high-dimensional word vector matrix into a query matrix, a key matrix, and a value matrix through linear projection. For each word position, the dot product of its query vector and the key vectors at all positions in the sequence is calculated. The result is then divided by a scaling factor and normalized using Softmax to obtain the attention weight distribution of that position relative to all positions. This process is performed simultaneously on multiple parallel "heads," each focusing on a different semantic subspace. The outputs of each head are concatenated and fused using linear projection. In the stacked multi-layer structure, the output of each layer serves as the input to the next, continuously deepening the semantic representation. To generate query intent features that characterize the global semantics of the entire sequence, a common approach is to add a special [CLS] classification label before the input sequence. After attention computation and transformation across all layers, the final hidden state of this label is considered to aggregate the contextual information of the entire sequence. Another approach avoids special labeling and instead performs weighted average pooling on the word vectors at all positions in the encoder output. The weights are dynamically calculated using a trainable attention layer that calculates the contribution score of each position to the global semantics based on the encoded word vectors—the global semantic weight. Then, a weighted aggregation of the high-dimensional word vector matrix is performed based on these weights; that is, a weighted sum of the encoded word vectors is calculated. The weighted sum is calculated by summing the encoder output matrix (shaped as sequence length multiplied by the hidden layer dimension) along the sequence length dimension, using the global semantic weights as coefficients. This results in a fixed-dimensional vector, which represents the query intent feature. This vector encapsulates the overall semantic intent of the query and can be directly used for subsequent classification tasks.
[0059] Sequence labeling layers in a semantic analysis model are used to predict entity categories from a high-dimensional word vector matrix. These layers are typically fully connected neural networks added on top of the context-rich word vector matrix output by the encoder, and may be followed by a conditional random field (CRF) layer to model transition constraints between labels. The encoder output matrix has each row corresponding to a deep contextual representation of a word in the original input sequence. The fully connected layer maps this high-dimensional vector to a vector space with dimensions equal to the number of entity label types. Label types follow a labeling system like BIOES, where B- indicates the start of an entity class, I- indicates interior, E- indicates end, S- indicates single-word entity, and O- indicates non-entity. Using only fully connected layers, a Softmax function is applied independently at each position to obtain the probability distribution for each label. If a CRF is combined, the label path probability of the entire sequence is considered during decoding, and the globally optimal label sequence is found using the Viterbi algorithm. The model performs forward inference, assigning an entity category label to each unit in the segmented sequence based on the final probability distribution. Extracting word segments predicted as business entity categories is accomplished by parsing the label sequence in a post-processing module. This module scans the tag sequence to identify consecutive tag segments that are labeled with the same entity type and conform to BIOES rules (e.g., a B-tag followed by zero or more I-tags). For each such tag segment, the original text string fragment is reconstructed based on the unit index in its corresponding word segmentation sequence. These text fragments and their predicted entity types are recorded, forming a key entity reference list. This list accurately identifies the specific business objects involved in the query command.
[0060] This embodiment receives and normalizes user query text, converting it into a machine-processable symbol sequence. An embedding layer transforms these symbols into numerical vectors rich in latent semantics. A deep attention network dynamically extracts a global semantic representation summarizing the overall query purpose from the vector sequence. Simultaneously, sequence labeling technology precisely locates and extracts the specific business objects involved in the query from the same underlying representation. This process achieves deep, parallel parsing of natural language queries, outputting both macro-level intent categories and micro-level entity references, providing a complete and reliable semantic understanding foundation for subsequent precise targeted retrieval in a structured knowledge base.
[0061] In one embodiment, step S40 above includes: S401, determine the semantic similarity between the key entity reference and each entity node in the business knowledge graph, and select the entity node with the highest semantic similarity as the anchor node; S402, retrieve the direct neighbor nodes and candidate connection edges of the anchor node in the business knowledge graph, and determine the semantic relevance score between the attribute information of the candidate connection edges and the query intent feature; S403, select candidate connection edges whose semantic relevance scores are greater than the path selection relevance threshold as valid retrieval paths, visit the next-hop neighbor nodes along the valid retrieval paths, and repeat the determination of semantic relevance scores and path selection to perform association traversal; S404, extract all the nodes visited and the connecting edges traversed during the association traversal process, and construct an association knowledge subgraph based on the topological structure of all the nodes visited and the connecting edges traversed.
[0062] In this embodiment, determining the semantic similarity between key entity references and entity nodes in the business knowledge graph is achieved by calculating the semantic proximity between entity text fragments extracted from natural language queries and standardized entity node names stored in the knowledge graph, thus assessing the probability that they refer to the same real-world object. Key entity references are text strings extracted using a sequence labeling model. Semantic similarity calculation can employ multi-level methods: at the lexical level, algorithms based on string edit distance or n-gram overlap are used; at the distributed semantic level, a pre-trained word embedding model is used to convert entity reference text and node name text into high-dimensional vectors, and then the cosine similarity or Euclidean distance between the vectors is calculated; at the context enhancement level, the similarity between the context word vectors of the entity reference in the original query sentence and the distribution vectors of the target node's neighboring node types in the graph can be further combined for a comprehensive score. For each possible candidate entity node in the graph, the system performs the above calculations to obtain a normalized similarity score. Selecting the entity node with the highest semantic similarity as the anchor node involves choosing the node with the highest comprehensive similarity score from all candidate nodes. This selection typically also requires the highest score to exceed a predetermined confidence threshold to ensure the reliability of the mapping. If multiple entity references need to be mapped simultaneously, the process is executed in parallel, independently determining the corresponding anchor node for each reference.
[0063] Retrieving the direct neighbor nodes and candidate connecting edges of an anchor node in the business knowledge graph is achieved through the graph database's query interface, executing a single-hop graph traversal query starting from the anchor node's unique identifier. The query statement specifies that all edges directly connected to the anchor node and the nodes at their other ends should be returned. Each returned edge carries its relation type label and may store other attribute information, such as weight and creation time. These edges constitute the candidate connecting edge set, and the nodes at the other ends of the edges constitute the direct neighbor node set. Determining the semantic relevance score between the attribute information of the candidate connecting edges and the query intent feature involves associating and quantifying the semantic information of each edge with a numerical vector representing the macroscopic purpose of the query. The query intent feature is typically a low-dimensional dense vector. For each candidate edge, the system extracts its core semantic attributes, primarily the relation type label, and may also include other textual attributes on the edge. These attribute texts are converted into vector representations using the same embedding model. The relevance score is calculated by comparing the cosine similarity between the edge attribute vector and the query intent feature vector. More sophisticated implementations can introduce an attention mechanism, allowing the query intent features to dynamically calculate attention weights for different relation type vectors as relevance scores. This process assigns a relevance score to each candidate connection edge originating from the anchor node, with the score indicating how well the relation represented by the edge matches the current query intent.
[0064] Candidate edges with semantic relevance scores greater than the path selection relevance threshold are selected as effective retrieval paths. This involves filtering edges highly relevant to the query intent using a predetermined numerical threshold. The path selection relevance threshold is an adjustable parameter used to control the strictness and focus of the traversal. The system traverses all candidate edges, filtering out those with relevance scores higher than the threshold. These selected edges are considered effective retrieval paths originating from the current node and potentially leading to query-related knowledge. Visiting the next-hop neighbor node along the effective retrieval path involves moving along each selected edge to its other end, marking that neighbor node as the new current node, and adding it to the exploration set. The process of determining semantic relevance scores and selecting paths is repeated, starting from newly visited nodes and recursively or iteratively repeating the above process: retrieving the direct neighbors and edges of the new node, calculating the relevance scores of these new edges to the original query intent features, filtering effective paths based on the threshold, and continuing to visit along the path. This association traversal process constitutes a query intent-guided, directed diffusion search on the knowledge graph. Traversal is typically limited by the maximum number of hops, the maximum number of nodes in the subgraph, or the time budget to prevent the search space from exploding. Traversal algorithms can employ priority queues, always prioritizing the exploration of the path with the highest current relevance score, thus implementing heuristic search.
[0065] Extracting all visited nodes and traversed edges during the association traversal involves collecting all visited entity nodes and relational edges marked as relevant to the query from the algorithm's internal state at the end of the traversal. This includes the initial anchor node, all neighbor nodes reached through valid retrieval paths, and all edges deemed valid retrieval paths. Constructing an association knowledge subgraph based on the topology of all visited nodes and traversed edges involves reassembling the collected nodes and edges into a complete subgraph data structure according to their original connectivity in the graph. The construction process ensures that the connectivity of nodes and edges in the subgraph is completely consistent with that in the original business knowledge graph. The subgraph may be a single connected graph or multiple connected components. The final association knowledge subgraph is a condensed network structure semantically closely related to the original query. It contains the core facts and association paths needed to answer the query, serving as a precise knowledge context for generating subsequent answers.
[0066] This embodiment accurately locates anchor nodes by calculating the semantic similarity between entity references and graph nodes, establishing an accurate starting point for retrieval. It achieves directional focus by retrieving anchor node neighbors and quantifying the relevance of edges to query intent. Through threshold filtering and iterative path expansion, it performs intent-guided directional graph traversal. Finally, it extracts the traversed nodes and edges to construct a subgraph. This series of operations achieves a leap from coarse keyword-based matching to precise, targeted knowledge retrieval based on semantics and graph structure, providing highly relevant and structurally complete condensed knowledge for answer generation.
[0067] In one embodiment, step S50 above includes: S501, traverse the entity nodes and connecting edges in the associated knowledge subgraph, convert the triple structure formed by the entity nodes and the connecting edges into natural language description statements, and concatenate all natural language description statements into a text sequence to generate a knowledge background context. S502, obtain a preset prompt word template, embed the knowledge background context into the background data slot of the prompt word template, and embed the natural language query instruction into the question slot of the prompt word template to construct a model input text containing context and question; S503, input the input text of the model into the pre-trained language generation model, and use the pre-trained language generation model to encode and infer the input text of the model to generate a response text sequence; S504, Perform logical integrity verification on the response text sequence, and use the response text sequence that passes the logical integrity verification as natural language feedback information.
[0068] In this embodiment, traversing the entity nodes and connecting edges in the associated knowledge subgraph is a process of systematically accessing the vertices and arcs in the graph data structure. The specific implementation typically employs a depth-first or breadth-first search algorithm, starting from any node, visiting all its adjacent edges and neighboring nodes, and recursively or iteratively visiting unvisited neighboring nodes. For each visited entity node, its stored core attributes are read, typically including at least a standardized name identifier. For each visited connecting edge, its relation type label is read, and the identifiers of the head and tail entity nodes it connects to are recorded. The conversion of the triple structure composed of entity nodes and connecting edges into natural language descriptions is accomplished through predefined text generation rules or templates. Each triple (head entity, relation, tail entity) corresponds to a conversion rule. The rule base specifies one or more natural language expression patterns for each relation type; for example, for the "belongs to" relation, the pattern might be "[head entity] belongs to [tail entity]". During the transformation, the system searches for the corresponding sentence template based on the relationship type of the edges, fills the name identifiers of the head and tail entities into the corresponding placeholders in the template, and generates a complete declarative sentence. After traversal, all generated descriptive statements are collected into a list. All natural language descriptive statements are then concatenated into a text sequence, either according to the element access order recorded during traversal or according to a predetermined sorting rule, connecting the statements in the list with punctuation marks into a coherent text paragraph. Newlines, periods, or semicolons may be inserted between statements during concatenation to enhance readability. The final generated text paragraph constitutes the knowledge background context, faithfully reproducing the structured facts and relationships contained in the subgraph in linear text form.
[0069] Obtaining the preset prompt word template involves reading a predefined text framework from a configuration file or database to construct the input for the generative model. This template is a string containing specific placeholder markers indicating where subsequent information should be inserted. Common placeholders include markers for inserting background knowledge and context, and markers for inserting the original question. Embedding the background knowledge and context into the background data slots of the prompt word template involves replacing the text paragraph string generated in the previous step with the corresponding background data placeholders in the template. Embedding the natural language query command into the question slots of the prompt word template involves filling the corresponding question placeholders in the template with the question text string initially entered by the user. After filling, string concatenation or formatting operations are used to construct a complete model input text containing both context and question. The structure of this input text clearly distinguishes between the background knowledge provided to the model and the question to be answered. Its format is designed to conform to the patterns familiar to the pre-trained language generation model during the instruction fine-tuning stage, thereby effectively guiding the model to answer based on the given context.
[0070] Inputting text into the pre-trained language generation model involves passing the constructed text string to the model via its service interface or local function calls. This model is a large neural network trained on a large-scale text corpus using an autoregressive language modeling objective, based on a Transformer decoder architecture. Encoding and inferring the input text using the pre-trained language generation model is the forward computation process performed internally by the model. In the encoding phase, the model tokenizes the input text into a sequence of identifiers representing sub-word units, and then converts this into an initial vector sequence through an embedding layer. This sequence is then processed by multiple Transformer decoder blocks, each containing a masked self-attention mechanism and a feedforward neural network. Through residual connections and layer normalization, the input sequence is progressively transformed into a hidden state sequence rich in contextual semantics. In the inference phase, the model generates a response text sequence in an autoregressive manner. Specifically, the model adds a special token to the end of the input sequence to initiate generation, and then predicts the next most likely token based on the complete context (the input sequence plus the generated portion). Prediction is achieved by calculating the probability distribution over the entire vocabulary obtained after linear transformation and a softmax function of the last hidden state. Based on a pre-defined decoding strategy, such as greedy search or kernel sampling, a token is selected from the distribution and appended to the generated sequence. This process is repeated cyclically, with each prediction based on the updated entire sequence, until the model generates a special token representing the end of the sequence, or the pre-defined maximum generation length is reached. The final output token sequence is the response text sequence.
[0071] Logical integrity verification of response text sequences is a post-processing operation that evaluates and filters the quality of the model's original output. Verification can include multi-dimensional analysis. Fact consistency verification compares entities and assertions mentioned in the response text with the input knowledge context to confirm that the response does not introduce new facts not mentioned in the context or directly contradict it. Logical coherence verification analyzes the syntactic structure and semantic coherence of the response text, potentially using a pre-trained language model to calculate its perplexity or checking for serious grammatical errors or semantic breaks. Format compliance verification ensures that the response conforms to the expected output format, such as whether it is a complete sentence or paragraph, and whether it contains inappropriate tags or repetitive content. Verification can be achieved through rule sets, lightweight classifiers, or by posing verification questions to the same generative model and analyzing its responses. Response text sequences that pass logical integrity verification are used as natural language feedback information; only responses that pass all or all key verification items are adopted by the system as the final output. Responses that fail may be discarded, trigger regeneration, or marked as low-confidence output and processed accordingly. The validated response text sequence undergoes necessary decoding to convert the sub-token sequence back into a human-readable string, which is then returned to the user as natural language feedback.
[0072] This embodiment transforms structured graph data into understandable textual background by traversing subgraphs and converting triples into natural language descriptions according to rules. It then uses pre-set prompt templates to structurally integrate background knowledge with the original question, forming input instructions that the generative model can clearly understand. This drives a pre-trained language generation model to perform autoregressive encoding and reasoning based on this structured input, synthesizing a grammatically fluent and semantically coherent preliminary response. Finally, the response undergoes multi-dimensional logical integrity verification to ensure its consistency with the source knowledge and its inherent rationality, ultimately outputting high-quality natural language feedback.
[0073] In one embodiment, after step S50 above, the method further includes: S601, record the user's historical query intent features and historical click behavior logs, and construct a user preference feature vector based on the historical query intent features and the historical click behavior logs; S602, determine the semantic similarity between the user preference feature vector and each entity node in the business knowledge graph, and select entity nodes whose semantic similarity exceeds the similarity screening threshold as relevant candidate nodes; S603, Based on the association relationship of the relevant candidate nodes in the business knowledge graph, generate an association knowledge list; S604, the associated knowledge list and the natural language feedback information are sent to the user terminal for display.
[0074] In this embodiment, recording the user's historical query intent features and historical click behavior logs is achieved by maintaining a persistent storage structure associated with the user identifier on the server side. The historical query intent feature is a numerical vector generated by a semantic analysis model each time a user submits a query, representing the macroscopic purpose of that query. At the end of each question-and-answer interaction, the system writes this vector, along with a timestamp and session identifier, into a specific table in the user behavior database. The historical click behavior log captures the user's interaction actions after receiving system feedback, specifically recording which specific elements in the feedback information the user clicked or selected. These elements may correspond to specific entities mentioned in the answer text, additional explanatory links provided by the system, or related knowledge entries displayed. The log records include the unique identifier of the clicked element, the element type, the timestamp of the click, and the original query session identifier to which the click belongs. Data storage typically uses partitioned tables in a time-series database or relational database to support efficient querying and aggregation based on time windows.
[0075] Constructing user preference feature vectors based on historical query intent features and historical click behavior logs is a computational process that fuses discrete interaction records into a continuous vector space representation. The construction process first extracts historical user data within a specified time window from storage. For query intent features, all historical query intent feature vectors within a certain period (e.g., the last 30 days) are retrieved; these vectors are typically L2 normalized. One fusion strategy is to calculate a weighted average of these vectors, with weights determined by a time decay function, giving higher weights to recent queries. Another strategy is to use an attention mechanism, calculating attention weights between a learnable query vector and all historical intent vectors, and then performing weighted aggregation. For click behavior logs, click behavior needs to be converted into a vector representation. The system pre-computes a semantic embedding vector for each clickable knowledge element (e.g., entity, document fragment). For each user click, the embedding vector of the clicked element is extracted. All element vectors corresponding to all clicks are also weighted averaged using time decay weights to obtain a vector representing click preferences. Finally, the aggregated query intent vector and click preference vector are concatenated, and possibly dimensionality reduction and fusion are performed through a fully connected neural network layer to output a fixed-dimensional user preference feature vector. This vector comprehensively encodes the user's long-term interest tendencies in both query intent and content selection dimensions.
[0076] Determining the semantic similarity between user preference feature vectors and entity nodes in a business knowledge graph involves quantifying the semantic association strength between user preferences and the concepts represented by each entity node in the graph through distance calculation in vector space. Each entity node in the business knowledge graph typically has a pre-computed semantic embedding vector, which can be obtained through graph neural networks or language models based on the node name, node description text, or its graph context structure. The calculation process traverses all entity nodes in the graph or nodes within a defined range (such as entities of a specific type). For each entity node, its semantic embedding vector is extracted. Similarity calculation typically uses the cosine similarity formula, calculating the cosine of the angle between the user preference feature vector and the embedding vector of each entity node. The result is between -1 and 1, with higher values indicating closer semantic similarity. To improve computational efficiency, approximate nearest neighbor search algorithms, such as vector retrieval systems based on locality-sensitive hashing or product quantization, can be used in large graphs. The system calculates a similarity score for each entity node.
[0077] Entity nodes with semantic similarity exceeding a similarity screening threshold are selected as relevant candidate nodes. This involves filtering entities highly relevant to user preferences from the calculation results using a preset numerical threshold. The similarity screening threshold is an empirical parameter used to balance recall and precision in recommendations. The system scans all calculated similarity scores and filters out all entity nodes with scores higher than the threshold. These nodes constitute an initial set of relevant candidate nodes. To prevent the recommendation list from becoming too long or too concentrated, the candidate set may undergo post-processing, such as sorting the nodes in descending order of similarity score and retaining only the top N nodes; or performing type-based diversity sampling on the nodes to ensure that recommendations cover different topic areas that the user may be interested in. The final set of relevant candidate nodes represents the core knowledge points initially filtered from massive amounts of knowledge that match the user's historical preferences.
[0078] Based on the relationships between relevant candidate nodes in the business knowledge graph, a list of related knowledge is generated. This involves exploring and organizing structured extended knowledge content within the graph, starting with the candidate nodes. The exploration process performs a restricted graph traversal. For each relevant candidate node, the system retrieves its direct neighbor nodes and connecting edges in the graph. Depending on the application scenario, it may focus only on specific types of relationship edges, such as "belongs to," "related to," or "applies to." The retrieval results form a one-hop neighborhood subgraph centered on the candidate node. Then, the system extracts readable knowledge entries from this neighborhood structure. For each edge connecting a candidate node and its neighbor, a natural language description is generated based on the edge type and information about the neighboring nodes. For example, for the "belongs to" relationship between the candidate node "deep learning" and the neighbor node "neural network," the entry "deep learning belongs to a type of neural network method" is generated. Furthermore, multi-hop paths can be explored to generate more complex association descriptions. All generated description entries are collected, deduplicated, and sorted according to the association strength or confidence level with the user's preference vector, forming the final list of related knowledge. Each entry in the list contains reference information that can be traced back to specific nodes and edges in the graph.
[0079] Sending the related knowledge list and natural language feedback to the user terminal for display involves packaging additional personalized extended content along with the main answer after completing the core question and answer. The system serializes the related knowledge list into a structured data format, such as a JSON array, where each element contains a text description of the knowledge item, related entity identifiers, and an optional confidence score. Simultaneously, the natural language feedback generated during the question-and-answer process is also prepared. When constructing the response message returned to the client, the system creates a response object containing multiple fields: one field stores the main answer text, another stores the related knowledge list data, and possibly other fields indicate the reason for the recommendation or metadata. Upon receiving the response, the user terminal application (such as a web frontend or mobile application) parses the structure, first rendering and displaying the main natural language feedback information, and then rendering and displaying the related knowledge list in specific areas of the interface (such as "You May Also Like" or "Related Knowledge Points" modules) in list, card, or other visual formats. Users can interact with these recommended items, such as clicking on an item to initiate a new related query, thus forming a closed learning loop.
[0080] In financial business scenarios, the daily operations of investment bank risk management departments require the integration of heterogeneous data from multiple sources, including real-time transaction records from exchanges, structured reports exported from internal financial reporting systems, policy notices and penalty announcements published on the websites of financial regulatory agencies, and industry analysis reports issued by third-party research institutions. This raw data is automatically collected and aggregated through a pre-defined data interface. After cleaning to remove duplicate records and garbled characters, and segmenting according to paragraph and semantic integrity, a series of standardized text fragments with uniform format and content are generated. Subsequently, the system uses a pre-trained financial domain named entity recognition model to automatically identify business entities and their categories from these text fragments, such as "XX Bank," "YY Technology Company," "AAA Credit Bond," and "Article 3 of the New Asset Management Regulations." By calculating the text similarity between similar entity mentions in different text fragments, multiple expressions referring to the same real object are merged and deduplicated to form a unique set of entities. Building upon this foundation, the system analyzes the co-occurrence relationships of entities within the text, using a relation classification model to determine the semantic connections between entity pairs. For example, it identifies a "major lender" relationship between "XX Bank" and "YY Technology Company," or a "issuer" relationship between "AAA credit bond" and "a local government financing platform." All these identified entities and relationships are assembled into triples of "head entity-relationship-tail entity" and persistently stored in a graph database, thus constructing a financial business knowledge graph containing a large number of companies, financial products, regulations, events, and their complex relationships.
[0081] When a risk analyst needs to assess “XX Bank’s credit exposure to YY Technology Company, and the potential cascading risks if YY Technology Company’s stock price plummets,” they simply input this natural language query command into the system interface. Upon receiving the command, the system first performs word segmentation and noise reduction preprocessing, then uses the vector embedding layer of the semantic analysis model to convert the segmented sequence into a high-dimensional word vector matrix. The model’s attention mechanism network further extracts global semantic weights representing the overall macro-level purpose of the query from the matrix and aggregates them to generate query intent features, which might be interpreted here as “assessing specific bilateral risk exposure and risk contagion paths.” Simultaneously, the model’s sequence labeling layer works in parallel to identify and extract the two key entity references, “XX Bank” and “YY Technology Company,” from the same word vector matrix. Next, the system performs semantic similarity matching between these two entity references and nodes in the financial business knowledge graph, accurately locating the corresponding “XX Bank” and “YY Technology Company” nodes as anchor nodes. Based on the query intent feature of "assessing risk contagion paths," the system starts with two anchor nodes and performs a relational traversal in the knowledge graph. It first retrieves the direct neighbors and connecting edges of the anchor nodes, calculates the semantic relevance scores between the relationship types of these edges and the query intent, and filters out highly relevant and effective paths such as "loan destination," "equity pledge," "cross-shareholding," and "common counterparty." It then visits the next-hop node along these paths (such as other entities providing guarantees for "YY Technology Company," or other financial institutions with significant financial dealings with "XX Bank"), repeating this process to explore multi-hop associations. Finally, the system extracts all visited nodes and edges, constructing a relational knowledge subgraph that displays potential risk contagion paths.
[0082] The associated knowledge subgraph is automatically serialized into a coherent knowledge context text, such as: "XX Bank is the main lender of YY Technology Company. YY Technology Company has pledged its shares in ZZ listed company. ZZ listed company has a large number of derivative transactions with AA Securities. AA Securities is an important interbank counterparty of XX Bank." This text, along with the user's original query, is embedded in a preset prompt word template, forming a structured input, and then fed into a pre-trained language generation model. The model has been specifically fine-tuned on financial text corpora, enabling it to reason based on the provided context and ultimately generate a natural language feedback message: "Based on existing knowledge graph information, XX Bank has direct credit exposure to YY Technology Company. Furthermore, through equity pledge chains and derivatives trading networks, the risks of YY Technology Company may be transmitted to ZZ listed company, and subsequently affect AA Securities. Since AA Securities and your bank (XX Bank) are important interbank counterparties, this risk has a potential path of indirect contagion to your bank. It is recommended to pay close attention to the financial situation of YY Technology Company and the stock price fluctuations of ZZ listed company." After providing this core analytical feedback, the system also records the intent characteristics of this query and the analyst's subsequent interactive behavior (e.g., clicking to view detailed cases about "cross-shareholding risk"), and updates its user preference feature vector accordingly. Based on this vector, the system calculates its semantic similarity with other entities in the knowledge graph, filters out highly relevant entities, such as "cases of risk contagion in the same industry" or "other highly indebted companies with business models similar to YY Technology Company", and then generates a list of related knowledge. This list is pushed to the analyst along with the main feedback mentioned above, providing them with clues for further in-depth research, thereby achieving an organic combination of intelligent question answering and personalized knowledge expansion.
[0083] This embodiment achieves continuous modeling of user interests by recording and fusing user historical intent and interaction behavior to construct a preference vector. By calculating the semantic similarity between this preference vector and entity nodes in the knowledge graph and filtering based on thresholds, it accurately locates core entities highly relevant to the user's historical interests from massive amounts of knowledge. Using this as the core, it explores relationships within the graph and generates a structured knowledge list, achieving personalized knowledge expansion and organization. Finally, it merges the expanded list with the main answer and displays it, providing a proactive and personalized knowledge exploration path while achieving accurate question answering. This series of operations builds a personalized knowledge recommendation system based on user historical behavior outside of the core question-answering service. It not only enhances the information value of a single question answer but also promotes continuous knowledge discovery and learning by guiding users to explore relevant knowledge, thereby improving the system's long-term user stickiness and service depth.
[0084] In one embodiment, a feedback generation device based on a business knowledge graph is provided, which corresponds one-to-one with the feedback generation method based on a business knowledge graph in the above embodiments. (Refer to...) Figure 3 , Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the feedback generation device based on a business knowledge graph of the present invention. The module includes a text preprocessing module 10, a knowledge graph construction module 20, a query understanding module 30, a knowledge graph retrieval module 40, and an answer generation module 50. Detailed descriptions of each functional module are as follows: Text preprocessing module 10 is used to collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments. The knowledge graph construction module 20 is used to perform entity recognition and relation extraction on the standardized text fragments, and to construct a business knowledge graph containing entity nodes and connection edges based on the entity recognition results and relation extraction results; The query understanding module 30 is used to receive natural language query instructions, extract features from the natural language query instructions using a semantic analysis model, and generate query intent features and key entity references. The graph retrieval module 40 is used to map the key entity references to the business knowledge graph to determine anchor nodes, and perform association traversal in the business knowledge graph based on the query intent features, starting from the anchor nodes, to obtain the associated knowledge subgraph. The answer generation module 50 is used to serialize the associated knowledge subgraph into a knowledge background context, input the knowledge background context and the natural language query instruction into a pre-trained language generation model, and use the pre-trained language generation model to generate natural language feedback information.
[0085] Specific limitations regarding the feedback generation device based on business knowledge graphs can be found in the aforementioned limitations on the feedback generation method based on business knowledge graphs, and will not be repeated here. Each module in the aforementioned feedback generation device based on business knowledge graphs can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0086] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements server-side functions or steps of a feedback generation method based on a business knowledge graph.
[0087] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a feedback generation method based on a business knowledge graph.
[0088] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments; Entity recognition and relation extraction are performed on the standardized text fragments, and a business knowledge graph containing entity nodes and connection edges is constructed based on the entity recognition results and relation extraction results. Receive natural language query instructions, use a semantic analysis model to extract features from the natural language query instructions, and generate query intent features and key entity references; The key entity designations are mapped to the business knowledge graph to determine anchor nodes. Based on the query intent features, an association traversal is performed in the business knowledge graph starting from the anchor nodes to obtain an association knowledge subgraph. The associated knowledge subgraph is serialized into a knowledge background context, and the knowledge background context and the natural language query instruction are jointly input into a pre-trained language generation model. The pre-trained language generation model is then used to generate natural language feedback information.
[0089] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, and a computer program is stored thereon, which, when executed by a processor, performs the following steps: Collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments; Entity recognition and relation extraction are performed on the standardized text fragments, and a business knowledge graph containing entity nodes and connection edges is constructed based on the entity recognition results and relation extraction results. Receive natural language query instructions, use a semantic analysis model to extract features from the natural language query instructions, and generate query intent features and key entity references; The key entity designations are mapped to the business knowledge graph to determine anchor nodes. Based on the query intent features, an association traversal is performed in the business knowledge graph starting from the anchor nodes to obtain an association knowledge subgraph. The associated knowledge subgraph is serialized into a knowledge background context, and the knowledge background context and the natural language query instruction are jointly input into a pre-trained language generation model. The pre-trained language generation model is then used to generate natural language feedback information.
[0090] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0091] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0092] It should be noted that if any AI models, software tools, or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The above-described embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
[0093] The user personal information involved in this application embodiment is all authorized (knowing and consenting) by the relevant parties or fully authorized by all parties, and the executing entity can obtain it through various open, legal and compliant means. The collection, storage, use, processing, transmission, provision and disclosure of the information, data and signals involved all comply with the relevant laws and regulations of the relevant countries and regions, and do not violate public order and good morals.
Claims
1. A method for generating feedback based on a business knowledge graph, characterized in that, Includes the following steps: Collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments; Entity recognition and relation extraction are performed on the standardized text fragments, and a business knowledge graph containing entity nodes and connection edges is constructed based on the entity recognition results and relation extraction results. Receive natural language query instructions, use a semantic analysis model to extract features from the natural language query instructions, and generate query intent features and key entity references; The key entity designations are mapped to the business knowledge graph to determine anchor nodes. Based on the query intent features, an association traversal is performed in the business knowledge graph starting from the anchor nodes to obtain an association knowledge subgraph. The associated knowledge subgraph is serialized into a knowledge background context, and the knowledge background context and the natural language query instruction are jointly input into a pre-trained language generation model. The pre-trained language generation model is then used to generate natural language feedback information. 2.The business knowledge graph based feedback generation method of claim 1, wherein, Collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments, including: A communication connection is established with the business system database, document management server and publicly available data sources on the Internet through a preset data interface. The original business file stream is acquired through the communication connection at a preset frequency and the original business file stream is aggregated into multi-source business data. Identify the file format type of the multi-source business data, extract the text content from the image format file using the optical character recognition module, integrate the text content with the text content of the non-image format file, and generate a text set to be cleaned. The text set to be cleaned is traversed using a preset regular expression pattern, and HTML web page tags, garbled characters, and stop words are removed to obtain a clean text sequence. Based on preset punctuation delimiters and semantic integrity length thresholds, the clean text sequence is truncated according to semantic boundaries to generate multiple independent text paragraphs. Extract the source metadata information of the multi-source business data, append the source metadata information to the attribute field of each independent text paragraph, and encapsulate the independent text paragraph containing the attribute field into a key-value pair object to generate a standardized text fragment. 3.The business knowledge graph based feedback generation method of claim 1, wherein, Entity recognition and relation extraction are performed on the standardized text fragments. Based on the entity recognition and relation extraction results, a business knowledge graph containing entity nodes and connection edges is constructed, including: The standardized text fragment is input into a pre-trained named entity recognition model to identify business-specific terms and category attributes in the standardized text fragment, obtain entity recognition results, and generate candidate entity nodes based on the entity recognition results; Determine the text similarity between different candidate entity nodes, and fuse and deduplicate candidate entity nodes whose text similarity exceeds the entity fusion similarity threshold to obtain a unique set of entity nodes; Entity pairs are constructed based on the position information of entities in the standardized text fragment in the unique entity node set. The entity pairs are then input into a relation classification model to determine the relation type, and the relation extraction result is obtained. Based on the relation extraction result, generate connection edges connecting the corresponding entities in the unique entity node set, and assemble the entities in the unique entity node set and the corresponding connection edges into triplet data. The triple data is stored in a graph database to construct a business knowledge graph. 4.The method of claim 1, wherein, Receive a natural language query instruction, extract features from the natural language query instruction using a semantic analysis model, and generate query intent features and key entity designations, including: Receive a natural language query command sent by a user terminal, perform word segmentation and noise reduction on the natural language query command, and generate a word segmentation sequence; The word segmentation sequence is input into the vector embedding layer of the semantic analysis model to obtain a high-dimensional word vector matrix; The global semantic weights of the high-dimensional word vector matrix are determined using the attention mechanism network of the semantic analysis model. Based on the global semantic weights, the high-dimensional word vector matrix is weighted and aggregated to generate query intent features that represent global semantic information. The sequence labeling layer of the semantic analysis model is used to predict the entity category of the high-dimensional word vector matrix, extract the word fragments predicted as business entity categories, and generate key entity references. 5.The business knowledge graph based feedback generation method of claim 1, wherein, The key entity designations are mapped to the business knowledge graph to determine anchor nodes. Based on the query intent features, an association traversal is performed in the business knowledge graph starting from the anchor nodes to obtain an association knowledge subgraph, including: Determine the semantic similarity between the key entity reference and each entity node in the business knowledge graph, and select the entity node with the highest semantic similarity as the anchor node; Retrieve the direct neighbor nodes and candidate connection edges of the anchor node in the business knowledge graph, and determine the semantic relevance score between the attribute information of the candidate connection edges and the query intent feature; Candidate connection edges with semantic relevance scores greater than the path selection relevance threshold are selected as valid retrieval paths. The next-hop neighbor nodes are visited along the valid retrieval paths, and the determination of semantic relevance scores and path selection are repeated to perform association traversal. Extract all visited nodes and traversed edges during the association traversal process, and construct an association knowledge subgraph based on the topological structure of all visited nodes and traversed edges. 6.The business knowledge graph based feedback generation method of claim 1, wherein, The associated knowledge subgraph is serialized into a knowledge context, and the knowledge context and the natural language query instruction are jointly input into a pre-trained language generation model. The pre-trained language generation model is then used to generate natural language feedback information, including: Traverse the entity nodes and connecting edges in the associated knowledge subgraph, convert the triple structure formed by the entity nodes and connecting edges into natural language description statements, and concatenate all natural language description statements into a text sequence to generate a knowledge background context. Obtain a preset prompt word template, embed the knowledge background context into the background data slot of the prompt word template, and embed the natural language query command into the question slot of the prompt word template to construct a model input text containing context and question; The input text to the model is fed into a pre-trained language generation model, which then encodes and infers the input text to generate a response text sequence. The logical integrity of the response text sequence is checked, and the response text sequence that passes the logical integrity check is used as natural language feedback information. 7.The business knowledge graph based feedback generation method of claim 1, wherein, The associated knowledge subgraph is serialized into a knowledge context, and the knowledge context and the natural language query instruction are jointly input into a pre-trained language generation model. After generating natural language feedback information using the pre-trained language generation model, the process further includes: Record the user's historical query intent features and historical click behavior logs, and construct a user preference feature vector based on the historical query intent features and historical click behavior logs; Determine the semantic similarity between the user preference feature vector and each entity node in the business knowledge graph, and select entity nodes whose semantic similarity exceeds the similarity screening threshold as relevant candidate nodes; Based on the association relationships of the relevant candidate nodes in the business knowledge graph, a list of related knowledge is generated; The associated knowledge list and the natural language feedback information are sent to the user terminal for display. 8.A service knowledge graph based feedback generation apparatus, characterized in that, The feedback generation device based on the business knowledge graph includes: The text preprocessing module is used to collect multi-source business data, clean and segment the multi-source business data, and generate standardized text fragments. The knowledge graph construction module is used to perform entity recognition and relation extraction on the standardized text fragments, and to construct a business knowledge graph containing entity nodes and connection edges based on the entity recognition results and relation extraction results; The query understanding module is used to receive natural language query instructions, extract features from the natural language query instructions using a semantic analysis model, and generate query intent features and key entity references; The graph retrieval module is used to map the key entity references to the business knowledge graph to determine anchor nodes, and to perform association traversal in the business knowledge graph based on the query intent features, starting from the anchor nodes, to obtain the associated knowledge subgraph. The answer generation module is used to serialize the associated knowledge subgraph into a knowledge background context, input the knowledge background context and the natural language query instruction into a pre-trained language generation model, and use the pre-trained language generation model to generate natural language feedback information.
9. A computer device, characterized in that, The computer device includes a memory, a processor, and a business knowledge graph-based feedback generation program stored in the memory and executable on the processor. When executed by the processor, the business knowledge graph-based feedback generation program implements the steps of the business knowledge graph-based feedback generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a feedback generation program based on a business knowledge graph, which, when executed by a processor, implements the steps of the feedback generation method based on a business knowledge graph as described in any one of claims 1-7.
Citation Information
Cited By
Low-code business data non-sensing automatic backflow and knowledge processing method
CN122198083A
Low-code business data non-sensing automatic backflow and knowledge processing method
CN122198083B
Query analysis method and device based on large language model, equipment and storage medium
CN122285852A