Information processing method, electronic device and computer program product

By sorting knowledge fragments in two dimensions and combining the writing order and similarity within the document, the problems of unclear reference and fragmented information in large language models in question-answering systems are solved, achieving more accurate and coherent question-answer generation.

CN121542391APending Publication Date: 2026-02-17KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511971949.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing slicing methods lead to problems such as ambiguous referencing, fragmented information, and logical inconsistencies in large language models in question-answering systems, affecting the accuracy of answers and user experience.

Method used

By sorting knowledge fragments in two dimensions, combining the writing order within the document with the similarity to the query information, a fragment sequence is formed, which is then input into the question-and-answer model to generate feedback text.

Benefits of technology

It improves the accuracy and consistency of the question-and-answer system, ensuring that the generated answers conform to the inherent logic of knowledge and user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542391A_ABST
    Figure CN121542391A_ABST
Patent Text Reader

Abstract

The invention provides an information processing method, electronic equipment and a computer program product. The information processing method comprises the steps that a plurality of knowledge fragments suitable for inquiry information are determined, and the knowledge fragments are phrases capable of solving the inquiry information; arranging the plurality of knowledge fragments to form a fragment sequence, in which, in the fragment sequence, the knowledge fragments from the same document are arranged according to the writing sequence of the document, and the knowledge fragments from different documents are arranged according to the similarity degree sequence between the knowledge fragments and the inquiry information; and inputting the fragment sequence into the question and answer model to generate a feedback text capable of answering the inquiry information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical fields of data processing, and in particular to an information processing method, electronic device, and computer program product. Background Technology

[0002] Slicing is key to achieving efficient and accurate question answering in RAG (Retrieval-Augmented Generation) systems. Because large language models are limited by context length and computing power, they cannot directly process a large number of documents. Therefore, the knowledge base needs to be sliced ​​into small segments to facilitate rapid retrieval and answer generation, reduce computational costs, and improve response speed.

[0003] However, current common slicing methods have two major drawbacks: first, mechanically segmenting by fixed length disrupts semantic integrity, leading to unclear pronoun references in fragments and affecting model understanding; second, sorting search results solely by similarity may disrupt the logical order of the original text, resulting in information fragmentation. These problems easily cause the model to generate answers with unclear references, disordered order, or even factual errors, seriously affecting the accuracy of responses and user experience. Summary of the Invention

[0004] This disclosure provides an information processing method, an electronic device, and a computer program product.

[0005] According to one aspect of this disclosure, an information processing method is provided, comprising: determining a plurality of knowledge fragments applicable to query information, the knowledge fragments being segments capable of answering the query information; arranging the plurality of knowledge fragments to form a fragment sequence, wherein, in the fragment sequence, knowledge fragments originating from the same document are arranged according to the writing order of the document, and knowledge fragments originating from different documents are arranged according to the degree of similarity between the knowledge fragments and the query information; and inputting the fragment sequence into a question-answering model to generate feedback text capable of answering the query information.

[0006] Based on one technical solution, by rationally arranging multi-source knowledge fragments and taking into account both the internal logic of the document and the relevance of the query, the accuracy and coherence of the answers generated by the question-and-answer system are improved.

[0007] In some implementations, determining multiple knowledge fragments applicable to the query information includes: calculating the similarity between the query information and each document fragment, and using document fragments with a similarity greater than a first threshold as the knowledge fragments; and / or, calculating the similarity between the query information and the background labels of each document fragment, and using document fragments corresponding to background labels with a similarity greater than a second threshold as the knowledge fragments, wherein the background labels record the document identifier of the document to which the corresponding document fragment belongs, the position information of the document fragment in the document to which it belongs, and the context of the document fragment.

[0008] According to one technical solution, by combining the dual similarity filtering of document fragment content and its contained location, context and other background information, the accuracy of knowledge fragment selection and context relevance are improved, thereby enhancing the quality of question answering.

[0009] In some implementations, before determining multiple knowledge fragments applicable to the query information, the process includes: invoking a tag analysis model to analyze the document fragments and the documents to which the document fragments belong, and generating background tags for the knowledge fragments.

[0010] According to one technical solution, background tags containing document identifiers, location information, and contextual content are automatically generated by pre-calling a tag analysis model. This enables the structured extraction of contextual information from knowledge fragments, providing a data foundation for subsequent accurate filtering and reasonable sorting, and improving the overall accuracy and interpretability of the question-answering system.

[0011] In some implementations, determining multiple knowledge segments applicable to query information includes: vectorizing the query information to obtain vector values ​​of the query information; vectorizing each document segment to obtain vector values ​​of each document segment; calculating the similarity between the vector values ​​of the query information and the vector values ​​of each document segment to determine the degree of similarity between the query information and the document segments; and selecting document segments with a similarity greater than a first threshold as the knowledge segments.

[0012] According to one technical solution, through vectorization processing and similarity calculation, query information and knowledge fragments can be matched efficiently and accurately, improving the automation level and semantic understanding ability of knowledge retrieval, and ensuring that the selected fragments are highly relevant to the query.

[0013] In some embodiments, arranging multiple knowledge fragments to form a fragment sequence includes: first sorting the knowledge fragments in ascending order of their similarity to the query information to form a process sequence; and second sorting the process sequence according to the writing order of the documents if at least two knowledge fragments originate from the same document to form the fragment sequence, wherein the at least two knowledge fragments are arranged adjacently in the fragment sequence.

[0014] According to one technical solution, a dual sorting mechanism is used, which first sorts by query relevance and then integrates fragments of the same source document according to the writing order. This ensures that key information is prioritized while preserving the logical coherence of the original text, thereby improving the accuracy and readability of question-and-answer generation.

[0015] In some implementations, when at least two knowledge fragments originating from the same document exist among the plurality of knowledge fragments, the process sequence is sorted a second time according to the writing order of the document, including: identifying at least two knowledge fragments originating from the same document among the plurality of knowledge fragments; moving the knowledge fragment with a lower degree of similarity among the at least two knowledge fragments to the adjacent position of the knowledge fragment with the higher degree of similarity among the at least two knowledge fragments; and arranging the at least two knowledge fragments according to the writing order of the document to form the fragment sequence.

[0016] According to one technical solution, by prioritizing the retention of the most similar segments and merging the remaining related segments nearby, and then arranging them in the original text order, the main logic of query relevance ranking is maintained, while ensuring the contextual coherence of related information, effectively improving the accuracy and readability of question-and-answer generation.

[0017] In some implementations, identifying at least two knowledge fragments from the plurality of knowledge fragments that originate from the same document includes: identifying document identifiers in the background labels of each knowledge fragment, and identifying knowledge fragments with the same document identifier as the at least two knowledge fragments originating from the same document.

[0018] According to one technical solution, document identifiers in background tags are analyzed to accurately identify knowledge fragments from the same source, enabling precise determination of the source relationship between multiple fragments. This provides a reliable basis for subsequent integration and coherent sorting according to the original text order, enhancing the logic and consistency of information organization.

[0019] In some implementations, inputting the fragment sequence into a question-answering model to generate feedback text that can answer the query information includes: inputting the fragment sequence and background labels of each knowledge fragment into the question-answering model to generate the feedback text.

[0020] According to one technical solution, by inputting the fragment sequence and its background labels containing document source, location and context information into the question answering model, the model's understanding of knowledge sources and contextual relationships is enhanced, which helps to generate more accurate, coherent and traceable feedback text.

[0021] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to perform an information processing method according to any embodiment of this disclosure.

[0022] According to another aspect of this disclosure, a readable storage medium is provided that stores executable instructions, which, when executed by a processor, are used to implement an information processing method according to any embodiment of this disclosure.

[0023] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements an information processing method according to any embodiment of this disclosure. Attached Figure Description

[0024] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0025] Figure 1 This is a schematic diagram illustrating an application scenario of the information processing method according to the embodiments of this disclosure.

[0026] Figure 2 This is a flowchart of an information processing method according to an embodiment of the present disclosure.

[0027] Figure 3 This is a schematic diagram of a question-and-answer process according to an embodiment of this disclosure.

[0028] Figure 4 This is a flowchart of the process for determining knowledge fragments based on embodiments of this disclosure.

[0029] Figure 5 This is a flowchart of the fragment sequence generation process according to an embodiment of the present disclosure.

[0030] Figure 6 This is a schematic block diagram of the structure of an information processing apparatus according to an embodiment of the present disclosure.

[0031] Figure 7 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation

[0032] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0033] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0034] Slicing is a core component of RAG (Retrieval-Augmented Generation) systems, enabling efficient and accurate question answering. Because large language models suffer from context length limitations and high computational costs, they cannot directly process entire manuals or large amounts of documents. Therefore, the knowledge base must be segmented into smaller fragments. This allows the system to quickly retrieve the most relevant fragments from massive amounts of information when a user asks a question, providing them as context input to the large model. This significantly reduces the amount of data processed and computational costs, improving response speed and usability.

[0035] However, the currently common slicing methods have significant drawbacks: on the one hand, slicing is usually mechanically divided into fixed lengths, disrupting the semantic integrity of the original text. This results in numerous references to "this product," "this system," and "the above steps" within the fragments, lacking contextual explanations of their specific meanings, making it difficult for large models to understand accurately. On the other hand, the retrieved fragments are only sorted by their similarity to the question, which may disrupt the logical order of the original text (such as the sequence of steps in the operation process), causing information fragmentation and logical confusion. These two problems together lead to unclear references, contradictory content, incorrect order, and even factual errors in the answers generated by large models, seriously affecting the accuracy of the responses and the user experience.

[0036] Therefore, this disclosure proposes an information processing method.

[0037] Figure 1 This is a schematic diagram illustrating an application scenario of the information processing method according to embodiments of this disclosure. For example... Figure 1 As shown, in this application scenario, a server 100 and a terminal device 200 may be included. The server 100 and the terminal device 200 can connect via a network or Bluetooth to exchange data. The server 100 can be a cloud server or a physical server, and the terminal device 200 can be a smart device such as a computer, mobile phone, or tablet. The server 100 provides the basic data required to run the information processing method, and the terminal device 200 executes the information processing method of this disclosure based on the basic data provided by the server 100.

[0038] Figure 2This is a flowchart of an information processing method according to an embodiment of the present disclosure. The present disclosure proposes an information processing method M2O0 that, through a two-dimensional sorting of knowledge fragments applicable to query information, enables a question-answering model to obtain a logically coherent sequence of fragments as input, thereby generating feedback text that accurately responds to the query information and conforms to the inherent logic of the knowledge.

[0039] Step S210: Identify multiple knowledge fragments applicable to the query information.

[0040] Specifically, the similarity between the query information and each document fragment is calculated, and document fragments with a similarity greater than a first threshold are used as knowledge fragments; and / or, the similarity between the query information and the background labels of each document fragment is calculated, and document fragments corresponding to background labels with a similarity greater than a second threshold are used as knowledge fragments. The background labels record the document identifier of the document to which the corresponding document fragment belongs, the position information of the document fragment in the document to which it belongs, and the context of the document fragment.

[0041] Inquiry is a natural language question posed by a user to acquire specific knowledge or solve a problem. Its core lies in expressing the user's actual needs, such as "How does the self-attention mechanism of a deep learning model work?"

[0042] A knowledge fragment refers to a segment of text that can answer a query. It can be natural language text, or other forms such as images, tables, formulas, and code snippets, depending on the characteristics of the knowledge carrier. Documents can be academic papers, technical manuals, encyclopedias, textbooks, or professional literature. Due to the limitations of large language models in terms of context length and computational resource consumption, directly processing the entire document is costly. Therefore, by dividing the document into multiple smaller document fragments, only the parts most relevant to the user's query are retrieved and processed when handling the query, significantly reducing the document processing volume and computational requirements. The parts of these document fragments that semantically match the current query are considered knowledge fragments. A single query can match one or more knowledge fragments; this is not a limitation.

[0043] It should be noted that when dividing a document into document fragments, the principle of semantic integrity can be used as the division principle, with the part of the document that can independently express complete semantics as a document fragment; of course, the document can also be divided into multiple document fragments according to a preset character length (e.g., 100 characters). There are no restrictions on the method of document division, and all other methods fall within the protection scope of this disclosure.

[0044] Step S220: Sort multiple knowledge fragments to form a fragment sequence.

[0045] A fragment sequence is an ordered set of retrieved knowledge fragments after sorting. In this sequence, knowledge fragments from different documents are first arranged in descending order based on their semantic similarity to the query information, ensuring that the most relevant content is presented first. When multiple knowledge fragments originate from the same document, these fragments should be arranged adjacent to each other while maintaining overall relevance, strictly following the original document's writing order. This approach ensures content relevance while maintaining the logical structure and contextual coherence of the original document, effectively avoiding misunderstandings or logical confusion caused by out-of-order fragments. This provides a reliable input foundation for the subsequent question-answering model to generate accurate and well-organized answers.

[0046] If a knowledge fragment has a high semantic similarity to the query information, while other knowledge fragments belonging to the same document have a relatively low similarity, these low-similarity knowledge fragments can be moved forward so that they are adjacent to the high-similarity knowledge fragments in the sequence and arranged according to the writing order of the documents.

[0047] Step S230: Input the fragment sequence into the question-answering model to generate feedback text that can answer the question.

[0048] Question-answering models can be large language models, capable of generating accurate and coherent natural language by incorporating external knowledge. In this method, the model uses a sorted sequence of fragments as input knowledge background, fully understanding its semantic content and logical structure. Based on this, it analyzes the user's query information, infers the question's intent, and ultimately generates feedback text that is both relevant to the query and conforms to the logical knowledge. By introducing a two-dimensionally sorted sequence of fragments, the model can not only acquire information highly relevant to the question but also perceive the contextual relationships of knowledge within the original text. This effectively alleviates problems such as logical inconsistencies, significantly improves the accuracy and readability of the answers, and achieves a more natural and intelligent human-computer dialogue experience.

[0049] Feedback text is the output content generated by the question-answering model in response to the query information, used to answer questions or provide information. Its presentation format can be natural language text, audio, video, images, etc., which can be set according to user needs and are not limited here.

[0050] The feedback text generated in this disclosure relies on a two-dimensionally ordered sequence of fragments. This structured and ordered knowledge input not only improves the question-answering model's ability to understand the context, but also reduces problems such as unclear references and logical inconsistencies caused by disordered order.

[0051] Figure 3 This is a schematic diagram of a question-and-answer process according to an embodiment of this disclosure. The following is in conjunction with... Figure 3 The complete question-and-answer process of this disclosure is explained.

[0052] In step 311, the query information is obtained.

[0053] A query is a natural language question posed by a user to acquire specific knowledge or solve a problem; its core purpose is to express the user's actual needs. Users can submit queries through smart devices on the dialogue page of an application equipped with the information processing method disclosed herein. There are no restrictions on the content or format of the query, aiming to maximize the user's question-and-answer experience.

[0054] In step 312, the vector value of the query information is calculated.

[0055] Vectorization of query information essentially involves converting user-generated queries in natural language into high-dimensional numerical vector values ​​to highlight their semantic content. The specific process includes: cleaning and segmenting the query information, then inputting it into a vector encoding model. This model extracts semantic features and outputs a fixed-dimensional high-dimensional vector. This vector numerically represents the deep semantic content of the question, enabling the computer to understand its meaning at a semantic level. The vector value not only captures the lexical surface information of the query but also reflects the semantic relationships within the context, thereby improving the accuracy of subsequent similarity calculations and laying the foundation for precise matching of relevant knowledge fragments.

[0056] In step 321, the document is sliced ​​to obtain document fragments.

[0057] When question-answering models are applied to human-computer dialogue scenarios, they typically require access to massive amounts of documents as knowledge sources, including academic papers, technical manuals, encyclopedias, textbooks, and various professional literature. Processing entire long documents for each dialogue not only faces the limitation of large language model context length but also incurs significant computational overhead, impacting response efficiency and system performance. To address this challenge, documents are usually pre-divided into multiple smaller document segments. When faced with a user question, only the most relevant segments need to be retrieved and processed, significantly reducing data processing volume and computational consumption, and improving question-answering efficiency.

[0058] There are two main methods for document slicing: one is uniform segmentation based on a fixed-length window, which divides the document into segments of equal length according to the number of characters and words; the other is intelligent segmentation based on semantic integrity, which segments paragraphs or chapters with independent meaning (such as a complete technical description or conceptual explanation) into fragments to preserve the coherence of local semantics. Regardless of the method used, the segmented document fragments are uniformly stored in the database for easy subsequent retrieval and matching.

[0059] For example, a comprehensive real estate guide document covering urban housing information can be divided into independent knowledge units, such as "the criteria for identifying school district housing and methods for finding corresponding schools," "the rules for calculating transaction taxes and fees for second-hand housing," and "an analysis of common breach of contract clauses in rental agreements." Each segment focuses on a specific home buying or renting issue that users are concerned about. This segmentation strategy avoids loading the entire lengthy real estate guide when a user only asks "how to calculate transaction taxes and fees," while ensuring that the retrieval system accurately recalls knowledge segments directly related to the question. This provides the question-answering model with clearly structured and semantically complete information input, thereby effectively improving response speed, answer accuracy, and user experience.

[0060] In step 322, the background label and vector value of the document fragment are determined.

[0061] Background tags are used to record the contextual information and source information of document fragments, including the document identifier of the document to which the fragment belongs, its specific location in the original document (such as the chapter, paragraph number, line number, etc.), and the surrounding text. The length of a background tag should be less than a set first character threshold, and this threshold should be significantly less than the total character count of its document to ensure conciseness and efficiency. Its main function is to preserve the context of the document fragment, clarifying the specific objects corresponding to pronouns that may appear in the fragment (such as "this method" or "the aforementioned system"), avoiding semantic fragmentation, unclear referencing, or missing information caused by text segmentation. Through background tags, the context of the fragment can be accurately reconstructed during knowledge retrieval and problem analysis, improving the accuracy of understanding and matching. Each background tag and its corresponding document fragment are stored in a database in a one-to-one association, ensuring that the information is traceable and reproducible.

[0062] In some implementations, a tag analysis model is invoked to analyze document fragments and the documents to which the document fragments belong, generating background tags for the knowledge fragments.

[0063] Specifically, a tag analysis model can be invoked to analyze the document and its segmented document fragments. Combining the overall document structure and contextual information, a corresponding background tag is generated for each document fragment. This tag records key information such as the fragment's source document identifier, its specific location within the document (e.g., chapter, paragraph), and surrounding context, ensuring that each document fragment has a unique and traceable background tag. The tag analysis model can be a large language model, either reusing an existing question-answering model or employing a separately deployed dedicated model; the specific implementation method is unrestricted. Through automated annotation, structured background information can be efficiently constructed, effectively mitigating the semantic fragmentation problem caused by text slicing, and providing strong support for subsequent accurate retrieval and semantic understanding.

[0064] Furthermore, after obtaining the document fragments, corresponding vector values ​​can be generated based on their semantic content. That is, unstructured document fragments are converted into high-dimensional numerical vector values ​​to highlight their semantic content. The specific process of vectorization may include: necessary cleaning and word segmentation of the document fragments, followed by inputting them into a vector encoding model. This model extracts semantic features and outputs a fixed-dimensional high-dimensional vector. This vector numerically represents the deep semantic content of the question, enabling the computer to understand its meaning at a semantic level. The vector values ​​not only capture the lexical surface information of the document fragments but also reflect the contextual semantic relationships, thereby improving the accuracy of subsequent similarity calculations and laying the foundation for accurate matching of relevant knowledge fragments. The vector encoding model used here can be a model that vectorizes the query information or a separate model; no restrictions are placed on this.

[0065] In step 331, multiple knowledge fragments applicable to the query information are determined based on the vector values.

[0066] Having completed the preceding steps, we already possess the crucial data required for semantic matching: vector values ​​for the query information, vector values ​​for each document fragment, and structured background labels and their vector values ​​for each fragment. Based on this data, we proceed to the knowledge fragment filtering stage—identifying the information units truly suitable for answering the current query from a massive pool of candidate fragments. This process relies not only on the direct semantic similarity between the fragment text and the question but also on the contextual clues implied by its background labels to improve the comprehensiveness and accuracy of the retrieval.

[0067] Figure 4 This is a flowchart illustrating the process of determining knowledge fragments according to embodiments of this disclosure. For methods of filtering knowledge fragments suitable for query information from a large number of document fragments, please refer to... Figure 4 .

[0068] In step 401, the similarity between the query information and the document fragment is determined based on the vector value of the query information and the vector value of the document fragment.

[0069] Specifically, after encoding the query information and each document fragment into vector values ​​of the same dimension, cosine similarity can be used as a metric to calculate the cosine of the angle between the two vectors in the semantic space. This value ranges from -1 to 1, with values ​​closer to 1 indicating greater semantic similarity. For example, when a user asks "How to configure network parameters," the cosine similarity between the query information's vector value and the vector values ​​of all document fragments is calculated as their degree of similarity. This vector space-based similarity comparison method can overcome the limitations of keyword matching, identifying content with different expressions but similar semantics, thus achieving more accurate and intelligent knowledge fragment selection.

[0070] Of course, cosine similarity is only one way to calculate the similarity between query information and document fragments; other similarity calculation methods fall within the protection scope of this disclosure.

[0071] In step 402, it is determined whether the similarity of the document fragments is greater than the first threshold.

[0072] The first threshold is a standard for measuring the similarity between a document fragment and the query information, and it is selected based on the precision and breadth of the question-answering model when processing the query information.

[0073] In step 403, when the similarity between the document fragment and the query information is greater than the first threshold, it indicates that the document fragment meets the relevance requirements required by the question-answering model when processing the query information, and the document fragment is determined to be a knowledge fragment.

[0074] If the semantic similarity between the document fragment and the query information is less than or equal to a preset first threshold, it indicates that the direct relevance between the text content of the fragment and the query information is weak, and it may not be able to serve as effective knowledge to support answer generation. In this case, step 404 is executed to further evaluate the similarity between the background label of the document fragment and the query information. The background label contains the identifier of the document to which the fragment belongs, its position in the original text, and contextual information such as its surrounding text, which can reflect the semantic environment and potential referential relationships of the fragment.

[0075] The background label text is vectorized to obtain its corresponding vector representation. Then, using the same metric as the document fragments—cosine similarity—the semantic similarity between the background label vector and the query information vector is calculated. For example, some document fragments may not explicitly mention content related to the query information, but their background information may imply the relevant context.

[0076] For example, if the query is "Does this residential complex support housing provident fund loans?", the main text of a document fragment might only state that "the main unit type in the complex is an 89-square-meter three-bedroom apartment, with an average price of 62,000 yuan per square meter," without directly mentioning "housing provident fund loans." However, its background tags might include the relevant section "Housing Finance Policies" and contextual information such as "This project can process combined loans and pure housing provident fund loans." In this case, although the main text of the fragment does not explicitly answer the user's question, its background tags provide key context and have a high semantic relevance to the query. Therefore, this fragment may still be identified as a valid knowledge fragment to support an accurate answer.

[0077] By introducing a secondary matching mechanism based on background tags, the knowledge filtering process not only relies on the text content of the fragment itself, but also fully considers its context and source background. This effectively compensates for the information fragmentation caused by fragmentation, improves the recall ability of implicitly related knowledge, ensures that the knowledge fragments input to the question answering model are more complete and accurate, avoids missing content that is semantically closely related but not directly expressed in the main text, and thus enhances the robustness and accuracy of the overall question answering system.

[0078] In step 405, it is determined whether the similarity between the query information and the background label is greater than a second threshold. The second threshold serves as a criterion for determining whether the background label has a semantic relationship with the query information. It is used to filter out document fragments that, although their relevance to the query information is low, their context or source background is highly relevant to the question. The specific value of the second threshold can be flexibly adjusted according to the actual application scenario of the question-answering model. For example, in high-precision scenarios that prioritize answer accuracy, a higher second threshold can be set to ensure that the recalled knowledge fragments are highly relevant to the context; while in breadth-first scenarios that require broad coverage of potential information, the threshold can be appropriately lowered to improve the recall rate.

[0079] If the calculated background label similarity is greater than the second threshold, it indicates that the context of the document fragment is significantly related to the query information. Even if the related document fragments do not directly match the question, they may contain implicit relevant information or key context. In this case, step 406 is executed, and the document fragments with background labels are used as knowledge fragments as the basis for generating subsequent feedback text.

[0080] For example, when a user asks, "Are there any schools near this house?", the main text of a document fragment might only describe "this community is a residential building constructed in 2018" without directly mentioning keywords like "school." However, its background label indicates that the fragment is located in the "Surrounding Amenities" section, and the surrounding text includes content such as "nine-year compulsory education school." In this case, even though the main text of the fragment does not explicitly mention "school," the contextual information in the background label can still indicate that it is highly relevant to the user's question, thus identifying it as a valid knowledge fragment.

[0081] It is worth noting that the second threshold can be the same as the first threshold in step 401, or it can be set to a higher value to reflect stricter requirements for background relevance. By introducing a dual threshold mechanism, collaborative judgment of content matching and context matching is achieved in the knowledge screening process. This not only improves the recall ability of fragmented knowledge, but also enhances the understanding and response ability to referential and context-dependent issues, thereby ensuring the integrity and accuracy of the feedback text.

[0082] In some implementations, only the similarity between the query information and each document fragment can be calculated, and then document fragments with a similarity greater than a first threshold can be used as knowledge fragments. This approach is suitable for scenarios with low requirements for the completeness of knowledge data. While ensuring that the amount of knowledge data input to the question-answering model is appropriate, it avoids calculating the similarity of background tags, effectively saving computing resources and improving processing efficiency.

[0083] In some implementations, the similarity between the query information and the background labels of each document fragment can be calculated only, with document fragments corresponding to background labels with a similarity greater than a second threshold being selected as knowledge fragments. This approach is suitable for scenarios that place high demands on the contextual relevance of knowledge sources and the overall background of the document. By filtering based solely on the similarity between background labels and query information, knowledge fragments highly relevant to the semantic context of the query can be prioritized. This is particularly suitable for tasks requiring the understanding of long text logic, reliance on document structure, or tracing of information sources, such as professional document question answering, legal text retrieval, or scientific literature analysis. It reduces the computational overhead of duplicate content matching while ensuring background relevance.

[0084] It should be noted that the above-described method of calculating the similarity between document fragments and query information, and / or background tags and query information based on vector values, is merely an exemplary method for determining knowledge fragments in this disclosure. In practical applications, semantic or statistical methods can also be used to determine knowledge fragments, such as traditional information retrieval scoring schemes like Jaccard (Jaccard Similarity Coefficient) based on keyword overlap and the probabilistic retrieval model BM25; of course, it can also be used to determine knowledge fragments through context-aware similarity scoring based on pre-trained language models, semantic relationship reasoning based on graph neural networks, and other methods. Any scheme that can effectively measure the semantic similarity between texts and thus obtain knowledge fragments should be considered an equivalent alternative to this disclosure and fall within the protection scope of this disclosure.

[0085] In step 332, multiple knowledge fragments are sorted to form a fragment sequence.

[0086] The knowledge fragments are first sorted in ascending order of their similarity to the query information to form a process sequence. If at least two knowledge fragments in a series of knowledge fragments originate from the same document, the process sequence is then sorted a second time according to the document’s writing order to form a fragment sequence, wherein at least two knowledge fragments are arranged adjacently in the fragment sequence.

[0087] In the second sorting, at least two knowledge fragments from the same document are identified among multiple knowledge fragments; the knowledge fragments with a lower degree of similarity among the at least two knowledge fragments are moved to the adjacent positions of the knowledge fragments with the highest degree of similarity among the at least two knowledge fragments; and the at least two knowledge fragments are arranged according to the writing order of the documents to form a fragment sequence.

[0088] Figure 5 This is a flowchart of the fragment sequence generation process according to embodiments of this disclosure. The following is in conjunction with... Figure 5 The process of generating the fragment sequence is explained in more detail.

[0089] In step 501, the knowledge fragments are sorted in ascending order of similarity to the query information to form a process sequence.

[0090] The process sequence is the result of the first sorting of knowledge fragments, aiming to prioritize the fragments most relevant to the query information, laying the foundation for subsequent logical optimization. For example, after calculating and filtering the similarity of vector values, several knowledge fragments are recalled from multiple document fragments, each corresponding to a degree of similarity to the query information. Assuming the recalled fragments are ordered from highest to lowest similarity as W1C3, W2C4, W1C2, W2C3, W3C3 (where "W" is the document identifier of the fragment, W1 is the document with identifier 1; "C" is the knowledge fragment identifier, C1 is the knowledge fragment with identifier 1), this sequence is the current process sequence. At this point, the sorting mainly reflects content relevance and has not yet considered the source relationship between fragments and the logical order of their respective documents. Therefore, fragments from the same document may be scattered and arranged haphazardly. This process sequence will serve as input for the next step of logical structure optimization to further improve the semantic coherence and expressive logic quality of the final input question-answering model.

[0091] In step 502, the source of the knowledge fragment is identified.

[0092] The source refers to the document identifier to which the knowledge fragment belongs (such as document name, document number, or unique identifier), as well as its precise location information within that document, such as the chapter title, paragraph number, page number, line number, or slice number. Accurately identifying the source of a knowledge fragment not only helps to restore its original context and avoid semantic gaps or unclear references caused by segmentation, but also provides an important basis for subsequent result tracing, credibility assessment, and user verification.

[0093] The primary method for identifying the source is to retrieve the background tags that correspond one-to-one with the knowledge fragment, and then parse out the pre-stored document identifier and location information. As metadata for the knowledge fragment, the background tags have already fully recorded their contextual source during the slicing or annotation stage, thus allowing for efficient and accurate reconstruction of the source information. Of course, the methods for obtaining document identifiers and location information are not limited to background tags. For example, document identifiers and location information can also be obtained by associating index fields in a database, reading metadata records in a document management system, or deriving them by combining node relationships in a knowledge graph. Any technical means that can accurately determine the document to which the knowledge fragment belongs and its specific location within the document fall within the protection scope of this disclosure.

[0094] In step 503, it is determined whether there is a knowledge fragment originating from the same document.

[0095] Specifically, the document identifier in the background label of each knowledge fragment is identified, and knowledge fragments with the same document identifier are regarded as at least two knowledge fragments originating from the same document.

[0096] If there are no at least two knowledge fragments corresponding to the same document identifier, then proceed to step 507, using the process sequence as the final fragment sequence.

[0097] Conversely, if two or more knowledge fragments correspond to the same document identifier, it indicates that these two or more knowledge fragments originate from the same document. In this case, step 504 is executed to determine whether the current knowledge fragment is the knowledge fragment with the highest similarity among all knowledge fragments from the same document.

[0098] For example, if knowledge fragment C1 and knowledge fragment C2 both originate from document W1, and the similarity between knowledge fragment C1 and the query information is 0.8, while the similarity between knowledge fragment C2 and the query information is 0.5, then knowledge fragment C1 is the fragment with the highest similarity among all knowledge fragments corresponding to document W1. In this example, if the currently determined knowledge fragment is C1, then the current knowledge fragment is the knowledge fragment with the highest similarity among all knowledge fragments originating from the same document. Step 505 is executed, iterating through another knowledge fragment corresponding to the same document, and then step 504 is repeated.

[0099] If the current knowledge fragment is not the knowledge fragment with the highest similarity among all knowledge fragments from the same document, such as knowledge fragment C2 in the example above, then step 506 is executed to move the fragment to the adjacent position of the knowledge fragment with the highest similarity from the same document, and arrange them according to the document writing order. Finally, step 507 is executed to obtain the fragment sequence.

[0100] For example, in the process sequence obtained after the first sorting, the knowledge fragments are ranked from highest to lowest similarity to the query information as follows: W1C3 (similarity 0.98), W2C4 (similarity 0.90), W1C2 (similarity 0.86), W2C3 (similarity 0.85), and W3C3 (similarity 0.80). Here, W1, W2, and W3 represent fragments originating from documents identified as 1, 2, and 3, respectively. It is known that in the original document W1, W1C2 precedes W1C3; and in document W2, W2C3 precedes W2C4.

[0101] To balance semantic relevance and the logical structure of the original text, the process sequence was optimized: segments belonging to the same document and with close semantic connections were aggregated and rearranged according to their order of appearance in the original document. Specifically, although W1C2 has a lower similarity to W2C4, it belongs to the same document W1 as the highly similar segment W1C3 and precedes W1C3 in the original text. Therefore, it was moved to the position immediately preceding W1C3, forming a coherent sequence "W1C2 → W1C3". Similarly, W2C3 was also moved to the position preceding W2C4, forming an ordered combination "W2C3 → W2C4". The final generated segment sequence is: W1C2, W1C3, W2C3, W2C4, W3C3.

[0102] The adjusted sequence, while preserving the priority of highly similar segments, fully restores the logical order and contextual relationships in the document, avoiding knowledge fragmentation or step disorder caused by simply sorting by similarity. This improves the coherence and structure of the input content of the question-answering model, ensuring that the generated answers are both accurate and consistent with the expression logic of the knowledge itself.

[0103] In step 333, the fragment sequence is synchronized to the question-answering model to obtain feedback results.

[0104] The question-answering model inputs a sequence of knowledge fragments and background labels for each fragment, generating feedback text. Upon receiving the sequence, the model combines the query information with semantic understanding and reasoning to synthesize the content of each knowledge fragment and generate feedback in natural language. Because the input content already considers relevance and logic, the model can more accurately grasp the knowledge structure, avoiding problems such as unclear references, incorrect order, or contradictory content caused by fragmented information, significantly improving the accuracy, coherence, and readability of the answers.

[0105] When inputting the sequence of knowledge fragments into the question-answering model, the background labels corresponding to each knowledge fragment are also provided. These background labels contain key contextual information such as the document identifier to which the fragment belongs, its specific location within the document, and its surrounding text. This information helps to reconstruct the complete semantic environment of the knowledge fragment within the original document, compensating for semantic fragmentation or information loss that may result from text slicing.

[0106] For example, when the passage contains referential expressions such as "the above method," "this system," or "this parameter," it is difficult to determine the object they refer to based solely on the text. However, by combining the contextual information in the background labels, the question-answering model can accurately identify the specific content referred to by the pronouns, thus avoiding misunderstandings. By introducing background labels, the model can not only "see" the relevant knowledge points but also "know" the source context and logical structure of those knowledge points, significantly enhancing its ability to understand complex, implicit, or context-dependent questions.

[0107] This input method, which integrates knowledge fragments and background tags, enhances the depth of knowledge perception and the accuracy of reasoning in question-answering models. Especially when processing structurally rigorous and logically demanding content such as technical documents and academic literature, it effectively ensures the completeness and reliability of the generated results, further optimizing the quality of human-computer dialogue and user experience. This step achieves a seamless connection from knowledge retrieval to intelligent generation, a crucial step in ensuring a high-quality human-computer question-answering experience.

[0108] Figure 6 This is a schematic block diagram of the structure of an information processing apparatus according to an embodiment of the present disclosure.

[0109] like Figure 6 As shown, the information processing device 600 includes: a fragment filtering module 610 for determining multiple knowledge fragments suitable for query information, wherein the knowledge fragments are phrases that can answer the query information; a sequence generation module 620 for arranging the multiple knowledge fragments to form a fragment sequence, wherein in the fragment sequence, knowledge fragments originating from the same document are arranged according to the writing order of the document, and knowledge fragments originating from different documents are arranged according to the degree of similarity between the knowledge fragments and the query information; and a response module 630 for inputting the fragment sequence into a question-and-answer model to generate feedback text that can answer the query information.

[0110] The information processing apparatus 600 disclosed herein may be in the form of computer software, and each module of the information processing apparatus 600 may be in the form of computer software modules.

[0111] The various modules of the information processing apparatus 600 disclosed herein are set up to implement the various steps of the information processing method. Their execution principles and steps can be referred to the preceding text and will not be repeated here.

[0112] Figure 7 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Figure 7 As shown, this disclosure also provides an electronic device 1000, including: a processor 1200 and a memory 1300, the memory 1300 storing execution instructions; the processor 1200 executes the execution instructions stored in the memory 1300, causing the processor 1200 to execute an information processing method.

[0113] The hardware architecture of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application of the hardware and overall design constraints. Bus 1100 connects various circuits, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400, such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.

[0114] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or only one type of bus.

[0115] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.

[0116] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.

[0117] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.

[0118] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, electronic devices, readable storage media, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0119] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0120] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0121] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0122] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.

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

[0124] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. An information processing method characterized by comprising: The method comprises: determining a plurality of knowledge segments suitable for the query information, the knowledge segments being able to answer the query information; arranging the plurality of knowledge segments to form a segment sequence, wherein in the segment sequence, knowledge segments from the same document are arranged according to the writing order of the document, and knowledge segments from different documents are arranged according to the similarity order between the knowledge segments and the query information; and inputting the segment sequence into a question and answer model to generate a feedback text capable of answering the query information. The determining of the plurality of knowledge segments suitable for the query information comprises:

2. The information processing method according to claim 1, characterized by, calculating the similarity between the query information and each document segment, and taking the document segment with a similarity greater than a first threshold as the knowledge segment; and / or, calculating the similarity between the query information and the background label of each document segment, and taking the document segment corresponding to the background label with a similarity greater than a second threshold as the knowledge segment, the background label recording the document identifier of the document to which the corresponding document segment belongs, the position information of the document segment in the document, and the context content of the document segment. Before the determining of the plurality of knowledge segments suitable for the query information, the method comprises:

3. The information processing method according to claim 2, characterized by, calling a label analysis model to analyze the document segment and the document to which the document segment belongs, and generating the background label of the knowledge segment. The determining of the plurality of knowledge segments suitable for the query information comprises:

4. The information processing method according to claim 1, characterized by, performing vectorization processing on the query information to obtain a vector value of the query information; performing vectorization processing on each document segment to obtain a vector value of each document segment; calculating the similarity between the vector value of the query information and the vector value of each document segment to determine the similarity between the query information and the document segment; and taking the document segment with a similarity greater than a first threshold as the knowledge segment. The arranging of the plurality of knowledge segments to form a segment sequence comprises:

5. The information processing method according to claim 1, characterized by, performing a first sorting according to the positive order of the similarity between each knowledge segment and the query information to form a sorted sequence; in the case that there are at least two knowledge segments from the same document in the plurality of knowledge segments, performing a second sorting on the sorted sequence according to the writing order of the document to form the segment sequence, wherein the at least two knowledge segments are arranged adjacently in the segment sequence. In the case that there are at least two knowledge segments from the same document in the plurality of knowledge segments, the performing of the second sorting on the sorted sequence according to the writing order of the document comprises:

6. The information processing method according to claim 5, characterized by, identifying at least two knowledge segments from the same document in the plurality of knowledge segments; moving the knowledge segment with the non-highest similarity in the at least two knowledge segments to the adjacent sequence position of the knowledge segment with the highest similarity in the at least two knowledge segments; and arranging the at least two knowledge segments according to the writing order of the document to form the segment sequence. The identifying of at least two knowledge segments from the same document in the plurality of knowledge segments comprises:

7. The information processing method according to claim 6, characterized by, ​ identifying a document identifier in a background label of each of the knowledge segments, and regarding knowledge segments with the same document identifier as the at least two knowledge segments originating from the same document.

8. The information processing method according to claim 1 or 3, characterized by, inputting the sequence of the segments into a question and answer model to generate feedback text capable of answering the inquiry information, including: inputting the sequence of the segments and the background label of each of the knowledge segments into the question and answer model to generate the feedback text.

9. An electronic device, comprising: including: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the information processing method in any one of claims 1 to 8.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the information processing method in any one of claims 1 to 8. The computer program is executed by the processor to implement the information processing method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Question answering method and device, storage medium and computer program product

    CN118446315A

  • Question and answer method and device, related equipment and computer program product

    CN119227813A

  • Large language model RAG optimization method based on tree neighbor context

    CN119293195A

  • Intelligent question and answer method and device

    CN119829702A

  • Intelligent text retrieval method and system, storage medium and program product

    CN120723896A