Retrieval recommendation method, device, computer readable storage medium and electronic device
Through the interest text vector model and similarity parameters, search results that meet users' expectations are recommended, which solves the problem of inaccurate search results of multisense search terms in the prior art and improves the user experience.
Patent Information
- Application Number
- CN201811585282.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2038-12-24
AI Technical Summary
In the prior art, when searching, when facing search terms with multiple meanings, there may be fewer texts in the search results that are feedbacked by users that meet the user's desired meaning, which is difficult to meet the user's usage needs.
By entering the word vector of the target search word into the interest text vector model, the interest text vector corresponding to the user is determined, and the recommended text is determined from the text set based on the similarity parameters between the text vector and the interest text vector in the text set, the recommended text is determined from the text set based on the similarity parameters between the text vector and the interest text vector in the text set. .
It realizes accurate representation of user interests and matching of recommendation texts, meets user usage needs and improves user experience.
Smart Images

Figure CN109783727B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular, to a retrieval recommendation method, device, computer-readable storage medium, and electronic device. Background Art
[0002] With the development of computer technology, users only need to enter search terms to obtain search data. However, with the gradual increase of network data, when users enter search terms, a large amount of data will be retrieved. In addition, the same search term may have different meanings in different fields. In the prior art, when searching according to the search terms, all texts in the search website can be matched with the search terms, and the texts that are successfully matched are fed back to the user. However, in this method, when facing search terms with multiple meanings, there may be fewer texts in the search results fed back by the user that meet the user's expected meaning, which is difficult to meet the user's usage needs. Summary of the invention
[0003] In order to solve the above problems, the purpose of the present disclosure is to provide a retrieval recommendation method, device, computer-readable storage medium and electronic device that are accurate and meet user expectations.
[0004] In order to achieve the above objective, according to a first aspect of the present disclosure, a retrieval recommendation method is provided, the method comprising:
[0005] Inputting the word vector of the target search term into the interest text vector model to determine the interest text vector corresponding to the target search term, wherein the interest text vector model corresponds to the user who inputs the target search term, and the interest text vector is used to represent the text that the user expects to obtain after searching for the target search term;
[0006] Respectively determining similarity parameters between the text vector of interest and the text vectors of the texts in the text set;
[0007] According to the similarity parameter, a recommended text is determined from the text set, and the recommended text is output.
[0008] Optionally, determine word vectors by:
[0009] Input text data containing the target word into the word vector model, obtain the output vector, and complete a training of the word vector model;
[0010] The weight of the output vector of the target word is determined according to the following formula:
[0011]
[0012] Wherein, P(W) represents the weight of the output vector;
[0013] α represents the learning rate of the word vector model;
[0014] Represents the target word w in the output layer of the word vector model t The activation value of the corresponding neuron; y i represents the activation value of the i-th neuron in the output layer;
[0015] t represents the total number of neurons in the output layer;
[0016] θ represents the regularization term;
[0017] According to the weight of the output vector, the word vector model is updated, and the step of inputting the text data containing the target word into the word vector model, obtaining the output vector, and completing one training of the word vector model is re-executed, until the number of training times of the word vector model reaches a preset number of times, or the difference between the weights of the output vectors corresponding to two consecutive trainings of the word vector model is within a preset range;
[0018] The output vector with the largest weight is determined as the word vector of the target word.
[0019] Optionally, the interest text vector model is obtained by training based on the word vector of the historical search term input by the user and the first browsing behavior data of the user on the text retrieved based on the historical search term.
[0020] Optionally, the method further comprises:
[0021] Acquire second browsing behavior data of the user for the recommended text;
[0022] If it is determined according to the second browsing behavior data that the recommended texts contain texts that the user is interested in, the interest text vector model is updated according to the difference between the text vector of the text that the user is interested in and the interest text vector.
[0023] Optionally, the method further comprises:
[0024] Determining the number of occurrences of the target search term in each text in the text collection;
[0025] Determine a correlation parameter between the target search term and each text in the text collection according to the inverse text frequency of the target search term in the text collection, the number of occurrences of the target search term in each text in the text collection, the word frequency, and the text length of each text in the text collection;
[0026] Determining the recommended text from the text set according to the similarity parameter includes:
[0027] The recommended text is determined according to the similarity parameter and the relevance parameter.
[0028] Optionally, the correlation parameter is determined by the following formula:
[0029]
[0030] Wherein, q represents the target search term;
[0031] Score(q,d) represents the correlation parameter between the target search term q and the text d in the text set;
[0032] IDF(q) represents the inverse document frequency of the target search term q in the text collection;
[0033] TF(q) represents the frequency of the target search term q in the text d in the text collection;
[0034] f represents the number of occurrences of the target search term q in the text d in the text collection;
[0035] k and b represent preset constants, where b≠0;
[0036] dl represents the text length of the text d in the text set;
[0037] avgdl represents the average text length of the text in the text collection.
[0038] Optionally, determining the recommended text according to the similarity parameter and the relevance parameter includes:
[0039] When there are multiple target search terms, the sum of the correlation parameters between each target search term and the text is determined as the correlation parameter corresponding to the text;
[0040] For each text in the text set, a similarity parameter corresponding to the text and a relevance parameter corresponding to the text are weighted summed to determine a recommendation value corresponding to the text;
[0041] The recommended text is determined based on the recommendation value corresponding to each text in the text set.
[0042] According to a second aspect of the present disclosure, a retrieval recommendation device is provided, the device comprising:
[0043] A first determination module is used to input the word vector of the target search term into the interest text vector model to determine the interest text vector corresponding to the target search term, wherein the interest text vector model corresponds to the user who inputs the target search term, and the interest text vector is used to represent the text that the user expects to obtain after searching for the target search term;
[0044] A second determination module is used to respectively determine similarity parameters between the interest text vector and text vectors of texts in the text set;
[0045] The third determination module is used to determine the recommended text from the text set according to the similarity parameter, and output the recommended text.
[0046] Optionally, determine word vectors by:
[0047] Input text data containing the target word into the word vector model, obtain the output vector, and complete a training of the word vector model;
[0048] The weight of the output vector of the target word is determined according to the following formula:
[0049]
[0050] Wherein, P(W) represents the weight of the output vector;
[0051] α represents the learning rate of the word vector model;
[0052] Represents the target word w in the output layer of the word vector model t The activation value of the corresponding neuron;
[0053] y i represents the activation value of the i-th neuron in the output layer;
[0054] t represents the total number of neurons in the output layer;
[0055] θ represents the regularization term;
[0056] According to the weight of the output vector, the word vector model is updated, and the step of inputting the text data containing the target word into the word vector model, obtaining the output vector, and completing one training of the word vector model is re-executed, until the number of training times of the word vector model reaches a preset number of times, or the difference between the weights of the output vectors corresponding to two consecutive trainings of the word vector model is within a preset range;
[0057] The output vector with the largest weight is determined as the word vector of the target word.
[0058] Optionally, the interest text vector model is obtained by training based on the word vector of the historical search term input by the user and the first browsing behavior data of the user on the text retrieved based on the historical search term.
[0059] Optionally, the device further comprises:
[0060] An acquisition module, used for acquiring second browsing behavior data of the user on the recommended text;
[0061] An updating module is used to update the interest text vector model according to the difference between the text vector of the text that the user is interested in and the interest text vector if it is determined according to the second browsing behavior data that the recommended text contains text that the user is interested in.
[0062] Optionally, the device further comprises:
[0063] A fourth determination module, used to determine the number of occurrences of the target search term in each text in the text collection;
[0064] a fifth determination module, for determining a correlation parameter between the target search term and each text in the text set according to an inverse text frequency of the target search term in the text set, a number of occurrences of the target search term in each text in the text set, a word frequency, and a text length of each text in the text set;
[0065] The third determination module is used to determine the recommended text according to the similarity parameter and the correlation parameter.
[0066] Optionally, the correlation parameter is determined by the following formula:
[0067]
[0068] Wherein, q represents the target search term;
[0069] Score(q,d) represents the correlation parameter between the target search term q and the text d in the text set;
[0070] IDF(q) represents the inverse document frequency of the target search term q in the text collection;
[0071] TF(q) represents the frequency of the target search term q in the text d in the text collection;
[0072] f represents the number of occurrences of the target search term q in the text d in the text collection;
[0073] k and b represent preset constants, where b≠0;
[0074] dl represents the text length of the text d in the text set;
[0075] avgdl represents the average text length of the text in the text collection.
[0076] Optionally, the third determining module includes:
[0077] A first determination submodule, for determining, when there are multiple target search terms, the sum of the correlation parameters between each of the target search terms and the text as the correlation parameter corresponding to the text;
[0078] A second determination submodule is used to perform weighted summation of a similarity parameter corresponding to each text in the text set and a relevance parameter corresponding to the text to determine a recommendation value corresponding to the text;
[0079] The third determination submodule is used to determine the recommended text based on the recommendation value corresponding to each text in the text set.
[0080] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any method described in the first aspect are implemented.
[0081] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:
[0082] a memory having a computer program stored thereon;
[0083] A processor is used to execute the computer program in the memory to implement the steps of any method described in the first aspect above.
[0084] In the above technical solution, the interest text vector corresponding to the user is determined by the target search term, which can provide data support for recommending search results that meet the user's interests. Afterwards, the recommended text for user feedback is determined based on the similarity parameter between the text vector of the text in the text set and the interest text vector. Therefore, through the above technical solution, on the one hand, the user's interests can be accurately and standardizedly represented, and on the other hand, the recommended text can be determined based on the interest text vector, so that the recommended text is a text that meets the user's interests, meets the user's usage needs, and improves the user's usage experience.
[0085] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0087] Figure 1 is a flowchart of a retrieval recommendation method provided according to an embodiment of the present disclosure;
[0088] Figure 2 is a flowchart of a retrieval recommendation method provided according to another embodiment of the present disclosure;
[0089] Figure 3 is a block diagram of a search recommendation device provided according to an embodiment of the present disclosure;
[0090] Figure 4 is a block diagram of an electronic device according to an exemplary embodiment;
[0091] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0092] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0093] Figure 1 As shown, it is a flowchart of a retrieval recommendation method provided according to an embodiment of the present disclosure, as shown in Figure 1 As shown, the method includes:
[0094] In S11, the word vector of the target search term is input into the interest text vector model to determine the interest text vector corresponding to the target search term, wherein the interest text vector model corresponds to the user who inputs the target search term, and the interest text vector is used to represent the text that the user expects to obtain after searching for the target search term.
[0095] Each user has a corresponding interest text vector model. Therefore, when the word vector of the target search term is input into the interest text vector model, an interest text vector that meets the interests of the user can be obtained.
[0096] In S12, similarity parameters between the text vector of interest and the text vectors of the texts in the text collection are determined respectively.
[0097] The text set may be a set formed by all or part of the texts in the website searched by the user. For example, when the user searches for texts in a document library website, the text set may be all the texts in the document library; or it may be a set formed by the texts in the document library that contain the target search term.
[0098] As an example, the distance between the interest text vector and the text vector of the text can be determined as the similarity parameter, or the cosine value of the angle between the interest text vector and the text vector of the text can be determined as the similarity parameter. The method for determining the distance between vectors and the cosine value of the angle is prior art and will not be repeated here.
[0099] In S13, a recommended text is determined from the text set according to the similarity parameter, and the recommended text is output.
[0100] In one embodiment, when the similarity parameter is distance, texts whose distance is less than a preset distance threshold can be determined as recommended texts, and output in order of distance from small to large; when the similarity parameter is the cosine value of the angle, texts whose cosine value is greater than a preset cosine value threshold can be determined as recommended texts, and the recommended texts can be output in order of the cosine value of the angle from large to small.
[0101] In another embodiment, the number of recommended texts may be preset. For example, the number of recommended texts may be set to 10, and the recommended texts may be determined by sorting according to the size of the similarity parameter. When the similarity parameter is the distance, the top 10 texts ranked in ascending order of distance are determined as recommended texts; when the similarity parameter is the angle cosine value, the top 10 texts ranked in descending order of angle cosine value are determined as recommended texts.
[0102] In the above technical solution, the interest text vector corresponding to the user is determined by the target search term, which can provide data support for recommending search results that meet the user's interests. Afterwards, the recommended text for user feedback is determined based on the similarity parameter between the text vector of the text in the text set and the interest text vector. Therefore, through the above technical solution, on the one hand, the user's interests can be accurately and standardizedly represented, and on the other hand, the recommended text can be determined based on the interest text vector, so that the recommended text is a text that meets the user's interests, meets the user's usage needs, and improves the user's usage experience.
[0103] In order to enable those skilled in the art to better understand the technical solution provided by the embodiment of the present invention, the above steps are described in detail below.
[0104] Optionally, word vectors can be determined by:
[0105] The text data containing the target word is input into the word vector model, the output vector is obtained, and the training of the word vector model is completed.
[0106] In one embodiment, the text containing the target word can be segmented, and the vector of each segmented word can be determined by a one-hot method. The text data containing the target word can be the vector of each segmented word. After the text data is input into the word vector model, the word vector model can generate an output vector based on the vector of each segmented word.
[0107] In another embodiment, the text containing the target word can also be directly input into the word vector model as text data. In the word vector model, the text can be segmented and the vectors of the segmented words can be determined. Afterwards, the word vector model generates an output vector based on the vectors of each segmented word.
[0108] After obtaining the output vector, the weight of the output vector of the target word is determined according to the following formula:
[0109]
[0110] Wherein, P(W) represents the weight of the output vector W;
[0111] α represents the learning rate of the word vector model. For example, α can be set to 0.5;
[0112] Represents the target word w in the output layer of the word vector model t The activation value of the corresponding neuron, where each neuron in the output layer of the word vector model corresponds to a word segment;
[0113] y i represents the activation value of the i-th neuron in the output layer;
[0114] t represents the total number of neurons in the output layer;
[0115] θ represents the regularization term, which can be L1 or L2 norm, which can effectively prevent overfitting of data in the word vector model;
[0116] Afterwards, the word vector model is updated according to the weight of the output vector, and the step of inputting the text data containing the target word into the word vector model to obtain the output vector is re-executed to complete one training of the word vector model until the number of training times of the word vector model reaches a preset number of times, or the difference between the weights of the output vectors corresponding to two consecutive trainings of the word vector model is within a preset range.
[0117] The output vector with the largest weight is determined as the word vector of the target word.
[0118] Among them, the preset number of times can be set according to the actual usage scenario. When the accuracy of the word vector model is required to be high, the preset coefficient can be set to a larger value, such as 100 times. When the accuracy of the word vector model is required to be average, the preset coefficient can be set to 80 times. Similarly, the preset range can also be set according to the actual usage scenario. For example, it can be set to [-0.1, 0.1], which is not limited in this disclosure.
[0119] For example, the word vector model is a neural network model. According to the weight of the output vector, an exemplary implementation method of updating the word vector model may be to feed the weight as a feedback value to the word vector model to update various parameter values in the word vector model. Among them, the method of updating the neural network model according to the feedback value is a prior art and will not be repeated here.
[0120] In one embodiment, after the word vector model is updated and the step of inputting text data containing the target word into the word vector model is re-executed to obtain the output vector and complete one training of the word vector model, the text data input into the word vector in the last training can be re-input into the word vector model, or new text data containing the target word can be re-determined and input into the word vector model for the next training.
[0121] In another embodiment, after multiple trainings of the word vector model, the output vector of each training can be used as a representation of the word vector of the target word. In the present disclosure, the output vector with the largest weight is determined as the word vector of the target word, thereby effectively ensuring the accuracy of the word vector when the target word is represented by other words, thereby ensuring the accuracy of the subsequently determined interest text vector and the accuracy of the retrieval results.
[0122] Optionally, the text vector of a text can be represented by the word vectors of each word contained in the text. For example, the text vector of a text can be determined by the following formula:
[0123]
[0124] Where D represents the text vector of the text;
[0125] s represents the total number of words in the text;
[0126] W i The word vector representing the i-th word in the text;
[0127] β i The weight corresponding to the i-th word in the text can be determined by the Markov chain;
[0128] θ' represents the regularization term, which can be in L1 or L2 form.
[0129] Among them, the formula of the above text vector is the prior art. In the present disclosure, when determining the text vector, the word vector of each word in the text can be determined by the method of determining the word vector provided in the present disclosure, and then the text vector of the text is determined according to the above formula, so as to facilitate the determination of the similarity parameter between the text vector and the interest text vector based on the text vector, thereby providing data support for determining the recommended text.
[0130] Optionally, the interest text vector model is obtained by training based on the word vector of the historical search term input by the user and the first browsing behavior data of the user on the text retrieved according to the historical search term. The interest text vector model can be implemented by a neural network model, including an input layer, multiple hidden layers, and an output layer, and the first browsing behavior data of the user on the text retrieved according to the historical search term is used as the user layer. The specific training process is as follows:
[0131] The word vector of the historical search term input by the user is input into the interest text vector model to obtain the interest text vector, and complete one training of the interest text vector model, wherein the word vector of the historical search term is input into the interest text vector model, and the interest text vector is obtained in the output layer through parameter propagation of multiple hidden layers.
[0132] The difference of the interest text vector model is determined according to the user's first browsing behavior data of the text retrieved according to the historical search term and the interest text vector.
[0133] For example, the word vector of the input historical search word is represented as x = [x1, x2, ..., x t ], then for each hidden layer, the output of the hidden layer can be determined by the following formula:
[0134] O i =f(δ i I i ),i=1,2,...m
[0135] Among them, I i represents the input vector of the neurons in the i-th hidden layer of the interest text vector model, δ i represents the weight of the previous layer to the i-th hidden layer. When initialized, δ i =0,O i represents the output vector of the neurons in the i-th hidden layer of the interest text vector model, f() represents the activation function of the interest text vector model, and in the present disclosure, the sigmoid function can be used as the activation function.
[0136] By forward propagation of each hidden layer, the interest text vector can be obtained at the output layer. For example, when the difference of the interest text vector model is determined based on the user's first browsing behavior data of the text retrieved according to the historical search term and the interest text vector, an exemplary implementation method is as follows: the text of interest to the user is determined based on the user's first browsing behavior data of the text retrieved according to the historical search term, and the difference between the text vector of the text of interest to the user and the interest text vector is determined as the difference of the interest text vector model.
[0137] As an example, the first browsing behavior data may be user click data. For example, when the text retrieved according to the historical search term is displayed, the text clicked by the user may be determined according to the user click data. When the number of the text is one, the text may be determined as the text that the user is interested in. For another example, when the number of the text clicked by the user is determined according to the user click data to be multiple, the browsing time corresponding to each clicked text may be determined according to the first browsing behavior data. In this case, the text clicked by the user with the longest corresponding browsing time may be determined as the text that the user is interested in.
[0138] As another example, the first browsing data may be text display duration data. For example, when the retrieved text is displayed in some websites now, a summary of the retrieved text is usually displayed, so that the user can simply understand the content of each retrieved text in advance without clicking on the text. Therefore, when the display duration of a certain retrieved text in the page is long, it is more likely that the text is a text of interest to the user, and the text with the longest display duration among the retrieved texts can be determined as the text of interest to the user. It should be noted that the number of texts of interest to the user is one, so when there are multiple texts with the longest display duration, any one can be selected to be determined as the text of interest to the user, or the text with the longest display duration and the longest mouse hover duration among the retrieved texts can be determined as the text of interest to the user. The above examples are exemplary implementations of determining texts of interest to the user, and do not limit the present disclosure.
[0139] After determining the text that the user is interested in, the difference between the interest text vector model can be determined based on the text vector of the text that the user is interested in and the interest text vector. For example, the difference can be determined in the following manner:
[0140] e=||y-o2
[0141] Wherein, e represents the difference of the interest text vector model;
[0142] y represents the text vector of the text that the user is interested in;
[0143] o represents the interest text vector.
[0144] After determining the difference in the interest text vector model, the interest text vector model is updated according to the difference, and the step of inputting the word vector of the historical search term input by the user into the interest text vector model to obtain the interest text vector is re-executed until the training times of the interest text vector model reaches a threshold or the difference is within a preset difference range.
[0145] In one embodiment, the parameters of each hidden layer of the interest text vector model may be updated in the following manner:
[0146]
[0147] Among them, λ represents the current weight of the hidden layer;
[0148] λ' represents the updated weight of the hidden layer;
[0149] Δλ represents the weight change of the hidden layer;
[0150] η represents the learning rate of the interest text vector model, which can be set to 0.1 for example;
[0151] e represents the difference of the interest text vector model;
[0152] A representation of a chain rule of differences representing the interest text vector model;
[0153] A representation of the chain rule for the current weights of the hidden layer.
[0154] Among them, the setting method of the threshold corresponding to the training times of the interest text vector model is similar to the preset times corresponding to the training times of the word vector model, and the setting method of the difference range corresponding to the difference of the interest text vector model is similar to the preset range corresponding to the word vector, which will not be repeated here.
[0155] Therefore, through the above technical solution, the interest text vector model corresponding to the user can be trained, so that the user's interest text can be characterized. For example, when the historical search term input by user A and user B is "Xiaomi", the first browsing behavior data of the two for the text retrieved according to the historical search term "Xiaomi" is different, so the determined interest text vectors are different. For example, user A clicks on the text corresponding to "The efficacy and function of Xiaomi", and user B clicks on the text corresponding to "Xiaomi Mall". Since the texts that the users are interested in are different, the determined differences are different, so that the interest text vector model updated according to the difference is different. Therefore, when the interest text vector model corresponding to the user is corrected by the text that the user is interested in, the interest text vector output by the interest text vector model is more in line with the user's interest, so that different users can obtain different interest text vectors for the same search term, so that the retrieval results are more in line with user needs and improve the user experience.
[0156] Optionally, the method further comprises:
[0157] Acquire second browsing behavior data of the user for the recommended text;
[0158] If it is determined according to the second browsing behavior data that the recommended texts contain texts that the user is interested in, the interest text vector model is updated according to the difference between the text vector of the text that the user is interested in and the interest text vector.
[0159] The specific implementation method of determining the text that the user is interested in based on the browsing behavior data has been described in detail above and will not be repeated here.
[0160] In this embodiment, when the recommended text is output based on the target search term input by the user, when the text of interest to the user is determined based on the second browsing behavior data, such as when the user clicks on a text in the recommended text (hereinafter referred to as "click text"), the interest text vector model can be updated based on the difference between the text vector of the click text and the interest text vector, wherein the method of determining the difference and updating the interest text vector model based on the difference is similar to the method in the training process and will not be repeated here.
[0161] Through the above technical scheme, by updating the interest text vector model according to the user's second browsing behavior data of the recommended text, the interest text vector output by the interest text vector model can be made more in line with the user's real-time interest, so that when the user refreshes the search page, the recommended text can be updated in real time, further improving the accuracy of the search results, and improving the real-time performance of the search recommendation method to enhance the user experience.
[0162] In addition, the text may be a special form of expression of a word segmentation combination, and the search results may also be characterized by determining the correlation between the target search term and the text. Therefore, the present disclosure also provides the following embodiments. Optionally, Figure 2 As shown, the method also includes:
[0163] In S21, the number of occurrences of the target search term in each text in the text collection is determined;
[0164] In S22, a correlation parameter between the target search term and each text in the text set is determined based on the inverse text frequency of the target search term in the text set, the number of occurrences of the target search term in each text in the text set, the word frequency, and the text length of each text in the text set;
[0165] Optionally, the correlation parameter may be determined by the following formula:
[0166]
[0167] Wherein, q represents the target search term;
[0168] Score(q,d) represents the correlation parameter between the target search term q and the text d in the text set;
[0169] IDF(q) represents the inverse document frequency of the target search term q in the text collection;
[0170] TF(q) represents the frequency of the target search term q in the text d in the text collection;
[0171] f represents the number of occurrences of the target search term q in the text d in the text collection;
[0172] k and b represent preset constants, where b≠0;
[0173] dl represents the text length of the text d in the text set;
[0174] avgdl represents the average text length of the texts in the text set, that is, the average value of the text lengths of the individual texts in the text set.
[0175] Among them, the determination method of IDF(q) and TF(q) is an existing technology and will not be repeated here. In the above formula, when determining the relevance between the target search term and the text, the text length of the text and the frequency of the target search term in the text are comprehensively considered to further improve the accuracy of the relevance parameter between the target search term and the text, thereby providing accurate data support for determining the recommended text.
[0176] In S13, another exemplary implementation of determining the recommended text from the text set according to the similarity parameter is as follows, including:
[0177] According to the similarity parameter and the relevance parameter, the recommended text is determined.
[0178] Among them, the similarity parameter can characterize the similarity between the text in the text set and the interest text vector determined according to the target search term and used to characterize the user's interest, and the relevance parameter can characterize the relevance between the target search term and the text in the text set. Therefore, when determining the recommended text, the relationship between the target search term and the text, and the relationship between the user's interest and the text are combined at the same time, thereby effectively improving the accuracy of the recommended text and making the recommended text consistent with the user's interests and in line with the user's usage needs.
[0179] Optionally, an exemplary implementation of determining the recommended text according to the similarity parameter and the relevance parameter is as follows, including:
[0180] When there are multiple target search terms, the sum of the correlation parameters between each target search term and the text is determined as the correlation parameter corresponding to the text; when there is only one target search term, the correlation parameter between the target search term and the text is directly determined as the correlation parameter corresponding to the text;
[0181] For each text in the text set, a similarity parameter corresponding to the text and a relevance parameter corresponding to the text are weightedly summed to determine a recommendation value corresponding to the text.
[0182] It should be noted that when the similarity parameter is distance, the reciprocal of the distance can be determined as the relevance parameter corresponding to the text; when the similarity parameter is cosine value, the cosine value can be directly determined as the relevance parameter corresponding to the text. The recommended value can be determined by the following formula:
[0183] NEW_Score(d)=γ*Score(d)+(1-γ)*Sim(d)
[0184] Among them, NEW_Score(d) represents the recommendation value corresponding to text d;
[0185] Score(d) represents the correlation coefficient corresponding to text d;
[0186] Sim(d) represents the similarity parameter corresponding to text d;
[0187] γ represents a weight value, and for example, can be set to 0.5, wherein the weight value can be set according to the actual usage scenario, and the present disclosure does not limit this.
[0188] The recommended text is determined based on the recommendation value corresponding to each text in the text set.
[0189] In one embodiment, texts with recommendation values greater than a preset recommendation threshold may be determined as recommended texts, and the recommended texts are output in descending order of their recommendation values, thereby feeding back the search results to the user.
[0190] In another embodiment, the recommended values may be sorted in descending order, so that the corresponding texts may be determined as recommended texts in this order, and the recommended texts may be output and fed back to the user as search results. In addition, the number of recommended texts may be preset, so that after the recommended texts are sorted, the texts with the highest number of recommended texts may be directly selected as recommended texts in order to feed back to the user as search results.
[0191] In the above embodiment, the recommendation value of the user characterizing the text can be determined by comprehensively considering the similarity parameter corresponding to the text and the relevance parameter corresponding to the text. Therefore, when determining the recommended text, it can be ensured that the recommended text is in line with the user's interests and that the recommended text is relevant to the target search term, thereby effectively ensuring the accuracy of the recommended text, thereby providing the user with accurate search results and further improving the user experience.
[0192] The present disclosure also provides a retrieval recommendation device, such as Figure 3 As shown, the device 10 comprises:
[0193] The first determination module 100 is used to input the word vector of the target search word into the interest text vector model to determine the interest text vector corresponding to the target search word, wherein the interest text vector model corresponds to the user who inputs the target search word, and the interest text vector is used to represent the text that the user expects to obtain after searching for the target search word;
[0194] A second determination module 200, for respectively determining similarity parameters between the interest text vector and text vectors of texts in a text set;
[0195] The third determination module 300 is used to determine the recommended text from the text set according to the similarity parameter, and output the recommended text.
[0196] Optionally, determine word vectors by:
[0197] Input text data containing the target word into the word vector model, obtain the output vector, and complete a training of the word vector model;
[0198] The weight of the output vector of the target word is determined according to the following formula:
[0199]
[0200] Wherein, P(W) represents the weight of the output vector;
[0201] α represents the learning rate of the word vector model;
[0202] Represents the target word w in the output layer of the word vector model t The activation value of the corresponding neuron;
[0203] y i represents the activation value of the i-th neuron in the output layer;
[0204] t represents the total number of neurons in the output layer;
[0205] θ represents the regularization term;
[0206] According to the weight of the output vector, the word vector model is updated, and the step of inputting the text data containing the target word into the word vector model, obtaining the output vector, and completing one training of the word vector model is re-executed, until the number of training times of the word vector model reaches a preset number of times, or the difference between the weights of the output vectors corresponding to two consecutive trainings of the word vector model is within a preset range;
[0207] The output vector with the largest weight is determined as the word vector of the target word.
[0208] Optionally, the interest text vector model is obtained by training based on the word vector of the historical search term input by the user and the first browsing behavior data of the user on the text retrieved based on the historical search term.
[0209] Optionally, the device 10 further includes:
[0210] An acquisition module, used for acquiring second browsing behavior data of the user on the recommended text;
[0211] An updating module is used to update the interest text vector model according to the difference between the text vector of the text that the user is interested in and the interest text vector if it is determined according to the second browsing behavior data that the recommended text contains text that the user is interested in.
[0212] Optionally, the device 10 further includes:
[0213] A fourth determination module, used to determine the number of occurrences of the target search term in each text in the text collection;
[0214] a fifth determination module, for determining a correlation parameter between the target search term and each text in the text set according to an inverse text frequency of the target search term in the text set, a number of occurrences of the target search term in each text in the text set, a word frequency, and a text length of each text in the text set;
[0215] The third determination module 300 is used to determine the recommended text according to the similarity parameter and the correlation parameter.
[0216] Optionally, the correlation parameter is determined by the following formula:
[0217]
[0218] Wherein, q represents the target search term;
[0219] Score(q,d) represents the correlation parameter between the target search term q and the text d in the text set;
[0220] IDF(q) represents the inverse document frequency of the target search term q in the text collection;
[0221] TF(q) represents the frequency of the target search term q in the text d in the text collection;
[0222] f represents the number of occurrences of the target search term q in the text d in the text collection;
[0223] k and b represent preset constants, where b≠0;
[0224] dl represents the text length of the text d in the text set;
[0225] avgdl represents the average text length of the text in the text collection.
[0226] Optionally, the third determining module 300 includes:
[0227] A first determination submodule, for determining, when there are multiple target search terms, the sum of the correlation parameters between each of the target search terms and the text as the correlation parameter corresponding to the text;
[0228] A second determination submodule is used to perform weighted summation of a similarity parameter corresponding to each text in the text set and a relevance parameter corresponding to the text to determine a recommendation value corresponding to the text;
[0229] The third determination submodule is used to determine the recommended text based on the recommendation value corresponding to each text in the text set.
[0230] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0231] Figure 4 FIG. 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. Figure 4 As shown, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.
[0232] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned retrieval recommendation method. The memory 702 is used to store various types of data to support the operation of the electronic device 700. For example, these data may include instructions for any application or method used to operate on the electronic device 700, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 707 may include: Wi-Fi module, Bluetooth module, NFC module, etc.
[0233] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned retrieval recommendation method.
[0234] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned retrieval recommendation method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 702 including program instructions, and the above-mentioned program instructions can be executed by the processor 701 of the electronic device 700 to complete the above-mentioned retrieval recommendation method.
[0235] Figure 5 1 is a block diagram of an electronic device 1900 according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. Figure 5 The electronic device 1900 includes a processor 1922, which may be one or more, and a memory 1932 for storing a computer program executable by the processor 1922. The computer program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processor 1922 may be configured to execute the computer program to perform the above-mentioned retrieval recommendation method.
[0236] In addition, the electronic device 1900 may further include a power supply component 1926 and a communication component 1950, wherein the power supply component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to implement communication of the electronic device 1900, for example, wired or wireless communication. In addition, the electronic device 1900 may further include an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, etc.
[0237] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned retrieval recommendation method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 1932 including program instructions, and the above-mentioned program instructions can be executed by the processor 1922 of the electronic device 1900 to complete the above-mentioned retrieval recommendation method.
[0238] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0239] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0240] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A retrieval recommendation method, characterized in that: The method comprises: Inputting the word vector of the target search term into the interest text vector model to determine the interest text vector corresponding to the target search term, wherein the interest text vector model corresponds to the user who inputs the target search term, and the interest text vector is used to represent the text that the user expects to obtain after searching for the target search term; Respectively determining similarity parameters between the text vector of interest and the text vectors of the texts in the text set; Determining recommended text from the text set according to the similarity parameter, and outputting the recommended text; Among them, the word vector is determined by the following method: Input text data containing the target word into the word vector model, obtain the output vector, and complete a training of the word vector model; The weight of the output vector of the target word is determined according to the following formula: ; in, represents the weight of the output vector; Represents the learning rate of the word vector model; Represents the target word in the output layer of the word vector model The activation value of the corresponding neuron; Indicates the output layer i The activation value of a neuron; represents the total number of neurons in the output layer; represents the regularization term; According to the weight of the output vector, the word vector model is updated, and the step of inputting the text data containing the target word into the word vector model, obtaining the output vector, and completing one training of the word vector model is re-executed, until the number of training times of the word vector model reaches a preset number of times, or the difference between the weights of the output vectors corresponding to two consecutive trainings of the word vector model is within a preset range; The output vector with the largest weight is determined as the word vector of the target word.
2. The method according to claim 1, characterized in that: The interest text vector model is obtained by training based on the word vector of the historical search term input by the user and the first browsing behavior data of the user on the text retrieved based on the historical search term.
3. The method according to claim 1, characterized in that The method further comprises: Acquire second browsing behavior data of the user on the recommended text; If it is determined according to the second browsing behavior data that the recommended texts contain texts that the user is interested in, the interest text vector model is updated according to the difference between the text vector of the text that the user is interested in and the interest text vector.
4. The method according to claim 1, characterized in that: The method further comprises: Determining the number of occurrences of the target search term in each text in the text collection; Determine a correlation parameter between the target search term and each text in the text collection according to the inverse text frequency of the target search term in the text collection, the number of occurrences of the target search term in each text in the text collection, the word frequency, and the text length of each text in the text collection; Determining the recommended text from the text set according to the similarity parameter includes: The recommended text is determined according to the similarity parameter and the relevance parameter.
5. The method according to claim 4, characterized in that The correlation parameter is determined by the following formula: in, represents the target search term; Indicates the target search term q and text in the text collection d Correlation parameters between Indicates the target search term q an inverse document frequency in the text collection; Indicates the target search term q The text in the text collection d The frequency of words in ; Indicates the target search term q The text in the text collection d The number of occurrences in ; , Represents a preset constant, where ; Represents the text in the text collection d Length of text; Indicates the average text length of the texts in the text collection.
6. The method according to claim 4, characterized in that The determining the recommended text according to the similarity parameter and the relevance parameter includes: When there are multiple target search terms, the sum of the correlation parameters between each target search term and the text is determined as the correlation parameter corresponding to the text; For each text in the text set, a similarity parameter corresponding to the text and a relevance parameter corresponding to the text are weighted summed to determine a recommendation value corresponding to the text; The recommended text is determined based on the recommendation value corresponding to each text in the text set.
7. A search and recommendation device, characterized in that: The device comprises: A first determination module is used to input the word vector of the target search term into the interest text vector model to determine the interest text vector corresponding to the target search term, wherein the interest text vector model corresponds to the user who inputs the target search term, and the interest text vector is used to represent the text that the user expects to obtain after searching for the target search term; A second determination module is used to respectively determine similarity parameters between the interest text vector and text vectors of texts in the text set; A third determination module, configured to determine a recommended text from the text set according to the similarity parameter, and output the recommended text; Among them, the word vector is determined by the following method: Input text data containing the target word into the word vector model, obtain the output vector, and complete a training of the word vector model; The weight of the output vector of the target word is determined according to the following formula: ; in, represents the weight of the output vector; Represents the learning rate of the word vector model; Represents the target word in the output layer of the word vector model The activation value of the corresponding neuron; Indicates the output layer i The activation value of a neuron; represents the total number of neurons in the output layer; represents the regularization term; According to the weight of the output vector, the word vector model is updated, and the step of inputting the text data containing the target word into the word vector model, obtaining the output vector, and completing one training of the word vector model is re-executed, until the number of training times of the word vector model reaches a preset number of times, or the difference between the weights of the output vectors corresponding to two consecutive trainings of the word vector model is within a preset range; The output vector with the largest weight is determined as the word vector of the target word.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
