Adaptive retrieval method, device, equipment and storage medium

By dynamically selecting the search method in the question and answer system and determining the search method according to the complexity of the query statement, the problem of inefficiency in the existing question and answer system when processing complex queries is solved, and efficient and accurate search results are achieved.

CN119760072APending Publication Date: 2025-04-04CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411819678.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When handling complex query statements, existing question-and-answer systems have high computational overhead and low efficiency, making it difficult to balance retrieval efficiency and accuracy.

Method used

By determining the target search intent based on the query statement, the target search complexity is determined, and dynamically selecting the most appropriate search method for query based on the correspondence between the search complexity and the search method.

Benefits of technology

It realizes dynamic selection of search methods based on the complexity of the query statement, reduces calculation overhead, improves search efficiency, and ensures high accuracy, achieving a balance between search accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760072A_ABST
    Figure CN119760072A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an adaptive retrieval method, device, equipment and storage medium. The present disclosure determines the target retrieval complexity of a query statement based on the target query intent of the query statement; determines the target retrieval method corresponding to the target retrieval complexity based on the correspondence between the target retrieval complexity and the retrieval method; retrieves the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement. The present disclosure can dynamically select the most appropriate retrieval method according to the complexity of the query statement, can better adapt to the retrieval requirements of query statements of different complexities, reduce unnecessary computing overhead, improve retrieval efficiency while ensuring high retrieval accuracy, and achieve a balance between retrieval accuracy and retrieval efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to an adaptive retrieval method, device, equipment and storage medium. Background Art

[0002] The question-answering system can retrieve data based on the user's query and output the answer corresponding to the query. The current question-answering system mainly relies on relevant language models to generate answers.

[0003] At present, the question-answering system mainly uses simple retrieval methods and complex retrieval methods to retrieve data for query statements. In the simple retrieval method, the question-answering system will directly search in the local knowledge base without accessing the external network. Although this method has high retrieval efficiency, it may not provide accurate answers to complex query statements; in the complex retrieval method, the question-answering system will first search in the local knowledge base. If the search in the local knowledge base fails, it will then search in external knowledge data outside the local knowledge base through the network. Although this method can handle complex query statements, it has high computational overhead and low efficiency.

[0004] Therefore, there is an urgent need for a retrieval method that can balance retrieval efficiency and retrieval accuracy to meet the current question-answering retrieval needs. Summary of the invention

[0005] In order to solve the above technical problems, the present disclosure provides an adaptive retrieval method, device, equipment and storage medium.

[0006] A first aspect of the present disclosure provides an adaptive retrieval method, comprising:

[0007] Based on the target query intent of the query statement, determine the target retrieval complexity of the query statement;

[0008] Based on the corresponding relationship between the target retrieval complexity and the retrieval method, determining the target retrieval method corresponding to the target retrieval complexity;

[0009] The answer to the query statement is retrieved based on the target retrieval method to obtain the target answer statement of the query statement.

[0010] A second aspect of the present disclosure provides an adaptive retrieval device, comprising:

[0011] A first determination module is used to determine the target retrieval complexity of the query statement based on the target query intent of the query statement;

[0012] A second determination module is used to determine the target retrieval method corresponding to the target retrieval complexity based on the corresponding relationship between the target retrieval complexity and the retrieval method;

[0013] The retrieval module is used to retrieve the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement.

[0014] A third aspect of the present disclosure provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the adaptive retrieval method of the first aspect can be implemented.

[0015] A fourth aspect of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the adaptive retrieval method of the first aspect can be implemented.

[0016] Compared with the prior art, the technical solution provided by the present invention has the following advantages:

[0017] The present disclosure determines the target retrieval complexity of a query statement based on the target query intent of the query statement; determines the target retrieval method corresponding to the target retrieval complexity based on the correspondence between the target retrieval complexity and the retrieval method; retrieves the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement. The present disclosure can dynamically select the most appropriate retrieval method according to the complexity of the query statement, can better adapt to the retrieval requirements of query statements of different complexities, reduces unnecessary computing overhead, improves retrieval efficiency while ensuring high retrieval accuracy, and achieves a balance between retrieval accuracy and retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 is a flow chart of an adaptive retrieval method provided by an embodiment of the present disclosure;

[0021] Figure 2 is a flow chart of another adaptive retrieval method provided by an embodiment of the present disclosure;

[0022] Figure 3 is a structural schematic diagram of an adaptive retrieval device provided by an embodiment of the present disclosure;

[0023] Figure 4It is a structural diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0027] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0028] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0029] The adaptive retrieval method provided by the embodiments of the present disclosure may be executed by a computer device, which may be understood as any device with processing and computing capabilities, and may include but is not limited to mobile terminals such as smart phones, laptops, personal digital assistants (PDAs), tablet computers (PADs), vehicle-mounted terminals, wearable devices, etc., as well as fixed electronic devices such as digital TVs, desktop computers, smart home devices, etc.

[0030] In order to better understand the inventive concept of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure are described below in conjunction with exemplary embodiments.

[0031] Figure 1 is a flowchart of an adaptive retrieval method provided by an embodiment of the present disclosure. The method can be executed by a computer device, such as Figure 1 As shown, the adaptive retrieval method provided in this embodiment includes the following steps:

[0032] Step 110: Determine the target retrieval complexity of the query statement based on the target query intent of the query statement.

[0033] In the disclosed embodiment, a question-answering system is provided in the computer device, and the question-answering system can receive a user's query statement and determine a target retrieval complexity of the query statement based on the target query intent of the query statement.

[0034] The query intent can be understood as the query target of the query statement. For example, when the query statement is "What is the current usage of the conference room in area A?", the query intent of the query statement is "The current usage of the conference room in area A"; for another example, when the query statement is "What is the current political news in city B today?", the query intent of the query statement is "The current political news in city B today".

[0035] The retrieval complexity of a query statement can be understood as the difficulty of retrieving the answer to the query statement. The more difficult it is to retrieve the answer to the query statement, the higher the retrieval complexity of the query statement; the easier it is to retrieve the answer to the query statement, the lower the retrieval complexity of the query statement.

[0036] In some embodiments, determining the target retrieval complexity of a query statement based on the target query intent of the query statement may include steps 1101-1102:

[0037] Step 1101: Input a query statement into a preset language model, perform semantic analysis on the query statement based on the language model, and obtain a target query intent of the query statement.

[0038] In the embodiments of the present disclosure, the preset language model can be understood as a model that can understand and generate human language. For example, the preset language model can be a large language model (LLM), which can be understood as a language model trained on a large amount of text data using a deep learning algorithm. The language model can capture the complexity and nuances of language and can understand and generate human language.

[0039] In the disclosed embodiment, the computer device may input a query statement into a preset language model, perform semantic analysis on the query statement based on the language model, and obtain a target query intent of the query statement.

[0040] Step 1102: Based on the correspondence between the target query intent and the retrieval complexity, determine the target retrieval complexity corresponding to the target query intent.

[0041] In the embodiment of the present disclosure, the corresponding relationship between each query intent and the retrieval complexity is pre-stored in the computer device or language model. The computer device or language model can determine the target retrieval complexity corresponding to the target query intent based on the corresponding relationship between the target query intent and the retrieval complexity.

[0042] For example, when the query intention is the office facilities within the enterprise, since the office facilities within the enterprise can be retrieved only in the enterprise's internal knowledge base without the need for external data of the enterprise, the retrieval complexity corresponding to the query intention can be level one; when the query intention is today's current affairs news in city B, since today's current affairs news in city B requires access to external network data to obtain, the retrieval complexity corresponding to the query intention can be level two.

[0043] Step 120: Based on the corresponding relationship between the target retrieval complexity and the retrieval method, determine the target retrieval method corresponding to the target retrieval complexity.

[0044] In the embodiment of the present disclosure, the corresponding relationship between each retrieval complexity and the retrieval mode is pre-stored in the computer device. The computer device can determine the target retrieval mode corresponding to the target retrieval complexity based on the corresponding relationship between the target retrieval complexity and the retrieval mode.

[0045] The search method may include at least one of no search, local knowledge base search, and external network search.

[0046] Among them, the search complexity corresponding to no search, local knowledge base search and external network search increases in turn.

[0047] No search can be understood as a search method that directly outputs the answer statement corresponding to the query statement without searching.

[0048] Local knowledge base retrieval can be understood as a retrieval method for retrieving answers to query statements in a local knowledge base, without accessing an external network.

[0049] External network search can be understood as a search method for searching answers to query statements in an external network. For example, the external network can be a Web network.

[0050] Step 130: Retrieve the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement.

[0051] In the disclosed embodiment, after determining the target retrieval method corresponding to the query statement, the computer device may search for the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement.

[0052] The disclosed embodiment determines the target retrieval complexity of the query statement based on the target query intent of the query statement; determines the target retrieval method corresponding to the target retrieval complexity based on the correspondence between the target retrieval complexity and the retrieval method; retrieves the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement. The disclosed embodiment can dynamically select the most appropriate retrieval method according to the complexity of the query statement, can better adapt to the retrieval requirements of query statements of different complexities, reduces unnecessary computing overhead, improves retrieval efficiency while ensuring high retrieval accuracy, and achieves a balance between retrieval accuracy and retrieval efficiency.

[0053] In some embodiments of the present disclosure, the above-mentioned target-based retrieval method retrieves the answer to the query statement to obtain the target answer statement of the query statement, and the computer device can execute Figure 2 A flowchart of an adaptive retrieval method is provided, such as Figure 2 As shown, the adaptive retrieval method provided in this embodiment includes the following steps:

[0054] Step 210: Search for answers to the query statement based on the target search method to obtain answer data for the query statement.

[0055] The answer data of the query statement can be understood as data related to the answer of the query statement.

[0056] Step 220: perform answer quality evaluation on the answer data to obtain the answer quality of the answer data.

[0057] In the disclosed embodiment, after obtaining answer data for a query statement, the computer device may perform answer quality evaluation on the answer data to obtain the answer quality of the answer data.

[0058] The answer quality of the answer data can be understood as the relevance of the answer data to the query statement.

[0059] In some embodiments, the answer quality evaluation is performed on the answer data to obtain the answer quality of the answer data. The computer device may execute S11-S13:

[0060] S11, inputting a query statement, answer data of the query statement and a question statement with a preset relevance into a preset language model, and determining based on the preset language model whether the relevance of the answer data to the query statement is greater than or equal to a preset relevance threshold.

[0061] The preset correlation threshold can be set as needed and is not limited here.

[0062] For example, the preset relevance question sentence may be “How relevant is the answer data of the query sentence to the query sentence?”.

[0063] S12: When the relevance between the answer data and the query statement is greater than or equal to a preset relevance threshold, determine that the answer quality of the answer data meets a first preset quality requirement.

[0064] The first preset quality requirement can be set as needed and is not limited here.

[0065] S13: When the relevance between the answer data and the query statement is less than a preset relevance threshold, it can be determined that the answer quality of the answer data does not meet a first preset quality requirement.

[0066] Step 230: When the answer quality of the answer data meets the first preset quality requirement, generate an answer for the answer data based on a preset language model to obtain an initial answer statement for the query statement.

[0067] Specifically, when the answer quality of the answer data meets the first preset quality requirement, it can be determined that the answer data is related to the query statement, the answer data can be input into a preset language model, and an answer can be generated for the answer data based on the preset language model to obtain an initial answer statement for the query statement.

[0068] Step 240: Evaluate the answer quality of the initial answer statement to obtain the answer quality of the initial answer statement.

[0069] In the disclosed embodiment, after obtaining the initial answer statement, the computer device may perform an answer quality evaluation on the initial answer statement to obtain the answer quality of the initial answer statement.

[0070] The answer quality of the initial answer statement can be understood as whether the initial answer statement is a hallucination statement and the degree of answer matching of the initial answer statement relative to the query statement.

[0071] In some embodiments, the computer device may perform S21-S25 to evaluate the answer quality of the initial answer statement and obtain the answer quality of the initial answer statement:

[0072] S21. Determine whether the initial answer sentence is a hallucination sentence based on a preset language model.

[0073] Hallucination sentences can be understood as sentences generated by the language model that are contrary to the facts of the real world, that is, sentences that violate normal laws or rules.

[0074] S22. When the initial answer statement is a hallucination statement, re-execute the answer generation for the answer data based on the preset language model to obtain the initial answer statement of the query statement and the subsequent steps.

[0075] S23. When the initial answer statement is not a hallucination statement, the query statement, the initial answer statement and the question statement with a preset matching degree are input into a preset language model, and based on the preset language model, it is determined whether the answer matching degree of the initial answer statement relative to the query statement is greater than or equal to a preset matching degree threshold.

[0076] For example, the preset relevance question statement may be “How well does the initial answer statement match the query statement?”.

[0077] The preset matching degree threshold can be set as needed and is not limited here.

[0078] S24: When the answer matching degree of the initial answer statement relative to the query statement is greater than or equal to a preset matching degree threshold, determine that the answer quality of the initial answer statement meets a second preset quality requirement.

[0079] The second preset quality requirement can be set as needed and is not limited here.

[0080] S25. When the answer matching degree of the initial answer statement relative to the query statement is less than a preset matching degree threshold, determine that the answer quality of the initial answer statement does not meet a second preset quality requirement.

[0081] Step 250: When the answer quality of the initial answer statement meets the second preset quality requirement, the initial answer statement is determined as the target answer statement of the query statement.

[0082] When the answer quality of the initial answer statement meets the second preset quality requirement, it means that the initial answer statement matches the query statement, and the initial answer statement can be determined as the target answer statement of the query statement.

[0083] Step 260: When the answer quality of the answer data does not meet the first preset quality requirement or when the answer quality of the initial answer statement does not meet the second preset quality requirement, re-execute the search for the answer to the query statement based on the target search method to obtain the answer data of the query statement and the subsequent steps.

[0084] In some embodiments of the present disclosure, the above Figure 2 In the example, the computer device can count the number of times the answer to the query statement is retrieved to obtain the number of retrievals corresponding to the query statement:

[0085] When the number of searches corresponding to the query statement reaches a preset number, if there is no initial answer statement for the query statement, the answer data of the query statement obtained in the most recent search is generated based on the preset language model to obtain a target answer statement for the query statement;

[0086] If there is an initial answer statement for the query statement, the initial answer statement for the query statement retrieved most recently is determined as the target answer statement for the query statement;

[0087] Alternatively, when the number of searches reaches a preset number, if the answer quality of the answer data of the query statement obtained in the most recent search does not meet the first preset quality requirement or the answer quality of the initial answer statement of the query statement obtained in the most recent search does not meet the second preset quality requirement, the search is terminated and a prompt message indicating that the query statement retrieval failed is output.

[0088] The preset number of times can be set as needed and is not limited here.

[0089] Therefore, in the process of retrieving answers to query statements and generating target answer statements for query statements, the quality of the retrieved data can be evaluated and monitored based on the self-correction mechanism, thereby further improving the accuracy of the retrieval.

[0090] In some embodiments of the present disclosure, the answer to the query statement is retrieved based on the target retrieval method to obtain the target answer statement of the query statement. The computer device can determine the target retrieval database corresponding to the target retrieval method based on the correspondence between the target retrieval method and the retrieval database; the answer to the query statement is retrieved in the target retrieval database to obtain the target answer statement of the query statement.

[0091] In some embodiments of the present disclosure, the answer to the query statement is retrieved based on the target retrieval method to obtain the answer data of the query statement. The computer device can determine the target retrieval database corresponding to the target retrieval method based on the correspondence between the target retrieval method and the retrieval database; the answer to the query statement is retrieved in the target retrieval database to obtain the answer data of the query statement.

[0092] Among them, the retrieval database may include a question-answering system database, a local knowledge base, and an external network database.

[0093] The question-answering system database is the database of the question-answering system itself.

[0094] A local knowledge base is a knowledge base that can be accessed without an external network, such as an internal database of the company to which the computer belongs, a database of the computer itself, etc.

[0095] An external network database is a database that can only be accessed through an external network, such as a database on the Internet.

[0096] The corresponding relationship between each search method and the search database is pre-stored in the computer device. For example, the corresponding relationship between the search method and the search database may include:

[0097] The search database corresponding to no search is the question-answering system database;

[0098] The search database corresponding to the local knowledge base search is the local knowledge base;

[0099] The search database corresponding to the external network search is the external network database.

[0100] In this way, the search can be directly performed in the retrieval database corresponding to the query statement to obtain the target answer statement of the query statement, reducing unnecessary computing overhead, improving the retrieval efficiency while ensuring high retrieval accuracy, and achieving a balance between retrieval accuracy and retrieval efficiency.

[0101] Figure 3 is a schematic diagram of the structure of an adaptive retrieval device provided by an embodiment of the present disclosure, and the device can be understood as the above-mentioned computer device or a part of the functional modules in the above-mentioned computer device. Figure 3 As shown, the adaptive retrieval device 300 includes:

[0102] A first determination module 310 is used to determine the target retrieval complexity of the query statement based on the target query intent of the query statement;

[0103] A second determination module 320, configured to determine a target retrieval method corresponding to the target retrieval complexity based on a correspondence between the target retrieval complexity and the retrieval method;

[0104] The retrieval module 330 is used to retrieve the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement.

[0105] Optionally, the first determining module includes:

[0106] An analysis submodule is used to input the query statement into a preset language model, perform semantic analysis on the query statement based on the preset language model, and obtain the target query intent of the query statement;

[0107] The complexity determination submodule is used to determine the target retrieval complexity corresponding to the target query intent based on the corresponding relationship between the target query intent and the retrieval complexity.

[0108] Optionally, the above retrieval module includes:

[0109] A first retrieval submodule is used to retrieve answers to the query statements based on a target retrieval method to obtain answer data for the query statements;

[0110] A first evaluation submodule is used to evaluate the answer quality of the answer data to obtain the answer quality of the answer data;

[0111] A first generation submodule, configured to generate an answer for the answer data based on a preset language model to obtain an initial answer sentence when the answer quality of the answer data meets a first preset quality requirement;

[0112] The second evaluation submodule is used to evaluate the answer quality of the initial answer statement to obtain the answer quality of the initial answer statement;

[0113] A first determination submodule is used to determine the initial answer statement as a target answer statement of the query statement when the answer quality of the initial answer statement meets a second preset quality requirement;

[0114] The execution submodule is used to re-execute the retrieval of the answer to the query statement based on the target retrieval method when the answer quality of the answer data does not meet the first preset quality requirement or the answer quality of the initial answer statement does not meet the second preset quality requirement, so as to obtain the answer data of the query statement and the subsequent steps.

[0115] Optionally, the first evaluation submodule includes:

[0116] A first judgment unit, configured to input a query statement, answer data, and a question statement with a preset relevance into a preset language model, and to judge whether the relevance between the answer data and the query statement is greater than or equal to a preset relevance threshold based on the preset language model;

[0117] A first determining unit, configured to determine that the answer quality of the answer data meets a first preset quality requirement when the relevance is greater than or equal to a preset relevance threshold;

[0118] The second determining unit is configured to determine that the answer quality of the answer data does not meet a first preset quality requirement when the correlation is less than a preset correlation threshold.

[0119] Optionally, the second evaluation submodule includes:

[0120] A second judgment unit, used for judging whether the initial answer sentence is a hallucination sentence based on a preset language model;

[0121] An execution unit, for re-executing the steps of generating an answer based on the preset language model for the answer data to obtain the initial answer statement of the query statement and subsequent steps when the initial answer statement is a hallucination statement;

[0122] A third judgment unit is used to input the query sentence, the initial answer sentence and the preset matching degree question sentence into a preset language model when the initial answer sentence is not a hallucination sentence, and judge whether the answer matching degree of the initial answer sentence relative to the query sentence is greater than or equal to a preset matching degree threshold based on the preset language model;

[0123] A third determining unit, configured to determine that the answer quality of the initial answer statement meets a second preset quality requirement when the matching degree is greater than or equal to a preset matching degree threshold;

[0124] The fourth determining unit is used to determine that the answer quality of the initial answer statement does not meet the second preset quality requirement when the matching degree is less than a preset matching degree threshold.

[0125] Optionally, the above retrieval module includes:

[0126] A counting submodule, used to count the number of times the answer to the query statement is retrieved, and obtain the number of retrievals corresponding to the query statement;

[0127] A second generation submodule is used for, when the number of retrievals reaches a preset number, if there is no initial answer statement for the query statement, generating an answer for the answer data of the query statement obtained in the most recent retrieval based on a preset language model to obtain a target answer statement for the query statement;

[0128] A second determination submodule is used to determine the initial answer statement of the query statement obtained by the most recent retrieval as the target answer statement of the query statement if there is an initial answer statement of the query statement;

[0129] Or, a prompt submodule is used to terminate the search and output a prompt message indicating that the query statement retrieval failed when the number of retrieval times reaches a preset number, if the answer quality of the answer data of the query statement obtained in the most recent retrieval does not meet the first preset quality requirement or the answer quality of the initial answer statement of the query statement obtained in the most recent retrieval does not meet the second preset quality requirement.

[0130] Optionally, the above retrieval module includes:

[0131] A database determination submodule, used to determine a target retrieval database corresponding to the target retrieval method based on the corresponding relationship between the target retrieval method and the retrieval database;

[0132] The second retrieval submodule is used to retrieve the answer to the query statement in the target retrieval database to obtain the target answer statement of the query statement.

[0133] Optionally, the first search submodule includes:

[0134] A database determining unit, configured to determine a target retrieval database corresponding to the target retrieval method based on a corresponding relationship between the target retrieval method and the retrieval database;

[0135] The retrieval unit is used to retrieve the answer to the query statement in the target retrieval database to obtain the answer data of the query statement.

[0136] The adaptive retrieval device provided in the embodiments of the present disclosure can implement the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.

[0137] The embodiments of the present disclosure also provide a computer device, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method of any of the above embodiments can be implemented, and its execution method and beneficial effects are similar and will not be repeated here.

[0138] Figure 4 is a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the computer device 400 may include a processor 410 and a memory 420, wherein the memory 420 stores a computer program 421, and when the computer program 421 is executed by the processor 410, the method provided by any of the above embodiments can be implemented, and its execution method and beneficial effects are similar and will not be repeated here.

[0139] Of course, to simplify, Figure 4 Only some of the components related to the present invention in the computer device 400 are shown, and components such as a bus, an input / output interface, an input device, and an output device are omitted. In addition, according to specific application conditions, the computer device 400 may also include any other appropriate components.

[0140] An embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.

[0141] The above-mentioned computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0142] The computer program may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer device, partially on the user's device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device or server.

[0143] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0144] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0145] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An adaptive retrieval method, characterized in that: include: Determining a target retrieval complexity of the query statement based on the target query intent of the query statement; Based on the corresponding relationship between the target retrieval complexity and the retrieval method, determining the target retrieval method corresponding to the target retrieval complexity; The answer to the query statement is retrieved based on the target retrieval method to obtain a target answer statement for the query statement.

2. The method according to claim 1, characterized in that The determining the target retrieval complexity of the query statement based on the target query intent of the query statement includes: Inputting the query statement into a preset language model, performing semantic analysis on the query statement based on the preset language model, and obtaining a target query intent of the query statement; Based on the corresponding relationship between the target query intent and the retrieval complexity, the target retrieval complexity corresponding to the target query intent is determined.

3. The method according to claim 1, characterized in that The step of retrieving the answer to the query statement based on the target retrieval method to obtain a target answer statement for the query statement includes: Retrieving the answer to the query statement based on the target retrieval method to obtain answer data for the query statement; Performing answer quality evaluation on the answer data to obtain answer quality of the answer data; When the answer quality of the answer data meets the first preset quality requirement, generate an answer for the answer data based on a preset language model to obtain an initial answer statement for the query statement; Performing answer quality evaluation on the initial answer statement to obtain the answer quality of the initial answer statement; When the answer quality of the initial answer statement meets the second preset quality requirement, determining the initial answer statement as the target answer statement of the query statement; When the answer quality of the answer data does not meet the first preset quality requirement or when the answer quality of the initial answer statement does not meet the second preset quality requirement, re-execute the search for the answer to the query statement based on the target search method to obtain the answer data of the query statement and subsequent steps.

4. The method according to claim 3, characterized in that The step of evaluating the answer quality of the answer data to obtain the answer quality of the answer data includes: Inputting the query statement, the answer data and a question statement with a preset relevance into a preset language model, and determining whether the relevance between the answer data and the query statement is greater than or equal to a preset relevance threshold based on the preset language model; When the relevance is greater than or equal to the preset relevance threshold, determining that the answer quality of the answer data meets a first preset quality requirement; When the relevance is less than the preset relevance threshold, it is determined that the answer quality of the answer data does not meet a first preset quality requirement.

5. The method according to claim 3, characterized in that: The step of evaluating the answer quality of the initial answer statement to obtain the answer quality of the initial answer statement includes: Determining whether the initial answer sentence is a hallucination sentence based on the preset language model; When the initial answer statement is a hallucination statement, re-execute the steps of generating an answer based on the answer data based on the preset language model to obtain the initial answer statement of the query statement and the steps thereafter; When the initial answer statement is not a hallucination statement, the query statement, the initial answer statement and the preset matching question statement are input into the preset language model, and based on the preset language model, it is determined whether the matching degree of the initial answer statement relative to the query statement is greater than or equal to a preset matching threshold; When the matching degree is greater than or equal to the preset matching degree threshold, determining that the answer quality of the initial answer statement meets a second preset quality requirement; When the matching degree is less than the preset matching degree threshold, it is determined that the answer quality of the initial answer statement does not meet a second preset quality requirement.

6. The method according to claim 3, characterized in that The method further comprises: Counting the number of times the answer to the query statement is searched, to obtain the number of searches corresponding to the query statement; When the number of searches reaches a preset number, if there is no initial answer statement for the query statement, then based on a preset language model, answer generation is performed on the answer data of the query statement obtained in the most recent search to obtain a target answer statement for the query statement; If there is an initial answer statement for the query statement, the initial answer statement for the query statement retrieved most recently is determined as the target answer statement for the query statement; Or, when the number of searches reaches a preset number, if the answer quality of the answer data of the query statement obtained in the most recent search does not meet the first preset quality requirement or the answer quality of the initial answer statement of the query statement obtained in the most recent search does not meet the second preset quality requirement, the search is terminated and a prompt message indicating that the query statement retrieval failed is output.

7. The method according to any one of claims 1 to 3, characterized in that The retrieving the answer to the query statement based on the target retrieval method includes: Based on the correspondence between the target search method and the search database, determining the target search database corresponding to the target search method; The answer to the query statement is searched in the target search database.

8. An adaptive retrieval device, characterized in that: include: A first determination module, configured to determine a target retrieval complexity of the query statement based on a target query intent of the query statement; A second determination module is used to determine the target retrieval method corresponding to the target retrieval complexity based on the corresponding relationship between the target retrieval complexity and the retrieval method; The retrieval module is used to retrieve the answer to the query statement based on the target retrieval method to obtain the target answer statement of the query statement.

9. A computer device, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the adaptive retrieval method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the adaptive retrieval method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Text retrieval method, device and equipment, readable storage medium and program product

    CN120804288A