Data retrieval method, device and equipment
By receiving search requests and auxiliary query information, and dynamically adjusting search representations and data representations using encoders and large language models, the problem of fixed data search results in the prior art is solved, and more flexible and efficient data retrieval is achieved.
Patent Information
- Application Number
- CN202411825946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The performance of existing data retrieval methods in single-modal or cross-modal data retrieval is affected by the effect of characterization models, resulting in fixed search results and difficult to meet the diverse needs of users.
By receiving search requests and auxiliary query information, the encoder generates search representations, and inputs the auxiliary query information into the large language model to obtain search constraint information, and dynamically adjusts the search representation and data representation to build a representation database that meets user needs.
It realizes temporary mapping transformation of the representation space without changing the representation model, providing search results that are more in line with user needs, and improving the flexibility and efficiency of data retrieval.
Smart Images

Figure CN119807245A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a data retrieval method, device and equipment. Background Art
[0002] In single-modal or cross-modal data retrieval (such as vector retrieval or representation retrieval, which are becoming more and more important as people pay more and more attention to their privacy data), the retrieval performance is mainly affected by the effect of the representation model (such as encoder, etc.). Representation learning determines whether the representation space of the target data set is constructed reasonably, and then determines the determination of the similarity between data. Once the representation space is determined, the retrieval results are basically fixed. For this reason, it is necessary to provide a more flexible data retrieval method, so that when performing data retrieval, the representation space can be temporarily mapped and transformed without changing the representation model, thereby providing users with retrieval results that better meet their needs. Summary of the invention
[0003] The purpose of the embodiments of this specification is to provide a more flexible data retrieval method, so that when performing data retrieval, the representation space can be temporarily mapped and transformed without changing the representation model, thereby providing users with retrieval results that better meet their needs.
[0004] In order to implement the above technical solution, the embodiments of this specification are implemented as follows: A data retrieval method provided in an embodiment of the present specification includes: receiving a retrieval request for a target object to be retrieved, and obtaining auxiliary query information for the target object. Inputting information related to the target object in the retrieval request into an encoder to obtain a retrieval representation corresponding to the retrieval request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain retrieval constraint information corresponding to the retrieval request. Adjusting the retrieval representation based on the retrieval constraint information to obtain an adjusted retrieval representation, and adjusting the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. Querying the adjusted data representation that matches the adjusted retrieval representation from the representation database, and determining the target retrieval data retrieved from the retrieval database based on the retrieval request based on the retrieval constraint information.
[0005] The embodiment of the present specification provides a data retrieval device, the device comprising: a request module, receiving a retrieval request for a target object to be retrieved, and obtaining auxiliary query information for the target object. An encoding module, inputting information related to the target object in the retrieval request into an encoder, obtaining a retrieval representation corresponding to the retrieval request, and inputting prompt information generated based on the auxiliary query information into a large language model, obtaining retrieval constraint information corresponding to the retrieval request. A representation adjustment module, adjusting the retrieval representation based on the retrieval constraint information to obtain an adjusted retrieval representation, and adjusting the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request based on the retrieval constraint information, respectively, to obtain a representation database composed of the adjusted data representations. A retrieval module, querying the adjusted data representation matching the adjusted retrieval representation from the representation database, and determining the target retrieval data retrieved from the retrieval database based on the retrieval request based on the queried adjusted data representation.
[0006] The embodiment of the present specification provides a data retrieval device, the data retrieval device comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor receives a retrieval request for a target object to be retrieved, and obtains auxiliary query information for the target object. The information related to the target object in the retrieval request is input into an encoder to obtain a retrieval representation corresponding to the retrieval request, and the prompt information generated based on the auxiliary query information is input into a large language model to obtain retrieval constraint information corresponding to the retrieval request. The retrieval representation is adjusted based on the retrieval constraint information to obtain an adjusted retrieval representation, and the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request is adjusted based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. The adjusted data representation matching the adjusted retrieval representation is queried from the representation database, and the target retrieval data retrieved from the retrieval database based on the retrieval request is determined based on the queried adjusted data representation.
[0007] The embodiment of the present specification also provides a storage medium, which is used to store computer executable instructions. When the executable instructions are executed by the processor, the following process is implemented: receiving a search request for a target object to be retrieved, and obtaining auxiliary query information for the target object. Inputting the information related to the target object in the search request into the encoder to obtain the search representation corresponding to the search request, and inputting the prompt information generated based on the auxiliary query information into the large language model to obtain the search constraint information corresponding to the search request. Adjusting the search representation based on the search constraint information to obtain an adjusted search representation, and adjusting the data representation corresponding to each search data contained in the search database corresponding to the search request based on the search constraint information, respectively, to obtain a representation database composed of the adjusted data representations. Querying the adjusted data representation matching the adjusted search representation from the representation database, and determining the target search data retrieved from the search database based on the search request based on the queried adjusted data representation.
[0008] The embodiments of this specification also provide a computer program product, including a computer program, which implements the following process when executed by a processor: receiving a search request for a target object to be searched, and obtaining auxiliary query information for the target object. Inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request. Adjusting the search representation based on the search constraint information to obtain an adjusted search representation, and adjusting the data representation corresponding to each search data contained in the search database corresponding to the search request based on the search constraint information to obtain a representation database composed of the adjusted data representations. Querying the adjusted data representation that matches the adjusted search representation from the representation database, and determining the target search data retrieved from the search database based on the search request based on the queried adjusted data representation. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 This is an embodiment of a data retrieval method of this specification; Figure 2 This is a schematic diagram of a data retrieval page of this manual; Figure 3 A schematic diagram of a data retrieval process of this specification; Figure 4 is a schematic diagram of another data retrieval process of this specification; Figure 5 Another data retrieval method embodiment of the present specification; Figure 6 This is a schematic diagram of a model training process in this manual; Figure 7 This is an embodiment of a data retrieval device of the present specification; Figure 8 This is an embodiment of a data retrieval device in this specification. DETAILED DESCRIPTION
[0010] The embodiments of this specification provide a data retrieval method, device and equipment.
[0011] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0012] The embodiments of this specification provide a data retrieval mechanism. In single-modal or cross-modal data retrieval (such as vector retrieval or representation retrieval, etc.), the retrieval performance is mainly affected by the effect of the representation model (such as encoder, etc.). Representation learning determines whether the representation space of the target data set is constructed reasonably, and further determines the determination of the similarity between the data. Once the representation space is determined, the retrieval results are basically fixed.
[0013] However, in many application scenarios, the retrieval task is subject to certain constraints. For example, in the case retrieval scenario of similar cases found in batch cases in risk prevention and control business, different batch cases may have different risk realization methods. For example, a group of batch cases A may have clustering (or high similarity) in terms of device media, but differences in behavioral performance, while another group of batch cases B may be just the opposite, that is, differences in device media, but clustering in behavioral performance. At this time, if we do not consider the aspects of "clustering" or "similarity", and only establish a set of general representation methods and use them for conventional data retrieval, the retrieval effect may be poor due to the fusion and confusion of information. The goal of constrained data retrieval is not to simply find similar data, but to find data that is similar in certain specific aspects of concern.
[0014] In the field of data retrieval with constraints, general coping strategies can include two categories: one is to achieve it by changing the retrieval database or modifying the retrieval method, and the other is to achieve it by modifying the representation space. Among them, the retrieval results are constrained by changing the retrieval database and modifying the retrieval method. The above processing methods include but are not limited to: screening the retrieval database according to the rules during the retrieval, query optimization, dynamic update, weighting, etc., or structuring the constraint information (or constraint conditions), considering the constraint conditions during the retrieval process, etc. The above methods are less flexible. Every time the user proposes a different constraint information (or constraint condition), it may be necessary to re-adjust the retrieval database and retrieval method in a targeted manner.
[0015] Multimodal or cross-modal data retrieval and data enhancement. In practical applications, data may consist of multiple modalities (such as text modality, image modality, or audio modality, etc.). The challenge faced by multimodal or cross-modal data retrieval is how to effectively fuse and utilize information from different modalities while taking into account the specific constraint information of each modality to improve retrieval performance. Another means is data enhancement, which is to enhance the representation of data by introducing additional features or changing the weights of existing features. For example, in vector retrieval with geographic location constraints, geographic location information can be incorporated into vector representation as an additional feature. The idea of data enhancement is essentially similar to the multimodal case. If a way to group feature categories can be found, different groups can also be regarded as different modalities. However, both of the above methods require the use of artificial experience or logic to adjust and fuse weights. At the same time, because the types of modalities are limited and different application scenarios use different modalities, the above methods are not universal and are only effective for specific tasks and application scenarios. To this end, the embodiments of this specification provide a more flexible data retrieval method, so that when performing data retrieval, the user can constrain the retrieval results through the provided constraints, and can temporarily map the representation space without changing the representation model, thereby providing the user with retrieval results that better meet their needs. For specific processing, please refer to the specific content of the following embodiments.
[0016] like Figure 1 As shown, an embodiment of this specification provides a data retrieval method, and the execution subject of the method can be a terminal device or a server, etc., wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, or a computer device such as a laptop or a desktop computer, or an IoT device (specifically such as a smart watch, a car device, etc.), etc., wherein the server can be an independent server, or a server cluster composed of multiple servers, etc., and the server can be a background server for financial services or online shopping services, or a background server for an application, etc. In this embodiment, the execution subject is a server as an example for detailed description. For the case where the execution subject is a terminal device, please refer to the following server situation processing, which will not be repeated here. The method can specifically include the following steps: In step S102, a search request for a target object to be searched is received, and auxiliary query information for the target object is obtained.
[0017] Among them, the target object can be any object, for example, it can be a certain account, a code of a certain certificate, a mobile phone number, an identification of a certain user, an image, a certain text data, a certain audio data, a certain video data, etc., which can be set according to the actual situation, and the embodiments of this specification do not limit this. The auxiliary query information can be relevant information used to assist the retrieval request to accurately retrieve or query, and the auxiliary query information can include a variety of different auxiliary information. For example, the target object can involve multiple different aspects, and the auxiliary query information can include information on some of them. Specifically, if the target object involves three aspects A, B and C, the auxiliary query information can include A and B. In actual applications, if the target object involves relevant information on three aspects of IP address, device and behavior sequence, the auxiliary query information can be "querying data that is similar to the target object in IP address and device", or the auxiliary query information can be "querying data that is similar to the target object in behavior sequence", etc., which can be set according to the actual situation.
[0018] In implementation, a designated application may be installed in the terminal device, and a search or query page may be provided in the application, such as Figure 2 As shown, the page may be provided with an input box for the relevant information of the target object, a confirmation button, a cancel button, an output box for the search results, and in addition, a trigger mechanism for inputting auxiliary query information may be provided. When searching for the target object, the user may enter the relevant information of the target object in the input box for the relevant information of the target object in the above application installed in the terminal device. After the input is completed, the user may click the confirmation button. At this time, the terminal device may generate a search request for the target object to be searched based on the relevant information input by the user, and send the search request to the server. The server may receive the search request for the target object to be searched. At the same time, the server may send a prompt for providing auxiliary query information to the terminal device. If the user needs to provide auxiliary query information, the auxiliary query information for the target object may be triggered and input based on the trigger mechanism for inputting the auxiliary query information. The auxiliary query information may be input in a variety of different ways, for example, the user may input it in the form of text, or may also input it in the form of voice, etc., which may be set according to actual conditions. Afterwards, the terminal device may send the auxiliary query information provided by the user to the server, and the server may obtain the auxiliary query information for the target object.
[0019] It should be noted that the above search request is used to request the server to retrieve the corresponding data from the search database to obtain the search result corresponding to the search request. If auxiliary query information is obtained when the search request is received or within a certain period of time after the search request is received, the following steps S104 to S108 need to be processed to retrieve the corresponding data from the search database. If the user does not need to provide auxiliary query information, the server can directly retrieve the corresponding search data from the search database through the search request in a common search method, thereby obtaining the search result corresponding to the search request.
[0020] In step S104, the information related to the target object in the above retrieval request is input into the encoder to obtain the retrieval representation corresponding to the retrieval request, and the prompt information generated based on the auxiliary query information is input into the large language model to obtain the retrieval constraint information corresponding to the retrieval request.
[0021] The encoder can be constructed by a variety of different algorithms or networks. For example, the encoder can be constructed by a neural network (such as a recurrent neural network RNN or a convolutional neural network CNN, etc.), or by a specified algorithm (such as a specified data compression algorithm, etc.), or by a Transformer network, or by a specified mapping algorithm, etc., which can be set according to actual conditions. Through the encoder, characters can be converted into corresponding matrices or vectors (such as embedding vectors, etc.), etc., which can be set according to actual conditions. The retrieval representation can be presented in a variety of ways. For example, the retrieval representation can be presented in a matrix, a vector, or a number, etc., which can be set according to actual conditions. The prompt information (i.e., Prompt) can be information that can effectively guide the large language model to solve a specific task. The prompt information is usually a descriptive text information (or can be text information converted from voice data, etc.). The large language model will adjust its output results according to the above prompt information to adapt to different task requirements. The large language model can be a large model for a natural language, such as ChatGLM, GPT-4, etc., which can be set according to actual conditions.
[0022] In implementation, the architecture of the encoder can be pre-built to obtain corresponding training samples, which can be composed of data used and generated by different users in data retrieval. Then, the encoder can be trained using the training samples to obtain a trained encoder, which can encode the data input into it. Figure 3As shown, after obtaining the retrieval request for the target object to be retrieved in the above manner, the retrieval request can be analyzed to extract information related to the target object in the retrieval request, and the extracted information related to the target object can be input into the encoder, and the information related to the target object is encoded by the encoder to obtain data (which can be a matrix, a vector or a numerical value, etc.) that can represent the information related to the target object, that is, the retrieval representation corresponding to the retrieval request.
[0023] A pre-trained large language model can be obtained. The large language model can be obtained by training the large language model using a large amount of sample data (such as text data in a text data set), or it can be a pre-trained large language model directly obtained, etc. The specific setting can be based on actual conditions. Figure 3 As shown, after the auxiliary query information is obtained in the above manner, corresponding prompt information Prompt can be generated through the auxiliary query information. After that, the prompt information Prompt can be input into the large language model to obtain the data representation corresponding to the auxiliary query information. The data representation corresponding to the auxiliary query information can be recorded as an auxiliary representation, and the auxiliary representation can be used as the retrieval constraint information corresponding to the retrieval request.
[0024] In step S106, the search representation is adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the above search request is adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations.
[0025] Among them, the retrieval database can be a database where the data to be queried is located. The retrieval database can store original data (such as text data, audio data, video data, etc.), the original data's identification, data volume, storage time, purpose and other related information. It can include matrices or vectors corresponding to the original data, etc., which can be set specifically according to actual conditions.
[0026] In implementation, Figure 3As shown, since the retrieval request is accompanied by retrieval constraint information, it is necessary to use the retrieval constraint information to adjust the retrieval representation corresponding to the retrieval request so that the retrieval representation conforms to the constraint relationship of the retrieval constraint information on the retrieval representation. For example, the retrieval representation is presented in the form of a vector, and the retrieval representation is a multi-dimensional vector. Through the constraint of the retrieval constraint information on the retrieval representation, only the vectors of the key dimensional information that needs to be paid attention to (that is, the key dimensional information that needs to be paid attention to determined by the retrieval constraint information) can be retained in the multi-dimensional vector of the retrieval representation, thereby achieving the adjustment of the retrieval representation. Based on this, the retrieval constraint information and the retrieval representation can be analyzed separately to determine the key dimensional information that needs to be paid attention to corresponding to the retrieval constraint information, as well as the vectors corresponding to different dimensional information in the retrieval representation. Then, only the vectors of the key dimensional information that needs to be paid attention to in the retrieval representation can be retained, and the vectors of other dimensional information can be deleted or blocked, or set to an invalid state, etc. Through the above adjustment, the adjusted retrieval representation can be obtained.
[0027] Correspondingly, since the corresponding search data needs to be retrieved from the search database through the search request, it is necessary to compare the similarity between the data to be retrieved and the search data in the search database. Since the search request is accompanied by search constraint information, and the data representation corresponding to each search data contained in the search database often also contains multi-dimensional information (which may contain more key dimensional information that does not need to be paid attention to), after the search representation corresponding to the search request is adjusted, it is also necessary to use the search constraint information to adjust the data representation corresponding to each search data contained in the search database, so that the data representation corresponding to each search data conforms to the constraint relationship of the search constraint information on the data representation corresponding to each search data. Based on this, the data representation corresponding to each search data contained in the search database can be analyzed to determine the vectors corresponding to different dimensional information in the data representation corresponding to each search data contained in the search database. Then, only the vectors of the key dimensional information that needs to be paid attention to in the data representation corresponding to each search data contained in the search database can be retained, and the vectors of other dimensional information can be deleted or blocked, or set to an invalid state, etc. Through the above adjustment, the adjusted data representation corresponding to each search data contained in the search database can be obtained, and the adjusted data representations corresponding to multiple search data can constitute a new search database, that is, a representation database.
[0028] In step S108, an adjusted data representation matching the adjusted search representation is searched from the representation database, and based on the searched adjusted data representation, target search data retrieved from the search database based on the search request is determined.
[0029] In implementation, Figure 3As shown, since the retrieval data in the retrieval database have all been adjusted to the adjusted data representations in the new representation database, subsequent retrieval processing can be performed from the representation database during the actual retrieval process. Specifically, the adjusted retrieval representation can be respectively calculated for similarity with each adjusted data representation in the representation database (the similarity calculation can be performed by a cosine similarity algorithm, or the similarity calculation can be performed by a Euclidean distance algorithm, etc., which can be specifically set according to actual conditions) to obtain the similarity between the adjusted retrieval representation and each adjusted data representation in the representation database. The adjusted data representation that matches the adjusted retrieval representation can be selected based on the obtained similarity. For example, the adjusted data representation corresponding to the maximum value of the similarity can be selected as the adjusted data representation that matches the adjusted retrieval representation, or a corresponding threshold can be set in advance, and the adjusted data representation with a similarity greater than the threshold can be selected as the adjusted data representation that matches the adjusted retrieval representation, etc. In addition to matching the two representations by the above-mentioned similarity method, the two representations can also be matched by other methods. For example, the two representations can be matched by a principal component analysis algorithm, or an adjusted data representation that matches the adjusted retrieval representation can be determined from a representation database by a clustering algorithm, or a specified machine learning model (such as a convolutional neural network model or a recurrent neural network model, etc.) can be pre-trained to determine the degree of match between the two representations through the machine learning model, and then determine the adjusted data representation that matches the adjusted retrieval representation, etc. The specific settings can be based on actual conditions.
[0030] After retrieving the adjusted data representation that matches the adjusted search representation in the above manner, the search data in the corresponding search database can be determined based on the queried adjusted data representation, and the determined search data can be used as the search result corresponding to the above search request. Based on this, the determined search data can be used as the target search data retrieved from the search database based on the above search request, and can be provided to the searcher or queryer.
[0031] It should be noted that if the queried adjusted data representations include multiple ones, the retrieval data corresponding to each of the multiple adjusted data representations can be used as the retrieval result corresponding to the above-mentioned retrieval request (i.e., target retrieval data). Alternatively, the multiple adjusted data representations can be calculated accordingly through a specified algorithm, and based on the calculation results, a part or one of the multiple adjusted data representations can be further selected, and the retrieval data corresponding to the selected part or one of the adjusted data representations can be used as the retrieval result corresponding to the above-mentioned retrieval request (i.e., target retrieval data). The specific setting can be based on actual conditions.
[0032] The embodiment of the present specification provides a data retrieval method, which, when receiving a retrieval request for a target object to be retrieved and obtaining auxiliary query information for the target object, inputs information related to the target object in the retrieval request into an encoder to obtain a retrieval representation corresponding to the retrieval request, and inputs prompt information generated based on the auxiliary query information into a large language model to obtain retrieval constraint information corresponding to the retrieval request. Then, the retrieval representation can be adjusted based on the retrieval constraint information to obtain an adjusted retrieval representation, and the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request can be adjusted based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. Finally, an adjusted data representation matching the adjusted retrieval representation can be queried from the representation database, and based on the queried adjusted data table, the adjusted data representation can be retrieved. The invention discloses a method for detecting the target retrieval data retrieved from the retrieval database based on the retrieval request, and determines the target retrieval data retrieved from the retrieval database based on the retrieval request. In this way, there is no need to change the basic model (such as the encoder, etc.) and the retrieval database. The user's needs (i.e., the auxiliary query information) are quantified through the large language model, and the retrieval results are directly controlled. Specifically, a mechanism for adaptively adjusting the retrieval logic based on the prompt information generated by the user's auxiliary query information is introduced. The prompt information is parsed, and the operating logic or weight distribution of the retrieval process is dynamically adjusted based on the prompt information without changing the basic model and the retrieval database to meet the user's specific needs, thereby improving the flexibility and scalability of data retrieval, reducing resource consumption, and improving retrieval efficiency. Moreover, the above method has better versatility and can be applied to different data modalities and specific tasks without the need for manual feature selection and importance weight adjustment.
[0033] In practical applications, the specific processing methods for adjusting the search representation based on the search constraint information in the above step S106 to obtain the adjusted search representation can be various. An optional processing method is provided below, such as Figure 4 As shown, the following may be specifically included: inputting the search constraint information and the search representation into the condition filter, so as to adjust the search representation based on the search constraint information to obtain an adjusted search representation.
[0034] The conditional filter can adjust the specified data based on the provided constraint conditions so that the specified data meets the constraint relationship of the constraint conditions on the specified data.
[0035] In implementation, the retrieval constraint information can be input as a constraint condition into the condition filter. After the condition filter obtains the retrieval constraint information, the retrieval constraint information can be used as a constraint condition. At the same time, the retrieval representation can be input as the data to be constrained into the condition filter. After the condition filter obtains the retrieval representation, the retrieval representation can be used as the data to be constrained. Then, the condition filter can use the constraint condition to adjust the data to be constrained, that is, the condition filter uses the retrieval constraint information to adjust the retrieval representation to obtain the adjusted retrieval representation.
[0036] Correspondingly, such as Figure 4 As shown, in the above step S106, based on the retrieval constraint information, the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the above retrieval request is adjusted respectively, and the specific processing method for obtaining the representation database composed of the adjusted data representations may include the following: the retrieval constraint information and the data representation corresponding to each retrieval data contained in the retrieval database are input into the conditional filter in sequence, so as to adjust the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request respectively based on the retrieval constraint information, and obtain the representation database composed of the adjusted data representations.
[0037] In implementation, the search constraint information can be input as a constraint condition into the condition filter. After the condition filter obtains the search constraint information, the search constraint information can be used as a constraint condition. At the same time, the data representation corresponding to each search data contained in the search database can be input as the data to be constrained into the condition filter ( Figure 4 The two rays between the two conditional filters represent parameter sharing between the two conditional filters), after the conditional filter obtains the data representation corresponding to each retrieval data contained in the retrieval database, the data representation corresponding to each retrieval data contained in the retrieval database can be used as the data to be constrained. Then, the conditional filter can use the constraint condition to adjust each data to be constrained, that is, the conditional filter uses the retrieval constraint information to adjust the data representation corresponding to each retrieval data contained in the retrieval database respectively, and obtains multiple adjusted data representations. The multiple adjusted data representations can constitute a new database, that is, a representation database composed of multiple adjusted data representations.
[0038] In practical applications, there are various specific processing methods for querying the adjusted data representation matching the adjusted search representation from the representation database in the above step S108. An optional processing method is provided below, such as Figure 5 As shown, the processing may specifically include the following steps S1082 and S1084.
[0039] In step S1082, the similarity between the adjusted search representation and each adjusted data representation in the representation database is obtained.
[0040] In step S1084, a target similarity greater than a preset threshold is determined from the obtained similarities, and based on the adjusted data representation corresponding to the target similarity, an adjusted data representation in the representation database that matches the adjusted search representation is determined.
[0041] The specific processing procedures of the above-mentioned steps S1082 and S1084 can be found in the aforementioned related content and will not be repeated here.
[0042] In practical applications, if the search for the target object does not require auxiliary query information, the user's search request can also be responded to in the following manner, and the details can be referred to the processing of the following steps A2 and A4.
[0043] In step A2, if the auxiliary query information is not obtained, a target data representation matching the search representation is searched from the data representation corresponding to each search data contained in the search database.
[0044] In implementation, Figure 4 As shown in the dotted line part, when a retrieval request for a target object to be retrieved is received, if auxiliary query information is not obtained or the user gives up providing auxiliary query information, the information related to the target object in the above retrieval request can be input into the encoder to obtain a retrieval representation corresponding to the retrieval request, and then, a target data representation matching the retrieval representation can be queried from the data representation corresponding to each retrieval data contained in the retrieval database. Specifically, the similarity between the retrieval representation and the data representation corresponding to each retrieval data contained in the retrieval database can be obtained, and a similarity greater than a preset similarity threshold can be determined from the obtained similarity, and based on the data representation corresponding to the obtained similarity greater than the preset similarity threshold, a target data representation matching the retrieval representation is determined.
[0045] In step A4, based on the queried target data representation, target search data retrieved from the search database based on the above search request is determined.
[0046] In implementation, the search data corresponding to the queried target data representation can be used as the target search data retrieved from the search database based on the above search request. Wherein, if the queried target data representation includes multiple target data representations, the search data corresponding to each target data representation in the multiple target data representations can be used as the search result (i.e., target search data) corresponding to the above search request, or, the multiple target data representations can be calculated accordingly by a specified algorithm, and a part or one target data representation can be further selected from the multiple target data representations based on the calculation results, and the search data corresponding to the selected part or one target data representation can be used as the search result (i.e., target search data) corresponding to the above search request, which can be set specifically according to actual conditions.
[0047] In practical applications, the above encoder and conditional filter can be jointly trained in the following way, such as Figure 6 As shown, please refer to the processing of the following steps B02 to B12 for details.
[0048] In step B02, a first sample pair is obtained, the first sample pair includes a first training sample and a second training sample, and for a first matching index, the similarity between the first training sample and the second training sample is greater than a first threshold, and for a second matching index, the similarity between the first training sample and the second training sample is less than a second threshold.
[0049] Among them, the first matching index is different from the second matching index, and the first matching index and the second matching index can be set according to actual conditions, for example, the first matching index includes an IP address and a device, and the second matching index includes a behavior sequence, or the first matching index includes a behavior sequence, and the second matching index includes an IP address, etc., which can be set according to actual conditions. The first threshold and the second threshold can be different, and the first threshold can be greater than the second threshold. For the first matching index, the similarity between the first training sample and the second training sample is greater than the first threshold, indicating that the first training sample and the second training sample have a higher similarity on the first matching index. For the second matching index, the similarity between the first training sample and the second training sample is less than the second threshold, indicating that the first training sample and the second training sample have a lower similarity on the second matching index or the two are completely different, which can be set according to actual conditions.
[0050] In implementation, Figure 6 As shown, the first sample pair can be obtained in a variety of different ways. For example, the first sample pair can be obtained from a specified database, or the server can record relevant data when different users perform specified services, and the first sample pair can be obtained from the above-mentioned relevant data, or the first sample pair can be obtained from different users through equivalent exchange and other methods. The specific settings can be based on actual conditions.
[0051] In step B04, the first training sample and the second training sample are respectively input into the encoder to obtain a first sample representation corresponding to the first training sample and a second sample representation corresponding to the second training sample.
[0052] The encoder may be an untrained encoder, and the architecture of the encoder may be constructed by a specified algorithm and / or a machine learning network, and the encoder may be initialized to obtain an initial encoder. Then, the first training sample and the second training sample may be respectively input into the initial encoder to obtain a first sample representation corresponding to the first training sample and a second sample representation corresponding to the second training sample.
[0053] In step B06, a first auxiliary sample generated based on the first matching index and a second auxiliary sample generated based on the second matching index are obtained, and a first prompt sample generated based on the first auxiliary sample and a second prompt sample generated based on the second auxiliary sample are respectively input into the pre-trained large language model to obtain a first constrained sample corresponding to the first auxiliary sample and a second constrained sample corresponding to the second auxiliary sample.
[0054] Among them, the large language model can be a trained large model directly obtained from a specified database, or it can be a large model obtained by building a large language model architecture through a machine learning network and then training the large language model with a large amount of sample data, etc. The specific setting can be based on actual conditions.
[0055] In step B08, the first constraint sample and the first sample representation are input into the conditional filter to adjust the first sample representation based on the first constraint sample to obtain a third sample representation, and the first constraint sample and the second sample representation are input into the conditional filter to adjust the second sample representation based on the first constraint sample to obtain a fourth sample representation.
[0056] In step B10, the second constraint sample and the first sample representation are input into the conditional filter to adjust the first sample representation based on the second constraint sample to obtain the fifth sample representation, and the second constraint sample and the second sample representation are input into the conditional filter to adjust the second sample representation based on the second constraint sample to obtain the sixth sample representation.
[0057] The specific processing procedures of the above steps B04 to B10 can be found in the above related contents and will not be described again here.
[0058] In step B12, the encoder and the conditional filter are jointly trained by contrastive learning using a preset first loss function for the positive sample pair consisting of the third sample representation and the fourth sample representation, and the negative sample pair consisting of the fifth sample representation and the sixth sample representation, to obtain a trained encoder and a trained conditional filter.
[0059] The first loss function may be determined by maximizing the similarity between the third sample representation and the fourth sample representation and minimizing the similarity between the fifth sample representation and the sixth sample representation, or may be determined by other loss functions, which may be specifically set according to actual conditions.
[0060] In implementation, Figure 6 As shown, the similarity between the third sample representation and the fourth sample representation can be calculated, and the corresponding objective function can be determined based on the first loss function. In this embodiment, the objective function can be to maximize the above similarity, and the parameters in the encoder and the conditional filter can be adjusted through the objective function. In addition, the similarity between the fifth sample representation and the sixth sample representation can be calculated, and the corresponding objective function can be determined based on the first loss function. In this embodiment, the objective function can be to minimize the similarity between the fifth sample representation and the sixth sample representation. The parameters in the encoder and the conditional filter can also be adjusted through the objective function. The above-mentioned processing process of steps B2 to B12 can be repeated to perform joint comparative learning training on the encoder and the conditional filter until the first loss function converges to obtain a trained encoder and a trained conditional filter.
[0061] In addition, if the auxiliary samples (including the first auxiliary samples and the second auxiliary samples, etc.) cannot be obtained, the encoder can also be trained in the following ways, such as Figure 6 As shown, please refer to the processing of the following steps C2 to C6 for details.
[0062] In step C2, a first sample pair is obtained, the first sample pair includes a first training sample and a second training sample, and for a first matching index, the similarity between the first training sample and the second training sample is greater than a first threshold, and for a second matching index, the similarity between the first training sample and the second training sample is less than a second threshold.
[0063] In practical applications, in the case where auxiliary samples (including the first auxiliary sample and the second auxiliary sample, etc.) cannot be obtained, the first training sample and the second training sample in the above-mentioned first sample pair may not need to meet the conditions that the similarity between the first training sample and the second training sample is greater than the first threshold for the first matching index, and the similarity between the first training sample and the second training sample is less than the second threshold for the second matching index. That is, at this time, step C2 can be to obtain the first sample pair, and the first sample pair includes the first training sample and the second training sample, which can be set specifically according to actual conditions.
[0064] In step C4, the first training sample and the second training sample are respectively input into the encoder to obtain a first sample representation corresponding to the first training sample and a second sample representation corresponding to the second training sample.
[0065] In step C6, based on the first sample representation and the second sample representation, the encoder is trained by a preset second loss function to obtain a trained encoder.
[0066] Among them, the second loss function can be a mean square error loss function, a cross entropy loss function, etc., which can be set according to actual conditions.
[0067] In implementation, a retrieval process can be performed in a retrieval database through the first sample representation to obtain corresponding retrieval results, and a retrieval process can be performed in a retrieval database through the second sample representation to obtain corresponding retrieval results. Based on the retrieval results corresponding to the first sample representation and the retrieval results corresponding to the second sample representation, as well as the retrieval label information corresponding to the first training sample and the retrieval label information corresponding to the second training sample in the first sample pair, the corresponding loss information can be calculated through a second loss function, and the parameters in the encoder can be adjusted through the loss information, and the encoder can be trained until the second loss function converges to obtain a trained encoder.
[0068] In practical applications, the auxiliary samples (or constraint samples (i.e., constraint conditions)) and the conditional filter themselves filter out key dimension information from the input representation based on the information in the prompt information (or auxiliary samples). Therefore, Figure 6 As shown, an auxiliary loss function may be added to guide the generation of the above-mentioned MASK-like vector. For details, please refer to the processing of the following steps D2 to D6.
[0069] In step D2, mask processing is performed on the first matching indicator included in the first training sample based on the first auxiliary sample to obtain a masked first training sample.
[0070] In implementation, a MASK for the first training sample can be generated based on the first auxiliary sample (or the first prompt sample), and the first matching indicator contained in the first training sample can be masked by the generated MASK. The above processing can include multiple methods. For example, the first training sample involves three matching indicators A1, B1 and C1, and a MASK for shielding or occluding can be generated. The MASK can be used to shield or occlude one or more matching indicators involved in the first training sample. Specifically, for example, the MASK can be used to shield or occlude A1 involved in the first training sample, so that the matching indicator A1 is in an unknown state. Alternatively, a MASK for other data indicators can be generated, and the MASK can be used to replace one or more matching indicators involved in the first training sample. Specifically, for example, A2 in the MASK can be used to replace A1 involved in the first training sample, so that the first training sample becomes a mask involving three matching indicators A2, B1 and C1. Through the above processing, a masked first training sample can be obtained.
[0071] In step D4, the masked first training sample is input into an encoder to obtain a seventh sample representation corresponding to the masked first training sample.
[0072] In step D6, based on the third sample representation and the seventh sample representation, the encoder and / or the conditional filter are jointly trained by a preset third loss function.
[0073] The third loss function may be determined by maximizing the similarity between the third sample representation and the seventh sample representation, or may be determined by other loss functions, which may be specifically set according to actual conditions.
[0074] In implementation, before step D6, it is also necessary to input the first training sample into the encoder to obtain a first sample representation corresponding to the first training sample, obtain a first auxiliary sample generated based on the first matching index, and input the first prompt sample generated based on the first auxiliary sample into the pre-trained large language model to obtain a first constraint sample corresponding to the first auxiliary sample, and input the first constraint sample and the first sample representation into the conditional filter to adjust the first sample representation based on the first constraint sample to obtain a third sample representation. According to the assumption, the seventh sample representation generated by the encoder of the masked first training sample should be as consistent as possible with the third sample representation generated by the first sample representation generated by the first training sample that has not been masked and then filtered by the conditional filter. In this way, it can be ensured that regardless of whether the first sample representation corresponding to the first training sample passes through the conditional filter, the representation space in which it is located is the same. Based on this, the similarity between the third sample representation and the seventh sample representation can be calculated, and the corresponding objective function can be determined based on the third loss function. In this embodiment, the objective function can be to maximize the above-mentioned similarity. The parameters in the encoder and the conditional filter can be adjusted through the objective function. The above process can be repeated to train the encoder and / or the conditional filter until the third loss function converges to obtain the trained encoder and / or the trained conditional filter.
[0075] In order to realize the feedback recovery and continuous optimization of the search results, an interactive search method can be set, and the details can be referred to the processing of the following steps E2 and E4.
[0076] In step E2, feedback information of the user on the target retrieval data is obtained, and the feedback information includes one or more of satisfaction information, click behavior information, and preset instructions.
[0077] In step E4, a search strategy for the object to be searched is generated based on the feedback information, and the search process currently in use is adjusted based on the generated search strategy.
[0078] Among them, the search strategy may include multiple types, for example, the search strategy may include one or more of the following: input strategy of auxiliary query information (such as which keywords need to be included in the auxiliary query information), generation strategy of prompt information, construction strategy of search constraint information, selection strategy of large language model, selection and optimization strategy of condition filter, matching strategy of representation, etc., which may be specifically set according to actual conditions. The search processing process currently used may be the search processing process of steps S102 to S108, etc.
[0079] Through the interactive retrieval process of step E2 and step E4, the manual retrieval evaluation link can be naturally integrated into the entire process. In this way, the current retrieval processing process can be gradually adjusted and optimized based on user satisfaction with the retrieval results, click behavior, further instructions and other feedback information, thereby improving the accuracy of the retrieval effect and user satisfaction.
[0080] The embodiment of the present specification provides a data retrieval method, which, when receiving a retrieval request for a target object to be retrieved and obtaining auxiliary query information for the target object, inputs information related to the target object in the retrieval request into an encoder to obtain a retrieval representation corresponding to the retrieval request, and inputs prompt information generated based on the auxiliary query information into a large language model to obtain retrieval constraint information corresponding to the retrieval request. Then, the retrieval representation can be adjusted based on the retrieval constraint information to obtain an adjusted retrieval representation, and the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request can be adjusted based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. Finally, an adjusted data representation matching the adjusted retrieval representation can be queried from the representation database, and based on the queried adjusted data table, the adjusted data representation can be retrieved. The invention discloses a method for detecting the target retrieval data retrieved from the retrieval database based on the retrieval request, and determines the target retrieval data retrieved from the retrieval database based on the retrieval request. In this way, there is no need to change the basic model (such as the encoder, etc.) and the retrieval database. The user's needs (i.e., the auxiliary query information) are quantified through the large language model, and the retrieval results are directly controlled. Specifically, a mechanism for adaptively adjusting the retrieval logic based on the prompt information generated by the user's auxiliary query information is introduced. The prompt information is parsed, and the operating logic or weight distribution of the retrieval process is dynamically adjusted based on the prompt information without changing the basic model and the retrieval database to meet the user's specific needs, thereby improving the flexibility and scalability of data retrieval, reducing resource consumption, and improving retrieval efficiency. Moreover, the above method has better versatility and can be applied to different data modalities and specific tasks without the need for manual feature selection and importance weight adjustment.
[0081] In addition, with the help of the understanding ability of the large language model and the paradigm of comparative learning, a mapping relationship is formed between the natural language-assisted query information input by the user and the features. In addition, through an interactive retrieval process, user feedback information is collected, and based on user satisfaction with the results, click behavior, further instructions and other feedback information, the current retrieval process is gradually adjusted and optimized, thereby improving the accuracy of the retrieval effect and user satisfaction.
[0082] The above is a data retrieval method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data retrieval device, such as Figure 7 shown.
[0083] The data retrieval device includes: a request module 701, an encoding module 702, a characterization adjustment module 703 and a retrieval module 704, wherein: The request module 701 receives a search request for a target object to be searched, and obtains auxiliary query information for the target object; The encoding module 702 inputs the information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputs the prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; A representation adjustment module 703 adjusts the search representation based on the search constraint information to obtain an adjusted search representation, and adjusts the data representation corresponding to each search data contained in the search database corresponding to the search request based on the search constraint information to obtain a representation database composed of the adjusted data representations; The retrieval module 704 searches the representation database for an adjusted data representation that matches the adjusted search representation, and determines, based on the searched adjusted data representation, target search data retrieved from the search database based on the search request.
[0084] In the embodiment of this specification, the characterization adjustment module 703 includes: A search representation adjustment unit, inputting the search constraint information and the search representation into a condition filter to adjust the search representation based on the search constraint information to obtain an adjusted search representation; The data representation adjustment unit inputs the retrieval constraint information and the data representation corresponding to each retrieval data contained in the retrieval database into the conditional filter in sequence, so as to adjust the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request based on the retrieval constraint information, and obtain a representation database composed of the adjusted data representations.
[0085] In the embodiment of this specification, the retrieval module 704 includes: a similarity acquisition unit, which acquires the similarity between the adjusted search representation and each adjusted data representation in the representation database; The query unit determines a target similarity greater than a preset threshold from the acquired similarities, and determines an adjusted data representation in the representation database that matches the adjusted search representation based on the adjusted data representation corresponding to the target similarity.
[0086] In the embodiment of this specification, the device further includes: A query module, if the auxiliary query information is not obtained, queries the target data representation that matches the search representation from the data representation corresponding to each search data contained in the search database; A result determination module determines, based on the queried target data representation, target search data retrieved from the search database based on the search request.
[0087] In the embodiment of this specification, the device further includes: A sample acquisition module is configured to acquire a first sample pair, wherein the first sample pair includes a first training sample and a second training sample, and with respect to a first matching index, the similarity between the first training sample and the second training sample is greater than a first threshold, and with respect to a second matching index, the similarity between the first training sample and the second training sample is less than a second threshold; A sample encoding module, inputting the first training sample and the second training sample into the encoder respectively, to obtain a first sample representation corresponding to the first training sample and a second sample representation corresponding to the second training sample; a constraint sample determination module, which obtains a first auxiliary sample generated based on the first matching index and a second auxiliary sample generated based on the second matching index, and inputs a first prompt sample generated based on the first auxiliary sample and a second prompt sample generated based on the second auxiliary sample into a pre-trained large language model, respectively, to obtain a first constraint sample corresponding to the first auxiliary sample and a second constraint sample corresponding to the second auxiliary sample; a first conditional filtering module, inputting the first constraint sample and the first sample representation into the conditional filter, adjusting the first sample representation based on the first constraint sample to obtain a third sample representation, and inputting the first constraint sample and the second sample representation into the conditional filter, adjusting the second sample representation based on the first constraint sample to obtain a fourth sample representation; a second conditional filtering module, inputting the second constraint sample and the first sample representation into the conditional filter to adjust the first sample representation based on the second constraint sample to obtain a fifth sample representation, and inputting the second constraint sample and the second sample representation into the conditional filter to adjust the second sample representation based on the second constraint sample to obtain a sixth sample representation; The first training module uses the positive sample pairs consisting of the third sample representation and the fourth sample representation, and the negative sample pairs consisting of the fifth sample representation and the sixth sample representation, to perform joint contrastive learning training on the encoder and the conditional filter through a preset first loss function to obtain a trained encoder and a trained conditional filter.
[0088] In the embodiment of this specification, the device further includes: The second training module trains the encoder based on the first sample representation and the second sample representation through a preset second loss function to obtain a trained encoder.
[0089] In the embodiment of this specification, the device further includes: a masking module, which performs masking processing on the first matching indicator included in the first training sample based on the first auxiliary sample to obtain a masked first training sample; a mask encoding module, inputting the masked first training sample into the encoder to obtain a seventh sample representation corresponding to the masked first training sample; The third training module jointly trains the encoder and / or the conditional filter based on the third sample representation and the seventh sample representation through a preset third loss function.
[0090] In the embodiment of this specification, the device further includes: A feedback information acquisition module, which acquires user feedback information on the target search data, wherein the feedback information includes one or more of satisfaction information, click behavior information, and preset instructions; The retrieval process adjustment module generates a retrieval strategy for the object to be retrieved based on the feedback information, and adjusts the currently used retrieval processing process based on the generated retrieval strategy.
[0091] The embodiment of the present specification provides a data retrieval device, which, when receiving a retrieval request for a target object to be retrieved and obtaining auxiliary query information for the target object, inputs information related to the target object in the retrieval request into an encoder to obtain a retrieval representation corresponding to the retrieval request, and inputs prompt information generated based on the auxiliary query information into a large language model to obtain retrieval constraint information corresponding to the retrieval request. Then, the retrieval representation can be adjusted based on the retrieval constraint information to obtain an adjusted retrieval representation, and the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request can be adjusted based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. Finally, an adjusted data representation matching the adjusted retrieval representation can be queried from the representation database, and based on the queried adjusted data table, the adjusted data representation can be retrieved. The invention discloses a method for detecting the target retrieval data retrieved from the retrieval database based on the retrieval request, and determines the target retrieval data retrieved from the retrieval database based on the retrieval request. In this way, there is no need to change the basic model (such as the encoder, etc.) and the retrieval database. The user's needs (i.e., the auxiliary query information) are quantified through the large language model, and the retrieval results are directly controlled. Specifically, a mechanism for adaptively adjusting the retrieval logic based on the prompt information generated by the user's auxiliary query information is introduced. The prompt information is parsed, and the operating logic or weight distribution of the retrieval process is dynamically adjusted based on the prompt information without changing the basic model and the retrieval database to meet the user's specific needs, thereby improving the flexibility and scalability of data retrieval, reducing resource consumption, and improving retrieval efficiency. Moreover, the above method has better versatility and can be applied to different data modalities and specific tasks without the need for manual feature selection and importance weight adjustment.
[0092] In addition, with the help of the understanding ability of the large language model and the paradigm of comparative learning, a mapping relationship is formed between the natural language-assisted query information input by the user and the features. In addition, through an interactive retrieval process, user feedback information is collected, and based on user satisfaction with the results, click behavior, further instructions and other feedback information, the current retrieval process is gradually adjusted and optimized, thereby improving the accuracy of the retrieval effect and user satisfaction.
[0093] The above is a data retrieval device provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data retrieval device, such as Figure 8 shown.
[0094] The data retrieval device may provide a terminal device or a server, etc. for the above-mentioned embodiment.
[0095] The data retrieval device may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and memory 802, and the memory 802 may store one or more storage applications or data. Among them, the memory 802 may be a temporary storage or a permanent storage. The application stored in the memory 802 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the data retrieval device. Furthermore, the processor 801 may be configured to communicate with the memory 802, and execute a series of computer executable instructions in the memory 802 on the data retrieval device. The data retrieval device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input and output interfaces 805, and one or more keyboards 806.
[0096] Specifically in this embodiment, the data retrieval device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the data retrieval device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following: Receiving a search request for a target object to be searched, and obtaining auxiliary query information for the target object; Inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; The search representation is adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the search request is adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations; An adjusted data representation matching the adjusted search representation is queried from the representation database, and target search data retrieved from the search database based on the search request is determined based on the queried adjusted data representation.
[0097] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data retrieval device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0098] The embodiment of the present specification provides a data retrieval device, which, when receiving a retrieval request for a target object to be retrieved and obtaining auxiliary query information for the target object, inputs information related to the target object in the retrieval request into an encoder to obtain a retrieval representation corresponding to the retrieval request, and inputs prompt information generated based on the auxiliary query information into a large language model to obtain retrieval constraint information corresponding to the retrieval request. Then, the retrieval representation can be adjusted based on the retrieval constraint information to obtain an adjusted retrieval representation, and the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request can be adjusted based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. Finally, an adjusted data representation matching the adjusted retrieval representation can be queried from the representation database, and based on the queried adjusted data table, the adjusted data representation can be retrieved. The invention discloses a method for detecting the target retrieval data retrieved from the retrieval database based on the retrieval request, and determines the target retrieval data retrieved from the retrieval database based on the retrieval request. In this way, there is no need to change the basic model (such as the encoder, etc.) and the retrieval database. The user's needs (i.e., the auxiliary query information) are quantified through the large language model, and the retrieval results are directly controlled. Specifically, a mechanism for adaptively adjusting the retrieval logic based on the prompt information generated by the user's auxiliary query information is introduced. The prompt information is parsed, and the operating logic or weight distribution of the retrieval process is dynamically adjusted based on the prompt information without changing the basic model and the retrieval database to meet the user's specific needs, thereby improving the flexibility and scalability of data retrieval, reducing resource consumption, and improving retrieval efficiency. Moreover, the above method has better versatility and can be applied to different data modalities and specific tasks without the need for manual feature selection and importance weight adjustment.
[0099] Furthermore, based on the above Figures 1 to 6 In one embodiment, the present specification further provides a storage medium for storing computer executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instruction information stored in the storage medium is executed by the processor, the following process can be implemented: Receiving a search request for a target object to be searched, and obtaining auxiliary query information for the target object; Inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; The search representation is adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the search request is adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations; An adjusted data representation matching the adjusted search representation is queried from the representation database, and target search data retrieved from the search database based on the search request is determined based on the queried adjusted data representation.
[0100] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0101] An embodiment of the present specification provides a storage medium, which, when receiving a retrieval request for a target object to be retrieved and obtaining auxiliary query information for the target object, inputs information related to the target object in the retrieval request into an encoder to obtain a retrieval representation corresponding to the retrieval request, and inputs prompt information generated based on the auxiliary query information into a large language model to obtain retrieval constraint information corresponding to the retrieval request. Then, the retrieval representation can be adjusted based on the retrieval constraint information to obtain an adjusted retrieval representation, and the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request can be adjusted based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations. Finally, an adjusted data representation matching the adjusted retrieval representation can be queried from the representation database, and based on the queried adjusted data representation , determine the target retrieval data retrieved from the retrieval database based on the retrieval request. In this way, there is no need to change the basic model (such as encoder, etc.) and the retrieval database. The user's needs (i.e., auxiliary query information) are quantified through the large language model, and then the retrieval results are directly controlled. Specifically, a mechanism is introduced that can adaptively adjust the retrieval logic according to the prompt information generated by the user's auxiliary query information. By parsing the prompt information, and based on this, without changing the basic model and the retrieval database, the operating logic or weight distribution of the retrieval process is dynamically adjusted to meet the user's specific needs, thereby improving the flexibility and scalability of data retrieval, while reducing resource consumption and improving retrieval efficiency. Moreover, the above method has better versatility and can be applied to different data modalities and specific tasks without the need for manual feature selection and importance weight adjustment.
[0102] Furthermore, based on the above Figures 1 to 6 In one or more embodiments of the present specification, a computer program product is provided, including a computer program. When the computer program in the computer program product is executed by a processor, the following process can be implemented: Receiving a search request for a target object to be searched, and obtaining auxiliary query information for the target object; Inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; The search representation is adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the search request is adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations; An adjusted data representation matching the adjusted search representation is queried from the representation database, and target search data retrieved from the search database based on the search request is determined based on the queried adjusted data representation.
[0103] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned computer program product embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0104] The embodiment of the present specification provides a computer program product, which, when receiving a search request for a target object to be searched and obtaining auxiliary query information for the target object, inputs information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputs prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request. Then, the search representation can be adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the search request can be adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations. Finally, an adjusted data representation matching the adjusted search representation can be queried from the representation database, and based on the queried adjusted data table, the adjusted data representation can be retrieved. The invention discloses a method for detecting the target retrieval data retrieved from the retrieval database based on the retrieval request, and determines the target retrieval data retrieved from the retrieval database based on the retrieval request. In this way, there is no need to change the basic model (such as the encoder, etc.) and the retrieval database. The user's needs (i.e., the auxiliary query information) are quantified through the large language model, and the retrieval results are directly controlled. Specifically, a mechanism for adaptively adjusting the retrieval logic based on the prompt information generated by the user's auxiliary query information is introduced. The prompt information is parsed, and the operating logic or weight distribution of the retrieval process is dynamically adjusted based on the prompt information without changing the basic model and the retrieval database to meet the user's specific needs, thereby improving the flexibility and scalability of data retrieval, reducing resource consumption, and improving retrieval efficiency. Moreover, the above method has better versatility and can be applied to different data modalities and specific tasks without the need for manual feature selection and importance weight adjustment.
[0105] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0106] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0107] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0108] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0109] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0110] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0111] The embodiments of this specification are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fraud case serial and parallel device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fraud case serial and parallel device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable fraud case serial and parallel device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0113] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0114] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0115] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0116] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0117] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0118] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0119] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0120] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0121] The above description is only an embodiment of this specification and is not intended to limit this document. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this specification.
Claims
1. A data retrieval method, the method comprising: Receiving a search request for a target object to be searched, and obtaining auxiliary query information for the target object; Inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; The search representation is adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the search request is adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations; An adjusted data representation matching the adjusted search representation is queried from the representation database, and target search data retrieved from the search database based on the search request is determined based on the queried adjusted data representation.
2. The method according to claim 1, wherein adjusting the search representation based on the search constraint information to obtain the adjusted search representation comprises: Inputting the search constraint information and the search representation into a condition filter to adjust the search representation based on the search constraint information to obtain an adjusted search representation; The step of adjusting the data representations corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request based on the retrieval constraint information to obtain a representation database composed of the adjusted data representations includes: The retrieval constraint information and the data representation corresponding to each retrieval data contained in the retrieval database are respectively input into the conditional filter in sequence, so as to adjust the data representation corresponding to each retrieval data contained in the retrieval database corresponding to the retrieval request based on the retrieval constraint information, and obtain a representation database composed of the adjusted data representations.
3. The method according to claim 1, wherein querying the representation database for an adjusted data representation that matches the adjusted search representation comprises: Obtaining a similarity between the adjusted search representation and each adjusted data representation in the representation database; A target similarity greater than a preset threshold is determined from the obtained similarities, and based on the adjusted data representation corresponding to the target similarity, an adjusted data representation in the representation database that matches the adjusted search representation is determined.
4. The method according to claim 1, further comprising: If the auxiliary query information is not obtained, querying the target data representation that matches the search representation from the data representation corresponding to each search data contained in the search database; Based on the queried target data representation, target retrieval data retrieved from the retrieval database based on the retrieval request is determined.
5. The method according to claim 2, further comprising: Acquire a first sample pair, wherein the first sample pair includes a first training sample and a second training sample, and with respect to a first matching index, the similarity between the first training sample and the second training sample is greater than a first threshold, and with respect to a second matching index, the similarity between the first training sample and the second training sample is less than a second threshold; Inputting the first training sample and the second training sample into the encoder respectively to obtain a first sample representation corresponding to the first training sample and a second sample representation corresponding to the second training sample; Acquire a first auxiliary sample generated based on the first matching index and a second auxiliary sample generated based on the second matching index, and input a first prompt sample generated based on the first auxiliary sample and a second prompt sample generated based on the second auxiliary sample into a pre-trained large language model, respectively, to obtain a first constrained sample corresponding to the first auxiliary sample and a second constrained sample corresponding to the second auxiliary sample; Inputting the first constraint sample and the first sample representation into the conditional filter to adjust the first sample representation based on the first constraint sample to obtain a third sample representation, and inputting the first constraint sample and the second sample representation into the conditional filter to adjust the second sample representation based on the first constraint sample to obtain a fourth sample representation; Inputting the second constraint sample and the first sample representation into the conditional filter to adjust the first sample representation based on the second constraint sample to obtain a fifth sample representation, and inputting the second constraint sample and the second sample representation into the conditional filter to adjust the second sample representation based on the second constraint sample to obtain a sixth sample representation; The encoder and the conditional filter are respectively trained by performing joint contrastive learning on the positive sample pairs consisting of the third sample representation and the fourth sample representation, and the negative sample pairs consisting of the fifth sample representation and the sixth sample representation, through a preset first loss function to obtain a trained encoder and a trained conditional filter.
6. The method according to claim 5, further comprising: Based on the first sample representation and the second sample representation, the encoder is trained by a preset second loss function to obtain a trained encoder.
7. The method according to claim 6, further comprising: performing mask processing on the first matching indicator included in the first training sample based on the first auxiliary sample to obtain a masked first training sample; Inputting the masked first training sample into the encoder to obtain a seventh sample representation corresponding to the masked first training sample; Based on the third sample representation and the seventh sample representation, the encoder and / or the conditional filter are jointly trained by a preset third loss function.
8. The method according to any one of claims 1 to 7, further comprising: Obtaining user feedback information on the target retrieval data, wherein the feedback information includes one or more of satisfaction information, click behavior information, and preset instructions; A search strategy for the object to be searched is generated based on the feedback information, and a search process currently in use is adjusted based on the generated search strategy.
9. A data retrieval device, comprising: A request module receives a search request for a target object to be searched, and obtains auxiliary query information for the target object; an encoding module, inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; a representation adjustment module, which adjusts the search representation based on the search constraint information to obtain an adjusted search representation, and adjusts the data representation corresponding to each search data contained in the search database corresponding to the search request based on the search constraint information to obtain a representation database composed of the adjusted data representations; The retrieval module searches the representation database for an adjusted data representation that matches the adjusted retrieval representation, and determines, based on the searched adjusted data representation, target retrieval data retrieved from the retrieval database based on the retrieval request.
10. A data retrieval device, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Receiving a search request for a target object to be searched, and obtaining auxiliary query information for the target object; Inputting information related to the target object in the search request into an encoder to obtain a search representation corresponding to the search request, and inputting prompt information generated based on the auxiliary query information into a large language model to obtain search constraint information corresponding to the search request; The search representation is adjusted based on the search constraint information to obtain an adjusted search representation, and the data representation corresponding to each search data contained in the search database corresponding to the search request is adjusted based on the search constraint information to obtain a representation database composed of the adjusted data representations; An adjusted data representation matching the adjusted search representation is queried from the representation database, and target search data retrieved from the search database based on the search request is determined based on the queried adjusted data representation.
Citation Information
Patent Citations
Retrieval method and device, electronic equipment, readable storage medium and product
CN115700532A
Data retrieval method and device, processor and electronic equipment
CN117009599A
Business data retrieval method and device, electronic equipment and storage medium
CN118093780A
Data retrieval unit, data retrieval method, and program
JP2021149857A
Hierarchical data retrieval method and apparatus, and device
WO2023087673A1