Data retrieval method, electronic device and computer program product

By performing collaborative retrieval and recall in text databases and question databases, and utilizing semantic model processing, the problem of insufficient accuracy of retrieval results in RAG technology is solved, achieving more efficient and accurate retrieval result output and improving user experience.

CN121561019APending Publication Date: 2026-02-24INNOVATION QIZHI TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511713104.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing retrieval augmentation (RAG) technologies based on large language models are insufficient in terms of the accuracy of retrieval recall results, leading to a decline in user experience. In particular, query expansion methods generate semantically divergent results and have high time costs, while fragment summarization methods have insufficient recall.

Method used

By constructing a text database and a question database as different recall channels, retrieval and recall are carried out separately. Intermediate data is generated through semantic model fusion processing, and finally, the retrieval results are output, thereby improving the relevance and accuracy of the retrieval results.

Benefits of technology

It improves the accuracy of search results and user experience, meets the search needs of various scenarios, and reduces time costs and misleading situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121561019A_ABST
    Figure CN121561019A_ABST
Patent Text Reader

Abstract

The invention provides a data retrieval method, electronic equipment and a computer program product, and relates to the technical field of data retrieval. The method comprises the steps of performing retrieval recall in a text database based on an input problem of a user to obtain first recalled text data; based on the input question, performing retrieval recall in a question database to obtain second recall text data; performing fusion processing on the first recalled text data and the second recalled text data to obtain intermediate data; and determining an output retrieval result based on the input problem and the intermediate data through a semantic model. Different types of databases can be used as different types of recall channels, retrieval recall is performed on the basis of different databases, fusion processing is performed on the basis of two obtained recall text data, corresponding intermediate data are obtained, processing can be performed on the basis of an input problem and the intermediate data through a semantic model, and the accuracy of the retrieval recall is improved. Therefore, the understandability and the accuracy of the finally output retrieval result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data retrieval technology, and more specifically, to a data retrieval method, electronic device, and computer program product. Background Technology

[0002] Currently, applications based on large language models are emerging in large numbers, and one important supporting technology is RAG, or Retrieval-Augmented Generation. By combining retrieval and generation as two core technologies, it significantly improves the accuracy and information richness of large language models when handling complex query and generation tasks. The basic working principle of RAG is as follows: First, a large-scale knowledge base or document database needs to be built as an external knowledge source; when a user asks a question or inputs a piece of text (usually called a query), the RAG system retrieves relevant documents or data fragments from the knowledge base; the retrieved relevant information is integrated into the generation process to improve the accuracy and relevance of the generated content; finally, combining the retrieved information, the large model generates a concise and highly context-relevant answer or text.

[0003] Since the quality of the content generated by the final large language model largely depends on the retrieval and recall results during the RAG process, many advanced methods have been proposed to optimize retrieval and recall performance. For example, semantic expansion of the user-input query, such as expanding it into multiple questions; or generating a core content summary of the retrieved segment as the retrieved segment, and returning its corresponding text segment as the recall result after retrieving the summary segment. Both methods aim to increase the matching degree between the query and the retrieved segment.

[0004] However, with the increasing application of large models and RAG technology, current RAG optimization methods have some problems: For query expansion methods, while generating multiple questions can increase the matching between the query and the retrieved fragment to some extent, the semantics generated are quite divergent because the retrieved content is not considered during semantic expansion, often resulting in mismatches with the retrieved fragment. Furthermore, since query expansion can only be performed after the user submits the query, it is added to the total time cost of each question-and-answer session. Moreover, the time cost of query expansion (usually performed through large models) is much higher than that of typical retrieval functions, leading to a significant increase in the time cost of each question-and-answer session and a decline in user experience. For retrieved fragment summarization methods, although the process of generating fragment summaries occurs during knowledge base construction and does not increase the time for each question-and-answer session, resulting in higher user tolerance, the summaries can only extract the core content of the fragment. As declarative text fragments, they do not match well with queries that are typically in question form, leading to a high probability of insufficient recall in practical applications. Therefore, the existing retrieval methods yield inaccurate results and cannot meet the actual retrieval needs of users. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a data retrieval method, electronic device and computer program product to improve the problem of poor accuracy of retrieval results in the prior art.

[0006] To address the aforementioned problems, firstly, embodiments of this application provide a data retrieval method, the method comprising: Based on the user's input question, a retrieval and recall operation is performed in the text database to obtain the first retrieved text data; Based on the input question, a retrieval and recall operation is performed in the question database to obtain the second recall text data; The first and second recalled text data are fused together to obtain intermediate data. Based on the input question and the intermediate data, the semantic model is used to determine the output search results.

[0007] In the above implementation process, a text database for retrieval and a question database associated with the text content within the text database are configured. Different types of databases can serve as different types of recall channels, allowing for separate retrieval and recall based on different databases. This results in two potentially different types of recall text data, which are then fused to obtain intermediate data, effectively improving the effectiveness and relevance of the intermediate data. Furthermore, considering users' need for reading comprehension of search results, a semantic model can be used to process the input question and intermediate data, improving the understandability and accuracy of the final output search results, thereby enhancing the user's search experience. By constructing a question database as a new recall channel and combining it with the text database as a recall channel for collaborative retrieval processing, the relevance and accuracy of search results to the input question are effectively improved, meeting the diverse search needs of users in various scenarios.

[0008] Optionally, the problem database is constructed in the following ways: Using the semantic model, semantic analysis is performed on each text segment in the text database to obtain multiple recommendation questions of target types; wherein, the target types include: overall content questions, key content questions, and type classification questions; Determine the identity information of the text segment associated with each of the recommendation questions; The recommendation questions are stored based on the identity information to obtain the question database.

[0009] In the above implementation process, semantic analysis can be performed on each text segment in the text database using a semantic model to obtain multiple recommendation questions of the target type, effectively improving the relevance and generalizability between the recommendation questions and the text segments. Based on this, to further enhance the correlation between the recommendation questions and their corresponding text segments, each recommendation question can be stored in a targeted, correlated manner based on the identity information of the text segments associated with it, resulting in a question database associated with the text database. This allows for the construction of a corresponding, correlated question database based on the actual content of the text segments within the text database, effectively improving the relevance between the question database and the text database.

[0010] Optionally, the text database includes multiple text segments; The process of retrieving and recalling text data based on user input questions in a text database to obtain the first retrieved text data includes: Based on the user's input question, a retrieval process is performed in the text database to determine the relevance of each text segment to the input question; The multiple correlations are sorted, and the text segments whose correlations are greater than or equal to a first preset threshold are determined as the first recall text data.

[0011] In the above implementation process, the text database includes multiple text segments. When performing retrieval and recall within the text database, the system can directly retrieve and process the text content based on the user's input question, determine the relevance of each text segment to the input question, and rank the multiple relevances. One or more text segments with a relevance greater than or equal to a first preset threshold are selected as the corresponding first recalled text data. This ability to perform retrieval and recall based on text content, analyze and process the relevance between text segments and the input question, and limit the relevance using the first preset threshold effectively improves the accuracy and effectiveness of the first recalled text data.

[0012] Optionally, the step of retrieving and recalling data in a question database based on the input question to obtain second recall text data includes: Based on the input question, a retrieval process is performed in the question database to determine the similarity between each recommended question and the input question; The similarity scores are sorted, and the recommendation questions with similarity scores greater than or equal to a second preset threshold are determined as the recall questions. Based on the identity information stored in the recall question, the associated text segment is determined in the text database as the second recall text data.

[0013] In the above implementation process, when performing retrieval and recall within the question database, the input question can be used as the retrieval condition to determine the similarity between the input question and each recommended question in the question database. The similarities are then ranked, and a question with a similarity greater than or equal to a second preset threshold is identified as a recall question related to the input question. Based on the corresponding identity information stored in the recall questions in the question database, one or more related text segments are identified in the text database as existing second recall text data. This approach enables retrieval and recall based on question content, analyzing and processing the similarity between the input question and recommended questions. It first identifies recall questions similar to the input question, then determines the corresponding second recall text data based on the correlation between the recall questions and text segments, and limits the similarity using a second preset threshold, effectively improving the accuracy and effectiveness of the second recall text data.

[0014] Optionally, the step of fusing the first recall text data and the second recall text data to obtain intermediate data includes: Based on the rearrangement technique, the updated order of the first recalled text data and the second recalled text data is determined; Based on the updated sorting, the first recalled text data and the second recalled text data are fused and filtered to obtain the intermediate data.

[0015] In the above implementation process, considering the potential differences between the two types of recall text data, a fusion process can be performed. First, the two types of recall text data are reordered using a reordering technique to determine the corresponding updated ranking. Then, based on the updated ranking, the two types of recall text data are fused and filtered to reduce the adverse effects of content with low relevance to the input question, resulting in intermediate data with high relevance to the input question. This ability to sort, filter, and fuse two types of differing recall text data effectively improves the relevance between the intermediate data and the input question, thereby improving the accuracy of the retrieval results determined based on the intermediate data.

[0016] Optionally, determining the output retrieval results based on the input question and the intermediate data using a semantic model includes: The semantic model is used to perform semantic analysis on the input question to obtain semantic information; Using the semantic model and based on the semantic information, the intermediate data is processed to obtain the output search results.

[0017] In the above implementation process, to make the final search results more in line with users' reading comprehension habits, a semantic model can be used to perform semantic analysis on the input question to obtain corresponding semantic information. Then, based on this semantic information, the intermediate data is further processed using the semantic model to obtain the corresponding search results for users to view. The ability to generate search results that conform to users' reading comprehension habits based on the input question and intermediate data through a semantic model effectively improves the user experience during the search process.

[0018] Optionally, the semantic model is obtained by training with negative samples; the method further includes: The semantic model is used to determine the correlation between the intermediate data and the semantic information. If the relevance is determined to be below a third preset threshold, the semantic model will output a search failure result.

[0019] Optionally, to mitigate the negative impact on users when the input question and search results have low relevance, the semantic model can be trained using negative samples. This allows the semantic model to refuse to answer, i.e., output a failed response. The semantic model uses semantic analysis to determine the correlation between intermediate data and semantic information. If the correlation is below a third preset threshold, it indicates a low correlation between the intermediate data and the input question, rendering it unable to output valid data to answer the user's input question. In this case, a failed search result is output to indicate the search failure. This effectively reduces the output of search results with low relevance, ensuring a high correlation between each search result and its corresponding input question, thus providing users with accurate and effective search results.

[0020] Optionally, the method further includes: Obtain various types of user input information; The input information is processed to obtain the input question in text form.

[0021] In the above implementation process, considering that users input information in various data formats during retrieval, to facilitate retrieval and analysis, information processing can be performed on various types of input information, uniformly converting them into text-based input questions. This allows for subsequent retrieval and analysis based on the input questions. It can provide users with multiple input modalities, uniformly converting various types of input information into input questions for processing, thus meeting diverse retrieval needs.

[0022] Secondly, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores program instructions, and when the processor executes the program instructions, it performs the steps of any of the above-described data retrieval methods.

[0023] Thirdly, embodiments of this application also provide a computer program product, which includes a computer program / instruction, and when the computer program / instruction is executed by a processor, it implements the steps in any of the above-described data retrieval methods.

[0024] In summary, the embodiments of this application provide a data retrieval method, electronic device, and computer program product that can use different types of databases as different types of recall channels, perform retrieval and recall on different databases, and fuse the two types of recall text data to obtain corresponding intermediate data. Furthermore, it can use a semantic model to process the input question and intermediate data to improve the understandability and accuracy of the final output retrieval results. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A block diagram illustrating an electronic device provided in an embodiment of this application; Figure 2 A flowchart illustrating the first data retrieval method provided in this application embodiment; Figure 3 A flowchart illustrating the second data retrieval method provided in this application embodiment; Figure 4 A detailed flowchart of step S200 provided for an embodiment of this application; Figure 5 A detailed flowchart of step S300 provided for an embodiment of this application; Figure 6 A detailed flowchart of step S400 provided for an embodiment of this application; Figure 7 A detailed flowchart of step S500 provided for an embodiment of this application; Figure 8 A flowchart illustrating the third data retrieval method provided in this application embodiment; Figure 9 This is a flowchart illustrating the fourth data retrieval method provided in this application embodiment.

[0027] Icons: 100 - Electronic device; 111 - Memory; 112 - Memory controller; 113 - Processor; 114 - Peripheral interface; 115 - Input / output unit; 116 - Display unit. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.

[0029] Currently, with the deepening application of large models and RAG technology, existing RAG optimization methods based on semantic expansion or summary retrieval have some problems: For query expansion methods, although generating multiple questions can increase the matching between the query and the retrieved fragment to some extent, the semantics generated are relatively scattered because the retrieved content is not considered during semantic expansion, and it is common for them not to match the retrieved fragment. In addition, since query expansion can only be performed after the user submits the query, it is added to the total time cost of each question and answer session, and the time cost required for query expansion is much larger than the time cost of the usual retrieval function, which leads to a significant increase in the time cost of each question and answer session, thus degrading the user experience. For retrieved fragment summary methods, although the fragment summary generation process is in the knowledge base construction process and does not increase the user's time for each question and answer session, and users have a high tolerance, the summary can only extract the most core content of the fragment, and as it is also a declarative text fragment, its matching effect with queries that are usually in question form is poor, and the probability of insufficient recall in practical applications is very high. Therefore, the retrieval results obtained by existing retrieval methods are inaccurate and cannot meet the actual retrieval needs of users.

[0030] To address the aforementioned issues, this application provides a data retrieval method applied to electronic devices. These devices can be servers, personal computers (PCs), tablets, smartphones, personal digital assistants (PDAs), or other electronic devices with logical computing capabilities. The method can use different types of databases as different types of recall channels, performing retrieval and recall on different databases separately. It then fuses the two types of retrieved text data to obtain corresponding intermediate data. Furthermore, it can use a semantic model to process the input question and intermediate data to improve the understandability and accuracy of the final output retrieval results.

[0031] Optionally, please refer to Figure 1 , Figure 1 This is a block diagram illustrating an electronic device according to an embodiment of this application. The electronic device 100 may include a memory 111, a memory controller 112, a processor 113, a peripheral interface 114, an input / output unit 115, and a display unit 116. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device 100. For example, the electronic device 100 may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0032] The aforementioned memory 111, memory controller 112, processor 113, peripheral interface 114, input / output unit 115, and display unit 116 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The aforementioned processor 113 is used to execute executable modules stored in the memory.

[0033] The memory 111 can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 111 stores programs. After receiving execution instructions, the processor 113 executes the programs. The methods executed by the electronic device 100 as defined in any embodiment of this application can be applied to the processor 113, or implemented by the processor 113.

[0034] The aforementioned processor 113 may be an integrated circuit chip with signal processing capabilities. The processor 113 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a digital signal processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0035] The peripheral interface 114 described above couples various input / output devices to the processor 113 and the memory 111. In some embodiments, the peripheral interface 114, the processor 113, and the memory controller 112 can be implemented on a single chip. In other instances, they can be implemented on separate chips.

[0036] The input / output unit 115 described above is used to provide user input data. The input / output unit 115 can be, but is not limited to, a mouse and a keyboard.

[0037] The aforementioned display unit 116 provides an interactive interface (e.g., a user interface) between the electronic device 100 and the user, or displays image data for the user's reference. In this embodiment, the display unit can be a liquid crystal display (LCD) or a touch display. If it is a touch display, it can be a capacitive touchscreen or a resistive touchscreen that supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated simultaneously from one or more locations on the touch display and pass the sensed touch operations to the processor for calculation and processing. In this embodiment, the display unit 116 can display various information such as input questions and the final output search results.

[0038] The electronic device in this embodiment can be used to execute various steps in the data retrieval methods provided in the embodiments of this application. The implementation process of the data retrieval methods is described in detail below through several embodiments.

[0039] Please see Figure 2 , Figure 2 This is a flowchart illustrating a first data retrieval method provided in an embodiment of this application. The method may include steps S200-S500.

[0040] Step S200: Based on the user's input question, perform a retrieval and recall in the text database to obtain the first recalled text data.

[0041] The electronic device is equipped with a text database for retrieval and a question database associated with the text content in the text database. The text database contains multiple text segments. When retrieval is performed, the text database can be used as a recall channel. Based on the user's input question, the text database is used to retrieve the text relevance between the input question and the text segments in order to retrieve the corresponding first recall text data.

[0042] Step S300: Based on the input question, perform a retrieval and recall operation in the question database to obtain the second recall text data.

[0043] In this approach, a question database can be used as a recall channel. Based on the user's input question, the similarity between the input question and multiple questions in the question database can be retrieved. Based on the correlation between the question database and the text database, the corresponding second recall text data can be retrieved.

[0044] Optionally, the order of steps S200 and S300 can be reversed, or they can be performed simultaneously.

[0045] Optionally, both the first recall text data and the second recall text data can include text segments from one or more text databases. Furthermore, due to the differences in recall channels, there may be overlaps or differences between the text segments of the first recall text data and the second recall text data.

[0046] Step S400: The first recalled text data and the second recalled text data are fused to obtain intermediate data.

[0047] Among them, the ability to fuse the two types of recall text data to obtain corresponding intermediate data effectively improves the effectiveness and relevance of the intermediate data.

[0048] Optionally, the fusion process may include sorting multiple text segments based on their relevance to the input question, or combining multiple text segments.

[0049] Step S500: Using a semantic model, determine the output search results based on the input question and intermediate data.

[0050] In addition, considering users' need for reading and understanding search results, semantic models can be used to process input questions and intermediate data to improve the comprehensibility and accuracy of the final search results, thereby enhancing the user's search experience.

[0051] Optionally, the semantic model can be a large model with semantic analysis capabilities of various types, such as BERT, RoBERTa, DeBERTa, GPT, Claude3, Gemini Ultra, LLM, and other types of models. Based on the input question, the semantic model can perform semantic analysis and re-output the text using intermediate data as the data basis to obtain the corresponding search results.

[0052] exist Figure 2 In the illustrated embodiment, the constructed question database can be used as a new recall channel, combined with the text database as a recall channel for collaborative retrieval processing, which effectively improves the relevance and accuracy of the retrieval results to the input question, and meets the various types of retrieval needs of users in various scenarios.

[0053] It should be noted that a text database can include multiple text segments. These multiple text segments can include multiple related text segments obtained from the same document, such as the same paper, after length segmentation, semantic segmentation, feature extraction, and other processing. They can also include multiple text segments from multiple documents.

[0054] For example, text can be divided by fixed length, such as segmenting it by a fixed number of characters, words, or subwords. It can also be divided into paragraphs based on formatting markers like line breaks or indentation. Semantic processing of the document can also be performed using a semantic model, generating semantic vectors for each sentence and calculating semantic similarity (e.g., cosine similarity) between sentences. When the similarity significantly decreases, segmentation occurs at that point. Alternatively, topic boundaries can be detected by calculating the lexical overlap of adjacent "word chunks." Significant changes in vocabulary usage are considered the end of a topic and the beginning of a new one. Alternatively, instructions can be directly given to a large language model to divide the document into logical paragraphs based on semantics. Input instructions could include: "Please divide the following document into several logically coherent text segments. Each paragraph should revolve around a core subtopic. Please output a list and provide a short subheading for each paragraph," etc. For texts with fixed structures, such as academic papers and news reports, segmentation can be based on their inherent structure, such as "Abstract," "Introduction," "Methods," "Results," "Discussion," and "Conclusion." Alternatively, the bag-of-words model can be used to represent text as the frequency of words in the vocabulary, allowing for segmentation based on the extracted features.

[0055] Optionally, after dividing the text into multiple segments, the text segments can be processed for database storage based on the RAG processing method to obtain the corresponding text database.

[0056] Optionally, please refer to Figure 3 , Figure 3 This is a flowchart illustrating a second data retrieval method provided in an embodiment of this application. The method may further include steps S610-S630.

[0057] Step S610: Using a semantic model, semantic analysis is performed on each text segment in the text database to obtain multiple recommendation questions for the target type.

[0058] The target types can include various types of questions such as overall content questions, key content questions, and type classification questions. Corresponding instructions can be configured in the semantic model, such as asking a general question about the content of the text segment, asking a question about the key content of the text segment, or asking a question about the type of the text segment. By leveraging the semantic analysis capabilities of the semantic model, each text segment in the input can be processed to obtain multiple recommendation questions, effectively improving the relevance and generality between the recommendation questions and the text segments.

[0059] Step S620: Determine the identity information of the text segment associated with each recommendation question.

[0060] Step S630: Store the recommendation questions based on the identity information to obtain a question database.

[0061] In order to improve the correlation between recommendation questions and corresponding text segments, each recommendation question can be stored in a targeted manner based on the identity information of the text segments associated with each recommendation question, thus obtaining a question database associated with the text database.

[0062] Optionally, since a text segment can include multiple related recommendation questions, when storing them, corresponding folders or index entries can be built based on an identity information to store multiple related recommendation questions in a targeted manner.

[0063] For example, the identity information of a text segment may include unique identification information such as a corresponding number, like a numerical ID, which can be determined based on the document name where the text segment is located, the generation time of the text segment, etc., or a randomly generated unique number can be uniformly assigned to multiple text segments.

[0064] exist Figure 3 In the illustrated embodiment, a corresponding related question database can be constructed based on the actual content of the text segments in the text database, effectively improving the relevance between the question database and the text database.

[0065] Optionally, please refer to Figure 4 , Figure 4 The following is a detailed flowchart of step S200 provided in an embodiment of this application. Step S200 may include steps S210-S220.

[0066] Step S210: Based on the user's input question, perform retrieval processing in the text database to determine the relevance of each text segment to the input question.

[0067] Since the text database contains multiple text segments, when performing retrieval and recall within the text database, the text content can be retrieved directly based on the user's input question, determining the relevance of each text segment to the input question.

[0068] Optionally, the RAG (Retrievable Query Aggregator) process can be used to retrieve and recall text segments from a text database based on the user's input question, determining the relevance of each text segment to the input question. Keyword matching can be used to represent the input question and text segments as high-dimensional sparse vectors (vectors with values ​​in only a few dimensions), where each dimension corresponds to a word, and the values ​​are typically statistical measures such as TF-IDF (a measure of a word's importance in a document) or BM25 (an improved version of TF-IDF). Retrieval is then performed by calculating the similarity (e.g., dot product) of these sparse vectors, achieving sparse retrieval. Alternatively, semantic matching can be used with a deep learning model employing a dual-encoder architecture to map the input question and text segments to the same low-dimensional, dense vector space. In this space, semantically similar texts also have similar vectors; the retrieval process involves finding the document vector most similar to the question vector, achieving dense retrieval. Sparse and dense retrieval can also be used simultaneously, and the results can be combined. After retrieving multiple text segments, a semantic model can be used to evaluate the relevance of each text segment to the input question.

[0069] Step S220: Sort the multiple correlations and determine the text segments with correlations greater than or equal to the first preset threshold as the first recall text data.

[0070] Among them, multiple relevances can be sorted, and one or more text segments with a relevance greater than or equal to a first preset threshold are used as the corresponding first recall text data.

[0071] Optionally, the first preset threshold can be set according to actual conditions and needs. For example, it can be set to 70% to reduce the adverse effects caused by relevant but low-relevance text segments. In the case of multiple text segments with relevance greater than or equal to the first preset threshold, the top n (n is a positive integer and n is much smaller than the number of text segments in the text database) most relevant text segments can be selected as the first recall text data. For example, 10 text segments with the highest relevance and greater than or equal to the first preset threshold can be selected as the first recall text data.

[0072] exist Figure 4 In the illustrated embodiment, retrieval and recall can be performed based on text content to analyze and process the correlation between the text segment and the input question, and the correlation can be limited by a first preset threshold, which effectively improves the accuracy and effectiveness of the first recalled text data.

[0073] Optionally, please refer to Figure 5 , Figure 5 This is a detailed flowchart of step S300 provided in an embodiment of the present application. Step S300 may include steps S310-S330.

[0074] Step S310: Based on the input question, perform a retrieval process in the question database to determine the similarity between each recommended question and the input question.

[0075] Specifically, when performing retrieval and recall within the question database, the input question can be used as a retrieval condition to determine the similarity between the input question and each recommended question in the question database.

[0076] Alternatively, the similarity between the input question and each recommendation question can be determined by keyword matching or vector similarity calculation.

[0077] Step S320: Sort the similarity scores and determine the recommendation questions with similarity scores greater than or equal to the second preset threshold as the recall questions.

[0078] In order to improve the effectiveness of the second recall text data, the similarity can be sorted to determine a question or recommended question with a similarity greater than or equal to a second preset threshold as a recall question related to the input question.

[0079] Optionally, the second preset threshold can be set according to actual conditions and needs, for example, it can be set to 80% to reduce the adverse effects caused by other irrelevant issues. In the case of multiple recommendation questions with similarity greater than or equal to the second preset threshold, the top n recommendation questions with the highest similarity can be selected as recall questions. For example, 10 recommendation questions with the highest similarity and greater than or equal to the second preset threshold can be selected as recall questions.

[0080] Step S330: Based on the identity information stored in the recall question, determine the associated text segment in the text database as the second recall text data.

[0081] Specifically, based on the identity information corresponding to the recalled questions stored in the question database, one or more associated text segments can be identified in the text database as existing second recall text data.

[0082] Optionally, since multiple recommended questions in the question database are stored in association based on corresponding identity information, after determining the recall question, a search can be performed in the text database based on the identity information corresponding to the recall question to obtain the text segment corresponding to that identity information.

[0083] Optionally, the first number of text segments in the first recalled text data and the second number of text segments in the second recalled text data can be equal to improve the consistency of data quantity by having the same number of text segments.

[0084] exist Figure 5In the illustrated embodiment, retrieval and recall can be performed based on the question content to analyze and process the similarity between the input question and the recommended question. First, recall questions similar to the input question are determined, and then the corresponding second recall text data is determined based on the correlation between the recall question and the text segment. The similarity is limited by a second preset threshold, which effectively improves the accuracy and effectiveness of the second recall text data.

[0085] Optionally, please refer to Figure 6 , Figure 6 This is a detailed flowchart of step S400 provided in an embodiment of the present application. Step S400 may include steps S410-S420.

[0086] Step S410: Based on the rearrangement technique, determine the updated order of the first and second recalled text data.

[0087] Considering the potential differences between the two types of recall text data, they can be merged. First, the two types of recall text data are reordered using a reordering technique to determine the corresponding update order.

[0088] Optionally, reranking techniques such as RRF (Reverse Ranking Fusion) and LLM rerank (Large Model Reranking) can be used to process the first and second recall text data. This processing may include combining each text segment from the first and second recall text data with the user's input question into (query, document) pairs, serving as the standard input format required by the reranking model. Based on a cross-encoder, these pairs can be simultaneously input into the model's Transformer layer, allowing them to interact deeply across all attention layers, resulting in relevance scores with higher accuracy than simple vector dot products. Since absolute scores under different queries may not be directly comparable, it is sometimes necessary to normalize the scores of all candidate text segments (e.g., softmax or min-max scaling) to facilitate setting a uniform threshold or subsequent fusion. Alternatively, an LLM (Limited Language Management) can be used as a reorderer. The LLM can be instructed to sort or score multiple text segments based on the input question. Input prompts for the LLM could include: "You are a professional document reordering assistant. Please sort the following text segments according to the relevance of the user's input question. The output format is a sorted list of text segment IDs, with the most relevant first." Alternatively, a model-free reordering method using RRF (Relevance Ranking Function) can be used. RRF is a lightweight, model-free fusion method that sorts text segments in descending order based on their RRF scores to obtain a relevance list. Using various reordering schemes can yield lists sorted based on new scores or rules, allowing for updated sorting from highest to lowest.

[0089] Step S420: Based on the updated sorting, the first and second recalled text data are fused and filtered to obtain intermediate data.

[0090] Among these methods, the two types of recall text data can be merged and filtered based on the updated sorting to reduce the adverse effects of content with low relevance to the input question and obtain intermediate data with high relevance to the input question.

[0091] Optionally, considering the possible contextual relationships between multiple text segments, in order to improve the coherence of intermediate data and reduce the adverse effects caused by low-relevance or repetitive text segments, multiple text segments in the first and second recalled text data can be screened first to filter out some repetitive text segments and low-relevance text segments, and then the remaining text segments can be fused and spliced ​​to obtain complete intermediate data.

[0092] exist Figure 8In the illustrated embodiment, sorting, filtering, and fusion of two different types of recall text data can be performed, which effectively improves the relevance between intermediate data and input questions, thereby improving the accuracy of retrieval results determined based on intermediate data.

[0093] Optionally, please refer to Figure 7 , Figure 7 The following is a detailed flowchart of step S500 provided in an embodiment of this application. Step S500 may include steps S510-S520.

[0094] Step S510: Semantic analysis is performed on the input question using a semantic model to obtain semantic information.

[0095] In order to make the final search results more in line with users' reading comprehension habits, semantic analysis of the input question can be performed using a semantic model to obtain the corresponding semantic information.

[0096] Optionally, the semantic model can map each word of the user's input question to a dense vector in a high-dimensional space, transforming discrete, isolated symbols into continuous, mathematically meaningful vectors. It can calculate the correlation between each word in the sentence and all other words in the sentence, and extract features such as syntax, word order, structure, and semantics based on a multi-layer structure through a neural network model to determine the semantic information contained in the input question.

[0097] Step S520: Using a semantic model, based on semantic information, perform text processing on the intermediate data to obtain the output search results.

[0098] In this process, the intermediate data is further processed using a semantic model based on semantic information to obtain the corresponding search results for users to view.

[0099] Optionally, the semantic model can perform text processing such as reconstruction based on the extracted semantic information and intermediate data as the data basis to obtain the corresponding search results.

[0100] For example, a semantic model can organize semantic information and intermediate data to obtain corresponding prompts, and then output corresponding search results based on the prompts.

[0101] exist Figure 7 In the illustrated embodiment, a semantic model can be used to generate search results that conform to the user's reading comprehension habits based on the input question and intermediate data, effectively improving the user's experience in the search process.

[0102] It should be noted that, considering text databases are typically used in offline applications, such as enterprise intranets, the data within a text database is limited and cannot comprehensively answer all user questions. When a user's input question cannot be answered, using low-relevance content as search results could mislead the user and negatively impact their search experience. Therefore, the semantic model for outputting search results in this application can be trained using negative samples. Negative samples can be non-existent questions generated based on a large model, such as "Where did Sun Wukong and Yue Fei fight?" Training with negative samples enables the semantic model to refuse to answer, i.e., to provide a failed response.

[0103] Optionally, please refer to Figure 8 , Figure 8 This is a flowchart illustrating a third data retrieval method provided in an embodiment of this application. The method may further include steps S530-S540.

[0104] Step S530: Determine the correlation between intermediate data and semantic information through semantic model.

[0105] In step S540, if the relevance is determined to be lower than the third preset threshold, the retrieval failure result is output through the semantic model.

[0106] The semantic model can determine the correlation between intermediate data and semantic information through semantic analysis. If the correlation is lower than the third preset threshold, it indicates that the correlation between the intermediate data and the input question is low, and it cannot output effective data to answer the user's input question. It can output the retrieval failure result to reflect the retrieval failure.

[0107] Optionally, the third preset threshold can be set according to actual conditions and needs. For example, it can be set to 40% to reduce the adverse impact on users of relevant but low-relevance search results.

[0108] Optionally, in the event of a failed retrieval, the semantic model can also provide an answer based on its own learning and historical experience, according to the user's input question.

[0109] exist Figure 8 In the illustrated embodiment, the output of search results with low relevance can be effectively reduced, ensuring that each search result is highly relevant to the corresponding input question, thereby providing users with accurate and effective search results.

[0110] Optionally, please refer to Figure 9 , Figure 9 This is a flowchart illustrating the fourth data retrieval method provided in this application embodiment. The method may further include steps S710-S720.

[0111] Step S710: Obtain various types of user input information.

[0112] When users ask questions, they can input information in various data formats, such as text, images, and audio.

[0113] Step S720: Process the input information to obtain the input question in text form.

[0114] In order to facilitate retrieval and analysis, considering that users may input information in various data formats, the various types of input information can be processed and uniformly converted into text input questions, so as to facilitate subsequent retrieval and analysis based on the input questions.

[0115] Optionally, for user-inputted image information, image recognition technology can be used to identify and extract text information from the image. Based on semantic analysis, descriptive text in natural language can be generated as the input question. Alternatively, a pre-trained convolutional neural network can be used to understand the image content, and the extracted visual features can be input into a language model to generate descriptive text as the input question. For user-inputted audio information, audio processing methods such as noise reduction, silence removal, audio normalization, and channel separation can be used to process the audio information, converting the audio waveform into spectral features more suitable for model processing. An acoustic model can then map the audio features to phonemes or sub-word units. Based on the acoustic model and according to the statistical laws of language, the recognized text can be corrected to better conform to grammar and common sense, resulting in a text-based input question. For user-inputted text information, keyword extraction and other methods can also be used to reduce the influence of irrelevant text content, resulting in a concise text-based input question.

[0116] exist Figure 9 In the illustrated embodiment, multiple input modalities can be provided to users, and the input information of multiple modalities can be uniformly converted into input questions for processing to meet various types of retrieval needs.

[0117] In summary, the embodiments of this application can generate recommendation questions for the retrieved text segments, solving the problem of semantically divergent generation in query extension methods and ensuring the effectiveness and reliability of the generated content. Furthermore, the question database is constructed in advance during database construction, without affecting the time cost of each query, thus guaranteeing a good user experience. By generating recommendation questions, a "question-to-question" match with the user query is ensured, and 3-5 recommendation questions can be generated simultaneously for each text segment, covering most of the key information in the text segment, effectively avoiding the poor matching effect and missed detection problems in existing retrieved fragment summarization methods. In actual RAG-based document question-and-answer application scenarios, the embodiments of this application can effectively reduce the recall and missed detection situations.

[0118] This application also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the steps in any of the data retrieval methods described above.

[0119] In the several embodiments provided in this application, it should be understood that the disclosed device can also be implemented in other ways. The device embodiments described above are merely illustrative; for example, the block diagrams in the accompanying drawings illustrate the possible architecture, functions, and operations of the device according to various embodiments of this application. In this regard, each block in the block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram, and combinations of block diagrams, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0120] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0121] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0122] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

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

[0124] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A data retrieval method, characterized in that, The method includes: Based on the user's input question, a retrieval and recall operation is performed in the text database to obtain the first retrieved text data; Based on the input question, a retrieval and recall operation is performed in the question database to obtain the second recall text data; The first and second recalled text data are fused together to obtain intermediate data. Based on the input question and the intermediate data, the semantic model is used to determine the output search results.

2. The method according to claim 1, characterized in that, in, The problem database is constructed in the following ways: Using the semantic model, semantic analysis is performed on each text segment in the text database to obtain multiple recommendation questions of target types; wherein, the target types include: overall content questions, key content questions, and type classification questions; Determine the identity information of the text segment associated with each of the recommendation questions; The recommendation questions are stored based on the identity information to obtain the question database.

3. The method according to claim 1, characterized in that, in, The text database includes multiple text segments; The process of retrieving and recalling text data based on user input questions in a text database to obtain the first retrieved text data includes: Based on the user's input question, a retrieval process is performed in the text database to determine the relevance of each text segment to the input question; The multiple correlations are sorted, and the text segments whose correlations are greater than or equal to a first preset threshold are determined as the first recall text data.

4. The method according to claim 1, characterized in that, The step of retrieving and recalling data from the question database based on the input question to obtain second recall text data includes: Based on the input question, a retrieval process is performed in the question database to determine the similarity between each recommended question and the input question; The similarity scores are sorted, and the recommendation questions with similarity scores greater than or equal to a second preset threshold are determined as the recall questions. Based on the identity information stored in the recall question, the associated text segment is determined in the text database as the second recall text data.

5. The method according to claim 1, characterized in that, The process of fusing the first recalled text data and the second recalled text data to obtain intermediate data includes: Based on the rearrangement technique, the updated order of the first recalled text data and the second recalled text data is determined; Based on the updated sorting, the first recalled text data and the second recalled text data are fused and filtered to obtain the intermediate data.

6. The method according to claim 1, characterized in that, The step of determining the output retrieval results based on the input question and the intermediate data using a semantic model includes: The semantic model is used to perform semantic analysis on the input question to obtain semantic information; Using the semantic model and based on the semantic information, the intermediate data is processed to obtain the output search results.

7. The method according to claim 6, characterized in that, in, The semantic model is obtained through training on negative samples; the method further includes: The semantic model is used to determine the correlation between the intermediate data and the semantic information. If the relevance is determined to be below a third preset threshold, the semantic model will output a search failure result.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: Obtain various types of user input information; The input information is processed to obtain the input question in text form.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing program instructions, and the processor executing the steps of the method according to any one of claims 1-8 when running the program instructions.

10. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the steps of the method according to any one of claims 1-8.