Semantic hashing method based on neighbor information and mutual information preserving variational autoencoder
By constructing a semantic hashing method based on a variational autoencoder that preserves neighbor information and mutual information, the problem of low accuracy and efficiency of text semantic hashing technology in text processing is solved, thereby improving the accuracy and efficiency of text processing.
Patent Information
- Application Number
- CN202310685089.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-06-09
AI Technical Summary
Existing text semantic hashing technology has low accuracy and efficiency in text processing, especially affecting the accuracy of document retrieval and containing errors.
The semantic hashing method based on neighbor information and mutual information preservation variational autoencoder improves the accuracy of hash codes by constructing a variational autoencoder model that preserves neighbor information and mutual information for text data and incorporating neighbor information into the hash code training process.
It improves the accuracy and efficiency of text processing, reduces errors, and particularly enhances retrieval accuracy in the field of document retrieval.
Smart Images

Figure CN116894075B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of text processing, and more particularly, to a semantic hashing method based on neighbor information and mutual information preserving variational autoencoder. BACKGROUND
[0002] With the rapid development of the Internet and mobile Internet, a large amount of text data has been generated and accumulated by people. In order to better process these massive text data, researchers have proposed many text processing techniques. Text semantic hashing is one of them.
[0003] Text semantic hashing is a technology that maps text to fixed-length binary codes. By mapping text to binary codes, it realizes efficient processing of text data. Text semantic hashing technology is based on deep learning models. In the process of mapping text to binary codes, not only the lexical information of the text is considered, but also the semantic information of the text, thereby improving the accuracy and efficiency of text processing.
[0004] Text semantic hashing technology has been widely applied in information retrieval, recommendation systems, text classification, text clustering, and text similarity calculation. In the field of information retrieval, traditional keyword-based retrieval methods are prone to ambiguity, while text semantic hashing technology can map text to binary codes and retrieve through binary codes, avoiding ambiguity and improving retrieval efficiency and accuracy. In the field of recommendation systems, text semantic hashing technology can map user historical behavior data and item text information to binary codes and calculate the similarity between users and items through binary codes to achieve accurate recommendations. For example, an information recommendation method is disclosed in the prior art. First, one or more first text contents of a user to be recommended and their respective first feature words are determined. Then, a plurality of reference text contents are obtained, which are associated with corresponding recommended information, and the second feature words corresponding to the plurality of reference text contents are determined. Based on the first feature words and the second feature words, the binary vectors of the first text contents and the reference text contents are determined based on the text semantic hashing algorithm. For each first text content, the second text content similar to the first text content is determined from the plurality of reference text contents based on the binary vector. The recommended information associated with all second text contents is counted, and a voting mechanism is used to recommend information to the user, achieving accurate recommendations.
[0005] In the field of text classification and clustering, text semantic hashing technology can map text to binary code and classify and cluster text through binary code, thereby realizing efficient text classification and clustering. In the field of text similarity calculation, text semantic hashing technology can map text to binary code and calculate the similarity between texts through binary code, thereby realizing efficient text similarity calculation.
[0006] However, in practical applications, text semantic hashing requires a large amount of text data for training, and the amount of text data is high, otherwise it will affect the accuracy and efficiency of text processing, especially in the field of document retrieval, which affects the retrieval accuracy. Secondly, due to the diversity and complexity of text, there may be certain errors in the actual application of text semantic hashing technology. SUMMARY
[0007] To solve the problem of low accuracy and efficiency of current text semantic hashing method for text processing, the present application proposes a semantic hashing method based on neighbor information and mutual information preserving variational autoencoder, which integrates the neighbor information of text data into the training process of hash code, improves the accuracy of hash code, and improves the accuracy and efficiency of text processing.
[0008] In order to achieve the above technical effects, the technical scheme of the present application is as follows:
[0009] A semantic hashing method based on neighbor information and mutual information preserving variational autoencoder, the method comprising the following steps:
[0010] S1. Constructing the neighbor information of the text data in the text data set;
[0011] S2. Building a mutual information preserving variational autoencoder model between adjacent texts;
[0012] S3. Inputting the text data and its neighbor information into the mutual information preserving variational autoencoder model to calculate the reconstruction similarity of the text data;
[0013] S4. Selecting adjacent texts from the text data set and calculating the mutual information lower bound between the hidden variables corresponding to the adjacent texts, the mutual information lower bound having fault tolerance;
[0014] S5. Maximizing the reconstruction similarity of the data and the mutual information lower bound between the hidden variables corresponding to the adjacent texts, updating the model parameters of the mutual information preserving variational autoencoder model to obtain an updated mutual information preserving variational autoencoder model;
[0015] S6. Obtaining a text data set to be processed, inputting the text data in the text data set to be processed into the updated mutual information preserving variational autoencoder model, and determining the final hash code;
[0016] S7. Use the hash code obtained in step S6 to process the document.
[0017] Through the above technical solution, a variational autoencoder model with mutual information preservation is constructed based on the neighbor information of text data. Combined with the variational autoencoder model, the neighbor information of the text data to be processed is integrated into the hash code training process. In this process, for the adjacent texts in the text dataset, a lower bound of mutual information with fault tolerance is obtained, which effectively improves the accuracy of semantic hashing in text processing and enhances the accuracy and efficiency of text processing.
[0018] Preferably, in step S1, the neighbor information of the text data is constructed based on the text data, according to the features of the text data or the inherent relationships of the text data.
[0019] The above methods can be used to construct neighbor information based on the features between text data or on the inherent relationships between text data.
[0020] Preferably, the variational autoencoder model described in step S2 includes: a multilayer perceptron encoder E and a single-layer perceptron decoder G; the multilayer perceptron encoder E is used to perform compression and dimensionality reduction operations on the text data, compressing the text data from the original space to a low-dimensional latent variable space, estimating the parameters of the distribution followed by the latent variables, and obtaining the corresponding hash code based on the parameters of the distribution followed by the latent variables; the single-layer perceptron decoder G is used to reconstruct the hash code to obtain the text data.
[0021] Preferably, in step S3, let the text data in the text dataset be represented as x, and the neighbor information as ε. The text data x is compressed and reduced in dimensionality by a multilayer perceptron encoder E to estimate the parameter E(x) of the distribution followed by the latent variables. Based on the parameter E(x) of the distribution followed by the latent variables, the variational posterior distribution q of the latent variables is obtained. φ (z|x), based on the variational posterior distribution q of latent variables φ (z|x), the corresponding hash code z is obtained by sampling, and then reconstructed by a single-layer perceptron decoder G to obtain text data G(z). Text data G(z) represents the text data reconstructed back by the latent variable z by the single-layer perceptron decoder G.
[0022] Let the prior distribution of the latent variables be a multivariate Bernoulli distribution, then it satisfies the expression:
[0023] p(z)=μ z (1-μ) 1-z
[0024] Where p(z) represents the prior distribution of the latent variable, and μ is the parameter of the multivariate Bernoulli distribution;
[0025] The reconstruction similarity calculation expression of the text data is:
[0026]
[0027] Preferably, in step S4, assuming that the text data set contains N text data, a random variable V' and a random variable V" are constructed to represent a pair of adjacent texts, the pair of adjacent texts is taken from the N text data of {1, 2,..., N}, and the joint distribution of the pair of adjacent texts is defined as:
[0028]
[0029] where v' and v" are corresponding text data values of the random variable V' and the random variable V" respectively, and the joint distribution indicates the probability of the text data v' and v" being adjacent in the given neighbor information;
[0030] Based on the joint distribution and the variational posterior distribution q φ (z|x), the distribution about the corresponding hidden variable is defined as:
[0031]
[0032] where the variational posterior distribution is assumed to be subject to a multivariate Bernoulli distribution, specifically:
[0033] q φ (z|x)=[E(x)] z [1-E(x)] 1-z
[0034] With the joint distribution of the hidden variables Z' and Z" corresponding to the adjacent text pair being defined, the mutual information I φ (Z';Z") between the adjacent texts is obtained; assuming that the mutual information lower bound with fault tolerance is satisfies:
[0035]
[0036]
[0037] where is K independent of the random variables Z' and Z", and Q φ (z" k )=Q φ (z"), z" k and z" are identically distributed; the function f(z', z'', c 1:M (z')) is a similarity function for describing the similarity between the hidden variable samples z' and z'', and is defined as:
[0038]
[0039] w(z',z") is a weight function; k are M vectors depending on z'; the M vectors have the following relationship with z': (z', c m (z') ~ Q φ (z',z");
[0040] The weight function is set to obtain a mutual information lower bound with fault tolerance capability, and the expression is:
[0041]
[0042] Through the above technical scheme, the mutual information lower bound is designed to improve the fault tolerance capability of the model. Even if (z', z") is not the real adjacent text, that is, the neighbor information shows that they are adjacent, but in fact they are not similar, which is a set of false adjacent information, but the risk brought by it can be shared by other M pairs of adjacent texts , improving the fault tolerance capability.
[0043] Preferably, the objective function of maximizing the mutual information lower bound between the reconstruction similarity of the current data and the latent variable corresponding to the adjacent text pair in step S5 is expressed as:
[0044]
[0045] wherein, KL(q φ (z i |x i )||p(z i )) is the relative entropy between the variational posterior distribution q φ (z i |x i ) and the prior distribution p(z i ), and the objective function has fault tolerance capability.
[0046] Preferably, the model parameters of the mutual information preserving variational autoencoder model include: model parameters of the multilayer perceptron encoder E and model parameters of the single-layer perceptron decoder G.
[0047] Preferably, when updating the model parameters of the mutual information preserving variational autoencoder model, the objective function is calculated, and the model parameters of the mutual information preserving variational autoencoder model are updated by the gradient ascent method. After multiple gradient backpropagation, the updated model parameters are recorded, and the mutual information preserving variational autoencoder model corresponding to the updated model parameters is taken as the updated mutual information preserving variational autoencoder model.
[0048] Preferably, the process of determining the final hash code is: inputting the text data into the multi-layer perception encoder E to obtain the latent variable distribution parameter, and binarizing the latent variable distribution parameter to obtain the final hash code.
[0049] A semantic hashing system based on neighbor information and mutual information preserving variational autoencoder, the system is used to realize the semantic hashing method, comprising:
[0050] A neighbor information construction unit is configured to construct neighbor information of text data in a text data set.
[0051] A variational autoencoder model construction unit is configured to construct a mutual information preserving variational autoencoder model between adjacent texts.
[0052] A reconstruction similarity calculation unit is configured to input the text data and its neighbor information into the mutual information preserving variational autoencoder model, and calculate the reconstruction similarity of the text data.
[0053] A mutual information lower bound calculation unit is configured to select adjacent texts from the text data set, and calculate the mutual information lower bound between the latent variables corresponding to the adjacent texts, the mutual information lower bound having fault tolerance.
[0054] A variational autoencoder model updating unit is configured to maximize the reconstruction similarity of the data and the mutual information lower bound between the latent variables corresponding to the adjacent texts, update the model parameters of the mutual information preserving variational autoencoder model, and obtain an updated mutual information preserving variational autoencoder model.
[0055] A hash code generation unit is configured to obtain a text data set to be processed, input the text data in the text data set to be processed into the updated mutual information preserving variational autoencoder model, and determine a final hash code.
[0056] A document processing unit is configured to perform document processing using the final hash code.
[0057] Compared with the prior art, the technical scheme of the present application has the following beneficial effects:
[0058] The present application provides a semantic hashing method based on neighbor information and mutual information preserving variational autoencoder, based on the neighbor information of the text data, a mutual information preserving variational autoencoder model is constructed, and the neighbor information of the text data to be processed is integrated into the process of hash code training by combining the variational autoencoder model, in this process, for the adjacent texts of the text data in the text data set, a mutual information lower bound with fault tolerance is obtained, which effectively improves the accuracy of semantic hashing in text processing and improves the accuracy and efficiency of text processing. BRIEF DESCRIPTION OF DRAWINGS
[0059] Figure 1Fig. 1 shows a flow chart of the semantic hashing method based on neighbor information and mutual information preserving variational autoencoder proposed in Embodiment 1 of the present application;
[0060] Figure 2 Fig. 2 shows a flow chart of the generation of the final hash code proposed in Embodiment 2 of the present application;
[0061] Figure 3 Fig. 3 shows a structure diagram of the semantic hashing system based on neighbor information and mutual information preserving variational autoencoder proposed in Embodiment 3 of the present application;
[0062] Figure 4 Fig. 4 shows a block diagram of the overall processing flow of the semantic hashing of text data based on neighbor information and mutual information preserving variational autoencoder proposed in Embodiment 4 of the present application. DETAILED DESCRIPTION
[0063] The accompanying drawings are only for illustrative purposes and should not be construed as limiting the present patent;
[0064] In order to better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the actual size;
[0065] For those skilled in the art, it is understandable that some well-known content in the drawings may be omitted.
[0066] The technical solutions of the present application will be further described below in combination with the drawings and embodiments.
[0067] The positional relationship described in the drawings is only for illustrative purposes and should not be construed as limiting the present patent;
[0068] Embodiment 1
[0069] The present embodiment proposes a semantic hashing method based on neighbor information and mutual information preserving variational autoencoder, and the flow chart of the method is shown in Fig. 1. Figure 1 The method comprises the following steps:
[0070] S1. Constructing the neighbor information of the text data in the text data set;
[0071] In the embodiment, the neighbor information has certain correlation with the text data in the text data set, similar to the concept of "neighbors" in physical location. The neighbor information of the text data is constructed based on the characteristics of the text data or the correlation relationship provided by the text data. When the neighbor information is constructed based on the characteristics of the text data, the relationship between the text data and the text data is considered. For a certain text data, the K other text data with the largest cosine similarity is selected as the neighbor. The correlation relationship provided by the text data can be, for example, the reference relationship between file data. In the embodiment, the two types of neighbor information are considered, that is, the constructed neighbor information is used in the text data set, and the neighbor information provided by the text data set is also used.
[0072] S2. Constructing a variational autoencoder model for preserving mutual information between adjacent texts; in the embodiment, the constructed variational autoencoder model includes a multilayer perceptron encoder E and a single-layer perceptron decoder G. The multilayer perceptron encoder E is used for compression and dimension reduction operation on the text data, compresses the text data from the original space to the low-dimensional hidden variable space, estimates the parameters of the distribution to which the hidden variable conforms, and obtains the corresponding hash code based on the parameters of the distribution to which the hidden variable conforms. The single-layer perceptron decoder G is used for reconstructing the hash code to obtain the text data.
[0073] S3. Inputting the text data and the neighbor information thereof into the variational autoencoder model for preserving mutual information, and calculating the reconstruction similarity of the text data;
[0074] S4. Selecting adjacent texts from the text data set, and calculating the mutual information lower bound between the hidden variables corresponding to the adjacent texts, the mutual information lower bound having fault tolerance;
[0075] S5. Maximizing the reconstruction similarity of the text data and the mutual information lower bound between the hidden variables corresponding to the adjacent texts, updating the model parameters of the variational autoencoder model for preserving mutual information, and obtaining an updated variational autoencoder model for preserving mutual information;
[0076] S6. Obtaining a text data set to be processed, inputting the text data in the text data set to be processed into the updated variational autoencoder model for preserving mutual information, and determining a final hash code;
[0077] S7. Using the hash code obtained in step S6 for document processing.
[0078] Embodiment 2
[0079] In the embodiment, the text data in the text data set is denoted as x, and the neighbor information is denoted as ε. The process of processing the text data by using the variational autoencoder model proposed in the embodiment is as follows:
[0080] The text data x is compressed and reduced in dimension by a multi-layer perception encoder E to estimate the parameter E(x) of the distribution of the latent variable, and the variational posterior distribution q φ (z|x) of the latent variable is obtained based on the parameter E(x) of the distribution of the latent variable φ (z|x), and a corresponding hash code z is sampled, and then reconstructed by a single-layer perception decoder G to obtain the text data G(z);
[0081] Suppose the prior distribution of the latent variable is a multinomial Bernoulli distribution, then the expression is satisfied:
[0082] p(z)=μ z (1-μ) 1-z
[0083] Where p(z) represents the prior distribution of the latent variable, and μ is the parameter of the multinomial Bernoulli distribution.
[0084] The reconstruction similarity calculation expression of the text data is:
[0085]
[0086] Here, the difference between the text data x and the reconstructed text data G(z) is the reconstruction error, and the "negative sign" after squaring represents similarity similarity The greater the similarity (that is, tends to 0, which is a kind of generalized similarity). Suppose the text data set contains N text data, and random variable V' and random variable V" are constructed to represent a pair of adjacent texts, and the pair of adjacent texts is taken from the N text data of {1, 2,..., N}, and the joint distribution of the pair of adjacent texts is defined as:
[0087]
[0088] Where v' and v" are the corresponding text data values of random variable V' and random variable V", respectively, and the joint distribution Indicates the probability of the text data v' and v" being adjacent in the given neighbor information.
[0089] Based on the joint distribution and the variational posterior distribution q φ (z|x), the distribution about the corresponding latent variable is defined as:
[0090]
[0091] Where the variational posterior distribution is assumed to follow a multinomial Bernoulli distribution, specifically:
[0092] q φ(z|x) = [E(x)] z [1-E(x)] 1-z
[0093] With the joint distribution of the latent variables Z' and Z" corresponding to the adjacent texts defined, the mutual information I φ (Z';Z") between the adjacent texts is obtained; in order to improve the fault tolerance, the mutual information lower bound with fault tolerance is set as satisfies:
[0094]
[0095]
[0096] wherein, is K independent of the random variables Z' and Z", and Q φ (z" k )=Q φ (z"), z" k and z" are identically distributed; the function f(z',z",c 1:M (z')) is a similarity function for describing the similarity between the latent variable samples z' and z", and is defined as:
[0097]
[0098] w(z',z" k ) is a weight function; is M vectors dependent on z'; the M vectors have the following relationship with z': (z',c m (z')) ~ Q φ (z',z");
[0099] The weight function is set, and the mutual information lower bound with fault tolerance is obtained, and the expression is:
[0100]
[0101] In this way, even if (z',z") is not a truly adjacent text, that is, they are adjacent in the neighbor information, but in fact they are not similar, which is a set of false adjacent information, and the risk it brings can be shared by the other M pairs of adjacent texts .
[0102] By maximizing the text reconstruction similarity and maximizing the mutual information lower bound between the latent variables of the adjacent texts, the model parameters of the variational autoencoder for mutual information preservation are iteratively updated, and in the embodiment, the objective function for maximizing the reconstruction similarity of the data and the mutual information lower bound between the latent variables corresponding to the adjacent texts is expressed as:
[0103]
[0104] where KL(q φ (z i |x i )||p(z i )) is the relative entropy between the variational posterior q φ (z i |x i ) and the prior p(z i ), and the objective function is robust to the error.
[0105] The model parameters of the mutual information preserving variational autoencoder model include: model parameters of the multilayer perceptron encoder E and model parameters of the single-layer perceptron decoder G. When updating the model parameters of the mutual information preserving variational autoencoder model, the objective function is calculated, and the model parameters of the mutual information preserving variational autoencoder model are updated by the gradient ascent method. After multiple gradient backpropagations, the updated model parameters are recorded, and the mutual information preserving variational autoencoder model corresponding to the updated model parameters is taken as the updated mutual information preserving variational autoencoder model.
[0106] The process of determining the final hash code is: inputting the text data into the multilayer perceptron encoder E to obtain the hidden variable distribution parameter, and binarizing the hidden variable distribution parameter to obtain the final hash code. Referring to Figure 2 , the text data document corresponds to "1", "2", "3", "4", "5", "6", "7", "8", the text data is input into the multilayer perceptron encoder to obtain the distribution of the hidden variable, and then binarization is performed to obtain the hash code.
[0107] Embodiment 3
[0108] This embodiment verifies the effectiveness of the method of the present application combined with specific text data sets. The text data sets used in this embodiment are Reuters21578, 20Newsgroup and Pubmed text data sets. The Reuters21578 text data set contains 10788 files, a total of 90 classes; the 20Newsgroup text data set contains 18828 news reports, a total of 20 classes; the Pubmed text data set contains 19717 scientific published articles, a total of 3 classes, and also has a reference network with 44338 edges. For Reuters21578 and 20Newsgroup without self-contained neighbor information, the K-nearest neighbor method is used to construct neighbor information. Specifically, the cosine similarity between all text data is calculated, and then the K text data with the largest similarity are selected as the neighbors of each text data.
[0109] Overall, the process of the variational autoencoder with all text dataset input mutual information preservation is as shown in Figure 3 Figure 3 Corresponding to "1", "2", "3", "4", "5", "6", "7", "8", the neighbor information obtained includes "(1, 2)", "(1, 5)", "(1, 6)", "(2, 8)", "(2, 4)", "(2, 3)", "(7, 2)", "(7, 5)", "(7, 6)", "(7, 8)", "(8, 4)", "(8, 3)", wherein, "(1, 6)" is selected as the adjacent text in the embodiment, input into the multilayer perceptron encoder, the corresponding latent variable distribution is obtained, the mutual information lower bound is calculated, and the latent variable is sampled and input into the single-layer perceptron decoder to obtain the reconstructed document data, the reconstruction similarity is calculated, the optimization target is integrated, the gradient of the model parameters is calculated using the calculation result of the objective function, and the model parameters are updated. After multiple gradient backpropagation, the final hash code is obtained.
[0110] Embodiment 4
[0111] As shown in Figure 4 , the embodiment proposes a semantic hashing system based on neighbor information and mutual information preserving variational autoencoder, which is used to implement the semantic hashing method, comprising:
[0112] A neighbor information construction unit is configured to construct neighbor information of text data in a text dataset;
[0113] A variational autoencoder model construction unit is configured to construct a variational autoencoder model with mutual information preservation between adjacent texts;
[0114] A reconstruction similarity calculation unit is configured to input the text data and its neighbor information into the variational autoencoder model with mutual information preservation, and calculate the reconstruction similarity of the text data;
[0115] A mutual information lower bound calculation unit is configured to select adjacent texts from the text dataset, calculate the mutual information lower bound between the latent variables corresponding to the adjacent texts, and the mutual information lower bound has fault tolerance;
[0116] A variational autoencoder model updating unit is configured to maximize the reconstruction similarity of the data and the mutual information lower bound between the latent variables corresponding to the adjacent texts, update the model parameters of the variational autoencoder model with mutual information preservation, and obtain an updated variational autoencoder model with mutual information preservation;
[0117] A hash code generation unit is configured to obtain a text dataset to be processed, input the text data in the text dataset to be processed into the updated variational autoencoder model with mutual information preservation, and determine the final hash code;
[0118] The document processing unit performs a document process using the final hash code.
[0119] Obviously, the above-mentioned embodiments of the application are only examples for clearly illustrating the application, but not limitation on the embodiments of the application. Based on the above-mentioned description, other different forms of changes or variations can be made by those skilled in the art. Here, all the embodiments are not required to be enumerated. Any modification, equivalent replacement and improvement, etc. made within the spirit and principle of the application should be included in the protection scope of the claims of the application.
Claims
1. A semantic hashing method based on neighbor information and mutual information preserving variational autoencoder, characterized in that, The method comprises the following steps: S1. Constructing neighbor information of text data in a text data set; S2. Building a variational autoencoder model that preserves mutual information between adjacent texts; The variational autoencoder model in step S2 comprises a multilayer perceptron encoder E and a single-layer perceptron decoder G; the multilayer perceptron encoder E is used for compression and dimension reduction operation on the text data, compressing the text data from the original space to a low-dimensional latent variable space, estimating the parameters of the distribution that the latent variable conforms to, and obtaining the corresponding hash code based on the parameters of the distribution that the latent variable conforms to; the single-layer perceptron decoder G is used for reconstructing the hash code to obtain the text data; S3. Inputting the text data and its neighbor information into the variational autoencoder model that preserves mutual information, and calculating the reconstruction similarity of the text data; In step S3, let the text data in the text dataset be represented as follows: x The latent variables corresponding to the text data are z Neighbor information is represented as Text data x By performing compression and dimensionality reduction using a multilayer perceptron encoder E, the parameters of the distribution followed by the latent variable z are estimated. Based on the parameters of the distribution followed by the latent variables Obtain the variational posterior distribution of the latent variables Variational posterior distribution based on latent variables The corresponding hash code is obtained by sampling. The text data is then reconstructed using a single-layer perceptron decoder G. Text data This represents the text data reconstructed from the latent variable z by the single-layer perceptron decoder G; If the prior distribution of the latent variable is a multinomial Bernoulli distribution, the expression is satisfied: wherein, denotes the prior distribution of the latent variable, are parameters of the multivariate Bernoulli distribution; Reconstruction similarity of textual data The computational expression is: ; S4. Selecting adjacent texts from the text data set, and calculating the mutual information lower bound between the latent variables corresponding to the adjacent texts, the mutual information lower bound having fault tolerance; S5. Maximizing the reconstruction similarity of the text data and the mutual information lower bound between the latent variables corresponding to the adjacent texts, updating the model parameters of the variational autoencoder model that preserves mutual information, and obtaining an updated variational autoencoder model that preserves mutual information; S6. Obtaining a text data set to be processed, inputting the text data in the text data set to be processed into the updated variational autoencoder model that preserves mutual information, and determining a final hash code; S7. Using the hash code obtained in step S6 for document processing.
2. The method of claim 1, wherein the semantic hashing based on neighbor information and mutual information preserving variational autoencoder is characterized by, In step S1, the neighbor information of the text data is constructed based on the text data, according to the features of the text data or the association relationship of the text data. 3.The semantic hashing method based on neighbor information and mutual information preserving variational autoencoder according to claim 1, characterized in that, In step S4, let the text data set contain N text data, construct random variables and random variables to represent a pair of adjacent texts, the pair of adjacent texts is taken from N text data, and the joint distribution of the pair of adjacent texts is defined as: wherein, and are corresponding one text data values of random variables and random variables respectively, the joint distribution indicates the probability of text data and adjacent in the given neighbor information; Based on the joint distribution and the variational posterior distribution , define the distribution over the corresponding latent variables as: The variational posterior distribution is assumed to conform to a multinomial Bernoulli distribution, and the specific expression is: With the latent variables corresponding to adjacent text and The joint distribution is defined, and the mutual information between adjacent texts is... Obtained; let the lower bound of fault-tolerant mutual information be... ,satisfy: where, are K independent samples of random variables and , and , and are identically distributed; the function is a similarity function used to describe the similarity between the latent variable samples and is defined as: is a weight function; is a vector of M functions dependent on ; the M vectors have the following relationship: ; The weight function is set to obtain the mutual information lower bound with fault tolerance, and the expression is: 。 4.The semantic hashing method based on neighbor information and mutual information preserving variational autoencoder according to claim 3, characterized in that, The objective function for maximizing the reconstruction similarity of the text data and the mutual information lower bound between the latent variables corresponding to the adjacent texts in step S5 is: wherein, is the variational posterior distribution is the relative entropy between the variational posterior distribution and the prior distribution, the objective function is robust to errors. 5.The semantic hashing method based on neighbor information and mutual information preserving variational autoencoder according to claim 4, characterized in that, The model parameters of the variational autoencoder model that preserves mutual information comprise the model parameters of the multilayer perceptron encoder E and the model parameters of the single-layer perceptron decoder G.
6. The method of claim 5, wherein the semantic hashing based on neighbor information and mutual information preserving variational autoencoder is characterized by, When updating the model parameters of the variational autoencoder model that preserves mutual information, the objective function is calculated, and the model parameters of the variational autoencoder model that preserves mutual information are updated by the gradient ascent method. After multiple gradient backpropagations, the updated model parameters are recorded, and the variational autoencoder model that preserves mutual information corresponding to the updated model parameters is taken as the updated variational autoencoder model that preserves mutual information.
7. The method of claim 6, wherein the semantic hashing based on neighbor information and mutual information preserving variational autoencoder is characterized by, The process of determining the final hash code is: inputting the text data into the multilayer perceptron encoder E to obtain the latent variable distribution parameter, binarizing the latent variable distribution parameter, and obtaining the final hash code. 8.A semantic hashing system based on neighbor information and mutual information preserving variational autoencoder, characterized in that, The system is used to implement the semantic hashing method in any one of claims 1-7, comprising: a neighbor information construction unit configured to construct neighbor information of text data in a text data set; a variational autoencoder model construction unit configured to build a variational autoencoder model that preserves mutual information between adjacent texts; The reconstruction similarity calculation unit is configured to input the text data and its neighbor information into the mutual information preserving variational autoencoder model, and calculate the reconstruction similarity of the text data; The mutual information lower bound calculation unit is configured to select adjacent texts from the text data set, and calculate the mutual information lower bound between the hidden variables corresponding to the adjacent texts, the mutual information lower bound having fault tolerance; The variational autoencoder model updating unit is configured to maximize the reconstruction similarity of the text data and the mutual information lower bound between the hidden variables corresponding to the adjacent texts, update the model parameters of the mutual information preserving variational autoencoder model, and obtain an updated mutual information preserving variational autoencoder model; The hash code generation unit is configured to obtain a text data set to be processed, input the text data in the text data set to be processed into the updated mutual information preserving variational autoencoder model, and determine a final hash code; The document processing unit is configured to perform document processing by using the final hash code.
Citation Information
Patent Citations
Multi-view comparative learning-based citation network graph representation learning system and method
CN113627463A
Commodity recommendation method and system based on neighbor perception interaction
CN115170243A