Hybrid path selection method of multi-hop path enumeration and large language model final review
By using a hybrid path selection method combining multi-hop path enumeration and LLM final review, the problem of topological structure and semantic separation in existing technologies is solved, thereby improving the executability of path generation and semantic matching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZHONGSHURUIZHI TECH CO LTD
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies suffer from problems such as the disconnect between topological structure and semantic understanding, uncontrollable path generation, and insufficient filtering of path combinations in multi-hop path selection, resulting in query results that do not match user intent.
A hybrid path selection method combining multi-hop path enumeration and LLM final review is adopted. By identifying known entities and target ontology classes, acyclic multi-hop ontology association paths are generated, and semantic topological constraint paths are determined using semantic decision prompts from a large language model.
It improves the executability and compliance of path generation, reduces redundant noise, and enhances the matching accuracy and interpretability in ambiguous scenarios and complex user intents.
Smart Images

Figure CN122364398A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of natural language processing and knowledge graph question answering technology, and more specifically, to a hybrid path selection method combining multi-hop path enumeration and LLM final review. Background Technology
[0002] In ontology-based natural language question answering systems, when a user's question involves relationships between multiple ontology classes, this application needs to find a path from the known entities to the target answer within the ontology. The selection of this multi-hop query path directly determines the validity of the query results, requiring the system to accurately understand the user's complex semantic intent and plan reasonable reasoning and jump steps within a vast domain ontology network.
[0003] Existing multi-hop path selection schemes typically rely on graph structure search algorithms or end-to-end large language model generation architectures. This scheme first maps ontology classes and relations to graph structure nodes or vector spaces, and then uses connectivity graph algorithms such as shortest path search to find reachable paths; alternatively, it directly inputs the user question into an end-to-end large language model, utilizing the model's internal parameterization knowledge to generate attribute association sequences from the question end-to-end. Finally, this application directly uses the shortest structural path obtained by the graph algorithm or the attribute sequence generated by the language model as the query path for execution.
[0004] However, this approach has significant technical flaws. Methods that rely solely on graph structure search often only consider topological connectivity and structural features, easily selecting the shortest path but one completely unrelated to the user's actual semantic intent, resulting in a severe disconnect between topological structure and semantic understanding. Methods that rely solely on end-to-end large language models to generate paths, lacking explicit topological constraints on the predefined domain ontology, are prone to generating "illusory" attribute nodes that don't actually exist in the domain ontology. Furthermore, when faced with an extremely large number of possible path combinations, the lack of effective grouping, filtering, and recommendation mechanisms makes the large language model highly uncontrollable when directly making global path decisions, making it difficult to output multi-hop paths that satisfy the user's semantic intent while ensuring the correctness of the underlying ontology's topology. Summary of the Invention
[0005] This application provides a hybrid path selection method combining multi-hop path enumeration and LLM final review to at least alleviate the aforementioned technical problems.
[0006] A hybrid path selection method combining multi-hop path enumeration and LLM final review includes: Step 1: Identify the known entities in the user question to be processed and determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed; Step 2: Extract global candidate ontology classes and object attributes from the preset domain ontology to generate a set of original candidate multi-hop ontology association paths that reflect the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class; Step 3: Determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and then group and filter the original candidate multi-hop ontology association path set to select a recommended multi-hop ontology association path list. Step 4: Extract the original text features reflecting the user's query intent from the user question to be processed, generate semantic decision prompts for the large language model using the joint recommendation multi-hop ontology association path list, and then determine the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the semantic decision prompts for the large language model.
[0007] Optionally, step 1: Identify known entities in the user question to be processed and determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed, including: Entity extraction is performed on the user issues to be processed to identify known entities in the user issues to be processed and their respective starting ontology classes, and the identified starting ontology classes are mapped to starting nodes; The query target parsing of the user question to be processed is performed to determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed, and the target ontology class is mapped as the termination node. The preset domain ontology contains global candidate ontology classes that reflect the domain knowledge structure and object attributes that reflect the logical relationship between global candidate ontology classes. The starting ontology class is a subset of the global candidate ontology classes.
[0008] Optionally, step 2: Extract global candidate ontology classes and object attributes from the preset domain ontology to generate a set of original candidate multi-hop ontology association paths that reflect the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class, including: Map the extracted global candidate ontology classes to topology nodes; By utilizing the extracted object attributes, logical edges are constructed to connect the topological nodes, thereby forming an inter-class adjacency graph that reflects the topological relationships between concepts within the preset domain. Based on the inter-class adjacency graph, a set of original candidate multi-hop ontology association paths is generated, reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class.
[0009] Optionally, based on the inter-class adjacency graph, a set of original candidate multi-hop ontology association paths is generated, reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class, including: Perform a topological traversal of the inter-class adjacency graph to search for candidate multi-hop ontology association paths connecting the start node and the end node; Acyclic multihop ontology association paths are enumerated among the candidate multihop ontology association paths, and then aggregated to generate a set of original candidate multihop ontology association paths that reflect the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class.
[0010] Optionally, the object attributes have attribute feature information, including function attribute identifiers, attribute names, and attribute annotation information; Step 3: Determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and group and filter the original candidate multi-hop ontology association path set to filter out a recommended multi-hop ontology association path list, including: Semantic parsing is performed on the user problem to be processed to extract the limiting requirements other than known entities in the user problem to be processed, and these requirements are determined as preset constraints. Calculate the coverage of the acyclic multi-hop ontology association path to the preset constraints in order to determine the path coverage factor; Determine the object attributes and their number contained in the acyclic multi-hop ontology association path in order to determine the path length factor; Based on the functional attribute identifiers corresponding to the object attributes contained in the acyclic multi-hop ontology association path, the number of functional attributes with unique constraints in the acyclic multi-hop ontology association path is identified, and then the functional attribute quantity factor is determined. Based on path coverage factor, path length factor, and functional attribute quantity factor, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list.
[0011] Optionally, the original candidate multi-hop ontology association path set is grouped and filtered based on path coverage factor, path length factor, and functional attribute quantity factor to select a recommended multi-hop ontology association path list, including: The path coverage factor, path length factor, and functional attribute quantity factor are weighted and quantified to generate path structure scoring results for acyclic multi-hop ontology associated paths. Based on the scoring results of each path structure, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list.
[0012] Optionally, step 3 further includes: determining the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list; and mapping the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list in the original candidate multi-hop ontology association path set.
[0013] Optionally, in step 4, the joint recommendation of the multi-hop ontology association path list generates semantic decision prompts for the large language model, and then, based on the semantic decision prompts for the large language model, the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology is determined, including: The original text features, the recommended multi-hop ontology association path list, and the attribute names and attribute annotation information of the association mapping are encapsulated in a structured manner to form semantic decision prompt words for a large language model containing semantic discrimination instructions. The semantic decision prompts of the large language model are input into the preset large language model. The preset large language model is used to perform semantic matching calculations on the attribute names and attribute annotation information of the original text features and the association paths of each acyclic multi-hop ontology to determine the semantic topological constraint multi-hop association path of the user question to be processed in the preset domain ontology.
[0014] Optionally, the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology is determined, including: The structured response text is generated based on the semantic matching calculation results using a pre-defined large language model. The structured response text contains a preferred multi-hop ontology association path identifier, which is used to indicate the multi-hop ontology association path that has a semantic mapping relationship with the original text features and is related to the user question to be processed. The structured response text is parsed to extract the preferred multi-hop ontology association path identifiers; Based on the preferred multi-hop ontology association path identifier, determine the semantic topological constraint multi-hop association path of the user problem to be processed in the preset domain ontology.
[0015] Optionally, the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology is determined based on the preferred multi-hop ontology association path identifier, including: Based on the preferred multi-hop ontology association path identifier, the final semantically preferred multi-hop ontology association path is selected from the list of recommended multi-hop ontology association paths; Based on semantically optimized multi-hop ontology association paths, generate semantic topological constraint multi-hop association paths for the user questions to be processed in the preset domain ontology; Based on semantic topological constraints and multi-hop association paths, a structured query plan is constructed for the user questions to be processed.
[0016] The technical advantages of the technical solution provided in this application are: This application's hybrid path selection method, combining multi-hop path enumeration and LLM final review, addresses the technical shortcomings of traditional path selection schemes, such as the susceptibility to structural illusions and high uncontrollability. Step 1 identifies known entities and target ontology classes, and step 2 extracts global candidate ontology classes and object attributes from a predefined domain ontology to generate an initial set of candidate multi-hop ontology association paths. This solves the problem of lacking explicit topological constraints in traditional large language model generation schemes. Compared to the traditional end-to-end language model generation method, which is completely unconstrained and prone to fabricating non-existent path nodes, this application strictly establishes the enumeration of multi-hop paths on the predefined topological associations of ontology classes and object attributes. This underlying enumeration mechanism avoids generating "illusory" paths outside the ontology, resulting in initial paths with high executability and compliance.
[0017] Based on the generated original path set, step 3 determines acyclic multi-hop ontology association paths and groups and filters them to select a recommended list of multi-hop ontology association paths. This solves the problem of uncontrollable final decision-making caused by the single filtering method in traditional solutions when faced with a massive number of candidate paths. Traditional graph search solutions usually only use a single shortest path for truncation, while this application groups and filters the original candidate multi-hop ontology association paths after removing loop redundancy, reducing the huge and complex graph network to a structurally highly feasible list of high-quality recommendations. Compared with the traditional direct output without sorting or single structural pruning, this greatly reduces redundant noise, resulting in a significant improvement in the quality of paths entering the final decision-making stage.
[0018] Finally, step 4 combines the extracted user intent raw text features with a list of recommended multi-hop ontology association paths to generate semantic decision prompts for the large language model, thereby determining the semantic topologically constrained multi-hop association paths. This effectively solves the problem of structural and semantic separation in traditional graph algorithms. Traditional graph connectivity-based algorithms cannot understand deep user intent. This application, however, limits the controllable range through structured enumeration and then uses the structured recommended paths as contextual prompts for the large language model to perform the final semantic decision. This hybrid path selection architecture unifies the rigor of structural topology with the deep semantic understanding capabilities of the large language model. Compared to traditional single-dimensional selection methods, it exhibits higher matching accuracy and interpretability when facing ambiguous scenarios and complex user intents. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a hybrid path selection method combining multi-hop path enumeration and LLM final review, as described in an embodiment of this application.
[0020] Figure 2 This is a structural diagram of a hybrid path selection device combining multi-hop path enumeration and LLM final review, according to an embodiment of this application.
[0021] Figure 3 This is a structural diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0022] like Figure 1 As shown, this embodiment of the present application presents a hybrid path selection method combining multi-hop path enumeration and LLM final review, which includes: Step 1: Identify known entities in the user question to be processed and determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed; Step 2: Extract global candidate ontology classes and object attributes from the preset domain ontology to generate a set of original candidate multi-hop ontology association paths that reflect the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class; Step 3: Determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and then group and filter the original candidate multi-hop ontology association path set to select a recommended multi-hop ontology association path list. Step 4: Extract the original text features reflecting the user's query intent from the user question to be processed, and generate semantic decision prompts for the large language model in conjunction with the recommended multi-hop ontology association path list. Then, determine the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the semantic decision prompts for the large language model.
[0023] Optionally, step 1: Identifying known entities in the user question to be processed and determining the target ontology class corresponding to the answer requested by the user question in a preset domain ontology, including: Entity extraction is performed on the user problem to be processed to identify known entities in the user problem to be processed and their respective starting ontology classes, and the identified starting ontology classes are mapped to starting nodes; The query target parsing of the user question to be processed is performed to determine the target ontology class corresponding to the answer requested by the user question in the preset domain ontology and to map the target ontology class as the termination node. The preset domain ontology includes global candidate ontology classes that reflect the domain knowledge structure and object attributes that reflect the logical association between the global candidate ontology classes. The starting ontology class is a subset of the global candidate ontology classes.
[0024] Preferably, in the implementation of this application's solution, the user's question in natural language form first needs to be parsed and processed. The core of this process lies in simultaneously completing two semantic recognition tasks: firstly, locating the known entities explicitly mentioned by the user from the question text; and secondly, inferring the conceptual category within the domain knowledge system to which the user's desired answer belongs. For example, "passenger..." Taking the question "Which cities has Yao been to?" as an example, the question text contains an individual " Yao" referred to by a proper name and an attribute value to be filled in, "city". This application needs to map " Yao" to the corresponding class node in the preset domain ontology and associate "city" with the class node in the preset domain ontology that can carry the answer. These two parsing tasks are not executed in isolation but share the same semantic parsing context. The former provides the starting position for the subsequent path enumeration process, and the latter defines the termination boundary of the path enumeration.
[0025] Preferably, in order to completely construct the inter-class adjacency graph, this application retrieves the preset domain ontology and extracts the globally defined candidate ontology classes and all object properties bound to these globally defined candidate ontology classes. The preset domain ontology here is a formal encoding of the knowledge structure of a specific domain. It contains globally defined candidate ontology classes that reflect the knowledge structure of the domain, that is, all possible concept nodes in the domain, and object properties that reflect the logical associations between these globally defined candidate ontology classes. The object properties clearly indicate what kind of semantic connections can be made between concepts. During the extraction process, this application not only pays attention to the name labels of the object properties but also synchronously obtains the domain constraints and range constraints of each object property to ensure the directionality of each edge and the correctness of the connected node types in the constructed inter-class adjacency graph. For example, the domain constraint of the object property "take" is the class of passengers, and the range constraint is the class of flights. This constraint information determines that there can only be an outgoing edge from the passenger node to the flight node in the inter-class adjacency graph and will not be constructed in the reverse direction. This mechanism of strictly following the formal definition of the preset domain ontology to construct the graph structure eliminates the introduction of objectively non-existent associations in the graph structure and lays a structural foundation for the legality of subsequent path enumeration and the direct executability of the results.
[0026] Preferably, in the link entity extraction stage of the user question, this application calls a pre-constructed entity recognition component to scan the question text word by word and combine fragments to extract known entities that can be linked to the preset domain ontology. The operation of the entity recognition component depends on the ontology instance data defined in the preset domain ontology and an optional synonym mapping table. By string matching or sequence annotation methods based on statistical models, the text fragments in the question are aligned with the labels or aliases of the ontology instances. When the text fragment " Yao" is recognized, this application does not simply record the string but further queries the ontology instance library to determine the ontology class to which " Yao" belongs in the preset domain ontology. During this process, the entity " Yao" may belong to multiple ontology classes at the same time. For example, in a preset domain ontology for air travel, the individual " "Yao" can be an instance of the passenger class or an instance of the crew member class due to having flight qualifications. These identified ontology classes constitute the initial ontology class set, and each class in the set will be regarded as the starting node for path enumeration in subsequent processes, so as to ensure that possible query paths are not missed due to the single ownership of entity type.
[0027] Preferably, after obtaining the set of initial ontology classes, this application maps each initial ontology class in the set to a starting node in an inter-class adjacency graph. Here, the node does not necessarily represent a "starting node". Instead of representing the specific individual "Yao," this represents conceptual nodes such as "passengers" or "crew members." This mapping from individual instances to their respective starting ontology classes elevates known entities in the specific problem to the conceptual level, allowing subsequent path enumeration to be performed at the pattern level, rather than the instance level. The reason for performing path search at the conceptual level is that semantic relationships spanning multiple hops are essentially pattern-level paths connected between classes via object attributes; instance relationships are merely the concrete data filling of these pattern paths. After mapping the starting ontology class to starting nodes, these starting nodes are in a state of waiting to start from them and explore directed paths hop-by-hop to reach the terminal node.
[0028] Preferably, while extracting entities from the user's question, or asynchronously, this application executes the query target parsing process in parallel to determine the target ontology class corresponding to the answer requested by the user's question in the preset domain ontology. The technical means employed in query target parsing is also semantic parsing, but its focus is on identifying interrogative words in the question, the modified central nouns, and their conceptual correspondences in the preset domain ontology. In the case of "passengers..." In the question "Which cities has Yao visited?", this application analyzes that "Which cities" is an interrogative phrase and extracts the core noun "city". Then, it searches the conceptual hierarchy of the predefined domain ontology for an ontology class that is semantically equivalent to or directly corresponds to "city". In the specific application scenario of air travel, the answer "city" does not exist as an independent class in the predefined domain ontology, but is attached to an attribute of the airport class or indirectly represented by the airport's geographical location. Therefore, the result of query target parsing is to determine the target ontology class as airport, because only by locating the airport node can the user's question be finally answered by extracting the city attribute of the airport in the subsequent query execution stage. This method of indirectly mapping the surface answer concept to the core class of the predefined domain ontology is key to addressing the difference between user freedom of expression and the rigor of the ontology structure.
[0029] Preferably, after determining that the target ontology class is an airport, this application maps the target ontology class as a termination node in an inter-class adjacency graph. This termination node, together with the aforementioned starting node, defines the start and end boundaries of the path enumeration, forming a search space where all candidate starting classes must ultimately reach the fixed node of the airport. The determination of the termination node is not a simple string replacement operation, but rather a mapping process that includes semantic alignment verification. That is, the system verifies whether the target ontology class actually exists in the global candidate ontology classes of the preset domain ontology, and whether it can be associated with other global candidate ontology classes through at least one object attribute. If the target ontology class is not defined in the preset domain ontology, or if it exists but is in an isolated state without any object attribute connection to other global candidate ontology classes, this application triggers an alternative processing flow, such as tracing back the parent class of the target ontology class or inferring the closest ontology class as an alternative termination node through attribute association. This verification ensures that the path enumeration process always exists within the legal conceptual space of the preset domain ontology, eliminating the empty search state caused by the lack of a target in subsequent enumeration steps.
[0030] Preferably, after both the starting node and the ending node have been established, this application will proceed to the subsequent path enumeration stage based on this pair of inputs. It should be noted that the starting ontology class set and the ending node are not static information that is fixed after being determined once. In a preferred embodiment, this application will perform initial pruning on each candidate class in the starting ontology class set, eliminating those starting ontology classes whose connectivity probability with the ending node in the preset domain ontology is zero. The pruning is based on offline analysis of the preset domain ontology. By pre-calculating the reachability index from each global candidate ontology class to other global candidate ontology classes, this application can determine in constant time whether a given starting ontology class has at least one object attribute path that can reach the ending node. Taking the starting ontology class "crew member" as an example, if no object attribute chain is defined in the preset domain ontology that starts from the crew member class and ultimately connects to the airport class, then this starting ontology class will be directly excluded, thereby simplifying the search cardinality for subsequent path enumeration. This pre-pruning based on reachability prediction reduces the generation of invalid candidate paths and lowers the computational overhead of the structural scoring and final review stages.
[0031] Optionally, step 2: Extract global candidate ontology classes and object attributes from a preset domain ontology to generate a set of original candidate multi-hop ontology association paths reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class, including: Map the extracted global candidate ontology classes to topology nodes; Logical edges connecting topological nodes are constructed using the extracted object attributes, thereby forming an inter-class adjacency graph that reflects the topological relationships between concepts within the preset domain. Based on the inter-class adjacency graph, a set of original candidate multi-hop ontology association paths is generated, reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class.
[0032] Preferably, in the specific execution of step 2, a directed search space is first constructed based on the established set of starting nodes and ending nodes, connecting these two types of nodes at the conceptual level of the preset domain ontology. The basic materials for constructing this directed search space are the global candidate ontology classes and object attributes extracted from the preset domain ontology. The preset domain ontology, as a structured encoding of knowledge in fields such as aviation and travel, explicitly defines all concept categories covered by the domain and the semantic relationships allowed between these concepts. Mapping each global candidate ontology class in the preset domain ontology to a topological node is a preliminary operation for expressing the reachability between ontology concepts using a graph structure. This mapping is not a simple symbol conversion, but rather creates a unique graph node identifier for each global candidate ontology class and attaches metadata such as the hierarchical relationship and local name of the global candidate ontology class to the corresponding topological node, so that subsequent graph traversal operations based on this graph structure can accurately locate the corresponding position at the conceptual level.
[0033] Preferably, after mapping the global candidate ontology classes to topology nodes, the extracted object attributes are used to construct directed logical edges connecting these topology nodes. Each object attribute contains domain constraints and value constraints in the preset domain ontology. These constraints precisely define which type of topology node the object attribute can originate from and which type of topology node it points to. Taking the object attribute "ride" as an example, its domain constraint limits the originating topology node to the passenger class, and its value constraint limits the pointing topology node to the flight class. Based on this, a directed logical edge is established in the inter-class adjacency graph from the passenger topology node to the flight topology node. At the same time, the object attribute's own name label and annotation information, such as "passenger's flight record," are stored as the label information of the directed logical edge, so that each directed logical edge not only expresses topological connectivity but also carries textual descriptions that can be used for semantic understanding by the subsequent large language model. After traversing and constructing based on the domain constraints and range constraints of all object attributes, a class adjacency graph is formed that fully reflects the topological relationships between concepts within the preset domain. This class adjacency graph is a directed and labeled graph structure.
[0034] Preferably, the directionality of this inter-class adjacency graph is directly inherited from the domain and range constraints of object attributes. It strictly follows the semantic direction of the relationships between concepts in the domain knowledge. For example, a passenger can take a flight, but there is no inverse relationship from flight to passenger. Therefore, there are absolutely no reverse directed logical edges in the inter-class adjacency graph that violate the predefined domain ontology definition. This graph construction method based on strict constraints is fundamentally different from those practices that simply treat all object attributes as undirected edges or ignore domain and range constraints. It ensures that any original candidate multi-hop ontology association path obtained by traversing the inter-class adjacency graph can directly correspond to a legal and complete attribute chain in the predefined domain ontology that can be used to construct structured queries, fundamentally eliminating the risk of generating unexecutable paths. Figure 1 Once constructed, it becomes the unified topological foundation for the subsequent enumeration of original candidate multi-hop ontology association paths in the entire method. No matter how the known entities in the user problem to be processed change, as long as the same set of preset domain ontology is faced, the structure of the inter-class adjacency graph remains stable. It is only necessary to limit the start and end range of the search on the inter-class adjacency graph according to the set of starting nodes and ending nodes parsed from the user problem to be processed in each query.
[0035] Preferably, the process of generating the original candidate multi-hop ontology association path set involves performing a controlled path enumeration operation on the constructed inter-class adjacency graph, using each starting node in the starting node set as the starting point for path exploration and the ending node as the unique endpoint. This controlled path enumeration operation employs a depth-first path exploration approach, starting from a starting topological node and extending outwards along the direction of directed logical edges. Each directed logical edge traversed adds an object attribute hop to the original candidate multi-hop ontology association path. When the current topological node in the exploration process happens to be the ending node, the alternating sequence of all topological nodes and directed logical edges traversed from the starting topological node to the ending node is recorded as an original candidate multi-hop ontology association path. To avoid infinite loops in ontology structures with cycles, the controlled path enumeration operation mandates that topological nodes in the same original candidate multi-hop ontology association path must not appear repeatedly, i.e., strictly enforcing the acyclic constraint.
[0036] Preferably, to maintain the completeness of the original candidate multi-hop ontology association path set while avoiding combinatorial explosion, the controlled path enumeration operation also introduces a length upper limit control mechanism. This length upper limit is not fixed to a single value, but can be dynamically set according to the actual size and structural complexity of the preset domain ontology. For example, when the number of global candidate ontology classes is small and the connectivity is relatively sparse, the maximum number of hops can be set to a larger value to fully capture long-range semantic associations. Conversely, when the ontology is large and the directed logical edges between global candidate ontology classes are dense, the maximum number of hops can be reduced to a smaller integer (e.g., five hops), thus achieving a balance between covering sufficiently reasonable semantic paths and controlling the number of original candidate multi-hop ontology association paths. All paths within the length upper limit and satisfying the acyclic constraint that can reach the terminal node from the starting node in the starting node set are collected and aggregated to form the original candidate multi-hop ontology association path set. Each original candidate multi-hop ontology association path in the set of original candidate multi-hop ontology association paths represents a potential association interpretation that starts from the initial ontology class to which the known entities in the user problem to be processed belong, and gradually deduces to the target ontology class according to the semantic connections allowed by the preset domain ontology.
[0037] Taking the air travel scenario as an example, when the initial ontology class set is determined to include passenger class and crew member class, and the target ontology class is determined to be airport class, the above-mentioned controlled path enumeration operation is performed on the inter-class adjacency graph composed of topology nodes such as passenger topology nodes, flight topology nodes, route topology nodes, crew member topology nodes, and airport topology nodes, as well as directed logical edges of passengers, directed logical edges belonging to routes, directed logical edges belonging to airports, directed logical edges of crew members, and directed logical edges residing in the destination. The enumeration results include: the first original candidate multi-hop ontology association path is from the passenger topology node via the directed logical edge of "riding" to the flight topology node, then via the directed logical edge of "belonging to the route" to the route topology node, and finally via the directed logical edge of "belonging to the airport" to the airport topology node; the second original candidate multi-hop ontology association path is from the passenger topology node via the directed logical edge of "riding" to the flight topology node, then via the directed logical edge of "crew" to the crew member topology node, and finally via the directed logical edge of "stationed" to the airport topology node; the third original candidate multi-hop ontology association path is from the crew member topology node directly via the directed logical edge of "stationed" to the airport topology node. These original candidate multi-hop ontology association paths, together with other possible original candidate multi-hop ontology association paths that meet the conditions, together form the set of original candidate multi-hop ontology association paths corresponding to the user problem to be processed. Each original candidate multi-hop ontology association path in this set of original candidate multi-hop ontology association paths is given a complete sequence of object attributes and corresponding annotation text, providing a transparent, traceable, and legally valid candidate solution space for the next step of structural scoring and semantic final review, which is within the preset domain ontology.
[0038] Optionally, based on the inter-class adjacency graph, a set of original candidate multi-hop ontology association paths is generated, reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class, including: A topological traversal is performed on the inter-class adjacency graph to search for candidate multi-hop ontology association paths connecting the starting node and the ending node; Acyclic multihop ontology association paths are enumerated among the candidate multihop ontology association paths, and then aggregated to generate an original set of candidate multihop ontology association paths that reflects the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class.
[0039] Preferably, in the process of generating the original candidate multi-hop ontology association path set based on the inter-class adjacency graph, the first step is to perform a topological traversal of the constructed inter-class adjacency graph to search for original candidate multi-hop ontology association paths connecting the starting node and the ending node in the starting node set. This inter-class adjacency graph serves as a graph representation of the preset domain ontology. Each topological node in the graph corresponds to a global candidate ontology class, and each directed logical edge corresponds to an object attribute, carrying the name label and annotation information of that object attribute. The starting point of the topological traversal is no longer a random graph node, but rather several topological nodes explicitly specified by the starting node set parsed in step 1 based on the user problem to be processed. For example, in an air travel scenario, the starting node set may include passenger topological nodes and crew member topological nodes. The ending point of the topological traversal uniquely points to the same ending node, namely the airport topological node mapped by the target ontology class determined by the query target parsing in step 1. This traversal method with clearly defined start and end conditions reduces the search scope from blind exploration of the entire graph to targeted probing of the current user problem to be processed, significantly compressing the graph space of the inter-class adjacency graph that needs to be examined.
[0040] Preferably, the topology traversal is executed using a depth-first path exploration strategy. However, unlike traditional graph search which only records node sequences, the topology traversal process in this application treats the object attribute represented by each traversed directed logical edge as an indispensable semantic jump step in the original candidate multi-hop ontology association path. When the search process starts from a current topology node, the traversal action does not randomly select downstream neighbors, but strictly expands along the direction of the directed logical edge starting from the current topology node. Each step means that a logical deduction has been completed at the semantic level along the conceptual relationship defined by the object attribute. Taking the passenger topology node in the air travel scenario as an example, its starting directed logical edge may include a ride directed logical edge. The topology traversal process will select the ride directed logical edge to enter the flight topology node. At this time, the original candidate multi-hop ontology association path segment is recorded as passenger topology node via ride directed logical edge to flight topology node. This original candidate multi-hop ontology association path segment also accumulates the name label and annotation information of the ride object attribute as its semantic payload.
[0041] Preferably, a cycle detection operation is performed at each step of the topology traversal process to ensure that each of the final enumerated original candidate multi-hop ontology association paths is acyclic multi-hop ontology association paths. Cycle detection is implemented by maintaining a record of visited topology nodes in the context of the topology traversal state. Whenever the next topology node is explored, it is first checked whether the target topology node has already appeared in the sequence of topology nodes traversed by the current original candidate multi-hop ontology association path. If it has, it indicates that continuing along this direction will form a cycle, and the search of this branch is truncated; if it has not, the target topology node is recorded as a visited topology node, and the search state is advanced from the current topology node to the target topology node. This acyclic constraint aligns with the semantic characteristics of the preset domain ontology, because in logical deduction, conceptual deduction should generally not loop back to itself. Eliminating loops not only avoids the technical risk of infinite loops but also eliminates semantically redundant re-entry paths, improving the semantic compactness of the original candidate multi-hop ontology association paths.
[0042] Preferably, the topology traversal process is also dynamically constrained by a length upper limit control mechanism, which determines the maximum number of directed logical edges that can be traversed from the starting topology node. In the application scenario of air travel, if the scale of global candidate ontology classes contained in the preset domain ontology is relatively limited and the connection relationship between concepts is relatively clear, the length upper limit can be set to a moderate number of hops (e.g., five hops) as a forced termination boundary for topology traversal. When the search depth reaches this length upper limit, even if the current search position has not yet reached the termination node, the exploration of this branch will be terminated and will no longer continue to extend to a deeper level. This hop-based truncation mechanism not only controls the exponential expansion of the search, but more importantly, it reflects a semantic fact: in the question-answering scenario, if two concepts require an indirect relationship exceeding a preset reasonable number of hops to establish a connection, then the semantic relationship expressed by this original candidate multi-hop ontology association path is often too far-fetched and lacks explanatory power for the user's query intent. Excluding it from the set of original candidate multi-hop ontology association paths helps the subsequent structural scoring and semantic final review stages to concentrate computational resources on original candidate multi-hop ontology association paths with high explanatory potential.
[0043] Preferably, when the current topological node in a certain exploration direction during the topological traversal is exactly the terminal node, it indicates that a complete connection relationship from the starting topological node to the terminal node has been discovered. The alternating sequence of topological nodes and directed logical edges traversed in this topological traversal constitutes an acyclic multi-hop ontology association path. This acyclic multi-hop ontology association path not only contains the sequence of topological nodes, but also completely encapsulates the name tags and annotation information of the object attributes corresponding to each directed logical edge in the sequence, forming a self-contained alternative answer derivation chain whose semantic meaning can be independently understood. For example, in an air travel scenario, a complete acyclic multi-hop ontology association path might be recorded as follows: the passenger topology node goes through the directed logical edge of the flight to the flight topology node, then through the directed logical edge of the route to the route topology node, and finally through the directed logical edge of the airport to the airport topology node. The semantic description carried by this acyclic multi-hop ontology association path is "the name label of the flight - the name label of the route - the name label of the airport". This description provides a direct basis for the subsequent large language model to understand that the acyclic multi-hop ontology association path expresses the semantics of "the passenger arrives at the destination airport through the route of the flight he / she took".
[0044] Preferably, after exhaustive topological traversal of the inter-class adjacency graph, starting from multiple starting topological nodes in the set of starting nodes, zero or more acyclic multi-hop ontology association paths that satisfy the acyclic constraint and the upper limit of length constraint are explored. These acyclic multi-hop ontology association paths are aggregated to form a set of original candidate multi-hop ontology association paths that reflect the potential association between known entities in the user problem to be processed and the answer represented by the target ontology class. The original candidate multi-hop ontology association path set has two fundamental attributes: First, each acyclic multi-hop ontology association path in this original candidate multi-hop ontology association path set is strictly based on the formal definition of the predefined domain ontology, and the object attributes used all actually exist in the predefined domain ontology, eliminating any fabricated or imagined paths; Second, the acyclic multi-hop ontology association paths within this original candidate multi-hop ontology association path set are parallel, each representing a different semantic derivation route. Before structural scoring and semantic final review, these acyclic multi-hop ontology association paths are in an equal candidate position, logically constituting multiple possible interpretations of the user's query intent. It is this complete and all legal, competitive and adjudicative path set form that provides the prerequisite for the subsequent hybrid decision-making mechanism of first selecting the best path through structural scoring and then conducting semantic final review by the large language model to function.
[0045] Optionally, the object attribute has attribute feature information, which includes function attribute identifier, attribute name, and attribute annotation information; Step 3: Determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and group and filter the original candidate multi-hop ontology association path set to filter out a recommended multi-hop ontology association path list, including: Semantic parsing is performed on the user problem to be processed to extract the limiting requirements in the user problem to be processed, excluding the known entities, and these requirements are determined as preset constraints. Calculate the coverage of the acyclic multi-hop ontology association path to the preset constraints to determine the path coverage factor; Determine the object attributes and their number contained in the acyclic multi-hop ontology association path in order to determine the path length factor; Based on the functional attribute identifiers corresponding to the object attributes contained in the acyclic multi-hop ontology association path, the number of functional attributes with unique constraints in the acyclic multi-hop ontology association path is identified, and then the functional attribute quantity factor is determined. Based on the path coverage factor, the path length factor, and the functional attribute quantity factor, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list.
[0046] Preferably, in the specific implementation of step 3, it is first necessary to perform semantic parsing on the user problem to be processed, so as to extract the limiting requirements in the user problem other than known entities, and establish the extracted limiting requirements as preset constraints. In the application scenario of air travel, when the user problem to be processed is "passenger..." When asking "Which cities has Yao visited?", the known entity " "Yao" has already been identified and mapped to the Passenger and Crew Member classes in the initial ontology class set in step 1. Although the modifier "passenger" in the statement is not a proper noun, it expresses the user's understanding of the known entity "Yao". The role of "Yao" is limited, that is Yao participated in the travel activities as a passenger, not a crew member. The semantic parsing process identifies such modifying elements and other binding expressions that may exist in the user question to be processed, extracting them from the natural language question text and structuring them into pre-defined constraints. These pre-defined constraints serve as a key reference in the subsequent structural scoring process for measuring whether an acyclic, multi-hop ontology association path closely aligns with the user's intent. Their existence provides a calibration signal from the semantic dimension of the user question to the path evaluation process, which originally relied solely on the graph topology of inter-class adjacency graphs.
[0047] Preferably, after the preset constraints are established, for each acyclic multi-hop ontology association path in the original candidate multi-hop ontology association path set, the degree of coverage of the preset constraints by the acyclic multi-hop ontology association path is calculated to obtain the path coverage factor. The calculation logic of the path coverage factor is based on class coverage matching: each acyclic multi-hop ontology association path consists of a series of alternating topology nodes and directed logical edges, where the topology nodes correspond to different global candidate ontology classes in the preset domain ontology. The global candidate ontology classes involved in the preset constraints are compared one by one with the topology nodes on the acyclic multi-hop ontology association path, and the number of constraint ontology classes covered by the topology nodes traversed by the acyclic multi-hop ontology association path is counted. For example, if the preset constraints include a passenger class, and a certain acyclic multi-hop ontology association path happens to contain a passenger topology node, then the constraint is determined to be covered; conversely, if a certain acyclic multi-hop ontology association path does not pass through a passenger topology node (such as a path that only starts from the crew member topology node), then the constraint is not covered. The higher the coverage, the closer the path coverage factor value is to the upper limit; the more coverage gaps, the lower the path coverage factor value. The numerical difference in the path coverage factor directly quantifies the extent to which each acyclic multi-hop ontology association path responds to the entity role constraints explicitly expressed in the user problem to be addressed.
[0048] Preferably, the number of object attributes contained in an acyclic multi-hop ontology association path is determined simultaneously or sequentially with the path coverage factor calculation to obtain the path length factor. The number of object attributes in an acyclic multi-hop ontology association path is equal to the number of all directed logical edges on that path, i.e., the number of semantic hops from the starting topological node to the ending topological node. Generally, a shorter path means a more direct semantic derivation from the known entity to the target answer, and reducing intermediate steps helps reduce the probability of semantic deviation or irrelevant interference introduced by multiple indirect associations. Therefore, the value of the path length factor is inversely related to the number of object attributes: the fewer the number of object attributes, the better the value of the path length factor. Taking two acyclic multi-hop ontology association paths in an air travel scenario as examples, the acyclic multi-hop ontology association path traversing the object attribute sequence "riding - belonging to the route - belonging to the airport" and the acyclic multi-hop ontology association path traversing the object attribute sequence "riding - having a flight crew - stationed at" both have the same path length factor because they both contain three object attributes. However, if there exists an acyclic multi-hop ontology association path containing only one object attribute, its path length factor will be superior to the former two. The path length factor quantifies the formal simplicity of the acyclic multi-hop ontology association path, providing evaluation data for the path topology dimension of structural scoring.
[0049] Preferably, the object attributes in the preset domain ontology have attribute feature information, including functional attribute identifiers, attribute names, and attribute annotation information. The functional attribute identifier indicates whether an object attribute is a functional attribute. In the preset domain ontology, a functional attribute signifies that the object attribute has a unique constraint on a specified domain; that is, for a given domain instance, the object attribute can be associated with at most one domain instance. This semantic characteristic means that when an acyclic multi-hop ontology association path contains a functional attribute, the intermediate or final result obtained by reasoning along that object attribute has stronger certainty because the object attribute will not lead the same starting point to multiple different goals. In the air travel scenario, the object attribute "taking a ride" is defined as a functional attribute, indicating that a passenger has a unique reference to the associated flight record set. Based on this, according to the functional attribute identifier of the object attribute corresponding to each directed logical edge contained in the acyclic multi-hop ontology association path, the number of functional attributes with unique constraints in the acyclic multi-hop ontology association path is identified, and then the functional attribute quantity factor is statistically derived. The more functional attributes there are, and the better the value of the functional attribute quantity factor, the stronger the determinism and compactness of the semantic inference of the acyclic multi-hop ontology association path.
[0050] Preferably, after obtaining the path coverage factor, path length factor, and functional attribute quantity factor, a comprehensive structural score is performed on each acyclic multi-hop ontology association path in the original candidate multi-hop ontology association path set based on these three factors. The structural score is executed by inputting the path coverage factor, path length factor, and functional attribute quantity factor into a designed weighted scoring function. This weighted scoring function assigns preset weight coefficients to each of the three factors to reflect the relative importance of different factors in the path selection process. For the air travel application scenario, since entity role constraints are often the core basis for judging user intent, the path coverage factor is usually set to a relatively high weight coefficient in the weighted scoring function; the path length factor is used to distinguish between acyclic multi-hop ontology association paths with similar coverage levels and is assigned a moderate weight coefficient; the functional attribute quantity factor serves as an enhancement to reflect path determinism and is assigned an auxiliary weight coefficient. The weighted scoring function outputs a quantitative structural score for each acyclic multi-hop ontology association path. The higher the structural score, the more the acyclic multi-hop ontology association path conforms to the preset constraints and semantic inference expectations of the user problem to be processed in terms of formal structure.
[0051] Preferably, based on the structural scoring results of each acyclic multi-hop ontology association path, a grouping and filtering operation is performed on the original candidate multi-hop ontology association path set to filter out a recommended multi-hop ontology association path list. The grouping and filtering process first sorts the structural scoring results by value, and then divides the acyclic multi-hop ontology association paths into high-scoring and low-scoring groups according to a preset recommendation threshold. The recommendation threshold can be set by selecting an absolute score threshold, or by retaining a certain number of top-ranking acyclic multi-hop ontology association paths (e.g., retaining the two with the highest structural scores). In the example of the air travel scenario, an acyclic multi-hop ontology association path passing through the object attribute sequence "riding - belonging to the route - belonging to the airport" and an acyclic multi-hop ontology association path passing through the object attribute sequence "riding - having an organization - stationed at" may have the same values for the path coverage factor and path length factor. In this case, the functional attribute quantity factor can play a further distinguishing role; if the two still have the same structural score, they are both included in the recommended multi-hop ontology association path list. After grouping and filtering, the acyclic multi-hop ontology association paths of low-scoring groups are discarded, while the acyclic multi-hop ontology association paths of high-scoring groups are output as a recommended multi-hop ontology association path list. This recommended multi-hop ontology association path list will serve as the input candidate set for the subsequent final review of the large language model. This achieves the preprocessing goal of significantly compressing the candidate size and retaining the optimal structural solution in a structured and quantifiable manner before sending the paths to the semantic final review.
[0052] Optionally, based on the path coverage factor, the path length factor, and the functional attribute quantity factor, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list, including: The path coverage factor, the path length factor, and the functional attribute quantity factor are weighted and quantified to generate a path structure score for acyclic multi-hop ontology association paths. Based on the scoring results of each path structure, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list.
[0053] Preferably, in the specific implementation of weighted quantization scoring and group filtering of the original candidate multi-hop ontology association path set in step 3, weighted quantization scoring is first performed on the path coverage factor, path length factor, and functional attribute quantity factor to generate a path structure score for each acyclic multi-hop ontology association path. These three factors characterize the quality of an acyclic multi-hop ontology association path at the formal structure level from different dimensions: the path coverage factor reflects the degree of response of the topological nodes traversed by the acyclic multi-hop ontology association path to the preset constraints in the user problem to be processed; the path length factor reflects the simplicity of the number of object attribute hops traversed by the acyclic multi-hop ontology association path; and the functional attribute quantity factor reflects the density of functional attributes with unique constraints contained in the acyclic multi-hop ontology association path. Since the dimensions and value distribution of the three factors may differ, the weighted quantization scoring does not directly add the original values of the three factors, but rather maps each factor to a comparable value space, multiplies it by the corresponding weight coefficient, and then sums them to obtain a comprehensive path structure score.
[0054] Preferably, in the weighted quantitative scoring execution phase, a preset weight coefficient is configured for the path coverage factor, path length factor, and functional attribute quantity factor, respectively. These three weight coefficients constitute a weight allocation scheme. The weight allocation scheme is based on the summarization of user intent expression patterns in application scenarios: In query scenarios such as air travel, which are dominated by entity roles, the entity role constraints carried in the user's question to be processed are often the core clues for determining path selection. Therefore, the weight coefficient of the path coverage factor is usually set to the maximum value among the three weight coefficients (e.g., 0.5), so that if an acyclic multi-hop ontology association path fails to cover the key starting ontology class in the preset constraints, even if it performs well on the other two factors, it is difficult to obtain a high path structure score result; the weight coefficient of the path length factor is set to a moderate value (e.g., 0.3) to distinguish between multiple acyclic multi-hop ontology association paths with similar coverage; the weight coefficient of the functional attribute quantity factor is set to an auxiliary value (e.g., 0.2) to play a role in the gain of path semantic determinism. The sum of the three weight coefficients is the upper limit, thereby making the quantitative proportional relationship of each factor's contribution clear and interpretable.
[0055] Preferably, after the weight allocation scheme is established, the weighted quantization scoring multiplies the three factor values of each acyclic multi-hop ontology association path by their corresponding weight coefficients, and then sums the three products to obtain the path structure score of the acyclic multi-hop ontology association path. Taking an acyclic multi-hop ontology association path in an air travel scenario that passes through the object attribute sequence "riding - belonging to the route - belonging to the airport" as an example, this path passes through passenger topology nodes, covering the passenger class in the preset constraints, so the path coverage factor can take a higher value; this path contains three object attributes, and the path length factor takes the corresponding value; this path contains a functional attribute "riding", and the functional attribute quantity factor takes the corresponding value. The weighted quantization scoring sums the three scaled factor values according to their weights to assign a comprehensive path structure score to the acyclic multi-hop ontology association path. The same calculation process is applied to each acyclic multi-hop ontology association path in the original candidate multi-hop ontology association path set, and finally generates a quantified and comparable path structure score for each path.
[0056] Preferably, after obtaining the path structure scores for each acyclic multi-hop ontology association path, the original candidate multi-hop ontology association path set is grouped and filtered based on these scores to select a recommended multi-hop ontology association path list. The first step in grouping and filtering is to sort all acyclic multi-hop ontology association paths in the original candidate multi-hop ontology association path set from highest to lowest according to their respective path structure scores, forming an ordered candidate path sequence. Based on this ordered sequence, a preset recommendation threshold is introduced as a dividing line. Acyclic multi-hop ontology association paths with path structure scores not lower than the recommendation threshold are assigned to the high-score group, while those with path structure scores lower than the recommendation threshold are assigned to the low-score group. The recommendation threshold can be set using an absolute score method, i.e., defining a fixed score line; if the path structure score reaches this line, it is retained. Alternatively, a relative ranking method can be used, i.e., retaining a preset number (e.g., two) of the top-ranked acyclic multi-hop ontology association paths in the ordered candidate path sequence and discarding the rest.
[0057] Preferably, during the grouping and filtering process, if multiple acyclic multi-hop ontology association paths have the same path structure score and happen to be near the boundary of the recommendation threshold, these paths with equal path structure scores are grouped together into the high-score group. This avoids losing semantic inference routes that are equally superior in terms of structure due to numerical truncation. For example, in the air travel scenario, an acyclic multi-hop ontology association path traversing the object attribute sequence "riding - belonging to the route - belonging to the airport" and an acyclic multi-hop ontology association path traversing the object attribute sequence "riding - having an organization - stationed at" may have the same values in the path coverage factor and path length factor. If the functional attribute quantity factor also fails to show a sufficient difference, the path structure scores of the two paths may be equal. In this case, both paths will be included in the high-score group, instead of being forcibly separated by the recommendation threshold. This inclusive handling of cases with equal scores maintains the objectivity of the structure scoring process and avoids arbitrary judgments that are either / or.
[0058] Preferably, the final output of group filtering is to define the set of acyclic multi-hop ontology association paths in the high-scoring group as the recommended multi-hop ontology association path list. Acyclic multi-hop ontology association paths in the low-scoring group are discarded from the current candidate solution space and will not proceed to the final review stage of the large language model. The size of the recommended multi-hop ontology association path list is usually much smaller than the original candidate multi-hop ontology association path set. The original candidate multi-hop ontology association path set may contain several to dozens of acyclic multi-hop ontology association paths after the path enumeration stage. After structural scoring and group filtering, the number of paths retained in the recommended multi-hop ontology association path list can be compressed to a small constant range (e.g., two to three). This compression process is not random elimination, but rather a formal structural-level selection based on the combined effect of path coverage factor, path length factor, and functional attribute quantity factor, achieved through weighted quantization scoring. The recommended multi-hop ontology association path list thus becomes the information carrier connecting the two stages of structural analysis and semantic final review. It inherits the formal constraints of the preset domain ontology and the semantic constraints of the user problem to be processed, and provides a candidate path input with controllable scale and better structure for the subsequent final review stage of the large language model. This avoids the increased selection burden and computational cost caused by directly exposing a large number of low-quality or irrelevant paths to the large language model.
[0059] Optionally, step 3 further includes: determining the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list; and mapping the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list in the original candidate multi-hop ontology association path set.
[0060] Preferably, after obtaining the recommended multi-hop ontology association path list through group filtering in step 3, the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list are further determined to provide sufficient semantic description material for the subsequent final review of the large language model. The attribute names and attribute annotation information originate from the attribute feature information of object attributes in the preset domain ontology. Each object attribute in the preset domain ontology is explicitly assigned an attribute name label and a text description used to explain the semantics of the object attribute, i.e., attribute annotation information. Each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list is formed by a series of directed logical edges connected end to end, and each directed logical edge uniquely corresponds to an object attribute in the preset domain ontology. Therefore, determining the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list is essentially extracting the attribute name label and attribute annotation information carried by each directed logical edge from the sequence of directed logical edges constituting each acyclic multi-hop ontology association path, forming a semantic annotation sequence corresponding to the topological structure of the acyclic multi-hop ontology association path.
[0061] Preferably, taking an acyclic multi-hop ontology association path within the recommended multi-hop ontology association path list in an air travel scenario as an example, the topological sequence of this acyclic multi-hop ontology association path is: passenger topological node via the "ride" directed logical edge to the flight topological node, then via the "belonging to route" directed logical edge to the route topological node, and finally via the "belonging to airport" directed logical edge to the airport topological node. In this acyclic multi-hop ontology association path, the attribute name of the object attribute "ride" corresponding to the "ride" directed logical edge is "ride", and the attribute annotation information is "passenger's flight record"; the attribute name of the object attribute "belonging to route" corresponding to the "belonging to route" directed logical edge is "belonging to route", and the attribute annotation information is "the route to which the flight belongs"; the attribute name of the object attribute "belonging to airport" corresponding to the "belonging to airport" directed logical edge is "belonging to airport", and the attribute annotation information is "the airport (destination) to which the route belongs". This application extracts the attribute names and attribute annotation information edge by edge, arranges them according to the order of appearance of the directed logical edges in the path, and obtains the attribute name sequence and attribute annotation information sequence bound to the path associated with the acyclic multi-hop ontology, so that the formal topological description of the path is transformed into a set of semantic text fragments that can be directly read and understood by large language models.
[0062] Preferably, after determining the attribute names and attribute annotation information corresponding to each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list, step 3 further performs an association mapping operation, that is, mapping the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list in the original candidate multi-hop ontology association path set. This association mapping refers to establishing an explicit index correspondence between the recommended multi-hop ontology association path list and its source path, ensuring that each path in the recommended multi-hop ontology association path list can accurately backtrack to the corresponding acyclic multi-hop ontology association path in the original candidate multi-hop ontology association path set, and completely inheriting the attribute names and attribute annotation information already attached to that original path during the enumeration phase. This association mapping is necessary because during the path enumeration phase, each acyclic multi-hop ontology association path in the original candidate multi-hop ontology association path set has already collected corresponding attribute name labels and attribute annotation information from the directed logical edges of the inter-class adjacency graph at the beginning of its generation. These semantic description materials are stored along with the path in the original candidate multi-hop ontology association path set. After the grouping and filtering process selects the recommended multi-hop ontology association path list, the association mapping operation avoids re-querying the attributes of the inter-class adjacency graph. Instead, it directly retrieves the encapsulated attribute names and attribute annotation information of the corresponding path from the original candidate multi-hop ontology association path set, achieving seamless transfer of semantic information.
[0063] Preferably, the association mapping can be implemented using a path identifier matching method. During the path enumeration phase, each acyclic multi-hop ontology association path in the original candidate multi-hop ontology association path set is assigned a unique path identifier. This path identifier uniquely identifies the path within the original candidate multi-hop ontology association path set and is bound and stored with the path's topological node sequence, directed logical edge sequence, attribute name sequence, and attribute annotation information sequence. When the group filtering stage selects a recommended multi-hop ontology association path list from the original candidate multi-hop ontology association path set, what is retained is essentially a list of identifiers composed of the selected path identifiers. The association mapping operation uses this identifier list as an index to search for the complete path data record corresponding to each path identifier in the storage space of the original candidate multi-hop ontology association path set, extracts the previously cached attribute names and attribute annotation information for that path, and attaches them to the corresponding path entry in the recommended multi-hop ontology association path list. This path identifier-based association mapping mechanism not only reduces the overhead of repeated attribute queries, but more importantly, it ensures that the semantic description information of each path remains consistent throughout the entire process from path enumeration to structure scoring and group filtering, and that attribute names or attribute annotation information are not misaligned, omitted, or versioned due to the switching of stages.
[0064] Preferably, after the association mapping is completed, each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list possesses both formal topological structure information and semantic attribute description information. These two types of information together constitute a complete information package for a path that can be semantically understood by a large language model. The formal topological structure information is reflected in the sequence of topological nodes and directed logical edges traversed by the path, while the semantic attribute description information is reflected in the sequence of attribute names and attribute annotation information that unfolds hop by hop along the path. These two types of information complement each other: the topological structure information informs the large language model which ontology classes the path passes through at the conceptual level and which object attribute connections are used; the attribute names and attribute annotation information clarify the specific semantic meaning of each hop to the large language model in the form of natural language text. By equipping each path in the recommended multi-hop ontology association path list with a semantic description sequence of such attribute names and attribute annotation information, this application provides directly embeddable text materials for the subsequent steps of structurally assembling the original text features of the user question to be processed, the recommended multi-hop ontology association path list, and the corresponding attribute annotation information to form the final review prompt words of the large language model. This avoids the problem of the large language model making semantic assumptions based solely on object attribute names and lacking explanatory context.
[0065] In summary, this application determines the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list and performs association mapping, which is equivalent to building a bridge for lossless information transfer between the quantitative optimization in the structural scoring stage and the semantic optimization in the final review stage of the large language model. In traditional schemes, once the structural scoring of the path selection is completed, only the skeleton identifier or brief number of the path is usually output to the subsequent stages. The subsequent stages need to query separately to obtain the semantic interpretation of the path. This process is prone to information attenuation or query misalignment. However, this application, by using association mapping as a continuation of group filtering in step 3, ensures that the paths in the selected recommended multi-hop ontology association path list not only perform better in structural scoring, but also that each path has its own attribute name sequence and attribute annotation information sequence that accurately correspond to its topological structure. This allows the structural optimization results and semantic description materials of the path to enter the semantic final review stage as a complete combination, providing an information foundation for improving the selection accuracy and interpretability of the final review stage of the large language model.
[0066] Optionally, in step 4, the large language model semantic decision prompts are generated by combining the recommended multi-hop ontology association path list, and then the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology is determined based on the large language model semantic decision prompts, including: The original text features, the recommended multi-hop ontology association path list, and the attribute names and attribute annotation information of the association mapping are structurally encapsulated to form semantic decision prompt words for a large language model containing semantic discrimination instructions. The semantic decision prompts of the large language model are input into the preset large language model. The preset large language model is used to perform semantic matching calculations on the attribute names and attribute annotation information of the original text features and the association mapping of each acyclic multi-hop ontology association path to determine the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology.
[0067] Preferably, in the initial stage of step 4, the original text features, the recommended multi-hop ontology association path list, and the attribute names and attribute annotation information of the association mapping are first structurally encapsulated to form semantic decision prompts for a large language model containing semantic discrimination instructions. Here, the original text features are the natural language text itself extracted from the user question to be processed, used to represent the user's query intent, such as "passenger". The complete question string is "Which cities has Yao visited?". The recommended multi-hop ontology association path list is the set of acyclic multi-hop ontology association paths that perform better in terms of formal structure, retained after step 3 through weighted quantitative scoring and grouping filtering using path coverage factor, path length factor, and functional attribute quantity factor. The attribute names and attribute annotation information of the association mapping are semantic description materials inherited from the original candidate multi-hop ontology association path set in step 3 through path identifier matching. The attribute names and attribute annotation information of the association mapping explain the specific meaning of the object attribute corresponding to the directed logical edge of each acyclic multi-hop ontology association path hop by hop. The structured encapsulation action integrates these three types of information from different sources into a text that conforms to the preset large language model input specification, namely, the large language model semantic decision prompt words.
[0068] Preferably, during the structured encapsulation process, the internal organization format of the semantic decision prompts in the large language model follows a logical hierarchy of first stating the task background, then listing candidate options, and finally providing output constraints. Taking the user problem to be processed in the air travel scenario, "passengers..." as an example... Taking "Which cities has Yao visited?" as an example, the text content of the semantic decision prompt words of the structured encapsulated large language model can be constructed as follows: First, it begins with a role setting and task description, informing the preset large language model that it acts as an ontology query path selection assistant and needs to select the semantically most matching path from the candidate acyclic multi-hop ontology association paths based on the user question to be processed; then, the original text features are used as "User question: traveler..." The phrase "Which cities has Yao visited?" is embedded into the semantic decision prompts of the large language model, allowing the pre-defined large language model to clearly define the original form of the user's question. Then, each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list, along with its associated attribute names and attribute annotations, is sequentially expanded. Each acyclic multi-hop ontology association path is described by a path identifier and a topological sequence of jumps from the starting topological node through various object attributes to the ending topological node. Simultaneously, the attribute name and attribute annotation information corresponding to the object attribute are appended next to each jump, for example, "Path A: Passenger topological node passes through object attribute..." The process proceeds from the object's attribute 'passenger's flight record' to the flight topology node, then through the object's attribute 'belongs to a route' (the attribute annotation is 'the route to which the flight belongs') to the route topology node, and finally through the object's attribute 'belongs to an airport' (the attribute annotation is 'the airport to which the route belongs, i.e., the destination') to the airport topology node. It concludes with a clear output format instruction, requiring the pre-defined large language model to return only structured results containing the selected path identifier, such as "Please return only JSON format; if path A is selected, return {"preferred_path": "A"}". Through this hierarchical assembly method, the large language model's semantic decision prompt simultaneously carries the user's intent, the topological information of the candidate acyclic multi-hop ontology association path, the semantic interpretation of the candidate acyclic multi-hop ontology association path, and the task execution specification, forming a self-contained semantic decision input package.
[0069] Preferably, after the text of the semantic decision prompts for the large language model is constructed, step 4 inputs the semantic decision prompts for the large language model into the preset large language model. The preset large language model refers to a large neural network model that has been pre-trained and has the ability to understand natural language and generate text. Its internal parameters have been solidified through training on a large-scale corpus and it can perform inference and selection operations based on the semantic content of the input text. After the semantic decision prompts for the large language model are sent to the input interface of the preset large language model, the preset large language model does not simply perform string matching or keyword retrieval, but performs deep semantic encoding on all the text content in the semantic decision prompts for the large language model. It performs semantic matching calculations on the user query intent expressed in the original text features and the attribute names and attribute annotation information associated with each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list. The essence of this semantic matching calculation is that the pre-defined large language model measures the distance or similarity between the semantic vector of the user question to be processed and the semantic description vector of each candidate acyclic multi-hop ontology association path in its own semantic representation space, so as to determine which acyclic multi-hop ontology association path describes the inference chain between concepts that best matches the query intent of the user question to be processed in terms of common sense and context.
[0070] Preferably, when the pre-defined large language model performs semantic matching calculations, its reasoning is mainly based on the common-sense contextual knowledge contained in the attribute annotation information and the semantic direction of the relationship between concepts indicated by the attribute names. Taking two acyclic multi-hop ontology association paths in the recommended multi-hop ontology association path list in the air travel scenario as examples, the attribute annotation information sequence of the association mapping of path A is "passenger's flight record - flight route - airport (destination) of the route". This series of attribute annotation information indicates to the preset large language model that the semantic inference logic of this acyclic multi-hop ontology association path starts with the passenger's flight behavior, goes through the flight route, and finally reaches the destination airport of the route. The airport obtained directly corresponds to the city that the passenger actually travels to. The attribute annotation information sequence of the association mapping of path B is "passenger's flight record - crew members who operate the flight - airport where the crew members are stationed". This series of attribute annotation information indicates to the preset large language model that the semantic inference logic of this acyclic multi-hop ontology association path is to associate the passenger's flight with the crew members who operate the flight, and then use the airport where the crew members are stationed as the endpoint. The airport where the crew members are stationed and the destination airport of the flight they operate may be two different locations. The pre-defined large language model is based on the semantic understanding of the attribute annotation information sequence of the two sets of association mappings. Combined with the common-sense premise of "the actual destination of the traveler" implied in the user question "which cities have been visited", after semantic matching calculation, it will determine that the semantic derivation process described by path A matches the query intent of the user question more closely. Thus, path A is identified as the semantically superior acyclic multi-hop ontology association path.
[0071] Preferably, the output constraint part of the semantic decision prompt of the large language model imposes strict structural restrictions on the output format of the preset large language model, requiring the preset large language model to return only a structured return result containing the selected path identifier, rather than generating a free-form explanatory text. This design is not merely for simplifying parsing, but has a deeper technical purpose: in the multi-hop ontology association path selection task, the role of the preset large language model is limited to making a selection judgment from the set of candidate acyclic multi-hop ontology association paths after structural scoring, rather than generating a path from scratch. Once the preset large language model is allowed to freely output text, it may fabricate an object attribute or acyclic multi-hop ontology association path that does not exist in the preset domain ontology based on its own parameter distribution, i.e., generating an "illusory" path. By constructing the task as a single selection from the labeled candidate acyclic multi-hop ontology association paths, and forcing the preset large language model to return only the path identifier at the level of the semantic decision prompt of the large language model, this application fundamentally eliminates the technical risk of the preset large language model generating an unexecutable acyclic multi-hop ontology association path.
[0072] Preferably, after the preset large language model completes semantic matching calculation and outputs structured return results, step 4 parses the structured return results to obtain the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology. The format of the structured return results can be a preset key-value pair text, such as {“preferred_path”: “A”}. The parsing action is to extract the selected path identifier from the structured return result text. Based on the selected path identifier, the corresponding acyclic multi-hop ontology association path is backtracked in the recommended multi-hop ontology association path list. This acyclic multi-hop ontology association path is the finally determined semantic topological constraint multi-hop association path. Because this acyclic multi-hop ontology association path has undergone topological traversal based on inter-class adjacency graphs in step 2, weighted quantitative scoring and grouping filtering based on path coverage factor, path length factor, and functional attribute quantity factor in step 3, and semantic verification and common sense selection by the pre-set large language model in step 4, this acyclic multi-hop ontology association path simultaneously satisfies three constraints: First, topological validity, meaning that every object attribute on this acyclic multi-hop ontology association path is truly defined in the pre-set domain ontology; second, structural optimization, meaning that this acyclic multi-hop ontology association path performs well in terms of path coverage factor, path length factor, and functional attribute quantity factor; and third, semantic fit, meaning that the semantic interpretation described by the attribute annotation information of this acyclic multi-hop ontology association path highly matches the query intent of the user question to be processed. It is the combined effect of these three constraints that enables the finally determined semantic topological constraint multi-hop association path to accurately guide the subsequent query plan construction, transforming the user question to be processed into a structured query operation that can be actually executed and corresponds to the pre-set domain ontology.
[0073] Optionally, determining the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology includes: The structured response text is generated based on the semantic matching calculation result using the preset large language model. The structured response text contains a preferred multi-hop ontology association path identifier, which is used to indicate the multi-hop ontology association path for the user question to be processed that has a semantic mapping relationship with the features of the original text. The structured response text is parsed to extract the preferred multi-hop ontology association path identifier; Based on the preferred multi-hop ontology association path identifier, the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology is determined.
[0074] Preferably, in step 4, when determining the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology, the preset large language model first generates a structured response text based on the semantic matching calculation results. This structured response text contains the preferred multi-hop ontology association path identifier. In the preceding steps, the preset large language model has received the semantic decision prompt words from the large language model and performed semantic matching calculations on the user query intent expressed by the original text features and the attribute names and attribute annotation information associated with each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list. It has completed the similarity measurement between the semantic vector of the user question and the semantic description vector of each candidate path in its own semantic representation space. Based on the result of this semantic matching calculation, the preset large language model selects the acyclic multi-hop ontology association path with the highest semantic matching degree from the recommended multi-hop ontology association path list, and uses the path identifier of this acyclic multi-hop ontology association path as the preferred multi-hop ontology association path identifier, encapsulating it in a structured response text that conforms to the preset output format.
[0075] Preferably, the format of the structured response text is clearly defined in the output constraints of the semantic decision prompts of the large language model. The preset large language model strictly adheres to these output constraints when generating the structured response text, outputting only the selected path identifiers in a preset key-value pair format, without any additional explanatory text or freely generated descriptive statements. Taking an air travel scenario as an example, when the recommended multi-hop ontology association path list includes path A (i.e., the passenger topology node travels through the object attribute "rides" to the flight topology node, then through the object attribute "belongs to the route" to the route topology node, and finally through the object attribute "belongs to the airport" to the airport topology node) and path B (i.e., the passenger topology node travels through the object attribute "rides" to the flight topology node, then through the object attribute "has a crew" to the crew member topology node, and finally through the object attribute "stationed at" to the airport topology node), the preset large language model, after semantic matching calculation, determines that path A semantically matches the user question to be processed, "passenger..." If the question "Which cities has Yao visited?" is a more suitable match, then the structured response text generated by the pre-defined large language model will be {"preferred_path": "A"}, where "preferred_path" is the pre-defined key name, and "A" is the identifier of the preferred multi-hop ontology association path. This structured response text has a concise format and clear meaning, containing only one key-value pair. The key name indicates the semantic meaning of the returned value, and the key value directly points to the selected acyclic multi-hop ontology association path.
[0076] Preferably, after the pre-defined large language model generates structured response text, step 4 performs text parsing on the structured response text to extract the preferred multi-hop ontology association path identifier contained therein. The text parsing action is performed according to the pre-defined format of the structured response text: since the output constraint part of the semantic decision prompt words of the large language model has already clearly defined the format of the structured response text, this application parses the text content according to the corresponding parsing rules after receiving the structured response text. The specific execution method of the parsing rules can be as follows: if the pre-defined format of the structured response text is in JSON key-value pair form, then the corresponding JSON parsing logic is called to read the key value corresponding to the key name "preferred_path", thereby extracting the preferred multi-hop ontology association path identifier. Taking the structured response text {"preferred_path": "A"} returned by the pre-defined large language model in the air travel scenario as an example, the text parsing process is to locate the key name "preferred_path" in the text and read its corresponding key value "A", which is the extracted preferred multi-hop ontology association path identifier. This accurate parsing method based on a preset format avoids the uncertainty introduced by fuzzy matching or intent inference from free text, making the process from the output of the preset large language model to the acquisition of path identifiers highly repeatable and deterministic.
[0077] Preferably, after extracting the preferred multi-hop ontology association path identifier through text parsing, step 4 backtracks through the recommended multi-hop ontology association path list based on this preferred multi-hop ontology association path identifier to determine the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology. Each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list has been assigned a unique path identifier in the grouping filtering and association mapping stages of step 3, and the preferred multi-hop ontology association path identifier is one of them. The backtracking process uses the preferred multi-hop ontology association path identifier as the index key to perform an accurate match in the recommended multi-hop ontology association path list, locating the acyclic multi-hop ontology association path whose identifier is completely consistent with the preferred multi-hop ontology association path identifier. This matched acyclic multi-hop ontology association path is the finally determined semantic topological constraint multi-hop association path. For example, in the air travel scenario, if the extracted preferred multi-hop ontology association path is identified as "A", then the recommended multi-hop ontology association path list will search for the acyclic multi-hop ontology association path identified as "A". That is, the passenger topology node goes through the object attribute "riding" to the flight topology node, then through the object attribute "belongs to the route" to the route topology node, and finally through the object attribute "belongs to the airport" to the airport topology node. This acyclic multi-hop ontology association path is then identified as the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology.
[0078] Preferably, this determination mechanism based on structured response text parsing and path identifier matching embodies, in its technical essence, the final closed loop of the hybrid intelligent selection mechanism of "algorithm recommendation and large language model decision-making" in this application. From the perspective of the upstream and downstream relationships of the technical process, the recommended multi-hop ontology association path list is generated by the weighted quantitative scoring and group filtering in step 3. Each acyclic multi-hop ontology association path within it already has the basis for selection at the formal structural level. The role assigned to the preset large language model in step 4 is to further identify these candidate paths that have been proven to be superior at the semantic level. The identification results are transmitted outward through the preferred multi-hop ontology association path identifier in the structured response text. The text parsing and path identifier backtracking search in step 4 accurately maps the semantic identification results of the preset large language model back to the conceptual space of the preset domain ontology, and finally locks a semantic topological constraint multi-hop association path that is topologically valid, structurally superior, and semantically adapted. This mechanism differs from the approach of directly allowing the pre-defined large language model to output the complete path text. It strictly limits the output of the pre-defined large language model to selecting identifiers from the verified candidate set. This fully utilizes the advantages of the pre-defined large language model in common sense reasoning and contextual understanding, while completely avoiding the technical risks of the pre-defined large language model generating object attributes or acyclic multi-hop ontology association paths that do not exist in the pre-defined domain ontology.
[0079] Preferably, the final determined semantic topological constraint multi-hop association path can then be passed to the downstream query plan construction stage as the topological basis for transforming natural language problems into structured query statements. Since each object attribute is precisely defined in the preset domain ontology, and the semantic meaning of each object attribute has been verified at the common-sense level through attribute annotation information in the semantic matching calculation process of the preset large language model, the downstream query plan construction stage no longer needs to perform secondary verification of the path's legality or semantic adaptability. It can directly generate an executable query plan based on the topological node sequence and directed logical edge sequence specified by the semantic topological constraint multi-hop association path. Taking the air travel scenario as an example, the final determined semantic topological constraint multi-hop association path is: passenger topological node via object attribute "ride" to flight topological node, then via object attribute "belongs to route" to route topological node, and finally via object attribute "belongs to airport" to airport topological node. The subsequent query plan construction stage can then generate the corresponding structured query based on this, starting from the known entity " Starting with "Yao", the system queries the flight records of the object based on the "riding" attribute, determines the corresponding flight route based on the "belonging to the route" attribute, and finally obtains the destination airport of the route based on the "belonging to the airport" attribute. Then, it extracts the city attribute of the airport as the answer and returns it to the user, completing the closed loop from natural language question to final answer.
[0080] Optionally, determining the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the preferred multi-hop ontology association path identifier includes: Based on the preferred multi-hop ontology association path identifier, the final semantically preferred multi-hop ontology association path is selected from the recommended multi-hop ontology association path list; Based on semantically optimized multi-hop ontology association paths, a semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology is generated. Based on semantic topological constraints and multi-hop association paths, a structured query plan is constructed for the user problem to be processed.
[0081] Preferably, in step 4, when determining the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the preferred multi-hop ontology association path identifier, the final semantically preferred multi-hop ontology association path is first selected from the list of recommended multi-hop ontology association paths based on the preferred multi-hop ontology association path identifier. In the preceding steps, the preset large language model has already determined the acyclic multi-hop ontology association path with the highest semantic matching degree from the list of recommended multi-hop ontology association paths through semantic matching calculation, and encapsulated the path identifier of this acyclic multi-hop ontology association path as the preferred multi-hop ontology association path identifier in the structured response text for output. After text parsing, the preferred multi-hop ontology association path identifier has been extracted. At this point, using the preferred multi-hop ontology association path identifier as the index key, an accurate matching search is performed in the recommended multi-hop ontology association path list. Each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list has been assigned a path identifier in the grouping and filtering stage of step 3. The matching search action is to compare the preferred multi-hop ontology association path identifier with the path identifiers of each acyclic multi-hop ontology association path in the recommended multi-hop ontology association path list one by one, and locate the acyclic multi-hop ontology association path whose path identifier is completely consistent with the preferred multi-hop ontology association path identifier. The located acyclic multi-hop ontology association path is the final semantically preferred multi-hop ontology association path. Taking the air travel scenario as an example, if the preferred multi-hop ontology association path is identified as "A", then the list of recommended multi-hop ontology association paths will search for the acyclic multi-hop ontology association path identified as "A". That is, the passenger topology node goes through the object attribute "riding" to the flight topology node, then through the object attribute "belonging to the route" to the route topology node, and finally through the object attribute "belonging to the airport" to the airport topology node. This acyclic multi-hop ontology association path is then selected as the semantically preferred multi-hop ontology association path.
[0082] Preferably, after selecting the semantically optimized multi-hop ontology association path, a semantically topologically constrained multi-hop association path corresponding to the user problem to be processed in the preset domain ontology is generated based on this semantically optimized multi-hop ontology association path. The semantically optimized multi-hop ontology association path itself is a complete acyclic multi-hop ontology association path, which contains a sequence of topological nodes from the starting topological node to the ending topological node and a sequence of directed logical edges connecting these topological nodes. Each directed logical edge uniquely corresponds to an object attribute in the preset domain ontology, and the attribute name and attribute annotation information of the object attribute have been carried along with the path through the association mapping operation in step 3. The semantically optimized multi-hop ontology association path is directly output as the semantically topologically constrained multi-hop association path. The semantically topologically constrained multi-hop association path is completely consistent with the semantically optimized multi-hop ontology association path in terms of formal structure, but it is given an additional role in technical semantics: the semantically topologically constrained multi-hop association path signifies that this multi-hop path selection method has completed the complete mapping from the user's natural language problem to a legal, better, and semantically adapted derivation path in the preset domain ontology concept space throughout the entire process. In the context of air travel, a semantic topological constraint multi-hop association path is as follows: the starting topological node is the passenger topological node, which sequentially travels through the directed logical edge "riding" to the flight topological node, through the directed logical edge "belonging to the route" to the route topological node, and through the directed logical edge "belonging to the airport" to the ending topological node, the airport topological node. The sequence of attribute annotation information carried by this semantic topological constraint multi-hop association path is "passenger's flight record - flight route - airport (destination) of the route".
[0083] Preferably, after generating a semantic topological constraint multi-hop association path, a structured query plan for the user problem to be processed is constructed based on this semantic topological constraint multi-hop association path. The semantic topological constraint multi-hop association path provides an accurate topological basis for the construction of the structured query plan: the sequence of topological nodes on the semantic topological constraint multi-hop association path indicates the classes in the preset domain ontology that need to be accessed sequentially during the query execution process, and the sequence of directed logical edges indicates the object attributes that need to be used in each step of access. The alternating arrangement of topological nodes and directed logical edges naturally constitutes a query step template that hops from known entities to the target answer. The action of constructing the structured query plan is to transform the abstract derivation logic expressed by the semantic topological constraint multi-hop association path into a sequence of specific query statements that conform to the query language syntax corresponding to the preset domain ontology and can be directly executed at the data level. Taking the air travel scenario as an example, the topology node sequence of the semantic topology-constrained multi-hop association path is passenger topology node, flight topology node, route topology node, and airport topology node, and the directed logical edge sequence is object attribute "riding", object attribute "belonging to route", and object attribute "belonging to airport". Then the construction process of the structured query plan is as follows: First, based on the known entity " Starting with "Yao", the system queries the set of flight instances associated with the individual passenger along the object attribute "riding". The second step involves querying the flight instance set obtained in the first step, along the object attribute "belongs to a route", to find the route instance to which the flight instance belongs. The third step involves querying the destination airport instance to which the route instance points along the object attribute "belongs to an airport". The fourth step involves extracting the city attribute value of the airport instance obtained in the third step, which will be used as the user question to be processed: "Passenger". Candidate values for the answer to "Which cities has Yao visited?"
[0084] Preferably, the construction process of the structured query plan does not mechanically translate each hop on the semantic topological constraint multi-hop association path into an isolated query. Instead, it organizes each hop query into a sequence of query steps with data dependencies according to the topological order of the semantic topological constraint multi-hop association path. The intermediate result set output by the previous query serves as the input constraint condition for the next query, thus forming a complete data pipeline from the known entity to the target answer. Taking the structured query plan in the air travel scenario as an example, the set of flight instances output by the first query is passed to the second query in the form of variable binding, serving as the input starting point for the object attribute "belongs to the route" in the second query; the set of route instances output by the second query is then passed to the third query in the same way, serving as the input starting point for the object attribute "belongs to the airport". This query transmission mechanism based on the topological sequence ensures that the execution path of the structured query plan at the data level is completely consistent with the derivation logic of the semantic topological constraint multi-hop association path at the conceptual level, without any distortion of query semantics or omission of steps.
[0085] Preferably, the attribute annotation information carried by the semantic topology constraint multi-hop association path is not idle during the construction of the structured query plan, but is used as metadata for verification and explanation. While constructing the structured query plan, the attribute name and attribute annotation information of the object attribute at each step of the semantic topology constraint multi-hop association path can be embedded as annotation fields into the query plan, or recorded in log form. This allows maintenance personnel or system debuggers to clearly trace the ontological semantic basis upon which each query step is based when the structured query plan is executed subsequently. For example, in a structured query plan for an air travel scenario, the first query can include the annotation "Query along the object attribute 'ride' (attribute annotation information: passenger flight records)". The first step, "Yao's flight," can be followed by a query with the annotation "Search the flight's route along the object's attribute 'belongs to route' (attribute annotation information: the route to which the flight belongs)." The second step, "Search the destination airport of the route along the object's attribute 'belongs to airport' (attribute annotation information: the airport to which the route belongs, i.e., the destination)." This method of binding semantic descriptions with query operations gives the structured query plan high interpretability and debuggability. When query results are abnormal, the annotation information can be used to quickly locate whether there is a problem in the semantic inference process.
[0086] Preferably, once the structured query plan is executed, its execution result is the final answer to the user question to be processed. From a global perspective of the technical process, the method of this application completes a complete automated reasoning chain from natural language question text to the final answer. First, step 1 extracts entities and parses query targets for the user question to be processed, determining the initial ontology class set and the target ontology class. Then, step 2 enumerates the original candidate multi-hop ontology association path set on the inter-class adjacency graph constructed from the preset domain ontology. Subsequently, step 3 performs multi-factor structural scoring and group filtering on the original candidate multi-hop ontology association path set, selecting a recommended multi-hop ontology association path list and completing the association mapping of attribute names and attribute annotation information. Then, step 4 assembles the recommended multi-hop ontology association path list with the original text features and attribute annotation information into semantic decision prompts for the large language model, which is then submitted to the preset large language model for semantic final review. The semantic topological constraint multi-hop association path is determined through parsing of the structured response text and matching and backtracking of path identifiers. Finally, a structured query plan is constructed based on the semantic topological constraint multi-hop association path and executed to obtain the answer. In this entire process, the formal constraints of the pre-defined domain ontology ensure the legality and executability of the candidate paths, the multi-factor structural scoring realizes the formal optimization of the candidate paths, and the semantic final review of the pre-defined large language model injects the judgment ability of common sense and contextual dimensions into the path selection. The three cooperate with each other and are linked together to form a hybrid intelligent selection mechanism of "algorithm recommendation and large language model decision-making", which is different from the traditional path selection schemes that rely solely on graph algorithms or solely on language models.
[0087] like Figure 2 As shown, this is a hybrid path selection device combining multi-hop path enumeration and LLM final review according to an embodiment of this application, which includes: The first program unit is used to identify known entities in the user question to be processed and to determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed. The second program unit is used to extract global candidate ontology classes and object attributes from a preset domain ontology to generate a set of original candidate multi-hop ontology association paths that reflect the potential association between known entities in the user question to be processed and the answer represented by the target ontology class. The third program unit is used to determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and to group and filter the original candidate multi-hop ontology association path set to filter out a recommended multi-hop ontology association path list. The fourth program unit is used to extract original text features reflecting the user's query intent from the user question to be processed, and to generate semantic decision prompts for a large language model in conjunction with the recommended multi-hop ontology association path list. Then, based on the semantic decision prompts for a large language model, the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology is determined.
[0088] like Figure 3 The image shows an electronic device that includes a processor and a memory. The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the functions of each module of the device described in the embodiments of this application, or implements the steps of the method described.
[0089] Figures 2-3 For an exemplary description, please refer to the above. Figure 1 This will not be elaborated upon here.
Claims
1. A hybrid path selection method combining multi-hop path enumeration and LLM final review, characterized in that, include: Step 1: Identify known entities in the user question to be processed and determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed; Step 2: Extract global candidate ontology classes and object attributes from the preset domain ontology to generate a set of original candidate multi-hop ontology association paths that reflect the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class; Step 3: Determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and then group and filter the original candidate multi-hop ontology association path set to select a recommended multi-hop ontology association path list. Step 4: Extract the original text features reflecting the user's query intent from the user question to be processed, and generate semantic decision prompts for the large language model in conjunction with the recommended multi-hop ontology association path list. Then, determine the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the semantic decision prompts for the large language model.
2. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 1, characterized in that, Step 1: Identify known entities in the user question to be processed and determine the target ontology class in the preset domain ontology corresponding to the answer requested by the user question to be processed, including: Entity extraction is performed on the user problem to be processed to identify known entities in the user problem to be processed and their respective starting ontology classes, and the identified starting ontology classes are mapped to starting nodes; The query target parsing of the user question to be processed is performed to determine the target ontology class corresponding to the answer requested by the user question in the preset domain ontology and to map the target ontology class as the termination node. The preset domain ontology includes global candidate ontology classes that reflect the domain knowledge structure and object attributes that reflect the logical association between the global candidate ontology classes. The starting ontology class is a subset of the global candidate ontology classes.
3. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 2, characterized in that, Step 2: Extract global candidate ontology classes and object attributes from the preset domain ontology to generate a set of original candidate multi-hop ontology association paths that reflect the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class, including: Map the extracted global candidate ontology classes to topology nodes; Logical edges connecting topological nodes are constructed using the extracted object attributes, thereby forming an inter-class adjacency graph that reflects the topological relationships between concepts within the preset domain. Based on the inter-class adjacency graph, a set of original candidate multi-hop ontology association paths is generated, reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class.
4. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 3, characterized in that, Based on the inter-class adjacency graph, a set of original candidate multi-hop ontology association paths is generated, reflecting the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class, including: A topological traversal is performed on the inter-class adjacency graph to search for candidate multi-hop ontology association paths connecting the starting node and the ending node; Acyclic multihop ontology association paths are enumerated among the candidate multihop ontology association paths, and then aggregated to generate an original set of candidate multihop ontology association paths that reflects the potential associations between known entities in the user question to be processed and the answers represented by the target ontology class.
5. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 4, characterized in that, The object attributes have attribute feature information, which includes function attribute identifiers, attribute names, and attribute annotation information; Step 3: Determine acyclic multi-hop ontology association paths from the original candidate multi-hop ontology association path set, and group and filter the original candidate multi-hop ontology association path set to filter out a recommended multi-hop ontology association path list, including: Semantic parsing is performed on the user problem to be processed to extract the limiting requirements in the user problem to be processed, excluding the known entities, and these requirements are determined as preset constraints. Calculate the coverage of the acyclic multi-hop ontology association path to the preset constraints to determine the path coverage factor; Determine the object attributes and their number contained in the acyclic multi-hop ontology association path in order to determine the path length factor; Based on the functional attribute identifiers corresponding to the object attributes contained in the acyclic multi-hop ontology association path, the number of functional attributes with unique constraints in the acyclic multi-hop ontology association path is identified, and then the functional attribute quantity factor is determined. Based on the path coverage factor, the path length factor, and the functional attribute quantity factor, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list.
6. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 5, characterized in that, Based on the path coverage factor, the path length factor, and the functional attribute quantity factor, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list, including: The path coverage factor, the path length factor, and the functional attribute quantity factor are weighted and quantified to generate a path structure score for acyclic multi-hop ontology association paths. Based on the scoring results of each path structure, the original candidate multi-hop ontology association path set is grouped and filtered to select a recommended multi-hop ontology association path list.
7. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 6, characterized in that, Step 3 further includes: determining the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list; and associating and mapping the attribute names and attribute annotation information corresponding to the recommended multi-hop ontology association path list in the original candidate multi-hop ontology association path set.
8. The hybrid path selection method combining multi-hop path enumeration and LLM final review according to claim 7, characterized in that, Step 4 involves generating semantic decision prompts for a large language model by combining the recommended multi-hop ontology association path list, and then determining the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the semantic decision prompts for the large language model, including: The original text features, the recommended multi-hop ontology association path list, and the attribute names and attribute annotation information of the association mapping are structurally encapsulated to form semantic decision prompt words for a large language model containing semantic discrimination instructions. The semantic decision prompts of the large language model are input into the preset large language model. The preset large language model is used to perform semantic matching calculations on the attribute names and attribute annotation information of the original text features and the association mapping of each acyclic multi-hop ontology association path to determine the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology.
9. The hybrid path selection method combining multi-hop path enumeration and LLM final review as described in claim 8, characterized in that, Determining the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology includes: The structured response text is generated based on the semantic matching calculation result using the preset large language model. The structured response text contains a preferred multi-hop ontology association path identifier, which is used to indicate the multi-hop ontology association path for the user question to be processed that has a semantic mapping relationship with the features of the original text. The structured response text is parsed to extract the preferred multi-hop ontology association path identifier; Based on the preferred multi-hop ontology association path identifier, the semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology is determined.
10. The hybrid path selection method combining multi-hop path enumeration and LLM final review according to claim 9, characterized in that, Determining the semantic topological constraint multi-hop association path corresponding to the user question to be processed in the preset domain ontology based on the preferred multi-hop ontology association path identifier includes: Based on the preferred multi-hop ontology association path identifier, the final semantically preferred multi-hop ontology association path is selected from the recommended multi-hop ontology association path list; Based on semantically optimized multi-hop ontology association paths, a semantic topological constraint multi-hop association path corresponding to the user problem to be processed in the preset domain ontology is generated. Based on semantic topological constraints and multi-hop association paths, a structured query plan is constructed for the user problem to be processed.