A model inference method

CN122947899APending Publication Date: 2026-10-20LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610846781.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-11
Publication Date
2026-10-20

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This disclosure provides a model reasoning method, the method comprising: determining a knowledge graph subgraph based on input text and a fused knowledge graph; inputting the knowledge graph subgraph and the input text into a target model to obtain a reasoning result corresponding to the input text; wherein, the fused knowledge graph includes at least two layers of hierarchical semantic nodes, and field nodes and table nodes corresponding to the database; the semantic nodes and field nodes are associated with each other through matching degree; any field node is associated with at least one table node; the knowledge graph subgraph includes multiple table nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of large model technology, and in particular to a model reasoning method. Background Technology

[0002] In highly specialized technical fields with strong verticality and professional attributes, user queries based on business scenarios typically contain a large amount of domain-specific terminology and industry-customized event descriptions. In traditional database query generation technologies, the semantic mapping between user natural language queries and the database physical schema is insufficiently precise. This leads to increased difficulty in database schema linking and insufficient matching accuracy, thus limiting the accuracy of Large Language Models (LLMs) based on database queries in responding to query questions. Summary of the Invention

[0003] This disclosure provides a model reasoning method to at least solve the above-mentioned technical problems existing in the prior art.

[0004] According to a first aspect of this disclosure, a model reasoning method is provided, the method comprising: Knowledge graph subgraphs are determined based on input text and fused knowledge graph. The knowledge graph subgraph and the input text are input into the target model to obtain the reasoning result corresponding to the input text; The fused knowledge graph includes at least two layers of hierarchical semantic nodes, as well as corresponding field nodes and table nodes in the database; the semantic nodes and field nodes are associated with each other through matching degree; any field node is associated with at least one table node; and the knowledge graph subgraph includes multiple table nodes.

[0005] In the above scheme, the fused knowledge graph includes a knowledge graph and a database; before determining the knowledge graph subgraph based on the input text and the fused knowledge graph, the method further includes determining the knowledge graph, specifically including: Classify at least one target entity to obtain a set of behavioral intentions, a set of general categories, a set of event types, a set of atomic events, and a set of attributes; Each set is used to form a hierarchical semantic node in the knowledge graph, and the knowledge graph is constructed in a top-down order of behavioral intent set, general category set, event type set, atomic event set and attribute set; Specifically, the elements in the behavioral intent set constitute the behavioral intent nodes in the behavioral intent layer of the knowledge graph; the elements in the general category set constitute the general category nodes in the general category layer of the knowledge graph; the elements in the event type set constitute the event type nodes in the event type layer of the knowledge graph; the elements in the atomic event set constitute the atomic event nodes in the atomic event layer of the knowledge graph; and the elements in the attribute set constitute the attribute nodes in the attribute layer of the knowledge graph.

[0006] In the above scheme, the at least one target entity is determined based on the following method: Obtain at least one candidate entity of the first type based on the unstructured document; At least one second-class candidate entity is obtained based on structured data; Based on semantic vector similarity, feature set matching degree, and path distance of each element in each candidate entity in the knowledge graph, the similarity between each first-class candidate entity and each second-class candidate entity is determined. Based on the similarity between each first-class candidate entity and each second-class candidate entity, the features of the first-class candidate entities and the second-class candidate entities are fused to obtain at least one target entity.

[0007] In the above scheme, each semantic node in the knowledge graph satisfies at least one of the following: There is a correlation between behavioral intent nodes and their corresponding general classification nodes; There is a relationship between general category nodes and the event type nodes they contain; There is a relationship between event type nodes and their corresponding atomic event nodes; There is an association relationship between any atomic event node and at least one attribute node; The next level node is the child node of the previous level node.

[0008] The above scheme further includes determining the fused knowledge graph, specifically including: Determine the feature vector corresponding to each semantic node in the knowledge graph; Determine the feature vectors corresponding to each field in the database; Based on the semantic similarity, pattern matching degree, and data distribution similarity between the feature vectors corresponding to each semantic node and the feature vectors corresponding to each field, the matching degree between each semantic node in the knowledge graph and each field in the database is determined. The mapping relationship between each semantic node in the knowledge graph and each field in the database is determined based on the matching degree between each semantic node in the knowledge graph and each field in the database. Using each field in the database as a field node and each table in the database as a table node, the association between each semantic node in the knowledge graph and each field in the database is determined based on the mapping relationship between each semantic node in the knowledge graph and each field node in the database. The association between each field node and each table node is determined based on the mapping relationship between each field in the database and each table. Based on the semantic nodes in the knowledge graph, the field nodes in the database, the table nodes in the database, the relationships between the semantic nodes in the knowledge graph and the field nodes in the database, and the relationships between the field nodes in the database and the table nodes in the database, the fused knowledge graph is determined.

[0009] In the above scheme, determining the knowledge graph subgraph based on the input text and the fused knowledge graph includes: Multiple target semantic nodes are identified by matching at least one keyword included in the input text with at least two levels of hierarchical semantic nodes in the fused knowledge graph. Based on the mapping relationship between semantic nodes in the fused knowledge graph and field nodes in the database, multiple target field nodes corresponding to the multiple target semantic nodes are determined; Identify multiple table nodes that are associated with the multiple target field nodes; The knowledge graph subgraph is determined based on the multiple table nodes.

[0010] In the above scheme, the step of matching at least one keyword included in the input text with at least two layers of hierarchical semantic nodes of the fused knowledge graph to determine multiple target semantic nodes includes: Identify multiple semantic indices corresponding to the knowledge graph; The multiple semantic indexes are matched against at least one keyword included in the input text, and at least one event type node and at least one atomic event node corresponding to at least one semantic index that successfully matches the at least one keyword are determined as the multiple target semantic nodes.

[0011] In the above scheme, determining the multiple target field nodes corresponding to the multiple target semantic nodes based on the mapping relationship between semantic nodes in the fused knowledge graph and field nodes in the database includes: Starting from each event type node and atomic event node, determine at least one candidate field node along the edges between semantic nodes and field nodes in the fused knowledge graph; Identify at least one candidate field node that has an association relationship with all event type nodes and atomic event nodes in the target semantic node as the target field node.

[0012] In the above scheme, determining the knowledge graph subgraph based on the plurality of table nodes includes: Taking the target field node as the starting node, at least one table node is determined in the fused knowledge graph along the edge between the target field node and the table node; The knowledge graph subgraph is determined based on the target field node, the at least one table node, and the connection key between the at least one table node; The connection key between the at least one table node is determined based on the shortest path between the two table nodes.

[0013] In the above scheme, the step of inputting the knowledge graph subgraph and the input text into the target model to obtain the reasoning result corresponding to the input text includes: Based on the semantic descriptions of each node in the knowledge graph subgraph, the knowledge graph subgraph and input text confirmation prompts are provided. The prompt information is input into the target model to obtain the inference result corresponding to the input text.

[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0015] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0016] Figure 1 This illustration shows an optional flowchart of the model inference method provided in an embodiment of the present disclosure; Figure 2 A schematic diagram of another optional process for the model inference method provided in this disclosure is shown; Figure 3 This illustration shows another optional flowchart of the model reasoning method provided in this embodiment of the disclosure; Figure 4 A schematic diagram of another alternative process for the model inference method provided in this disclosure is shown; Figure 5 A schematic diagram of an optional structure of the model inference apparatus provided in an embodiment of this disclosure is shown; Figure 6 A schematic diagram of the composition structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0017] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0018] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0019] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.

[0020] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.

[0021] It should be understood that in the various embodiments of this disclosure, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.

[0022] Before providing a further detailed description of the embodiments of this disclosure, the nouns and terms involved in the embodiments of this disclosure will be explained, and the nouns and terms involved in the embodiments of this disclosure shall be interpreted as follows.

[0023] 1) Knowledge graph.

[0024] In this embodiment, the knowledge graph includes at least two layers of hierarchical semantic nodes; the semantic nodes are divided into different levels according to semantic type. Optionally, the knowledge graph includes, from top to bottom, a tactical concept layer, a general category layer, an event type layer, an atomic event layer, and an attribute layer; the nodes in the tactical concept layer are tactical concept nodes, and their semantic type is macroscopic, such as stage, behavior, tactical intent, etc.; the nodes in the general category layer are general category nodes, and their semantic type is event category or general category, which are child nodes of the tactical concept nodes, such as multiple event categories corresponding to a certain stage, or multiple general categories corresponding to a certain behavior; the nodes in the event type layer are event type nodes, and their semantic type is event type, which are child nodes of the general category nodes; the atomic event layer is a fine-grained set of general categories, which is a specific subdivision of the general categories, and it is a child node of the event type nodes; the nodes in the attribute layer are attribute nodes, and their semantic type is the attribute of the atomic event, which are child nodes of the atomic event nodes.

[0025] Taking football as an example, nodes in the behavioral intent layer can include macro-level match phases or tactical intentions, such as attacking organization, defensive pressing, and transition phases. Nodes in the general classification layer represent general categories of football actions, such as defensive actions and attacking actions. The event type layer includes specific subdivisions of general categories, such as passing, shooting, and set pieces within a particular category. The atomic event layer represents fine-grained business concept entities, such as long passes, tackles, and corner kicks. The multi-dimensional attribute layer is the underlying semantic description, such as action method, result, degree of pressure, style, body part, initiation point, location, area, and match phase.

[0026] In the financial field, the nodes in the behavioral intent layer can include macro-level business intentions and risk control stages, such as screening for abnormal funds, assessing transaction risks, and verifying account compliance. The nodes in the general classification layer, as sub-nodes of the behavioral intent layer, divide general categories, such as large fund flows, cross-regional transfers, and account operation behaviors. The nodes in the event type layer are refined types of general categories, such as single large inflow, single large outflow, and multiple cumulative large transactions. The nodes in the atomic event layer are fine-grained business entities, such as multiple outflows from a corporate account in a single day, large transfers from a personal account in the early morning, and interbank urgent remittances. The attribute layer contains the descriptive attributes of atomic events, such as transaction amount, transaction time, transfer channel, counterparty account type, geographical location, operating terminal, and risk level.

[0027] Taking equipment operation and maintenance as an example, the behavioral intent layer represents the macro-level operation and maintenance goals and control phase, such as equipment fault monitoring, operational status inspection, and anomaly warning and handling. The general classification layer categorizes events into major categories, such as abnormal mechanical operation, abnormal electrical parameters, and abnormal piping systems. The event type layer further subdivides the general categories, such as abnormal speed, abnormal vibration, and abnormal noise. The atomic event layer consists of fine-grained entity events, such as sudden drops in motor speed, high-frequency vibration of bearings, and intermittent abnormal noise from gearboxes. The attribute layer represents the characteristic attributes of atomic events, such as runtime, parameter values, fault occurrence time, equipment number, operating environment, component location, and alarm level.

[0028] 2) Database.

[0029] In this embodiment of the disclosure, the database includes a database physical schema, which includes at least column nodes, table nodes, and a constraint key between two table nodes.

[0030] 3) Integrate knowledge graphs.

[0031] This disclosure integrates a knowledge graph, which includes a knowledge graph and a database; multiple semantic nodes in the knowledge graph are associated with multiple field nodes in the database, thereby linking the knowledge graph and the database.

[0032] In highly specialized technical fields with strong vertical segmentation and professional attributes, the domain terms proposed by users based on business scenarios exhibit vertical and professional characteristics. User queries typically contain a large number of domain-specific terms and event expressions, such as attack organization, passing, offside, second assist, counter-pressing, and misjudgment in football. There is no explicit semantic mapping relationship between these professional expressions and the physical structure of the database physical schema, including tables, fields, and join keys, making schema linking quite difficult. Existing general-purpose text-to-structured query language (Text to SQL) technologies have good cross-domain generalization capabilities, but they cannot fully utilize the event-centric semantic layer and the systematic semantic information of domain-related entities and vocabularies.

[0033] Meanwhile, existing technologies suffer from insufficient contextual retrieval capabilities. Even with Large Language Model (LLM) technology, if the event semantics in the user's query intent cannot be stably and reusably aligned to the database metadata, the generated SQL will frequently suffer from issues such as missing tables, incorrect fields, and redundant joins, significantly reducing the execution accuracy and interpretability of SQL statements. Database metadata includes the underlying structure of the database, tables, fields, constraints, views, materialized views, and statistics.

[0034] It has been confirmed that the quality of the initial pattern linking directly determines the performance ceiling of subsequent SQL generation. Therefore, it is urgent to build a fusion mechanism between the domain semantic layer and database metadata, establish a stable bidirectional association between abstract semantics such as events, categories, and terms and structured elements of executable queries, and provide general tool support for upper-layer intelligent agents by relying on graph-based retrieval and association query capabilities.

[0035] The current mainstream solutions can be mainly divided into two categories.

[0036] One approach is a multi-agent text-to-structured query language framework centered on a large language model, with representative technologies including MAC SQL and Mage SQL. This solution utilizes multi-agent collaboration to complete processes such as problem decomposition, context retrieval, SQL generation, and self-repair, achieving high execution accuracy in large-scale benchmark tests like BIRD. However, this approach focuses on workflow orchestration and prompt word strategy optimization, failing to build a domain-specific semantic layer to achieve a systematic mapping between terminology and database schemas. In highly vertical domains, terminological ambiguity and intent fulfillment rely heavily on prompt word engineering, resulting in poor stability. Furthermore, its extensible tools are based on general pattern retrieval and example retrieval designs, lacking standardized interfaces for event ontology and classification layers. This leads to a scarcity of shareable and interpretable knowledge among intelligent agents, limiting technology transferability.

[0037] The second approach involves graph structure optimization methods that enhance schema linking. Representative techniques include the Knapsack Schema Linking Agent / Approach (KaSLA) and SchemaGraphSQL. These methods optimize missing and redundant schema links through strategies such as knapsack optimization and graph path search, effectively improving SQL generation. However, this approach only focuses on optimizing the database schema layer and does not effectively model the semantic layer above the metadata layer that is closer to the business logic. When user queries are centered on event descriptions, it is difficult to achieve an effective bridge from abstract semantics to specific data fields, requiring additional development of adaptation projects. Furthermore, this approach lacks a systematic integration path between domain ontology and knowledge graph, failing to accurately project the event semantics defined by domain experts onto the database schema element set, making it difficult to adapt to the specialized query generation needs of vertical domains.

[0038] Therefore, in view of the deficiencies in the related technologies, this disclosure provides a model reasoning method that integrates the knowledge graph and the database by using the semantic similarity between each semantic node of the knowledge graph and the field nodes in the database. This overcomes the semantic gap between domain data and complex database schemas and improves the accuracy of the target model's output text based on the integrated knowledge graph.

[0039] Figure 1 A schematic diagram of an optional process for the model inference method provided in an embodiment of this disclosure is shown, and the steps will be described accordingly.

[0040] Step S101: Determine the knowledge graph subgraph based on the input text and the fused knowledge graph.

[0041] In some embodiments, the carrier implementing the model reasoning method (hereinafter referred to as the carrier) first inputs at least one keyword in the text, performs matching in the knowledge graph based on the at least one keyword, and determines multiple semantic nodes; based on the association relationship between semantic nodes and field nodes in the fused knowledge graph, determines multiple field nodes corresponding to the multiple semantic nodes; determines multiple table nodes that have an association relationship with the multiple field nodes, and determines a knowledge graph subgraph based on the multiple table nodes.

[0042] The knowledge graph subgraph includes at least one of multiple table nodes, multiple semantic nodes, multiple field nodes, and connection keys between the multiple table nodes.

[0043] In this way, domain-specific terms in the input text can be accurately matched with corresponding semantic nodes. Then, relying on the knowledge graph to associate database fields, tables, and join keys, a precise mapping between domain terminology and database schemas can be achieved. This effectively solves the semantic gap problem, improves the accuracy of schema linking, and reduces the probability of SQL errors.

[0044] The carrier can be computer programs, electronic circuits, databases, mobile applications, electronic devices, cloud computing platforms, distributed systems, artificial intelligence frameworks, mathematical models, automation tools, and microcontrollers, etc., which are software or hardware capable of implementing algorithms and methods.

[0045] Step S102: Input the knowledge graph subgraph and the input text into the target model to obtain the reasoning result corresponding to the input text.

[0046] In some embodiments, the carrier generates prompt information based on the knowledge graph subgraph, the input text, and the prompt word template, and inputs the prompt information into the target model so that the target model can perform reasoning based on the prompt information to obtain the reasoning result corresponding to the input text.

[0047] The target model includes an artificial intelligence model that has been trained on massive amounts of text, can understand natural language, and generate structured logic (such as SQL), such as a large language model.

[0048] Thus, the model reasoning method provided in this embodiment of the disclosure, based on the fused knowledge graph, completes the step-by-step matching from keywords to semantic nodes, and then to database fields and tables, effectively breaking down the semantic barriers between professional terms and database schemas, and eliminating the domain semantic gap. By filtering and generating concise knowledge graph subgraphs, only valid information such as business semantics, data tables, fields, and inter-table join keys is retained, avoiding redundant interference from the full database structure, improving the quality of generated Text-to-SQL statements, and thereby improving the execution accuracy and interpretability of the target model.

[0049] Figure 2 An alternative flowchart of the model inference method provided in this disclosure is shown, and will be described step by step.

[0050] In some embodiments, the model reasoning method further includes determining a fused knowledge graph, specifically including: Step S201: Determine the target entity based on different data sources.

[0051] In some embodiments, the same term may be expressed differently in official documents and industry articles, requiring disambiguation and fusion of data extracted from different data sources; wherein, the different data sources include at least unstructured documents and structured data.

[0052] In some embodiments, the carrier can obtain at least one first-class candidate entity from an unstructured document. The unstructured document may include materials without a fixed table format, in free text form, i.e., materials whose entities cannot be directly obtained according to preset row fields; for example, reports and articles published online, in journals, newspapers, conferences, and magazines. The first-class candidate entity includes natural text such as technical terms, event definitions, and textual descriptions from the unstructured document.

[0053] In other embodiments, the carrier can obtain at least one second-type candidate entity from structured data. The structured data includes data with a regular format, fixed table structure, and clear fields, which can be directly used for database storage and querying. It typically has clearly defined row fields, allowing direct retrieval of entity information according to preset row fields; examples include industry databases and business data tables. Taking the football field as an example, it can include a match database, including player data, match records, passing / shooting statistics, etc. The second-type candidate entity includes professional terms, event definitions, textual descriptions, and other data from the structured data.

[0054] In some embodiments, the carrier further calculates the similarity between any first-type candidate entity and any second-type candidate entity, the similarity being used to characterize the probability that any first-type candidate entity and any second-type candidate entity refer to the same concept. Entities include text such as business concepts and professional terms related to various fields extracted from different data sources.

[0055] Specifically, this will be illustrated by taking the carrier as an example to calculate any first-class candidate entity (such as the first entity) and any second-class candidate entity (such as the second entity).

[0056] The carrier calculates the semantic vector similarity between the first entity and the second entity; calculates the feature set matching degree of the feature sets corresponding to the first entity and the second entity, where the feature sets may include the entity's context and / or attributes; and calculates the path distance between the semantic nodes corresponding to the first entity and the semantic nodes corresponding to the second entity in the knowledge graph. Based on the semantic vector similarity, feature set matching degree, and path distances of each element in each candidate entity in the knowledge graph, the similarity between the first entity and the second entity is determined. The knowledge graph involved here includes the knowledge graph already determined when calculating the similarity between the first entity and the second entity.

[0057] Specifically, the carrier can be used to determine the first entity using the following formula. (The corresponding feature set is) ) and second entity (corresponding feature set) Similarity between :

[0058] in Characterizes the Sigmoid function; Characterizing the first entity semantic vectors With the second entity semantic vectors Semantic similarity between them; The degree of matching between the feature set representing the first entity and the feature set representing the second entity; Representing the first entity in a knowledge graph Corresponding semantic nodes and second entities The path distance between corresponding semantic nodes; , and These are weights, which can be set according to actual needs and experimental results.

[0059] In some embodiments, in response to the similarity between the first entity and the second entity being greater than a similarity threshold ,Right now Then it is determined that the first entity and the second entity refer to the same semantic concept. Determine semantic concepts The target entity is defined as follows. The similarity threshold can be set based on actual needs or experimental results.

[0060] In this embodiment, different candidate entities are extracted from unstructured documents and structured data, and diverse sources such as official documents, industry articles, and business databases are integrated to bridge the differences in expression between different sources. This effectively eliminates the semantic gap between official standardized terminology and unofficial textual descriptions and statistical data, achieving unified alignment of entities across data sources and providing support for subsequent semantic graph construction and accurate mapping of terminology to database schemas.

[0061] Step S202: Construct a knowledge graph based on multiple target entities.

[0062] In some embodiments, after determining the target entity, the carrier constructs a knowledge graph based on the target entity.

[0063] In some embodiments, the knowledge graph includes five layers: a behavioral intent layer, a general classification layer, an event type layer, an atomic event layer, and an attribute layer. The carrier determines the layer corresponding to the target entity based on the semantics of the target entity, and determines the semantic node corresponding to the target entity at the corresponding layer.

[0064] In some embodiments, the carrier classifies at least one target entity according to semantics to obtain a set corresponding to each level of the knowledge graph; an element in the set (i.e., a target entity) is designated as a semantic node in the corresponding level of the knowledge graph, constructing five levels of the knowledge graph. At this point, the semantic nodes in each level exist independently and have no association with semantic nodes in other levels. Therefore, the carrier needs to determine the constraints between the semantic nodes included in each level based on the relationships between the levels.

[0065] Specifically, the constraints include: behavioral intent nodes can only establish associations with their corresponding general classification nodes, i.e. ,in Nodes representing behavioral intent Representing general category nodes. General category nodes can only establish associations with the event type nodes they contain, i.e. × ,in Event type nodes represent event types. An event type node can only be associated with its constituent atomic event nodes. ,in Characterizes atomic event nodes.

[0066] Specifically, there are dimensional binding relationships between nodes in the hierarchy, that is... .in A set of relationships representing the connections between atomic events and attribute dimensions, i.e., which atomic events correspond to which attributes. It is a Cartesian product. It represents any atomic event ( It can match any specific value under any attribute. Here, Dk refers to all possible values ​​of a certain type of attribute, such as all values ​​under the "Actiontype" attribute: {left foot, right foot, header, save}. ∪{ε}, the representation must belong to a general dimensional system ( The set can be either an empty set (ε) or an empty set (ε). That is, not all atomic events must possess all properties. This constraint allows atomic events to lack certain properties to ensure logical rigor.

[0067] Specifically, there are inheritance relationships between semantic nodes at each level. Specifically, general category nodes are child nodes of behavior intent nodes, event type nodes are child nodes of general category nodes, atomic event nodes are child nodes of event type nodes, and attribute nodes are child nodes of atomic event nodes.

[0068] In some embodiments, the constraint may further include: a complete link exists from any behavioral intent node to any atomic event node. Specifically, this includes: for any... ∈ Define its set of valid nodes: Events )={ ∈ | , :( , )∈ ∧( , )∈ t∧( , )∈ } A valid node is a node that can be linked from the top-level behavioral intent layer down to the atomic event layer, thus forming a complete link.

[0069] Among them, valid behavioral intent includes If ec:(tc,ec)∈Rtc→ec, meaning that the behavioral intent node has a general classification node with an association relationship, then the behavioral intent node is a valid node; valid general classifications include: If et:(ec,et)∈Rec→et, meaning that the general category node contains event type nodes with associated relationships, then the general category node is a valid node; valid event types include... If e:(et,e)∈Ret→e, then the event type node is a valid node if there are atomic event nodes with related relationships.

[0070] A pairing of a general category node (ec) and an event type node (et) belongs to the set of legal constraints for 'general category pointing to event type'. A pairing of an event type node (et) and an atomic event node (e) belongs to the set of legal constraints for 'event type pointing to atomic event'. This constraint is used to "filter irrelevant scenarios". If tc is specified in any query / reasoning input text, then Events(tc) is evaluated. For example, when a user's query or the system's reasoning task specifies a certain behavioral intent (tc), all event data that does not belong to that behavioral intent will be automatically truncated and masked, and calculation and response will only be performed on the subset of events corresponding to that behavioral intent.

[0071] In some embodiments, the constraint may further include the number of associations between atomic events and attributes; that is, Dims( )={( , )∣ ∈ ∧( , )∈ Each atomic event is associated with at most one attribute, i.e., a single-value constraint. For example, an atomic event has at most one attribute. ∈ , ∈ ,∣{ ∣( , )∈ }

[0072] In some alternative embodiments, for the most recently acquired target entity, the carrier creates a semantic node in the knowledge graph. and in semantic nodes China Integration and Features; or, if semantic nodes already exist in the knowledge graph. Then and Features are fused into existing semantic nodes. .

[0073] In some embodiments, the carrier can realize the processing and fusion of different entities based on a multimodal large model (MLM).

[0074] Specifically, the carrier can identify entities from unstructured documents based on a multi-modal large model and construct various levels in the knowledge graph according to the semantic types of the entities. The carrier performs statistical analysis on the distribution of entities in structured data based on the multi-modal large model, mines high-frequency enumeration values ​​in the field value range, abstracts them into new relationships, and supplements them to the levels corresponding to semantic nodes. Specifically, the framework for constructing a knowledge graph using entities identified from unstructured documents enriches the knowledge graph with entities from structured data.

[0075] Entities in unstructured documents are mostly words, which form the basis for constructing semantic nodes in the knowledge graph. Entities in structured data are mostly data points; for example, in football, these could be the number of passes, the number of shots, etc., which are then linked to semantic nodes in the knowledge graph. For instance, structured data typically uses fixed-category values ​​(enumerated values), such as the "pass result" field having "success" or "failure," and the "location" field having "left wing," "middle wing," or "right wing." The carrier utilizes a multimodal large-scale model to statistically analyze entity distribution, identifying the most frequently occurring entities and linking them to relevant semantic nodes in the knowledge graph.

[0076] Step S203: Construct a fused knowledge graph based on the matching degree between semantic nodes in the knowledge graph and field nodes in the database.

[0077] In some embodiments, after constructing a knowledge graph, the carrier determines a fused knowledge graph based on the knowledge graph and the database. The carrier associates the semantics of atomic nodes and attribute nodes in the knowledge graph with field nodes in the database, thereby fusing the knowledge graph and the database.

[0078] In some embodiments, the carrier determines the semantic attributes of each semantic node in the knowledge graph, such as the atomic event node Corner, and associated attribute nodes including: action type: direct, target area: restricted area, and orientation: right side. It also determines a set of all field nodes in the database, each node including the original field name, data type, and sample value.

[0079] Furthermore, the semantic nodes are vectorized into data; specifically, the semantic nodes... The names and values ​​of all associated attribute nodes are encoded using a pre-trained Natural Language Processing (NLP) model to obtain the feature vectors of each semantic node. Specifically, this includes:

[0080] in, Representation semantic nodes eigenvectors, Representation semantic nodes The weight coefficients of the associated attributes are determined based on their frequency of occurrence in the official documentation. For example, in the field of football, corner kicks and the attribute "Body Part" occur more frequently than corner kicks and the attribute "Location," therefore the weight coefficient for body parts is greater than the weight coefficient for location. Represents the attribute name, Represents attribute values.

[0081] Similarly, the carrier encodes field nodes based on an NLP model to obtain feature vectors corresponding to each field in the database.

[0082] Map the feature vectors corresponding to each semantic node and each field to the feature space of the joint semantics and fields, and calculate the matching degree between semantic nodes and field nodes in the feature space. Specifically, it includes:

[0083] in, Representing any semantic node, Represents any field node, The cosine similarity between semantic nodes and field nodes is used to represent the similarity between them. Characterizes the pattern matching degree between semantic nodes and field nodes. Characterizes the data distribution similarity between semantic nodes and field nodes; , and These are weights, which can be set according to actual needs or experimental results.

[0084] Among them, the pattern matching degree is used to evaluate semantic nodes. Does the corresponding attribute match the lexical pattern of the field node? For example, the semantic node "corner kick" corresponds to three attributes: {action type, target area, field area}. The field node "corners_direct_to_penalty_area_from_right" (corner kick_direct_to_penalty_area_from_right) can resolve these three attributes. Specific calculation methods include:

[0085] in, Representation semantic nodes The collection of all attributes, The set of attributes that were successfully parsed in the representation field.

[0086] The data distribution similarity includes: based on the historical numerical distribution or enumerated value set of field nodes, and the similarity with semantic nodes. The value is obtained by comparing it with the expected value. For example, semantic nodes. For the result "Outcome: Successful", the data values ​​of the mapping candidate fields should be highly concentrated in the enumeration values ​​representing "success", such as 1, 'Yes', 'SUCCESS'. This similarity can be calculated using KL divergence (logarithmic distribution) or Jaccard similarity (for the enumeration set).

[0087] The carrier calculates the matching degree between each semantic node and all field nodes. The field node with the highest score and a matching degree greater than a matching degree threshold is selected to determine the association between the semantic node and the field node. The matching degree threshold can be set according to actual needs or experimental results.

[0088] In some embodiments, semantic nodes at each level in the knowledge graph are associated with each other. The association between semantic nodes and database field nodes is determined based on the matching degree between semantic nodes in the knowledge graph and database fields. There is an association between database field nodes and table nodes. In this way, semantic nodes at each level in the knowledge graph can be directly or indirectly associated with database field nodes and table nodes to obtain a fused knowledge graph.

[0089] Thus, by integrating multi-source data to achieve entity disambiguation fusion, semantic differences between different materials are eliminated, and terminology is unified. A hierarchical knowledge graph is built by standardizing semantic logic through multi-level constraints and association rules. Finally, by combining semantics, schema, and data distribution to calculate matching degrees from multiple dimensions, the association between semantic nodes and database field nodes is accurately established, breaking down the barriers between domain semantics and database metadata. This ensures the accuracy of mapping domain-specific terminology to database table structures, providing reliable support for subsequent schema linking and SQL generation.

[0090] Figure 3 A schematic diagram of another optional process of the model reasoning method provided in this disclosure is shown, and will be described in terms of each step.

[0091] Step S301: Determine the target semantic node based on the input text.

[0092] In some embodiments, the carrier determines the domain corresponding to the input text, and then determines the semantic nodes corresponding to that domain; and determines the semantic index corresponding to each semantic node. The semantic index may be the feature vector corresponding to the semantic node.

[0093] In some embodiments, the carrier can extract at least one keyword from the input text based on a large language model. Query information is determined based on the at least one keyword, with each keyword corresponding to a filtering rule in the query information. Taking football as an example, if the input text is "count the number of successful direct through balls down the right wing," the corresponding keywords include right wing, direct, through ball, and successful. The corresponding constraint information is {right wing, direct, through ball, successful}, and the query results must include all four keywords.

[0094] In some embodiments, the carrier converts the query information into a semantic vector, compares it with multiple semantic indexes in the knowledge graph, and determines the top i atomic event nodes and the top j attribute nodes with the highest matching degree as target semantic nodes. i and j are both integers greater than or equal to 0, and can be set according to actual needs.

[0095] Step S302: Determine multiple table nodes based on the target semantic node.

[0096] In some embodiments, the plurality of target semantic nodes are used as starting nodes, and a search is performed in the fused knowledge graph. At least one candidate field node is determined along the edges between semantic nodes and field nodes in the fused knowledge graph. The candidate field node that satisfies all the filtering rules included in the query information among the at least one candidate field node is determined as the target field node.

[0097] In practice, the query information includes all target semantic nodes, and at least one candidate field node is identified as the target field node if it has a relationship with all target semantic nodes.

[0098] In some embodiments, after determining the target field node, at least one table node is determined starting from the target field node and along the edge between the target field node and the table node in the fused knowledge graph.

[0099] Step S303: Determine the knowledge graph subgraph based on multiple table nodes.

[0100] In some embodiments, the knowledge graph subgraph is determined based on at least one of the target field node, at least one table node, and at least one join key between table nodes. The join keys between two table nodes are determined based on the graph's shortest path algorithm.

[0101] Wherein, the at least one target field node, the at least one table node, and the connection key between the at least one table node are fragments of database metadata.

[0102] Step S304: Input the knowledge graph subgraph and the input text into the target model to obtain the reasoning result corresponding to the input text.

[0103] In some embodiments, the carrier determines prompt information based on the semantic descriptions corresponding to at least one target field node, at least one table node, and at least one connection key between table nodes in the knowledge graph subgraph, the knowledge graph subgraph, and the input text, inputs the prompt information into the target model, and obtains the reasoning result corresponding to the input text.

[0104] This reduces interference from fields and tables in the database schema that are irrelevant to the domain and the input question, thus reducing the word length input to the target model.

[0105] Thus, through the model reasoning method provided in this disclosure, an explicit and interpretable "terminology, event, database" bridging mechanism is constructed, achieving a deterministic mapping between professional terms and database schemas, effectively reducing the model illusion problem. For example, when querying "passing under high pressure," the system can accurately locate the corresponding field based on the explicit relationships within the fused knowledge graph, significantly improving retrieval accuracy. Simultaneously, this disclosure utilizes the associations between nodes in the fused knowledge graph to form a chain-like retrieval, enabling the selection of the minimum sufficient data table and field set required for the query. On one hand, it eliminates a large number of irrelevant fields, simplifies prompt word content, reduces lexical consumption, and avoids interference from redundant information on the target model; on the other hand, it automatically completes the associated tables required for cross-table queries based on graph connectivity, improving the accuracy of SQL statement execution. Compared to general solutions such as KaSLA and SchemaGraphSQL, the addition of a domain semantic dimension as a constraint further narrows the retrieval scope.

[0106] Furthermore, the embodiments disclosed herein can decouple the semantic ontology layer from the data physical layer. The ontology layer carries stable business logic, while the physical layer corresponds to a variable data storage structure, and the two are connected by a mapping relationship. When the database is upgraded, the table structure is adjusted, or the data source is changed, there is no need to modify the upper-layer business logic; only the node association rules within the graph need to be updated, effectively reducing the difficulty of system maintenance and extending the application lifecycle.

[0107] To verify the model inference method provided in this disclosure, a dataset containing 200 football business questions and answers was constructed based on the FIFA AI Pro test set. The effects of the direct prompt word engineering (general LLM and full schema, referred to as Baseline) and the model inference method described in this disclosure were compared. Table 1 shows the comparison of the accuracy of Text-to-SQL generation.

[0108] Table 1

[0109] Among them, the accuracy (Schema Linking accuracy) includes the probability of hitting the correct table and / or field; the SQL execution accuracy includes the probability of the target model outputting the correct result. As shown in Table 1, the model inference method provided in this disclosure improves the accuracy by 9.9% and the SQL execution accuracy by 10.5% compared with related technologies that directly use LLM and full schema.

[0110] Table 2 shows a comparison of computing resources and efficiency.

[0111] Table 2

[0112] Table 2 shows the Prompt Token consumption, which includes the average number of tokens consumed per input text in the query. In related technologies, approximately 4500 tokens are consumed per input text because the full database is used for each query. The model inference method provided in this disclosure consumes approximately 800 tokens per input text, reducing token consumption by 82%. Correspondingly, the response latency of related technologies for input text is approximately 16.5 seconds, while the response latency of the model inference method provided in this disclosure is 5.8 seconds, reducing latency by 65%.

[0113] The data above shows that after bidirectional fusion of knowledge graphs and databases, the accuracy of processing related queries is significantly improved, while the computational cost is greatly reduced due to the simplification of context.

[0114] Figure 4 This illustration shows another alternative flowchart of the model reasoning method provided in an embodiment of the present disclosure.

[0115] Figure 4 Taking the football field as an example, entities related to football are obtained from the FIFA official website, football-related documents, and football-related databases. Based on the semantic information corresponding to the entities, multiple sets are determined, namely, a behavioral intent set, a general category set, an event type set, an atomic event set, and an attribute set. A knowledge graph is constructed based on these multiple sets.

[0116] Extract table structure information from the business database (Schema), and determine the database based on the table structure and fields.

[0117] By integrating knowledge graphs and databases, and associating data information with football semantics, a fused knowledge graph is obtained.

[0118] When the target model responds based on the fused knowledge graph, it performs semantic information compression on each level of the knowledge graph in the fused knowledge graph, and combines the input text to filter atomic event nodes and attribute nodes in the fused knowledge graph to obtain the target semantic nodes.

[0119] By combining the fused knowledge graph to determine the field nodes and table nodes associated with the target semantic node, a knowledge graph subgraph is obtained.

[0120] SQL is generated based on the knowledge graph subgraph and the input text, and then input into the target model to obtain the reasoning result.

[0121] Figure 5 A schematic diagram of an optional structure of the model inference apparatus provided in an embodiment of this disclosure is shown, and the details will be described in terms of each part.

[0122] In some embodiments, the model reasoning apparatus includes a knowledge graph retrieval unit and a reasoning unit.

[0123] The knowledge graph retrieval unit is used to determine knowledge graph subgraphs based on the input text and the fused knowledge graph; The reasoning unit is used to input the knowledge graph subgraph and the input text into the target model to obtain the reasoning result corresponding to the input text; The fused knowledge graph includes at least two layers of hierarchical semantic nodes, as well as corresponding field nodes and table nodes in the database; the semantic nodes and field nodes are associated with each other through matching degree; any field node is associated with at least one table node; and the knowledge graph subgraph includes multiple table nodes.

[0124] In some embodiments, the fused knowledge graph includes a knowledge graph and a database; before determining the knowledge graph subgraph based on the input text and the fused knowledge graph, the knowledge graph retrieval unit is further configured to determine the knowledge graph, specifically including: Classify at least one target entity to obtain a set of behavioral intentions, a set of general categories, a set of event types, a set of atomic events, and a set of attributes; Each set is used to form a hierarchical semantic node in the knowledge graph, and the knowledge graph is constructed in a top-down order of behavioral intent set, general category set, event type set, atomic event set and attribute set; Specifically, the elements in the behavioral intent set constitute the behavioral intent nodes in the behavioral intent layer of the knowledge graph; the elements in the general category set constitute the general category nodes in the general category layer of the knowledge graph; the elements in the event type set constitute the event type nodes in the event type layer of the knowledge graph; the elements in the atomic event set constitute the atomic event nodes in the atomic event layer of the knowledge graph; and the elements in the attribute set constitute the attribute nodes in the attribute layer of the knowledge graph. The knowledge graph retrieval unit is specifically used to obtain at least one first-class candidate entity based on unstructured documents; At least one second-class candidate entity is obtained based on structured data; Based on semantic vector similarity, feature set matching degree, and path distance of each element in each candidate entity in the knowledge graph, the similarity between each first-class candidate entity and each second-class candidate entity is determined. Based on the similarity between each first-class candidate entity and each second-class candidate entity, the features of the first-class candidate entities and the second-class candidate entities are fused to obtain at least one target entity.

[0125] Wherein, each semantic node in the knowledge graph satisfies at least one of the following: There is a correlation between behavioral intent nodes and their corresponding general classification nodes; There is a relationship between general category nodes and the event type nodes they contain; There is a relationship between event type nodes and their corresponding atomic event nodes; There is an association relationship between any atomic event node and at least one attribute node; The next level node is the child node of the previous level node.

[0126] The knowledge graph retrieval unit is also used to determine the fused knowledge graph, specifically including: Determine the feature vector corresponding to each semantic node in the knowledge graph; Determine the feature vectors corresponding to each field in the database; Based on the semantic similarity, pattern matching degree, and data distribution similarity between the feature vectors corresponding to each semantic node and the feature vectors corresponding to each field, the matching degree between each semantic node in the knowledge graph and each field in the database is determined. The mapping relationship between each semantic node in the knowledge graph and each field in the database is determined based on the matching degree between each semantic node in the knowledge graph and each field in the database. Using each field in the database as a field node and each table in the database as a table node, the association between each semantic node in the knowledge graph and each field in the database is determined based on the mapping relationship between each semantic node in the knowledge graph and each field node in the database. The association between each field node and each table node is determined based on the mapping relationship between each field in the database and each table. Based on the semantic nodes in the knowledge graph, the field nodes in the database, the table nodes in the database, the relationships between the semantic nodes in the knowledge graph and the field nodes in the database, and the relationships between the field nodes in the database and the table nodes in the database, the fused knowledge graph is determined.

[0127] The knowledge graph retrieval unit is specifically used to match at least one keyword included in the input text with at least two layers of hierarchical semantic nodes of the fused knowledge graph to determine multiple target semantic nodes; Based on the mapping relationship between semantic nodes in the fused knowledge graph and field nodes in the database, multiple target field nodes corresponding to the multiple target semantic nodes are determined; Identify multiple table nodes that are associated with the multiple target field nodes; The knowledge graph subgraph is determined based on the multiple table nodes.

[0128] The knowledge graph retrieval unit is specifically used to determine multiple semantic indexes corresponding to the knowledge graph. The multiple semantic indexes are matched against at least one keyword included in the input text, and at least one event type node and at least one atomic event node corresponding to at least one semantic index that successfully matches the at least one keyword are determined as the multiple target semantic nodes.

[0129] The knowledge graph retrieval unit is specifically used to determine at least one candidate field node by starting with each event type node and atomic event node and following the edges of semantic nodes and field nodes in the fused knowledge graph. Identify at least one candidate field node that has an association relationship with all event type nodes and atomic event nodes in the target semantic node as the target field node.

[0130] The knowledge graph retrieval unit is specifically used to determine at least one table node in the fused knowledge graph, starting from the target field node and taking the target field node as the starting node. The knowledge graph subgraph is determined based on the target field node, the at least one table node, and the connection key between the at least one table node; The connection key between the at least one table node is determined based on the shortest path between the two table nodes.

[0131] The reasoning unit is specifically used to determine the prompt information based on the semantic description of each node in the knowledge graph subgraph, the knowledge graph subgraph, and the input text. The prompt information is input into the target model to obtain the inference result corresponding to the input text.

[0132] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.

[0133] Figure 6 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0134] like Figure 6As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0135] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0136] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as model inference methods. For example, in some embodiments, the model inference method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the model inference method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform model inference methods by any other suitable means (e.g., by means of firmware).

[0137] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0138] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0139] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0140] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0141] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0142] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0143] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0144] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.

[0145] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A model reasoning method, the method comprising: Knowledge graph subgraphs are determined based on input text and fused knowledge graph. The knowledge graph subgraph and the input text are input into the target model to obtain the reasoning result corresponding to the input text; The fused knowledge graph includes at least two layers of hierarchical semantic nodes, as well as corresponding field nodes and table nodes in the database; the semantic nodes and field nodes are associated with each other through matching degree; any field node is associated with at least one table node; and the knowledge graph subgraph includes multiple table nodes.

2. The method according to claim 1, wherein the fused knowledge graph includes a knowledge graph and a database; before determining the knowledge graph subgraph based on the input text and the fused knowledge graph, the method further includes determining the knowledge graph, specifically including: Classify at least one target entity to obtain a set of behavioral intentions, a set of general categories, a set of event types, a set of atomic events, and a set of attributes; Each set is used to form a hierarchical semantic node in the knowledge graph, and the knowledge graph is constructed in a top-down order of behavioral intent set, general category set, event type set, atomic event set and attribute set; The elements in the behavioral intent set constitute the behavioral intent nodes in the behavioral intent layer of the knowledge graph; the elements in the general category set constitute the general category nodes in the general category layer of the knowledge graph. The elements in the event type set constitute the event type nodes in the event type layer of the knowledge graph; the elements in the atomic event set constitute the atomic event nodes in the atomic event layer of the knowledge graph; and the elements in the attribute set constitute the attribute nodes in the attribute layer of the knowledge graph.

3. The method according to claim 2, wherein the at least one target entity is determined based on the following method: Obtain at least one candidate entity of the first type based on the unstructured document; At least one second-class candidate entity is obtained based on structured data; Based on semantic vector similarity, feature set matching degree, and path distance of each element in each candidate entity in the knowledge graph, the similarity between each first-class candidate entity and each second-class candidate entity is determined. Based on the similarity between each first-class candidate entity and each second-class candidate entity, the features of the first-class candidate entities and the second-class candidate entities are fused to obtain at least one target entity.

4. The method according to claim 2, wherein each semantic node in the knowledge graph satisfies at least one of the following: There is a correlation between behavioral intent nodes and their corresponding general classification nodes; There is a relationship between general category nodes and the event type nodes they contain; There is a relationship between event type nodes and their corresponding atomic event nodes; There is an association relationship between any atomic event node and at least one attribute node; The next level node is the child node of the previous level node.

5. The method according to claim 2, further comprising determining a fused knowledge graph, specifically including: Determine the feature vector corresponding to each semantic node in the knowledge graph; Determine the feature vectors corresponding to each field in the database; Based on the semantic similarity, pattern matching degree, and data distribution similarity between the feature vectors corresponding to each semantic node and the feature vectors corresponding to each field, the matching degree between each semantic node in the knowledge graph and each field in the database is determined. The mapping relationship between each semantic node in the knowledge graph and each field in the database is determined based on the matching degree between each semantic node in the knowledge graph and each field in the database. Using each field in the database as a field node and each table in the database as a table node, the association between each semantic node in the knowledge graph and each field in the database is determined based on the mapping relationship between each semantic node in the knowledge graph and each field node in the database. The association between each field node and each table node is determined based on the mapping relationship between each field in the database and each table. Based on the semantic nodes in the knowledge graph, the field nodes in the database, the table nodes in the database, the relationships between the semantic nodes in the knowledge graph and the field nodes in the database, and the relationships between the field nodes in the database and the table nodes in the database, the fused knowledge graph is determined.

6. The method according to claim 1 or 2, wherein determining the knowledge graph subgraph based on the input text and the fused knowledge graph comprises: Multiple target semantic nodes are identified by matching at least one keyword included in the input text with at least two levels of hierarchical semantic nodes in the fused knowledge graph. Based on the mapping relationship between semantic nodes in the fused knowledge graph and field nodes in the database, multiple target field nodes corresponding to the multiple target semantic nodes are determined; Identify multiple table nodes that are associated with the multiple target field nodes; The knowledge graph subgraph is determined based on the multiple table nodes.

7. The method according to claim 6, wherein the step of matching at least one keyword included in the input text with at least two layers of hierarchical semantic nodes of the fused knowledge graph to determine multiple target semantic nodes includes: Identify multiple semantic indices corresponding to the knowledge graph; The multiple semantic indexes are matched against at least one keyword included in the input text, and at least one event type node and at least one atomic event node corresponding to at least one semantic index that successfully matches the at least one keyword are determined as the multiple target semantic nodes.

8. The method according to claim 6, wherein determining the plurality of target field nodes corresponding to the plurality of target semantic nodes based on the mapping relationship between semantic nodes in the fused knowledge graph and field nodes in the database includes: Starting from each event type node and atomic event node, determine at least one candidate field node along the edges between semantic nodes and field nodes in the fused knowledge graph; Identify at least one candidate field node that has an association relationship with all event type nodes and atomic event nodes in the target semantic node as the target field node.

9. The method according to claim 6, wherein determining the knowledge graph subgraph based on the plurality of table nodes comprises: Taking the target field node as the starting node, at least one table node is determined in the fused knowledge graph along the edge between the target field node and the table node; The knowledge graph subgraph is determined based on the target field node, the at least one table node, and the connection key between the at least one table node; The connection key between the at least one table node is determined based on the shortest path between the two table nodes.

10. The method according to claim 1, wherein inputting the knowledge graph subgraph and the input text into the target model to obtain the inference result corresponding to the input text includes: Based on the semantic descriptions of each node in the knowledge graph subgraph, the knowledge graph subgraph and input text confirmation prompts are provided. The prompt information is input into the target model to obtain the inference result corresponding to the input text.