Long text retrieval and reasoning method and device

By converting long text data into a multi-dimensional hierarchical knowledge base and designing an agent cognitive structure strategy, the problems of high resources, limited window and insufficient intelligence in existing technologies are solved, and efficient and flexible long text retrieval and reasoning are achieved.

CN120631932APending Publication Date: 2025-09-12PAZHOU LAB (HUANGPU) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510701793.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies have high computing resource requirements, limited context windows, memory decay, lack of intelligent decision-making and in-depth reasoning capabilities in long text retrieval and reasoning, and fail to fully utilize the structural information of long texts, making it difficult to form a stable and coherent knowledge structure.

Method used

The unstructured long text data is converted into a structured multi-dimensional hierarchical knowledge base. Through the agent's cognitive structure design planning, decision-making and reasoning strategies, dynamic interaction from top to bottom is carried out. The hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base are utilized to gradually correct the exploration strategy to achieve efficient retrieval and reasoning.

Benefits of technology

It achieves stronger temporal coherence and logical consistency, enhances the flexibility and interpretability of long-text retrieval and reasoning, and efficiently utilizes long-text data structure information by simulating the human reading process, achieving more efficient and accurate retrieval and reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631932A_ABST
    Figure CN120631932A_ABST
Patent Text Reader

Abstract

The invention discloses a long text retrieval and reasoning method and device, and the method comprises the steps: carrying out the preprocessing of long text data inputted by a user, and converting the unstructured long text data into a structured multi-dimensional hierarchical knowledge base; performing de-noising processing on the problem proposed by the user, performing structured processing on the problem proposed by the user based on hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, and making an initial exploration strategy according to the problem subjected to structured processing; and on the basis of the cognitive structure of the Agent, designing planning, decision making and reasoning strategies, dynamically interacting with the multi-dimensional hierarchical knowledge base from top to bottom according to the initial exploration strategy and the de-noised question, and gradually correcting the exploration strategy so as to retrieve and deduce the answer of the question according to the corrected exploration strategy. According to the method, the long text can be understood from shallow to deep, and the flexibility and interpretability of retrieval and reasoning are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of text data processing, and in particular relates to a long text retrieval and reasoning method and device. Background Art

[0002] With the continuous increase in long documents, conversations, and other text data, long text has become an important source of information. Efficient retrieval and reasoning of long text is a key topic in the field of natural language processing. For the implementation of long text retrieval and reasoning technology, existing technologies include: (1) Large language models have made significant progress in understanding and generating natural language. By modifying model parameters or training or fine-tuning the model's internal structure, large models that support long text input are obtained. For example, among existing large models at home and abroad, the maximum context length supported by GPT-4 is 128k tokens, and the maximum context length supported by DeepSeek-V3 and DeepSeek-R1 is 64k tokens.

[0003] (2) Retrieval-Augmented Generation (RAG) technology. This technology reduces context by extracting or recalling specific information from long text information. Specifically, using RAG technology to achieve retrieval and reasoning of long text involves a three-stage workflow: Chunking, dividing the long context into manageable short text units of a certain length; Retrieving short text units to extract the most relevant information. There are two existing retrieval methods: sparse retrievers that use sparse representations of text data such as TF-IDF, BM25, etc., and dense retrievers that use vector representations to capture semantic similarity; Generation, inputting the retrieved information as context information into the generative model to obtain output.

[0004] (3) Agent-based methods. Use language models as reasoners. For example: ReadAgent adopts a storage management method driven by a large model. It breaks down long text into a series of smaller, logically coherent text blocks, namely "pages", and then extracts summaries from these text blocks to achieve efficient storage. When long text retrieval and reasoning are required, the summary content is used to select relevant information to complete the task. MemWalker divides and summarizes long text to process it into a summary tree. It collects relevant information by exploring this summary tree to complete long text retrieval and reasoning. GraphReader divides long text into multiple text blocks to extract summaries of each text block, extracts key elements (such as important nouns, verbs, and adjectives) from the text blocks to construct a graph structure, and gradually collects key information according to the problem to complete long text retrieval and reasoning.

[0005] The shortcomings of the above-mentioned prior art are as follows: (1) Large language models that support long text input require high computing resources and have high computational costs. In addition, the context window of large language models has a fixed length limit. When the length exceeds the limit, the input cannot be complete, and key information is often truncated or diluted. At the same time, for long texts, large language models still face the problem of "memory decay", that is, the loss of contextual information when retrieving and reasoning long texts. The more fundamental challenge of large language lies in the unstructured nature of long texts. These texts usually contain dense but loosely organized content and lack clear themes or logical divisions. Therefore, it is difficult for large language models to form a stable and coherent internal knowledge structure. They rely on the self-attention mechanism, which often gets "lost in the middle" when dealing with long-distance dependencies.

[0006] (2) When using RAG technology for long text retrieval and reasoning, the retrieval in its three-stage workflow belongs to breadth retrieval, which lacks intelligent decision-making and in-depth reasoning capabilities, cannot complete tasks efficiently and intelligently, and is easily affected by retrieval errors and digressions.

[0007] (3) Existing agent-based methods use the method of segmenting text blocks when processing long texts. When retrieving relevant information, they basically only select based on the summary of the block. The division is not scientific enough and cannot make better use of structural information such as chapters in long texts, thus failing to fully utilize the agent architecture for efficient reasoning and decision-making. Summary of the Invention

[0008] To address the aforementioned problems in the prior art, the present invention provides a long text retrieval and reasoning method and apparatus. The technical problems to be solved by the present invention are achieved through the following technical solutions: In a first aspect, an embodiment of the present invention provides a long text retrieval and reasoning method, the method comprising: Preprocess the long text data input by users and convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base; De-noise the questions raised by users, and structure the de-noised questions based on the hierarchical structure of the multi-dimensional hierarchical knowledge base. Then, formulate the initial exploration strategy based on the structured questions. Based on the cognitive structure of the agent, planning, decision-making and reasoning strategies are designed. Based on the initial exploration strategy and the denoised questions, the agent dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom, and gradually modifies the exploration strategy to retrieve and infer the answer to the question according to the modified exploration strategy.

[0009] In one embodiment of the present invention, preprocessing is performed on the long text data input by the user to convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base, including: The long text data entered by the user is divided into chunks while preserving the paragraph and chapter structure in the long text data. This ensures that the length of the text in each chunk can fit within the context window of the large language model and that the large language model does not lose context when processing each chunk. For each block, the execution process includes: constructing a semantic structure graph corresponding to the block, wherein the semantic structure graph has three dimensions: hierarchical structure dimension, time dimension and attribute dimension; wherein, in the hierarchical structure dimension, a series of basic events are extracted using a large language model, and these basic events are used as nodes of the sub-event level, and the corresponding event level nodes are recursively generated according to the nodes of the sub-event level, and the corresponding chapter level nodes are recursively generated according to the nodes of the event level, and the corresponding article level nodes are recursively generated according to the nodes of the chapter level; a top-down semantic structure graph is formed by the nodes of the article level, the nodes of the chapter level, the nodes of the event level, and the nodes of the sub-event level; in the time dimension, a timeline between basic events is established according to the order of occurrence of basic events extracted by the large language model or the order when humans read the long text data; in the attribute dimension, information related to each basic event is stored; After completing all the block processing, the unstructured long text data is converted into a structured multi-dimensional hierarchical knowledge base.

[0010] In one embodiment of the present invention, performing denoising on questions raised by users includes: Use a large language model to remove irrelevant descriptions contained in the question statements raised by users.

[0011] In one embodiment of the present invention, based on the hierarchical structure of the multi-dimensional hierarchical knowledge base, the denoised questions are structured, including: The denoised questions are structured according to the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, so that the questions raised by users have the hierarchical structure characteristics of sub-event level, event level, chapter level, and article level.

[0012] In one embodiment of the present invention, planning, decision-making, and reasoning strategies are designed based on the agent's cognitive structure. Based on the initial exploration strategy and the denoised questions, dynamic top-down interaction is performed with the multi-dimensional hierarchical knowledge base to gradually modify the exploration strategy, including: According to the initial exploration strategy, starting from the nodes at the article level in the multidimensional hierarchical knowledge base, exploration is carried out layer by layer from top to bottom. The optimal exploration node is decided based on the correlation between the denoised question and the node of the multidimensional hierarchical knowledge base currently being explored. After moving to the optimal exploration node, the multidimensional information of the node at the current exploration level in the initial exploration strategy is adjusted to the multidimensional information of the optimal exploration node, and the multidimensional information currently moved to the optimal exploration node is collected into the notebook. The large language model is used for reasoning to determine whether the multidimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user. If the multidimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user, the exploration is terminated, and the exploration path formed during the node movement is used as the exploration strategy.

[0013] In one embodiment of the present invention, if the multi-dimensional information collected in the notebook cannot complete the retrieval and reasoning of the question raised by the user, the exploration is continued from the top to the bottom layer by layer starting from the optimal exploration node in the adjusted initial exploration strategy until the multi-dimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user.

[0014] In one embodiment of the present invention, the optimal exploration node is determined to be moved based on the correlation between the denoised question and the node of the multi-dimensional hierarchical knowledge base currently being explored, including: Determine all nodes in the next level corresponding to the node in the currently explored multi-dimensional hierarchical knowledge base; Calculate the semantic similarity score between the denoised question and each node in the next level, and select the node with the largest semantic similarity score from all semantic similarity scores as the optimal exploration node to move.

[0015] In a second aspect, an embodiment of the present invention provides a long text retrieval and reasoning device, the device comprising: The conversion module is used to pre-process the long text data input by the user and convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base; The denoising and strategy formulation module is used to denoise the questions raised by users, and based on the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, structure the denoised questions and formulate the initial exploration strategy based on the structured questions; The retrieval and reasoning module is used to design planning, decision-making, and reasoning strategies based on the agent's cognitive structure. It dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom based on the initial exploration strategy and the denoised questions, and gradually modifies the exploration strategy to retrieve and infer the answer to the question based on the modified exploration strategy.

[0016] Beneficial effects of the present invention: The long text retrieval and reasoning method proposed in the present invention is similar to the human reading and reasoning process, and is a human-like interactive retrieval and reasoning method. The present invention uses a novel long text data processing method to construct a multi-dimensional hierarchical knowledge base, which better utilizes the rich structural information and semantic expression characteristics in the long text data, and converts the unstructured long text data into an effective structured multi-dimensional hierarchical knowledge base, solving the difficulties brought about by the unstructured characteristics of long texts, and by simulating the human understanding and memory characteristics of long texts, achieving stronger temporal coherence and logical consistency in the structuring process of long text data. The present invention has a detailed understanding of the intention of the problem, and realizes the understanding of the intention of the problem through the formulation of denoising, structuring, and exploration strategies, and is close to the semantic expression of the multi-dimensional hierarchical knowledge base in the semantic space, thereby achieving more efficient and accurate interaction with the multi-dimensional hierarchical knowledge base. Furthermore, this invention fully leverages the multidimensional and hierarchical nature of the knowledge base and, based on the agent's cognitive structure, designs an efficient and intelligent path planning strategy and effective decision-making and reasoning methods. This approach dynamically interacts with the multidimensional and hierarchical knowledge base from top to bottom and from coarse to fine-grained, and feeds back information gained through interaction to dynamically adjust path planning. This not only effectively organizes and transforms long text data, but also enables efficient long text retrieval and reasoning through intelligent agents. Furthermore, through a carefully designed workflow and clear reasoning strategy, complex tasks are broken down into discrete steps. Through a cyclical execution of planning, decision-making, and reasoning, and multi-stage synthesis within dynamic interactions, this approach achieves a comprehensive understanding of long texts from shallow to deep, enhancing the flexibility and interpretability of retrieval and reasoning.

[0017] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a flowchart of a long text retrieval and reasoning method provided by an embodiment of the present invention; Figure 2 It is a structural diagram of a long text retrieval and reasoning device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention will be further described in detail below with reference to specific examples, but the embodiments of the present invention are not limited thereto.

[0020] When searching and reasoning about long texts, large language models require high computational resources, have limited context windows, and suffer from "memory decay." RAG technology suffers from insufficient intelligence and efficiency in retrieval and reasoning. Existing agent-based approaches fail to fully leverage the agent architecture for efficient reasoning and decision-making. Furthermore, all existing technologies fail to fully utilize the structural information in long texts. Due to their unstructured nature, these technologies struggle to form stable and coherent knowledge structures.

[0021] When it comes to long-text retrieval and reasoning, existing technologies differ fundamentally from humans: humans actively and interactively read, constructing hierarchical mental models that capture key concepts, thematic structures, logical relationships, and discourse organization, and dynamically review and integrate different paragraphs to answer questions or derive conclusions; in contrast, existing methods process long texts passively, without an external logical framework, and cannot replicate the flexible and comprehensive reasoning capabilities embodied in human understanding.

[0022] In view of the above shortcomings of the prior art, the present invention is inspired by human reading and proposes a long text retrieval and reasoning method and device.

[0023] First, see Figure 1 The embodiment of the present invention provides a long text retrieval and reasoning method, which specifically includes the following steps: S10. Preprocess the input long text data to convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base.

[0024] The present invention pre-processes the long text data input by the user and converts the unstructured long text data into a structured multi-dimensional hierarchical knowledge base, including: cutting the long text data input by the user into blocks and retaining the paragraph and chapter structure in the long text data to ensure that the text length of each block can adapt to the context window of the large language model and ensure that the large language model does not lose context when processing each block; for each block, the execution process includes: constructing a semantic structure graph corresponding to the block, the semantic structure graph has three dimensions: hierarchical structure dimension, time dimension and attribute dimension; wherein, in the hierarchical structure dimension, a series of basic events are extracted using the large language model, and these basic events are used as sub-event layers The nodes at the sub-event level are recursively generated into nodes at the event level, the nodes at the event level are recursively generated into nodes at the chapter level, and the nodes at the chapter level are recursively generated into nodes at the article level. The nodes at the article level, the nodes at the chapter level, the nodes at the event level, and the nodes at the sub-event level form a top-down semantic structure diagram. In the time dimension, a timeline between basic events is established based on the order of occurrence of basic events extracted by the large language model or the order in which humans read long text data. In the attribute dimension, information related to each basic event is stored. After completing all the processing of the blocks, the unstructured long text data is converted into a structured multi-dimensional hierarchical knowledge base. More specifically: Existing technologies primarily preprocess long text data using a block-based approach, without considering how to transform long text data into an effective structured knowledge base. This invention simulates the coherent thinking patterns of humans during reading, converting unstructured long text into a hierarchical semantic structure graph, thereby capturing subtle details and overall relationships. This structured representation not only enriches understanding of long text data but also reveals deeper insights into the long text data. Importantly, the present invention's strategy for structuring long text data is not static; rather, the graph construction strategy can be adjusted based on the structure and content characteristics of the long text data. For example, legal texts focus on describing the logical hierarchy and argumentation flow of each case, while medical texts highlight diagnostic tips, treatment plans, and patient outcomes. Fiction texts have a chapter structure and event-centered narrative. By adjusting the semantic structure graph construction strategy based on the unique characteristics of long text data, the information contained in the long text data is both accessible and focused.

[0025] The following takes a novel as an example to explain in detail the long text data preprocessing method used in the present invention.

[0026] Long-text novel data, characterized by a chapter structure and event-centered narrative, is well-suited for constructing a semantic structure graph centered around characters, scenes, and plots, where the plot is driven by a series of events. Each event includes elements such as time, location, involved characters, and motivation. By extracting and structuring these core attributes, the basic content structure of the novel is clearly presented, laying a solid foundation for subsequent retrieval and reasoning. Based on this, the present invention utilizes a hierarchical semantic graph structure to model and structure novel-type long-text data in multiple dimensions. The constructed semantic structure graph has three main dimensions: the first is the hierarchical structure dimension (vertical dimension). Because a novel-type long-text data consists of multiple chapters, each chapter can be semantically divided into a series of events, which can be further decomposed into multiple sub-events. Therefore, the constructed semantic structure graph can be divided into four levels, from coarse-grained to fine-grained: v1 represents the article level, v2 represents the chapter level, v3 represents the event level, and v4 represents the sub-event level. Each node in the semantic structure graph represents an event of different granularity. The second dimension is the time dimension (horizontally), which reflects the order in which events occur or the order in which humans read long text data, thereby establishing a timeline between events. The third dimension is the attribute dimension (depthwise), which stores information related to each event node, such as summary, time, location, people, motivation, and outcome. Because the article and chapter levels semantically represent a collection of events, specific attributes such as time and location are not added, and only summary information is retained.

[0027] The present invention uses a large language model to extract events from the original long text data input by the user. The specific method is as follows: The long text data entered by the user is segmented, while preserving the paragraph and chapter structure. This segmentation process ensures that the length of each segment fits within the context window of the large language model, that the large language model does not lose context when processing each segment, and that the semantics of the segmented text remain reasonable, complete, and coherent.

[0028] For each text chunk, the large language model is prompted to extract a series of basic events, corresponding to the sub-event level v4 in the semantic structure graph. A "basic event" is defined as one that includes a clear action or decision, clearly defined participants and their motivations, and a significant outcome or impact. These elements, taken together, form an event that independently drives narrative development, reveals character traits, or deepens thematic information, possessing unique and irreplaceable significance within the story. Based on this definition, the basic event information to be extracted includes the following attributes: event name, time, location, participants, motivation, outcome, and a brief description. These attributes ensure that the event is expressed clearly and comprehensively. By extracting a series of basic events, nodes at the sub-event level v4 in the semantic structure graph are generated, along with corresponding attribute information. For a novel with n chapters, human understanding is cumulative: when a reader reaches chapter k, they will recall key events from previous chapters. To simulate this, the large semantic model receives not only the text chunk for chapter k but also concise summaries of chapters 1 to k−1. This summary highlights the development of important events without exhaustive details, simulating how human memory retains core information. By providing this high-level semantic context, the large language model achieves stronger temporal coherence and logical consistency when constructing the semantic structure of the current chapter.

[0029] After extracting nodes at the sub-event level v4, these nodes are recursively aggregated into higher-level events using the large language model. Specifically, by identifying relationships and associations between sub-events, these are combined to form higher-level events, generating nodes at the event level v3. This recursive process ultimately creates nodes at the chapter level v2 and article level v1. The semantic structure graph constructed in this way aggregates fine-grained basic events to capture increasingly abstract semantic representations.

[0030] Through the above preprocessing operations, unstructured long text data is converted into a structured multi-dimensional hierarchical knowledge base.

[0031] S20. De-noise the questions raised by the user, and structure the de-noised questions based on the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, and formulate an initial exploration strategy based on the structured questions.

[0032] To achieve more efficient and accurate interaction with a multi-dimensional hierarchical knowledge base, embodiments of the present invention understand the intent of user questions. They denoise the user's questions, structure them, and develop preliminary exploration strategies to achieve intent understanding. Existing long-text retrieval and reasoning technologies often use direct input or simple denoising for questions. The resulting results fall into a different semantic domain than the structured multi-dimensional hierarchical knowledge base. However, through denoising, structuring, and developing exploration strategies, the resulting question intent is aligned with the structured multi-dimensional hierarchical knowledge base in semantic space, facilitating the extraction of clue information and subsequent more accurate retrieval and reasoning. Denoising involves using a large language model to remove irrelevant descriptions from user question expressions. According to survey data, in real-world scenarios, approximately 62% of questions in dialogue systems contain social etiquette words (such as "hello"), emotional modifiers (such as "please"), or scenario descriptions (such as "I have a question now"). These noisy components can deviate from the core intent of the question, increase the computational complexity of word vectors, and increase response time in real-time dialogue systems. There are three challenges in unstructured natural language: semantic ambiguity, information redundancy, and expression heterogeneity. Therefore, questions need to be structured. The embodiment of the present invention structures the questions raised by users based on the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, including: structuring the denoised questions according to the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, so that the questions raised by users have hierarchical structure characteristics of sub-event level, event level, chapter level, and article level.

[0033] Questions raised to users in embodiments of the present invention The intention understanding process can be formulated as: ; in, Indicates a problem The filtered version after denoising, Represents the initial exploration strategy obtained after the structured process. The entire intent understanding process involves three main steps: Denoising: Questions from users Remove the noise from the spoken language. The noise comes from the spoken language. , as a cleaner input for the next step of processing.

[0034] Structuring: Problems after denoising In the process of extracting structured information, we can identify key elements, including entities, relationships and attributes. This process generates important semantic clues, which are helpful for the subsequent reasoning steps. For example, the multi-dimensional hierarchical knowledge base includes article level v1, chapter level v2, event level v3, and sub-event level v4. The part-of-speech tagging, syntactic analysis, and semantic role tagging technologies in natural language processing are used to de-noise the problem. Converted into a semantic structure diagram including article level v1, chapter level v2, event level v3, and sub-event level v4 hierarchical structures.

[0035] Development of preliminary exploration strategy: This strategy aims to identify the most relevant nodes at each level that the query may involve. Output a complete exploration path, such as for the denoised question "Who did Robinson Crusoe travel with to escape the Sally pirates on his second voyage?", based on a structured question , its initial exploration strategy for: Article level v1: Robinson Crusoe, Chapter level v2: The Second Voyage, Event level v3: Robinson Crusoe is Enslaved by the Salisbury Pirates, Sub-event level v4: Robinson Crusoe Escapes from Slavery.

[0036] After understanding the intention, the embodiment of the present invention will infer that the node n at the article level 1 Start the initialization reasoning process as the root of the semantic structure graph. Then, the initial exploration strategy The guided,exploration process is performed through top-down reasoning.,And an empty notebook M = {} is initialized to dynamically accumulate,information about visited nodes.

[0037] S30. Based on the cognitive structure of the agent, design planning, decision-making and reasoning strategies, and dynamically interact with the multi-dimensional hierarchical knowledge base from top to bottom based on the initial exploration strategy and the denoised questions, and gradually revise the exploration strategy to retrieve and infer the answer to the question according to the revised exploration strategy.

[0038] The embodiment of the present invention is based on the cognitive structure of the agent, designs planning, decision-making and reasoning strategies, and dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom according to the initial exploration strategy and the denoised questions, and gradually corrects the exploration strategy, including: starting from the article-level nodes in the multi-dimensional hierarchical knowledge base from top to bottom and exploring layer by layer according to the initial exploration strategy, deciding the optimal exploration node to move to according to the correlation between the denoised questions and the nodes of the multi-dimensional hierarchical knowledge base currently being explored, and after moving to the optimal exploration node, adjusting the multi-dimensional information of the nodes of the current exploration level in the initial exploration strategy to the multi-dimensional information of the optimal exploration node, and moving the currently moved nodes to the optimal exploration node. The multi-dimensional information moved to the optimal exploration node is collected in the notebook, and the large language model reasoning is used to determine whether the multi-dimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user. If the multi-dimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user, the exploration is ended, and the exploration path formed during the node movement is used as the exploration strategy. If the multi-dimensional information collected in the notebook cannot complete the retrieval and reasoning of the question raised by the user, the optimal exploration node in the adjusted initial exploration strategy is continued to be explored layer by layer from top to bottom until the multi-dimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user.

[0039] An embodiment of the present invention decides the optimal exploration node to move based on the correlation between the denoised question and the nodes of the multidimensional hierarchical knowledge base currently being explored, including: determining all nodes in the next level corresponding to the node based on the node of the multidimensional hierarchical knowledge base currently being explored; calculating the semantic similarity score between the denoised question and each node in the next level, and selecting the node corresponding to the largest semantic similarity score from all semantic similarity scores as the optimal exploration node to move.

[0040] The embodiment of the present invention designs planning, decision-making, and reasoning strategies, and dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom based on the intention of the question to retrieve and reason out the answers to the user's questions. This process enhances the flexibility and explainability of retrieval and reasoning. Planning: Based on a dynamic top-down path planning strategy, the retrieval and reasoning of the denoised questions are planned. That is, interactive exploration starts from the article level v1 in the multi-dimensional hierarchical knowledge base, and explores the chapter level v2, event level v3, and sub-event level v4 layer by layer. And according to the preliminary exploration strategy In the process of step-by-step interactive exploration with the multi-dimensional hierarchical knowledge base, the nodes in the path are dynamically adjusted according to the feedback information of the multi-dimensional hierarchical knowledge base.

[0041] Decision: In the nodes of the multi-dimensional hierarchical knowledge base that need to be explored, the optimal exploration node is determined based on the question intent and the relevance of the nodes. That is, by calculating the multi-dimensional information of the chapter / event / sub-event nodes that need to be explored in the multi-dimensional hierarchical knowledge base and the semantic relevance of the question intent, the most relevant node is selected. If the current node is l Hierarchical nodes , the decision model will observe the next level (the l +1 level) a set of child nodes ,in N Representation node In the l +1 layer of child nodes, Indicates the l +1st floor i Then, according to the question intent Q , each node in the set of child nodes Both are related to the intention of the question Q Compare and calculate the semantic similarity score , semantic similarity score Representation node and the intention of the question Q The value of the correlation ranges from 0 (completely irrelevant) to 1 (completely relevant). Q Most relevant nodes As a moving target. The formula is as follows: ; ; in, represents the semantic similarity function, Is the intention of the question Q The most similar child nodes, once determined , the path will move to that node and continue exploring.

[0042] Reasoning: Add the multi-dimensional information of the node currently selected for exploration to the memory (context), and use the large language model to determine whether the reasoning has accumulated enough information to complete the retrieval and reasoning of the problem. If not, re-plan the path based on the adjusted initial exploration strategy for deeper exploration. When the reasoning agent moves to the node When it further observes the node, it will move the multi-dimensional information of the current optimal exploration node to Collected into notebooks, the notebooks are iteratively updated to . Through the memory notebook M The multi-dimensional information accumulated in the dataset is used to evaluate whether sufficient evidence has been collected to answer the query using the inference model. The formula is as follows: ; ; in, Q Indicates the problem intent, i.e., the denoised problem output by S20 and the initial exploration strategy formulated. M Represents the accumulated fact set in the current notebook, i.e., multi-dimensional information. To realize the language model of reasoning function, Indicates based on Q and M Make inferences, represents the probability density function, Indicates Q and M Generate the answer The probability of Indicates whether sufficient multi-dimensional information has been collected. When The answer generated when Not generated .if When , the exploration ends and the exploration path formed during the node movement is used as the exploration strategy; if , the path is replanned according to the adjusted initial exploration strategy, and the exploration continues from the top to the bottom layer by layer from the optimal exploration node in the adjusted initial exploration strategy, and a deeper exploration is carried out until the multi-dimensional information collected in the notebook can complete the retrieval and reasoning of the questions raised by the user.

[0043] Finally, based on the cognitive structure of the agent, we design path planning, decision-making, and reasoning strategies, decompose complex tasks into discrete steps, and through the cyclic execution of planning, decision-making, and reasoning, interact with the multi-dimensional hierarchical knowledge base again and again. In the interaction, we realize top-down, coarse-to-fine, and dynamic exploration in the multi-dimensional hierarchical knowledge base, and finally retrieve and infer the answers to the questions raised by the user.

[0044] In summary, the long text retrieval and reasoning method proposed in the embodiment of the present invention is similar to the human reading and reasoning process, and is a human-like interactive retrieval and reasoning method. The present invention uses a novel long text data processing method to construct a multi-dimensional hierarchical knowledge base, which better utilizes the rich structural information and semantic expression characteristics in the long text data, and converts the unstructured long text data into an effective structured multi-dimensional hierarchical knowledge base, solving the difficulties brought about by the unstructured characteristics of long texts, and by simulating the human understanding and memory characteristics of long texts, achieving stronger temporal coherence and logical consistency in the structuring process of long text data. The present invention has a detailed understanding of the intention of the problem, and realizes the understanding of the intention of the problem through the formulation of denoising, structuring, and exploration strategies, and is close to the semantic expression of the multi-dimensional hierarchical knowledge base in the semantic space, thereby achieving more efficient and accurate interaction with the multi-dimensional hierarchical knowledge base. Furthermore, this invention fully leverages the multidimensional and hierarchical nature of the knowledge base and, based on the agent's cognitive structure, designs an efficient and intelligent path planning strategy and effective decision-making and reasoning methods. This approach dynamically interacts with the multidimensional and hierarchical knowledge base from top to bottom and from coarse to fine-grained, and feeds back information gained through interaction to dynamically adjust path planning. This not only effectively organizes and transforms long text data, but also enables efficient long text retrieval and reasoning through intelligent agents. Furthermore, through a carefully designed workflow and clear reasoning strategy, complex tasks are broken down into discrete steps. Through a cyclical execution of planning, decision-making, and reasoning, and multi-stage synthesis within dynamic interactions, this approach achieves a comprehensive understanding of long texts from shallow to deep, enhancing the flexibility and interpretability of retrieval and reasoning.

[0045] Second, see Figure 2 , an embodiment of the present invention provides a long text retrieval and reasoning device, the device comprising: The conversion module is used to pre-process the long text data input by the user and convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base; The denoising and strategy formulation module is used to denoise the questions raised by users, and based on the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, structure the denoised questions and formulate the initial exploration strategy based on the structured questions; The retrieval and reasoning module is used to design planning, decision-making, and reasoning strategies based on the agent's cognitive structure. It dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom based on the initial exploration strategy and the denoised questions, and gradually modifies the exploration strategy to retrieve and infer the answer to the question based on the modified exploration strategy.

[0046] As for the device embodiment of the second aspect, since it is basically similar to the method embodiment of the first aspect, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment of the first aspect.

[0047] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0048] Although the present invention is described herein in conjunction with various embodiments, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the specification and accompanying drawings in the process of implementing the claimed invention. In the specification, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components or steps. The fact that certain measures are described in different embodiments does not mean that these measures cannot be combined to produce good results.

[0049] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should be considered to fall within the scope of protection of the present invention.

Claims

1. A long text retrieval and reasoning method, characterized in that: The method comprises: Preprocess the long text data input by users and convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base; De-noise the questions raised by users, and structure the de-noised questions based on the hierarchical structure of the multi-dimensional hierarchical knowledge base. Then, formulate the initial exploration strategy based on the structured questions. Based on the cognitive structure of the agent, planning, decision-making and reasoning strategies are designed. Based on the initial exploration strategy and the denoised questions, the agent dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom, and gradually modifies the exploration strategy to retrieve and infer the answer to the question according to the modified exploration strategy.

2. The long text retrieval and reasoning method according to claim 1, characterized in that: Preprocess the long text data input by the user and convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base, including: The long text data entered by the user is divided into chunks while preserving the paragraph and chapter structure in the long text data. This ensures that the length of the text in each chunk can fit within the context window of the large language model and that the large language model does not lose context when processing each chunk. For each block, the execution process includes: constructing a semantic structure graph corresponding to the block, wherein the semantic structure graph has three dimensions: hierarchical structure dimension, time dimension and attribute dimension; wherein, in the hierarchical structure dimension, a series of basic events are extracted using a large language model, and these basic events are used as nodes of the sub-event level, and the corresponding event level nodes are recursively generated according to the nodes of the sub-event level, and the corresponding chapter level nodes are recursively generated according to the nodes of the event level, and the corresponding article level nodes are recursively generated according to the nodes of the chapter level; a top-down semantic structure graph is formed by the nodes of the article level, the nodes of the chapter level, the nodes of the event level, and the nodes of the sub-event level; in the time dimension, a timeline between basic events is established according to the order of occurrence of basic events extracted by the large language model or the order when humans read the long text data; in the attribute dimension, information related to each basic event is stored; After completing all the block processing, the unstructured long text data is converted into a structured multi-dimensional hierarchical knowledge base.

3. The long text retrieval and reasoning method according to claim 1, characterized in that: De-noising of user questions, including: Use a large language model to remove irrelevant descriptions contained in the question statements raised by users.

4. The long text retrieval and reasoning method according to claim 2, characterized in that: Based on the hierarchical structure of the multi-dimensional hierarchical knowledge base, the denoised questions are structured, including: The denoised questions are structured according to the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, so that the questions raised by users have the hierarchical structure characteristics of sub-event level, event level, chapter level, and article level.

5. The long text retrieval and reasoning method according to claim 2, characterized in that: Based on the agent's cognitive structure, we design planning, decision-making, and reasoning strategies. Based on the initial exploration strategy and the denoised questions, we dynamically interact with the multi-dimensional hierarchical knowledge base from top to bottom, gradually revising the exploration strategy. This includes: According to the initial exploration strategy, starting from the nodes at the article level in the multidimensional hierarchical knowledge base, exploration is carried out layer by layer from top to bottom. The optimal exploration node is decided based on the correlation between the denoised question and the node of the multidimensional hierarchical knowledge base currently being explored. After moving to the optimal exploration node, the multidimensional information of the node at the current exploration level in the initial exploration strategy is adjusted to the multidimensional information of the optimal exploration node, and the multidimensional information currently moved to the optimal exploration node is collected into the notebook. The large language model is used for reasoning to determine whether the multidimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user. If the multidimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user, the exploration is terminated, and the exploration path formed during the node movement is used as the exploration strategy.

6. The long text retrieval and reasoning method according to claim 5, characterized in that: If the multi-dimensional information collected in the notebook cannot complete the retrieval and reasoning of the question raised by the user, then continue to explore layer by layer from the optimal exploration node in the adjusted initial exploration strategy until the multi-dimensional information collected in the notebook can complete the retrieval and reasoning of the question raised by the user.

7. The long text retrieval and reasoning method according to claim 5, characterized in that: The optimal exploration node is determined based on the correlation between the denoised question and the nodes of the currently explored multi-dimensional hierarchical knowledge base, including: Determine all nodes in the next level corresponding to the node in the currently explored multi-dimensional hierarchical knowledge base; Calculate the semantic similarity score between the denoised question and each node in the next level, and select the node with the largest semantic similarity score from all semantic similarity scores as the optimal exploration node to move.

8. A long text retrieval and reasoning device, characterized in that: The device comprises: The conversion module is used to pre-process the long text data input by the user and convert the unstructured long text data into a structured multi-dimensional hierarchical knowledge base; The denoising and strategy formulation module is used to denoise the questions raised by users, and based on the hierarchical structure characteristics of the multi-dimensional hierarchical knowledge base, structure the denoised questions and formulate the initial exploration strategy based on the structured questions; The retrieval and reasoning module is used to design planning, decision-making, and reasoning strategies based on the agent's cognitive structure. It dynamically interacts with the multi-dimensional hierarchical knowledge base from top to bottom based on the initial exploration strategy and the denoised questions, and gradually modifies the exploration strategy to retrieve and infer the answer to the question based on the modified exploration strategy.