Information retrieval method, electronic device, and computer-readable storage medium
By using dimensionality reduction features in information retrieval for preliminary screening and determining the transfer probability of bridge sample information, the problem of difficulty in taking into account efficiency and accuracy in massive information retrieval is solved, and efficient and accurate information retrieval is achieved.
Patent Information
- Application Number
- CN202411923119.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The prior art is difficult to take into account both efficiency and accuracy in massive information retrieval. High-dimensional feature retrieval efficiency is low, and low-dimensional feature retrieval accuracy is insufficient.
By obtaining the first feature of the information to be queried and the second feature after its dimensionality reduction, large-scale search is performed in the database based on the second feature, the candidate sample information is screened out, and the transfer probability is determined using the bridge sample information, thereby filtering out the set of information to be matched with high matching probability, and using the first feature for accurate search.
The efficiency and accuracy of information retrieval are improved, and preliminary screening is carried out through dimensionality reduction features, reducing the amount of data retrieved in subsequent searches, and narrowing the distance between the information to be queried and the information candidate sample is found through bridge sample information, improving matching accuracy.
Smart Images

Figure CN119357442B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of information retrieval, and in particular to an information retrieval method, an electronic device and a computer-readable storage medium. Background Art
[0002] With the advent of the data age, how to retrieve massive amounts of information has received increasing attention. In the prior art, feature matching is usually used to retrieve and recall matching information from a database. However, for massive amounts of information, using high-dimensional features for information retrieval will seriously affect retrieval efficiency, and using low-dimensional features for information retrieval will reduce retrieval accuracy. Therefore, it is difficult to balance the efficiency and accuracy of information retrieval. In view of this, how to improve the efficiency and accuracy of information retrieval has become an urgent problem to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide an information retrieval method, an electronic device and a computer-readable storage medium, which can improve the efficiency and accuracy of information retrieval.
[0004] To solve the above technical problems, the first aspect of the present application provides an information retrieval method, including: obtaining a first feature and a second feature corresponding to information to be queried, searching in a database based on the second feature of the information to be queried, and obtaining a candidate sample information set corresponding to the information to be queried; wherein the second feature is a dimensionality reduction feature of the first feature, and the database includes first features and second features corresponding to multiple sample information respectively; obtaining bridge sample information in the candidate sample information set, and determining a transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set; wherein the similarity between the second feature of the information to be queried and the second feature of the bridge sample information satisfies a similarity condition; based on the transition probability, screening out a sample information set to be matched from the candidate sample information set, searching in the sample information set to be matched based on the first feature of the information to be queried, and obtaining a target sample information set corresponding to the information to be queried.
[0005] To solve the above technical problems, the second aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect.
[0006] In order to solve the above technical problem, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.
[0007] The above scheme obtains the first feature corresponding to the information to be queried and the second feature obtained after the first feature is reduced in dimension, and searches in the database based on the second feature of the information to be queried to obtain the candidate sample information set corresponding to the information to be queried, wherein the database includes the first feature and the second feature corresponding to each of the multiple sample information, and the candidate sample information set includes the second feature of the candidate sample information, and the second feature is the dimension reduction feature of the first feature, so that the retrieval efficiency can be improved when performing large-scale retrieval based on the second feature. Bridge sample information is obtained in the candidate sample information set, and the similarity between the second feature of the information to be queried and the second feature of the bridge sample information meets the similarity condition, and the transition probability of the information to be queried to each candidate sample in the candidate sample information set through the bridge sample information is determined, wherein the second feature of the information to be queried and the second feature of some of the candidate sample information at the back of the candidate sample information set may belong to the same information source, but the similarity is low because the features after dimension reduction are not obvious, and the bridge sample information is used as a transfer, which can shorten the distance between the information to be queried and some of the candidate sample information that are difficult to identify, and the probability of matching the information to be queried with the corresponding candidate sample information is characterized by the transition probability. Based on the transition probability, some sample information is screened out from the candidate sample information set to obtain the sample information set to be matched. Based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain the target sample information set corresponding to the information to be queried. After a small number of sample information sets to be matched with a higher matching probability are screened out, the first feature of high dimension is used for retrieval, thereby taking into account both retrieval efficiency and retrieval accuracy. Therefore, the second feature is used to perform a full-range search in the database to obtain the candidate sample information set, which can improve the retrieval efficiency. After the bridge sample information is screened out, the bridge sample information is used to shorten the distance between the information to be queried and the difficult sample information in the candidate sample information set, thereby screening out a small number of sample information sets to be matched with a higher matching probability. The first feature is used for retrieval to obtain a high-precision target sample information set from the sample information set to be matched, thereby improving the efficiency and accuracy of information retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flowchart of an implementation method of the information retrieval method of the present application;
[0010] Figure 2 It is a flowchart of another implementation method of the information retrieval method of the present application;
[0011] Figure 3 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0012] Figure 4 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0014] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0015] The information retrieval method provided in the present application is used to retrieve and match the features of the query information and the sample information in the database, and its corresponding execution subject is a processing unit that can call the database.
[0016] See also Figure 1 , Figure 1 1 is a flow chart of an implementation method of the information retrieval method of the present application, the method comprising:
[0017] S101: Obtain a first feature and a second feature corresponding to the information to be queried, and search in a database based on the second feature of the information to be queried to obtain a candidate sample information set corresponding to the information to be queried; wherein the second feature is a dimensionality reduction feature of the first feature, and the database includes the first feature and the second feature corresponding to each of a plurality of sample information.
[0018] Specifically, a first feature corresponding to the information to be queried and a second feature obtained after dimensionality reduction of the first feature are obtained, and a search is performed in the database based on the second feature of the information to be queried to obtain a candidate sample information set corresponding to the information to be queried.
[0019] It should be noted that the database includes first features and second features corresponding to multiple sample information respectively, and the candidate sample information set includes the second feature of the candidate sample information. The second feature is a dimensionality reduction feature of the first feature, so that the retrieval efficiency can be improved when performing large-scale retrieval based on the second feature.
[0020] It is understandable that the information to be queried can be image data or text data. Similarly, the sample information can be image data or text data. The first features obtained after feature extraction of the information to be queried or the sample information correspond to the same feature dimension, and the second features obtained after feature extraction of the information to be queried or the sample information correspond to the same feature dimension.
[0021] In some implementation scenarios, feature extraction is performed on the query information to obtain a first feature of the query information, and the first feature is subjected to dimensionality reduction processing to obtain a second feature. The similarity between the second feature of the query information and the second feature of the sample information in the database is determined, and sample information with a similarity greater than a filtering threshold is screened out to form a candidate sample information set.
[0022] In some implementation scenarios, convolutional layers of different dimensions are used to extract features of the query information to obtain a high-dimensional first feature and a low-dimensional second feature corresponding to the query information, and the similarity between the second feature of the query information and the second feature of the sample information in the database is determined. A preset screening value of sample information with the highest similarity is obtained from the database to form a candidate sample information set.
[0023] S102: Obtain bridge sample information in the candidate sample information set, and determine the probability of the query information passing through the bridge sample information to reach each candidate sample information in the candidate sample information set; wherein the similarity between the second feature of the query information and the second feature of the bridge sample information satisfies the similarity condition.
[0024] Specifically, bridge sample information is obtained from the candidate sample information set, and the similarity between the second feature of the information to be queried and the second feature of the bridge sample information meets the similarity condition, and the transition probability of the information to be queried passing through the bridge sample information to each candidate sample in the candidate sample information set is determined.
[0025] It should be noted that the second feature of the information to be queried and the second feature of some of the candidate sample information at the back in the candidate sample information set may belong to the same information source, but the similarity is low because the features after dimensionality reduction are not obvious. Using the bridge sample information as a transfer can shorten the distance between the information to be queried and some difficult-to-identify candidate sample information, and characterize the probability of matching the information to be queried with the corresponding candidate sample information through the transfer probability.
[0026] In some implementation scenarios, the similarity condition corresponds to candidate sample information whose similarity exceeds a first threshold. In the candidate sample information set, the candidate sample information whose similarity with the second feature of the information to be queried exceeds the first threshold is obtained as the bridge sample information. Based on the similarity between the second feature of the information to be queried and the second feature of each candidate sample information, and the similarity between the second feature of the bridge sample information and the second feature of each candidate sample information, a transfer matrix is constructed. Based on the transfer matrix, the transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set is determined.
[0027] For ease of explanation, when there are topKPF candidate sample information in the candidate sample information set, the dimension of the transfer matrix M is H×H, H=1+topKPF, that is, H corresponds to the total number of information to be queried and all candidate sample information, and the transfer matrix M corresponds to the similarity matrix SH. Assuming that the bridge sample information corresponds to the topL candidate sample information in the candidate sample information set, the similarity matrix SH includes at least the first 1+topL rows of valid parameters. Taking the first row as an example, it corresponds to the similarity between the second feature of the feature information to be queried, the second feature of the information to be queried, and the second feature of each candidate sample information. After normalizing the similarity matrix SH by row, the transfer matrix M can be obtained.
[0028] In some implementation scenarios, the similarity condition corresponds to the first number of candidate sample information with the highest similarity, wherein all candidate sample information in the candidate sample information set are sorted according to the similarity with the second feature of the information to be queried, and the first number of candidate sample information with the highest similarity is obtained as the bridge sample information. The similarity between the second feature of the information to be queried and the second feature of the bridge sample information, and the similarity between the second feature of the bridge sample information and the second feature of each candidate sample information are obtained, and based on the product of the two, the probability of the queried information jumping once through the bridge sample information to each candidate sample information is predicted, and the transfer probability of the queried information passing through the bridge sample information to each candidate sample information in the candidate sample information set is obtained.
[0029] For ease of explanation, the similarity is between 0 and 1. The similarity between the second feature of the information to be queried and the second feature of the bridge sample information is multiplied with the similarity between the second feature of the bridge sample information and the second feature of each candidate sample information to obtain the similarity product. All similarity products are normalized so that the sum of all products is 1, and the probability of the information to be queried jumping once through the bridge sample information to each candidate sample information is determined.
[0030] S103: Based on the transition probability, a sample information set to be matched is screened out from the candidate sample information set, and based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain a target sample information set corresponding to the information to be queried.
[0031] Specifically, based on the transition probability, part of the sample information is screened out from the candidate sample information set to obtain the sample information set to be matched. Based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain the target sample information set corresponding to the information to be queried. After a smaller number of sample information sets to be matched with a higher matching probability are screened out, the high-dimensional first feature is used for retrieval, thereby taking into account both retrieval efficiency and retrieval accuracy.
[0032] In some implementation scenarios, based on the transition probability, a preset number of sample information are screened out from the candidate sample information set as the sample information to be matched to form the sample information set to be matched, the similarity between the first feature of the information to be queried and the first feature of each sample information to be matched is determined, and the sample information whose similarity meets the target threshold is screened out to form the target sample information.
[0033] In some implementation scenarios, based on the transition probability, sample information above the probability threshold is screened out from the candidate sample information set as sample information to be matched to form the sample information set to be matched, and the similarity between the first feature of the information to be queried and the first feature of each sample information to be matched is determined, and the top target number of sample information with the highest similarity is screened out to form the target sample information.
[0034] The above scheme obtains the first feature corresponding to the information to be queried and the second feature obtained after the first feature is reduced in dimension, and searches in the database based on the second feature of the information to be queried to obtain the candidate sample information set corresponding to the information to be queried, wherein the database includes the first feature and the second feature corresponding to each of the multiple sample information, and the candidate sample information set includes the second feature of the candidate sample information, and the second feature is the dimension reduction feature of the first feature, so that the retrieval efficiency can be improved when performing large-scale retrieval based on the second feature. Bridge sample information is obtained in the candidate sample information set, and the similarity between the second feature of the information to be queried and the second feature of the bridge sample information meets the similarity condition, and the transition probability of the information to be queried to each candidate sample in the candidate sample information set through the bridge sample information is determined, wherein the second feature of the information to be queried and the second feature of some of the candidate sample information at the back of the candidate sample information set may belong to the same information source, but the similarity is low because the features after dimension reduction are not obvious, and the bridge sample information is used as a transfer, which can shorten the distance between the information to be queried and some of the candidate sample information that are difficult to identify, and the probability of matching the information to be queried with the corresponding candidate sample information is characterized by the transition probability. Based on the transition probability, some sample information is screened out from the candidate sample information set to obtain the sample information set to be matched. Based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain the target sample information set corresponding to the information to be queried. After a small number of sample information sets to be matched with a higher matching probability are screened out, the first feature of high dimension is used for retrieval, thereby taking into account both retrieval efficiency and retrieval accuracy. Therefore, the second feature is used to perform a full-range search in the database to obtain the candidate sample information set, which can improve the retrieval efficiency. After the bridge sample information is screened out, the bridge sample information is used to shorten the distance between the information to be queried and the difficult sample information in the candidate sample information set, thereby screening out a small number of sample information sets to be matched with a higher matching probability. The first feature is used for retrieval to obtain a high-precision target sample information set from the sample information set to be matched, thereby improving the efficiency and accuracy of information retrieval.
[0035] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of the information retrieval method of the present application, the method comprising:
[0036] S201: Obtain a first feature and a second feature corresponding to the information to be queried, and search in a database based on the second feature of the information to be queried to obtain a candidate sample information set corresponding to the information to be queried; wherein the second feature is a dimensionality reduction feature of the first feature, and the database includes the first feature and the second feature corresponding to each of a plurality of sample information.
[0037] Specifically, a first feature corresponding to the information to be queried and a second feature obtained after dimensionality reduction of the first feature are obtained, and a search is performed in the database based on the second feature of the information to be queried to obtain a candidate sample information set corresponding to the information to be queried.
[0038] In some implementation scenarios, feature extraction is performed on the queried information to obtain a first feature corresponding to the queried information, and dimension reduction processing is performed on the first feature corresponding to the queried information to obtain a second feature corresponding to the queried information; based on the similarity between the second feature of the queried information and the second feature of each sample information in the database, a candidate sample information set corresponding to the queried information is obtained.
[0039] Specifically, feature extraction is performed on the query information to obtain a high-dimensional first feature corresponding to the query information, and dimensionality reduction processing is performed on the first feature of the query information to obtain a low-dimensional second feature corresponding to the query information, thereby ensuring the correlation between the first feature and the second feature.
[0040] Furthermore, the similarity between the second feature of the information to be queried and the second feature of each sample information in the database is obtained, and based on the similarity, some sample information is screened out from the database as candidate sample information to form a candidate sample information set, thereby completing the initial screening of the database, reducing the amount of data that needs to be further retrieved later, and improving retrieval efficiency.
[0041] Optionally, a pre-trained feature extraction model may be used to extract a first feature of the information to be queried, and a pre-trained conversion model may be used to reduce the dimension of the first feature and convert the first feature into a second feature.
[0042] In a specific implementation scenario, based on the similarity between the second feature of the information to be queried and the second feature of each sample information in the database, a candidate sample information set corresponding to the information to be queried is obtained, including: based on the similarity between the second feature of the information to be queried and the second feature of each sample information in the database, an initial sample information set including a specified number of sample information is screened; and the initial sample information set is filtered to obtain a candidate sample information set corresponding to the information to be queried.
[0043] Specifically, based on the similarity between the second feature of the information to be queried and the second feature of each sample information in the database, all sample information in the database is sorted according to the similarity, and an initial sample information set consisting of the first specified number of sample information with the highest similarity is obtained.
[0044] Furthermore, the initial sample information set is filtered to further reduce the amount of sample information in the initial sample information set, and a candidate sample information set corresponding to the information to be queried is obtained, so as to compress the total amount of sample information in the candidate sample information set while increasing the probability that the sample information actually matching the information to be queried is included in the candidate sample information set.
[0045] Optionally, when filtering the initial sample information set, threshold filtering and feature duplication checking may be used to reduce the number of candidate sample information in the candidate sample information set as much as possible.
[0046] For ease of explanation, it is assumed that there are a total of topK samples to be matched in the sample information set to be matched that is expected to be obtained later. The second feature of the query information is used to search in the database to obtain an initial sample information set consisting of a specified number of topKP sample information, where topKP is much larger than topK, for example, topKP is a preset multiple of topK, and the preset multiple can be 50, 100 or 200, etc. The initial sample information set is filtered to increase the probability that the sample information actually matched by the query information is included in the candidate sample information set, and at the same time, the size of topKP is compressed as much as possible to obtain topKPF sample information to form a candidate sample information set.
[0047] S202: Obtain bridge sample information in the candidate sample information set, and determine a similarity set corresponding to the information to be queried and the bridge sample information; wherein the similarity set includes the similarity between the second feature of the information to be queried and the second feature of each candidate sample information, and the similarity between the bridge sample information and the second feature of each candidate sample information.
[0048] Specifically, bridge sample information that meets the similarity condition is obtained from the candidate sample information set, and a similarity set corresponding to the information to be queried and the bridge sample information is constructed by using the similarity between the second feature of the information to be queried and the second feature of each candidate sample information, as well as the similarity between the bridge sample information and the second feature of each candidate sample information.
[0049] S203: Based on the similarity set, determine the transition probability of the query information passing through the bridge sample information to each candidate sample information in the candidate sample information set.
[0050] Specifically, based on the similarity set, on the basis of the similarity between the second feature of the information to be queried and the second feature of each candidate sample information, combined with the similarity between the second feature of the bridge sample information and the second feature of each candidate sample information, the probability of the queried information passing through the bridge sample information to each candidate sample information in the candidate sample information set is estimated, and the transfer probability of the queried information passing through the bridge sample information to each candidate sample information is obtained.
[0051] It can be understood that for the true value that is difficult to accurately match based solely on the second feature of the information to be queried, the transition probability can be more accurately determined by using the bridge sample information as an intermediate bridge and combining the similarity between the second feature of the bridge sample information and the second feature of each candidate sample information. The transition probability can thus shorten the distance between the information to be queried and the true value that is difficult to accurately match.
[0052] In some implementation scenarios, based on a similarity set, the transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set is determined, including: constructing an adjacency matrix based on the similarity set; wherein the dimension of the adjacency matrix corresponds to the total number of the information to be queried and all candidate sample information; normalizing the adjacency matrix by rows to obtain a transfer matrix, and using the transfer matrix, determining the transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set.
[0053] Specifically, based on the similarities contained in the similarity set, an adjacency matrix is constructed, where the dimension of the adjacency matrix corresponds to the total number of the query information and all candidate sample information. That is, the dimension of the adjacency matrix is H×H, and when the number of all candidate sample information is topKPF, H=1+topKPF.
[0054] Furthermore, the adjacency matrix is normalized row by row so that the sum of the probabilities of each sample jumping to each sample is 1, and the transfer matrix is obtained. Then, the transfer probability of the Nth-order nearest neighbor can be directly calculated based on the transfer matrix, thereby accurately determining the transfer probability of the query information passing through the bridge sample information to each candidate sample information in the candidate sample information set.
[0055] It should be noted that constructing an adjacency matrix based on a similarity set includes: obtaining a similarity matrix that matches the similarity set; renormalizing the similarities in the similarity matrix, and determining an adjacency matrix based on the renormalized similarity matrix; wherein, when renormalizing the similarity, the similarity cutoff value is used as the cutoff value, and the difference between the similarity distance and the similarity cutoff value is increased.
[0056] Specifically, a matching similarity matrix is constructed using a similarity set, and the dimension of the similarity matrix is H×H. The similarities in the similarity matrix are renormalized, so that in the renormalized similarity matrix, the similarity cutoff value is used as the cutoff value, and the similarities smaller than the similarity cutoff value are adjusted to a smaller value, and the similarities larger than the similarity cutoff value are adjusted to a larger value. Thus, the similarities in the renormalized similarity matrix present the characteristics of being concentrated at both ends and having a sudden change in value within a shorter interval in the middle, thereby improving the problem of insufficient similarity discrimination between the true value and the non-true value based on the low-dimensional second feature respectively compared with the query information.
[0057] Furthermore, based on the renormalized similarity matrix, an adjacency matrix corresponding to the information to be queried and the bridge sample information is obtained.
[0058] For ease of explanation, the adjacency matrix represents the probability of connection between each two sample information. Here, there are a total of topKPF candidate sample information, plus the query information, a total of H=1+topKPF samples, and the adjacency matrix is H×H dimension. Let the adjacency matrix be A. The adjacency matrix A is obtained based on the similarity matrix SH, where the similarity matrix SH is expressed using the following formula:
[0059] (1)
[0060] in, is the identity matrix, represents the first 1+L rows of the similarity matrix SH, The feature matrix is obtained by connecting the S-dimensional second feature of the query information and the topL bridge sample information; is the feature matrix composed of the S-dimensional second features of the aforementioned H samples, with dimensions (H, S); Lut represents the mapping operation of similarity. For simplicity, The internal order is the query information to be queried, and the topKPF candidate sample information sorted by similarity. In this way, That is the matrix The first 1+L rows.
[0061] It should be noted that similarity filling is not calculated for rows 1+L to H in the similarity matrix SH in order to prevent interference from disordered information in the adjacency matrix A. This application uses the true value of the information to be queried in the database as the bridge sample information, but the topKPF is very likely not all true values. The mixing of non-true values will cause the information to be queried to jump to other data matched by this non-true value data through this bridge, and continuously amplify this pollution in multiple jumps. Therefore, only the topL part is filled so that only this part can be used as a bridge point.
[0062] Furthermore, similarity is generally distributed between 0 and 1, but in actual use, except for the closest partial true value, which has a high similarity with the information to be queried, the similarity of the remaining features with the information to be queried basically presents an exponential distribution, that is, the lower the similarity, the exponential increase in the number of sample information of this similarity. Therefore, a large part of the similarities in topKPF are actually very close, and if used as transition probabilities, the discrimination is insufficient. Therefore, the similarities in the similarity matrix are renormalized so that the similarities greater than the similarity cutoff value tend to the true value, and the similarities less than the similarity cutoff value tend to the non-true value, thereby widening the discrimination in the middle score segment so that different similarities have better expression meaning.
[0063] Optionally, the renormalization calculation function may be expressed based on the following formula:
[0064] (2)
[0065] Among them, ts is the similarity cutoff value, and α is the saturation coefficient. You can set ts=0.8, α=25, or ts=0.85, α=20 and other customized parameters. Based on this renormalization calculation function, the first 1+L rows of values in the similarity matrix SH are mapped to obtain the final adjacency matrix A.
[0066] It should be noted that in addition to the above-mentioned renormalization calculation function, it is also possible to obtain the difference between the original similarity and the similarity boundary value, set an adaptive adjustment value according to the difference, superimpose the adjustment value on the original similarity, adjust the similarity toward the direction of the region boundary value, and keep the size relationship between the original similarities unchanged.
[0067] It can be understood that after obtaining the adjacency matrix A, the adjacency matrix A is normalized by row so that the sum of the probabilities of each sample information jumping to each sample information is 1. The above process is expressed by the following formula:
[0068] (3)
[0069] Among them, matrix D is a diagonal matrix, the diagonal values are the sum of the corresponding row A matrix values, and the M matrix is the A matrix normalized by the D matrix. The M matrix is the transfer matrix.
[0070] Furthermore, the transition probability of the Nth-order neighbor can be directly calculated based on the transition matrix M:
[0071] (4)
[0072] (5)
[0073] (6)
[0074] in, Indicates matrix multiplication. Since rows 1+L to H of the M matrix are all unit matrices, rows 1+L to H will not change during transfer matrix multiplication. Therefore, only the first 1+L rows of the M matrix need to be right-multiplied by the M matrix:
[0075] (7)
[0076] (8)
[0077] Among them, n can usually be 2 or 3 to determine the transition probability and save computing power.
[0078] S204: Based on the transition probability, a sample information set to be matched is screened out from the candidate sample information set, and based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain a target sample information set corresponding to the information to be queried.
[0079] Specifically, based on the transition probability, part of the sample information is screened out from the candidate sample information set to obtain the sample information set to be matched. Based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain the target sample information set corresponding to the information to be queried. After a smaller number of sample information sets to be matched with a higher matching probability are screened out, the high-dimensional first feature is used for retrieval, thereby taking into account both retrieval efficiency and retrieval accuracy.
[0080] It can be understood that the transfer matrix corresponds to the initial probability of the query information going to any candidate sample information. The transfer probability obtained by using the transfer matrix corresponds to the multi-order transfer probability, which indicates the probability that the query information will jump to each candidate sample information at least once through the bridge sample information. The first row in the matrix corresponds to the initial probability of the query information going to any candidate sample information. The first row in the matrix corresponds to the probability that the query information jumps to each candidate sample information at least once through the bridge sample information.
[0081] In some implementation scenarios, based on the transition probability, a sample information set to be matched is screened out from a candidate sample information set, and based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain a target sample information set corresponding to the information to be queried, including: based on the probability difference between the multi-order transition probability corresponding to each candidate sample information and the initial probability, the sample information set to be matched is screened out from the candidate sample information set; wherein the number of sample information to be matched in the sample information set to be matched is a preset number; based on the similarity between the first feature of the information to be queried and the first feature of each sample information to be matched in the sample information set to be matched, the target sample information set corresponding to the information to be queried is obtained.
[0082] Specifically, for each candidate sample information, the probability difference between the multi-order transition probability corresponding to the candidate sample information and the initial probability is obtained, so that the difference is used to eliminate the background interference from the information to be queried, and based on the probability difference, a preset number of sample information is screened out from the candidate sample information set as the sample information to be matched to form the sample information set to be matched, thereby improving the accuracy of the sample information set to be matched.
[0083] Furthermore, the similarity between the first feature of the information to be queried and the first feature of each sample information to be matched is obtained, and based on the similarity, part of the sample information is screened out from the sample information set to be matched as the target sample information to form a target sample information set, thereby achieving high-precision matching in a small range and improving the accuracy of information retrieval.
[0084] Optionally, the similarity condition corresponds to the similarity exceeding a first threshold. The first threshold is relatively strict when used as a similarity condition, so as to screen out true values that match the information to be queried. For example, the similarity is between 0 and 1, and the first threshold is a value greater than 0.95 and less than 1.
[0085] Further, based on the probability difference between the multi-order transition probability corresponding to each candidate sample information and the initial probability, a set of sample information to be matched is screened out from the candidate sample information set, including: based on the similarity between the second feature of the information to be queried and the second feature of each candidate sample information, candidate sample information with a similarity exceeding a second threshold is screened out as sample information to be matched, and a first number of sample information to be matched that has been obtained is determined; wherein the second threshold is less than the first threshold; based on all the sample information to be matched that has been obtained and the first number corresponding to them, and the probability difference corresponding to other candidate sample information, a second number of candidate sample information that is different from the sample information to be matched that has been obtained is extracted from the candidate sample information set as sample information to be matched; wherein the sum of the first number and the second number is a preset number.
[0086] Specifically, according to the similarity between the second feature of the information to be queried and the second feature of the candidate sample information, the candidate sample information with a similarity exceeding the second threshold is screened out as the sample information to be matched that is initially screened out, and the number of the sample information to be matched is counted and recorded as the first number. The second threshold is smaller than the first threshold, so that part of the candidate sample information is preferentially screened out by similarity as the sample information to be matched, and the probability difference is mainly used to screen the sample information that is difficult to identify.
[0087] Furthermore, the other candidate sample information in the candidate sample information set except the obtained sample information to be matched is reordered according to the probability difference, and a second number of candidate sample information different from the obtained sample information to be matched is extracted from the other reordered candidate sample information as the remaining sample information to be matched, so that the sum of the first number and the second number is a preset number, thereby obtaining the sample information set to be matched through similarity screening and probability difference screening, thereby ensuring the accuracy of the sample information to be matched that is ultimately used for high-precision matching.
[0088] For ease of explanation, assume that the number of candidate sample information with a similarity greater than the second threshold is Q, the preset number is K, and usually Q < K. For the remaining topKPF-topQ candidate sample information, calculate the probability difference corresponding to its transition probability:
[0089] (9)
[0090] Among them, the dimension of R is (1, topKPF). After removing the topQ obtained sample information to be matched and the first position of the query information, sort the values in R from high to low, take the top (KQ) candidate sample information and include it in topK to obtain the sample information set to be matched.
[0091] In this embodiment, bridge sample information satisfying the similarity condition is obtained from the candidate sample information set, and a similarity set corresponding to the query information and the bridge sample information is constructed by using the similarity between the second feature of the query information and the second feature of each candidate sample information, and the similarity between the bridge sample information and the second feature of each candidate sample information. Based on the similarity contained in the similarity set, an adjacency matrix is constructed, wherein the similarity in the adjacency matrix is the renormalized similarity, and the similarity threshold value is used as the threshold, and the similarity less than the similarity threshold value is adjusted to a smaller value, and the similarity greater than the similarity threshold value is adjusted to a larger value, so that the similarity presents the characteristics of being concentrated at both ends and a sudden change in the value in the short interval in the middle, thereby improving the problem of insufficient similarity discrimination between the true value and the non-true value obtained based on the low-dimensional second feature and the query information, and based on the renormalized similarity matrix, an adjacency matrix corresponding to the query information and the bridge sample information is obtained. The adjacency matrix is normalized by row, so that the probability of each sample jumping to each sample is 1, and a transfer matrix is obtained. Furthermore, the transition probability of the Nth-order nearest neighbor can be directly calculated based on the transition matrix, so as to accurately determine the transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set. For each candidate sample information, the probability difference between the multi-order transition probability corresponding to the candidate sample information and the initial probability is obtained, so as to use the difference to eliminate the background interference from the information to be queried, and based on the probability difference, a preset number of sample information is screened out from the candidate sample information set as the sample information to be matched, forming a sample information set to be matched, and improving the accuracy of the sample information set to be matched, and obtaining the similarity between the first feature of the information to be queried and the first feature of each sample information to be matched, and based on the similarity, some sample information is screened out from the sample information set to be matched as the target sample information, and forming a target sample information set, so as to achieve high-precision matching in a small range and improve the accuracy of information retrieval.
[0092] See also Figure 3 , Figure 3It is a structural diagram of an embodiment of an electronic device of the present application, wherein the electronic device 30 includes a memory 301 and a processor 302 coupled to each other, wherein the memory 301 stores program data (not shown), and the processor 302 calls the program data to implement the method in any of the above embodiments. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0093] See also Figure 4 , Figure 4 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 40 stores program data 400. When the program data 400 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0094] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0095] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0096] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0097] The above description is only an implementation method of the present application, and does not limit the protection scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the protection scope of the present application.
Claims
1. An information retrieval method, characterized in that: The method comprises: Acquire a first feature and a second feature corresponding to the information to be queried, and search in a database based on the second feature of the information to be queried to obtain a candidate sample information set corresponding to the information to be queried; wherein the second feature is a dimension reduction feature of the first feature, and the database includes the first feature and the second feature corresponding to each of a plurality of sample information; Obtaining bridge sample information in the candidate sample information set, and determining the transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set; wherein the similarity between the second feature of the information to be queried and the second feature of the bridge sample information satisfies the similarity condition; Based on the transition probability, a sample information set to be matched is screened out from the candidate sample information set, and based on the first feature of the information to be queried, the sample information set to be matched is searched to obtain a target sample information set corresponding to the information to be queried.
2. The information retrieval method according to claim 1, characterized in that: The obtaining of the bridge sample information in the candidate sample information set and determining the transition probability of the information to be queried to each candidate sample information in the candidate sample information set through the bridge sample information includes: Obtain bridge sample information in the candidate sample information set, and determine a similarity set corresponding to the information to be queried and the bridge sample information; wherein the similarity set includes the similarity between the second feature of the information to be queried and the second feature of each candidate sample information, and the similarity between the bridge sample information and the second feature of each candidate sample information; Based on the similarity set, a transition probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set is determined.
3. The information retrieval method according to claim 2, characterized in that: The determining, based on the similarity set, the probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set comprises: Based on the similarity set, an adjacency matrix is constructed; wherein the dimension of the adjacency matrix corresponds to the total number of the information to be queried and all the candidate sample information; The adjacency matrix is normalized row by row to obtain a transfer matrix, and the transfer matrix is used to determine the transfer probability of the information to be queried passing through the bridge sample information to each candidate sample information in the candidate sample information set.
4. The information retrieval method according to claim 3, characterized in that: The step of constructing an adjacency matrix based on the similarity set includes: Obtaining a similarity matrix that matches the similarity set; The similarities in the similarity matrix are renormalized, and the adjacency matrix is determined based on the renormalized similarity matrix; wherein, when the similarities are renormalized, the similarity cutoff value is used as a cutoff, and the difference between the similarity and the similarity cutoff value is increased.
5. The information retrieval method according to claim 3, characterized in that: The transfer matrix corresponds to the initial probability of the information to be queried going to any candidate sample information, and the transfer probability obtained by using the transfer matrix corresponds to a multi-order transfer probability, and the multi-order transfer probability represents the probability that the information to be queried jumps at least once through the bridge sample information to each candidate sample information; The step of screening out a to-be-matched sample information set from the candidate sample information set based on the transition probability, and searching in the to-be-matched sample information set based on the first feature of the to-be-queried information to obtain a target sample information set corresponding to the to-be-queried information comprises: Based on the probability difference between the multi-order transition probability corresponding to each of the candidate sample information and the initial probability, a to-be-matched sample information set is screened out from the candidate sample information set; wherein the number of to-be-matched sample information in the to-be-matched sample information set is a preset number; Based on the similarity between the first feature of the information to be queried and the first feature of each piece of sample information to be matched in the sample information set to be matched, a target sample information set corresponding to the information to be queried is obtained.
6. The information retrieval method according to claim 5, characterized in that: The similarity condition corresponds to the similarity exceeding a first threshold; The step of screening out a to-be-matched sample information set from the candidate sample information set based on the probability difference between the multi-order transition probability corresponding to each candidate sample information and the initial probability comprises: Based on the similarity between the second feature of the information to be queried and the second feature of each of the candidate sample information, the candidate sample information having a similarity exceeding a second threshold is screened as the sample information to be matched, and a first number of the obtained sample information to be matched is determined; wherein the second threshold is less than the first threshold; Based on all the obtained sample information to be matched and their corresponding first quantity, and the probability difference between the multi-order transition probability corresponding to other candidate sample information and the initial probability, a second quantity of candidate sample information different from the obtained sample information to be matched is extracted from the candidate sample information set as the sample information to be matched; wherein the sum of the first quantity and the second quantity is the preset quantity.
7. The information retrieval method according to claim 1, characterized in that: The step of obtaining the first feature and the second feature corresponding to the information to be queried, and searching in a database based on the second feature of the information to be queried to obtain a candidate sample information set corresponding to the information to be queried, includes: Performing feature extraction on the information to be queried to obtain a first feature corresponding to the information to be queried, and performing dimensionality reduction processing on the first feature corresponding to the information to be queried to obtain a second feature corresponding to the information to be queried; Based on the similarity between the second feature of the information to be queried and the second feature of each sample information in the database, a candidate sample information set corresponding to the information to be queried is obtained.
8. The information retrieval method according to claim 7, characterized in that: The obtaining, based on the similarity between the second feature of the information to be queried and the second feature of each sample information in the database, a candidate sample information set corresponding to the information to be queried includes: Based on the similarity between the second feature of the information to be queried and the second feature of each sample information in the database, an initial sample information set including a specified number of sample information is obtained by screening; The initial sample information set is filtered to obtain a candidate sample information set corresponding to the information to be queried.
9. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Information retrieval method and device, terminal and computer readable storage medium
CN116049473A
Intelligent archive classification and retrieval method
CN117216217A