Correlation model training method, sorting method, device, electronic device and medium

By building an end-to-end correlation model and using convolutional neural networks to process query words and website data, the problem of low recommendation efficiency and accuracy caused by unlogged words in the graph model is solved, and the accuracy of website recommendations is improved. and efficiency.

CN114595800BActive Publication Date: 2024-09-17BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011402049.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-02
Publication Date
2024-09-17
Estimated Expiration
2040-12-02

AI Technical Summary

Technical Problem

In the existing technology, when obtaining the correlation between query words and network sites based on graph models, unregistered words lead to low recommendation efficiency and accuracy.

Method used

By constructing a training data set based on user historical query data, using a convolutional neural network to map the word vectors and feature vectors of query words and network sites, an end-to-end correlation model is generated, and positive and negative sample data are used for model training and transformation. The relationship between query words and network sites is a classification problem, thereby improving the accuracy of recommendations.

Benefits of technology

It improves the accuracy and efficiency of website recommendation, solves the problem of low recommendation efficiency and accuracy caused by unlogged words, and takes into account the quality and authority of the website.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595800B
    Figure CN114595800B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a correlation model training method, which comprises obtaining a training data set according to user historical query data; mapping the word vector of the query word in the training data to the embedding layer in the convolutional neural network for each training data in the training data set, and obtaining the mapped word vector of the query word in the training data; obtaining the site feature vector of the network site in the training data; obtaining the correlation value between the query word and the network site in the training data according to the mapped word vector and the site feature vector; and obtaining the correlation model based on the correlation value between the query word and the network site in each training data. The correlation model training method provided by the embodiment of the present invention can improve the accuracy of the network site corresponding to the query word obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of Internet technology, and in particular to a correlation model training method, a sorting method, a device, an electronic device and a medium. Background Art

[0002] With the rapid development of Internet technology, search engine technology has become increasingly mature. By entering a query word in a search engine, you can get websites related to the query word.

[0003] In the prior art, when obtaining relevant websites based on query words, a graph model is usually used to obtain the correlation between the query words and the website. However, in the process of using the graph model to obtain the correlation between the query words and the website, there are usually words that do not exist in the graph model, namely, unregistered words. In this case, the correlation between the query words and the website needs to be obtained after secondary processing of the unregistered words. However, the graph model has not been trained for the unregistered words, resulting in low accuracy between the query words and the corresponding website. Summary of the invention

[0004] The embodiments of the present invention provide a correlation model training method, a ranking method, a device, an electronic device and a medium, which can improve the accuracy of acquiring a website corresponding to a query word.

[0005] A first aspect of an embodiment of the present invention provides a correlation model training method, comprising:

[0006] According to the user's historical query data, a training data set is obtained, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query word and a website, wherein the website is extracted from a result web page corresponding to the query word;

[0007] For each training data in the training data set, the word vector of the query word in the training data is mapped to the embedding layer in the convolutional neural network to obtain the mapped word vector of the query word in the training data; the site feature vector of the network site in the training data is obtained; according to the mapped word vector and the site feature vector, the correlation value between the query word and the network site in the training data is obtained;

[0008] The correlation model is obtained based on the correlation values ​​between the query words and the website in each training data, wherein the correlation model is an end-to-end model.

[0009] Optionally, obtaining a training data set according to user historical query data includes:

[0010] Finding positive sample pairs from the user's historical query data, and acquiring the positive sample data set based on the found positive sample pairs;

[0011] Using word2vec negative sampling method to perform negative sampling on the user historical query data to obtain negative sample pairs; based on the obtained negative sample pairs, obtaining the negative sample data set;

[0012] The training data set is acquired based on the positive sample data set and the negative sample data set.

[0013] Optionally, the negative sampling of the user historical query data by using word2vec negative sampling to obtain negative sample pairs includes:

[0014] The user historical query data is negatively sampled using the negative sampling probability formula in word2vec to obtain the negative sample pair, wherein the value of the hyperparameter in the negative sampling probability formula is within a set value range.

[0015] Optionally, mapping the word vector of the query word in the training data to an embedding layer in a convolutional neural network to obtain the mapped word vector of the query word in the training data includes:

[0016] The pre-trained model and convolutional neural network are used to map the word vector of the query word to the word embedding layer to obtain the mapped word vector of the query word.

[0017] Optionally, in the process of obtaining the correlation model based on the correlation value between the query word and the website in each training data, the method includes:

[0018] The parameters of the correlation model are adjusted using the logarithmic loss function and the margin distance method.

[0019] A second aspect of an embodiment of the present invention provides a method for ranking network sites, including:

[0020] Get the current query word entered by the user in real time;

[0021] Inputting the word vector of the current query word into the correlation model provided in the first aspect to obtain the correlation value between the current query word and each website in the website set;

[0022] The website sites corresponding to the current query word are ranked based on the correlation value between the current query word and each website.

[0023] Optionally, the network site set is composed of all network sites included in the correlation model.

[0024] A third aspect of an embodiment of the present invention provides a correlation model training device, including:

[0025] A training data acquisition unit, configured to acquire a training data set according to user historical query data, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query word and a website, wherein the website is extracted from a result web page corresponding to the query word;

[0026] A training unit is used to map the word vector of the query word in the training data to the embedding layer in the convolutional neural network for each training data in the training data set, so as to obtain the mapped word vector of the query word in the training data; obtain the site feature vector of the network site in the training data; and obtain the correlation value between the query word in the training data and the network site according to the mapped word vector and the site feature vector;

[0027] The model acquisition unit is used to obtain the correlation model based on the correlation value between the query word and the website in each training data, wherein the correlation model is an end-to-end model.

[0028] Optionally, the training data acquisition unit includes:

[0029] A positive sample data set acquisition module, used to find positive sample pairs from user historical query data, and acquire the positive sample data set based on the found positive sample pairs;

[0030] A negative sample data set acquisition module is used to perform negative sampling on the user historical query data using a word2vec negative sampling method to obtain negative sample pairs; based on the obtained negative sample pairs, the negative sample data set is acquired;

[0031] A training data acquisition module is used to acquire the training data set based on the positive sample data set and the negative sample data set.

[0032] Optionally, the negative sample data set acquisition module is used to perform negative sampling on the user historical query data using the negative sampling probability formula in word2vec to obtain the negative sample pairs, wherein the value of the hyperparameter in the negative sampling probability formula is within a set value range.

[0033] Optionally, the training unit includes:

[0034] The word vector mapping module is used to map the word vector of the query word to the word embedding layer using a pre-trained model and a convolutional neural network to obtain the mapped word vector of the query word.

[0035] Optionally, the model acquisition unit is used to adjust the parameters of the correlation model using a logarithmic loss function and an interval distance method in the process of obtaining the correlation model based on the correlation value between the query word and the website in each training data.

[0036] A fourth aspect of an embodiment of the present invention provides a network site ranking device, including:

[0037] A query word acquisition unit, used to acquire the current query word input by the user in real time;

[0038] A correlation value acquisition unit, configured to input the word vector of the current query word into the correlation model provided in the first aspect, and acquire a correlation value between the current query word and each website in the website set;

[0039] The ranking unit is used to rank the websites corresponding to the current query word based on the correlation value between the current query word and each website.

[0040] Optionally, the network site set is composed of all network sites included in the correlation model.

[0041] A fifth aspect of an embodiment of the present invention provides a device for data processing, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include steps for the training method or sorting method as described above.

[0042] A sixth aspect of an embodiment of the present invention provides a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the training method or the sorting method as described above.

[0043] The beneficial effects of the embodiments of the present invention are as follows:

[0044] Based on the above technical solution, a training data set is obtained according to the user's historical query data, and for each training data in the training data set, the word vector of the query word in the training data is mapped to the embedding layer in the convolutional neural network to obtain the mapped word vector of the query word in the training data; the site feature vector of the network site in the training data is obtained; according to the mapped word vector and the site feature vector, the correlation value between the query word and the network site in the training data is obtained; based on the correlation value between the query word and the network site in each training data, the correlation model is obtained; since the correlation model is an end-to-end model, the correlation model obtained through the above training converts the relationship between the query word and the network site into a classification problem; in this way, the correlation value between the query word and the multiple network sites can be obtained through the correlation model, and then the obtained network sites are sorted based on the correlation value; in this way, the problem of low recommendation efficiency and accuracy caused by the presence of unregistered words when recommending network sites in the prior art graph model can be solved, thereby improving the accuracy of network site recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A method flow chart of a method for training a correlation model in an embodiment of the present invention;

[0046] Figure 2 A method flow chart of a method for ranking network sites according to an embodiment of the present invention;

[0047] Figure 3 Schematic diagram of the structure of a training device for a correlation model in an embodiment of the present invention;

[0048] Figure 4 It is a schematic diagram of the structure of a network site sorting device according to an embodiment of the present invention;

[0049] Figure 5 It is a structural block diagram of a training device or a network site ranking device for a correlation model in an embodiment of the present invention when used as a device;

[0050] Figure 6 It is a structural block diagram of the server in some embodiments of the present invention. DETAILED DESCRIPTION

[0051] In order to better understand the above technical scheme, the technical scheme of the embodiment of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiment of the present invention and the specific features in the embodiments are detailed descriptions of the technical scheme of the embodiment of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiment of the present invention and the technical features in the embodiments can be combined with each other.

[0052] In response to the technical problem that the accuracy of website recommendations from query terms is low, an embodiment of the present invention provides a training scheme for a correlation model, which is used to obtain a training data set based on user historical query data, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query term and a website, wherein the website is extracted from a result web page corresponding to the query term; for each training data in the training data set, the word vector of the query term in the training data is mapped to an embedding layer in a convolutional neural network to obtain a mapped word vector of the query term in the training data; a site feature vector of the website in the training data is obtained; based on the mapped word vector and the site feature vector, a correlation value between the query term and the website in the training data is obtained; based on the correlation value between the query term and the website in each training data, the correlation model is obtained, wherein the correlation model is an end-to-end model.

[0053] In this way, a training data set is obtained based on the user's historical query data, and for each training data in the training data set, the word vector of the query word in the training data is mapped to the embedding layer in the convolutional neural network to obtain the mapped word vector of the query word in the training data; the site feature vector of the website in the training data is obtained; based on the mapped word vector and the site feature vector, the correlation value between the query word and the website in the training data is obtained; based on the correlation value between the query word and the website in each training data, the correlation model is obtained; since the correlation model is an end-to-end model, the correlation model obtained through the above training converts the relationship between the query word and the website into a classification problem; in this way, the correlation value between the query word and multiple websites can be obtained through the correlation model, and then the obtained websites are sorted based on the correlation value; in this way, the problem of low recommendation efficiency and accuracy caused by the presence of unregistered words in the existing graph model when recommending websites can be solved, thereby improving the accuracy of website recommendations.

[0054] The correlation model used in the embodiment of the present invention is an end-to-end model, and when training the correlation model, it is necessary to construct training data, and then use the constructed training data to train the model to obtain the correlation model. Since the correlation model predicts the correlation between the query word and the website, when the user uses the query word to search, what is searched is the result web page; but each result web page corresponds to a website, and the result web page can be a page in the website. The website can be, for example, www.jianbihua.cc, www.xxxjd.com, etc., and the result web page can be the homepage or inner page in the website. In this way, in the process of constructing the training data, it is necessary to obtain the website corresponding to the result web page based on the result web page.

[0055] Specifically, when obtaining the website corresponding to the result webpage, since each result webpage corresponds to a webpage uniform resource locator (URL), the website corresponding to the result webpage can be determined according to the webpage URL of the result webpage. Specifically, the Host name field in the webpage URL can be used as the unique identifier of the website corresponding to the result webpage.

[0056] For example, the webpage URL corresponding to a result webpage is "http: / / www.nipic.com / show / 10810369.html". In the webpage URL, "http: / / " represents the HyperText Transfer Protocol (http for short), "www.nipic.com" represents the host name or website name, "www." represents the subdomain, "nipic.com" represents the domain, "com" represents the top-level domain, and "show" represents the path. At this time, "www.nipic.com" is used as the unique identifier of the website of the webpage URL, that is, "www.nipic.com" is used to represent the corresponding website "Nipic.com".

[0057] like Figure 1 As shown, an embodiment of the present invention provides a method for training a correlation model, comprising the following steps:

[0058] S101, acquiring a training data set according to user historical query data, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query word and a website, wherein the website is extracted from a result web page corresponding to the query word;

[0059] S102, for each training data in the training data set, mapping the word vector of the query word in the training data to the embedding layer in the convolutional neural network to obtain the mapped word vector of the query word in the training data; obtaining the site feature vector of the network site in the training data; according to the mapped word vector and the site feature vector, obtaining the correlation value between the query word in the training data and the network site;

[0060] S103: Obtain the correlation model based on the correlation value between the query word and the website in each training data, wherein the correlation model is an end-to-end model.

[0061] In step S101, when training the correlation model, it is necessary to construct training data, and the training data construction is mainly to find the positive correlation between the query word and the website. Based on this, after obtaining the user's historical query data, the positive sample pairs can be found from the user's historical query data. <query, > indicates that query indicates the query word. Indicates the website corresponding to the result web page; then based on the found positive sample pairs, obtain the positive sample data set.

[0062] When obtaining a positive sample data set based on the found positive sample pairs, all or part of the found positive sample pairs can be used to form a positive sample data set. <query, >After that, you can also find <query, >Perform filtering and cleaning processing to obtain all or part of the positive sample pairs after cleaning to form a positive sample data set.

[0063] And, when obtaining a negative sample data set based on the user's historical query data, negative sampling is used to negatively sample the user's historical query data to obtain negative sample pairs, wherein the negative sample pairs can be used <query, > indicates that query indicates the query word. Indicates the website corresponding to the result web page; then based on the obtained negative sample pairs, obtain the negative sample data set. At this time, all or part of the obtained negative sample pairs can be used as the negative sample data set. Of course, when all negative sample pairs are obtained from the user's historical query data through negative sampling, <query, >Afterwards, you can also get all <query, >Perform filtering and cleaning processing to obtain all or part of the cleaned negative sample pairs to form a negative sample data set.

[0064] Specifically, when negative sampling is used to obtain negative sample pairs, an average sampling method of website can be used to make each website have the same probability of becoming a negative sample. Of course, negative sampling can also be performed according to the ratio of the number of result web pages corresponding to the website.

[0065] Specifically, when using negative sampling to obtain negative sample pairs, the negative sampling method of word2vec can also be used for negative sampling. At this time, the unigram model distribution is used to select negative samples. The probability of a website being selected as a negative sample is related to its frequency of occurrence. The higher the frequency of occurrence of a website, the more likely it is to be selected as a negative sample. The specific formula for the negative sampling probability is:

[0066] Formula 1

[0067] Among them, in formula 1 Represents a network site is the probability of negative sampling, express The frequency of occurrence, t is a hyperparameter, usually t=0.75.

[0068] In the actual application process, in order to avoid the problem of high probability of negative sampling samples of network sites with high frequency in the above formula 1, a large number of experiments were conducted on the value of t. The experiment found that when t is within the set value range, the problem of high probability of negative sampling samples of network sites with high frequency in the above formula 1 can be effectively avoided. In this way, the value of the hyperparameter in the negative sampling probability formula is within the set value range. Among them, the set value range is 0.45 to 0.65. At this time, t can be any value between 0.45 and 0.65, for example, t can be 0.48, 0.5 and 0.52, etc., so that the problem of high probability of negative sampling samples of network sites with high frequency in the above formula 1 can be effectively avoided.

[0069] In this way, after mining the positive sample data set and the negative sample data set based on the user's historical query data, a training data set is formed based on the positive sample data set and the negative sample data set; after obtaining the training data set, the correlation between the query term and the grid site is converted into a classification problem through the correlation model.

[0070] In the embodiment of the present invention, the word vector of the query word can be obtained through a word vector model. The word vector model can be CBOW, Skip-gram model or GloVe model of word2vec, etc., and the present invention does not make specific limitations.

[0071] After obtaining the training data set, execute step S102. In this step, for each training data, the word vector of the query word is mapped to the word embedding layer in the correlation model to obtain the mapped word vector of the query word; similarly, the site features of the website are mapped to the site embedding layer to obtain the site feature vector of the website; the mapped word vector and the site feature vector are input into the correlation model to obtain the correlation value between the query word and the website; in this way, each training data in the training data set is input into the correlation model for training, and various parameters in the correlation model are adjusted until the correlation model meets the constraints, thereby obtaining the final correlation model.

[0072] Specifically, when training the correlation model, the positive sample pairs and negative sample pairs in the training data set are used to promote the classification of the correlation model obtained through training to be more accurate. For example, some positive samples can be websites with high correlation values ​​with cars, such as "cars, www.autohome.com.cn", "cars, mall.bydauto.com.cn", etc.; some negative samples can be websites that are not very relevant to cars, such as "cars, nev.ofweek.com", "cars, field.10jqka.com.cn", etc., so that the correlation model obtained through training can accurately determine the websites with high correlation values ​​with "cars". In this way, a large number of positive samples and negative samples are used for model training, so that the correlation model obtained through training can predict websites with higher correlation values ​​with the query words, thereby improving the accuracy of prediction.

[0073] In an embodiment of the present invention, the vector dimensions of the mapping word vector and the site feature vector are the same, for example, they can both be 200-dimensional vectors, 256-dimensional vectors, 512-dimensional vectors, etc.; of course, the vector dimensions of the mapping word vector and the site feature vector may also be different, for example, the mapping word vector may be a 200-dimensional vector, while the site feature vector may be a 256-dimensional vector, and the mapping word vector may be a 512-dimensional vector, while the site feature vector may be a 300-dimensional vector, and the present invention does not make specific limitations.

[0074] In an embodiment of the present invention, during the training process of the relevance model, when mapping the word vector of the query word to the word embedding layer in the relevance model, a pre-trained model and a convolutional neural network (Convolutional Neural Networks, referred to as CNN) are used to map the word vector of the query word to the word embedding layer to obtain the mapping word vector of the query word. Specifically, a pre-trained model can be used to obtain the word vector of the query word, wherein the pre-trained model is obtained by collecting a large amount of corpus, such as Sogou Encyclopedia, news corpus, Baidu Encyclopedia and Wikipedia, etc., to perform word vector training, and then obtain the pre-trained model; in this way, the query word can obtain a first training result through the pre-trained word vector model; then use CNN to train the word vector of the query word to obtain a second training result; based on the first training result and the second training result, in the process of training the relevance model, the CNN model parameters are trained, the pre-trained model is fine-tuned, and the training is stopped when the performance is optimal on the test data, and the fine-tuned pre-trained model and CNN model are obtained; the word vector of the query word after fine-tuning is input into the CNN model to obtain the mapping word vector of the query word.

[0075] Specifically, in the model of the word embedding layer, the length of the query word can be set, and the number of convolution kernels can also be set according to the actual situation. The number of convolution kernels can be set according to the performance and real-time requirements of the device itself, or only according to the real-time or performance of the device itself, or can be set manually or by the system. The number of convolution kernels can be, for example, 32, 40, 52, and 64. The number of layers of the fully connected layer can also be set in the correlation model, for example, 3 layers, 4 layers, and 5 layers, etc., and the present invention does not make specific restrictions.

[0076] Specifically, the word vector of the query word is input into the model of the word embedding layer, and is processed by the convolutional layer and the fully connected layer of the word embedding layer model, and the final output vector is used as the mapping word vector of the query word.

[0077] In the embodiment of the present invention, during the training process of the correlation model, the site embedding layer can be used to initialize the features of the website to obtain the initialization features of the website; then, the correlation value between the website and the query word is calculated based on the initialization features of the website and the mapping word vector of the query word. In addition, when calculating the correlation value between the website and the query word, the cosine similarity can be used for calculation, and the following formula can be used specifically:

[0078] Formula 2

[0079] In formula 2, X represents the website, and Y represents the query word. Characterizes the correlation value between the website and the query word, represents the i-th dimension vector of network sites, Represents the i-th dimension vector of the query word.

[0080] Specifically, in order to make the site feature vector of the acquired network site more accurate, the site embedding layer corresponding to the network site can be fine-tuned based on the fine-tuning network during the training process to obtain the adjusted site embedding layer, and the site feature vector of the network site can be obtained using the adjusted site embedding layer.

[0081] In the embodiment of the present invention, when calculating the correlation value between the website and the query word, similarity algorithms such as Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, Pearson correlation coefficient and Mahalanobis distance can also be used. And, after obtaining the correlation value between the query word and the website in each training data, a correlation model is obtained based on the correlation value between the query word and the website in each training data, wherein the correlation model is an end-to-end model.

[0082] In the embodiment of the present invention, the classifier in the correlation model calculates the correlation value between the query word and multiple websites through the above formula 2, and uses the website with the largest correlation value as the recommended website for the query word; or, selects at least one website from multiple websites with correlation values ​​greater than a preset threshold as the recommended website for the query word, thereby making the recommended website match the query word more accurately. In this way, the accuracy of the correlation model prediction is higher. Of course, the recommended website can also be sorted according to the correlation value between the query word and multiple websites, so that the website with a high correlation value is ranked first, and the website with a low correlation value is ranked last, thereby improving the accuracy of the sorting of the recommended website.

[0083] After obtaining the correlation values ​​between the query words and the websites in the training data in step S102, step S103 is executed to obtain a correlation model based on the correlation values ​​between the query words and the websites in each training data.

[0084] Specifically, in order to make the correlation model predict more accurately, the loss function can be used to evaluate the output value of the classifier in the correlation model to obtain an evaluation result; then, according to the evaluation result, the parameters of the correlation model are adjusted until the evaluation result of the output value predicted by the adjusted correlation model meets the evaluation constraint condition, and the correlation model that meets the evaluation constraint condition is used as the final correlation model, and the parameters of the correlation model are adjusted through the loss function so that the final correlation model obtained is

[0085] It can improve the model convergence efficiency and the accuracy of model prediction. The classifier can be softmax and SVM.

[0086] In an embodiment of the present invention, when adjusting the parameters of the correlation model based on the loss function, the loss function may specifically use a logarithmic loss function, a square loss function, an exponential loss function, etc. The following specifically takes the logarithmic loss function as an example.

[0087] Specifically, when the logarithmic loss function is used to adjust the parameters of the correlation model, the margin method can be used to improve the convergence efficiency of the correlation model and make the model prediction more accurate. The logarithmic loss function with increased margin is:

[0088] Formula 3

[0089] In Formula 3, k represents the number of training samples input at one time during the model training process, and the general value is 1, 2, 4, 8, 16, 32, etc.; n represents the number of samples of a website corresponding to a query word. If the positive and negative samples are 1:100, then n=101; j represents the position of the positive sample in the n websites; m and s are hyperparameters, representing the interval distance and the scaling ratio respectively; where m can be , etc., s can be 3.5, 4 and 5.5 etc.; Indicates the angle between the query term and the positive sample of the website; Represents the angle between the query term and the negative sample of the website.

[0090] In this way, the site embedding layer is fine-tuned through the above formula 3, so that the site feature vector of the network site obtained by the adjusted site embedding layer is more accurate. Based on the higher accuracy of the obtained site feature vector, the accuracy of the calculated site feature vector and the mapping word vector will also be improved, thereby improving the prediction accuracy of the correlation model.

[0091] Of course, you can also use the logarithmic loss function without the margin method to fine-tune the site embedding layer. In this case, the logarithmic loss function is:

[0092] Formula 4

[0093] Among them, in formula 4 Represents the prediction result of the i-th category, and m is a hyperparameter.

[0094] Because in the prior art, when calculating the correlation between query terms and website sites, if the website recommendation is based on the quality and authority of the website itself, the recommendation is not based on the query terms, resulting in a large difference in the correlation between the recommended website and the query terms; and if a graph model is used to calculate the correlation between query terms and website sites, since there will be unregistered words when the query terms are segmented, the unregistered words need to be processed before calculation, resulting in lower recommendation efficiency and accuracy.

[0095] The correlation model in the embodiment of the present invention is achieved by converting the relationship between query words and website sites into a classification problem; using the user's historical query data and negative sampling to obtain sample pairs of query words and website sites; then training is performed based on a sample data set composed of sample pairs to obtain a correlation model; the correlation model obtained through training can then obtain the correlation values ​​between query words and website sites, and sort the obtained website sites based on the correlation values; in this way, the problem of low recommendation efficiency and accuracy due to the existence of unregistered words in the graph model can be solved, and negative sampling is used during sampling, so that the recommended website sites obtained through the correlation model take into account the quality and authority of the website itself, further improving the accuracy of the recommendation; compared with the prior art, the correlation model in the embodiment of the present invention can improve the recommendation efficiency of website sites and improve the accuracy of recommendations.

[0096] like Figure 2 As shown, the embodiment of the present invention also provides a network site ranking method, including:

[0097] S201, obtaining the current query word input by the user in real time;

[0098] In step S201, the current query word input by the user can be obtained in real time; for example, if user A inputs "animation" in the search engine, then "animation" input by user A is obtained as the current query word.

[0099] S202, inputting the word vector of the current query word into the correlation model, and obtaining the correlation value between the current query word and each website in the website set;

[0100] Among them, in step S202, the training steps of the correlation model specifically refer to the description of the above steps S101-S103, and the correlation model is obtained through steps S101-S103; and after obtaining the current query word, the word vector of the current query word can be obtained through the word vector model; then the word vector of the current query word is input into the word embedding layer of the correlation model to obtain the mapping word vector of the current query word; and the mapping word vector of the current query word is used as the input of the correlation model, and the correlation model is used to calculate and output the correlation value between the current query word and each website in the website set.

[0101] Specifically, the network site set is composed of all or part of the network sites included in the correlation model, and the present invention does not make any specific limitation.

[0102] S203: Sort the websites corresponding to the current query word based on the correlation value between the current query word and each website.

[0103] Specifically, when ranking the websites corresponding to the current query word based on the correlation value between the current query word and each website, the websites are ranked from high to low according to the correlation values ​​corresponding to the websites. Of course, the websites can also be ranked from low to high according to the correlation values ​​corresponding to the websites, or the websites with the correlation values ​​in the middle can be ranked first and the remaining websites can be ranked from high to low according to the correlation values. Of course, there can be other ranking methods, which are not specifically limited by the present invention.

[0104] For example, taking the query words "classic lens pictures of people" and "decoration renderings" as examples, the correlation model obtains the correlation values ​​of "classic lens pictures of people" and the website as shown in Table 1 below:

[0105]

[0106] Table 1

[0107] According to the correlation scores between “classic shots of people” and websites in Table 1, the websites for “classic shots of people” are ranked as “side.sports.sina.com.cn”, “sports.sohu.com”, “sports.163.com”, “sports.sina.cn” and “sports.eastday.com”; similarly, the websites for “decoration renderings” are ranked as “www.17house.com”, “home.fang.com”, “zixun.jia.com” and “www.xiujukoo.com”. The websites are ranked in descending order according to the correlation values.

[0108] Device Embodiment

[0109] Reference Figure 3 , shows a structural block diagram of an embodiment of a correlation model training device of the present invention, which may specifically include:

[0110] The training data acquisition unit 301 is used to acquire a training data set according to the user's historical query data, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query word and a website, wherein the website is extracted from the result web page corresponding to the query word;

[0111] The training unit 302 is used to map the word vector of the query word in the training data to the embedding layer in the convolutional neural network for each training data in the training data set, so as to obtain the mapped word vector of the query word in the training data; obtain the site feature vector of the network site in the training data; and obtain the correlation value between the query word in the training data and the network site according to the mapped word vector and the site feature vector;

[0112] The model acquisition unit 303 is used to obtain the correlation model based on the correlation value between the query word and the website in each training data, wherein the correlation model is an end-to-end model.

[0113] In an optional implementation, the training data acquisition unit 301 includes:

[0114] A positive sample data set acquisition module, used to find positive sample pairs from user historical query data, and acquire the positive sample data set based on the found positive sample pairs;

[0115] A negative sample data set acquisition module is used to perform negative sampling on the user historical query data using a word2vec negative sampling method to obtain negative sample pairs; based on the obtained negative sample pairs, the negative sample data set is acquired;

[0116] A training data acquisition module is used to acquire the training data set based on the positive sample data set and the negative sample data set.

[0117] In an optional implementation, the negative sample data set acquisition module is used to perform negative sampling on the user historical query data using the negative sampling probability formula in word2vec to obtain the negative sample pair, wherein the value of the hyperparameter in the negative sampling probability formula is within a set value range.

[0118] In an optional implementation, the training unit 302 includes:

[0119] The word vector mapping module is used to map the word vector of the query word to the word embedding layer using a pre-trained model and a convolutional neural network to obtain the mapped word vector of the query word.

[0120] In an optional implementation, the model acquisition unit 303 is used to adjust the parameters of the correlation model using a logarithmic loss function and an interval distance method in the process of obtaining the correlation model based on the correlation value between the query word and the website in each training data.

[0121] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0122] The various embodiments of the present invention are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to in detail.

[0123] 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.

[0124] Reference Figure 4 , shows a structural block diagram of an embodiment of a network site ranking device of the present invention, which may specifically include:

[0125] The query word acquisition unit 401 is used to acquire the current query word input by the user in real time;

[0126] A correlation value acquisition unit 402 is used to input the word vector of the current query word into a correlation model to obtain a correlation value between the current query word and each website in the website set;

[0127] The ranking unit 403 is configured to rank the websites corresponding to the current query word based on the correlation value between the current query word and each website.

[0128] In an optional implementation, the network site set is composed of all network sites included in the correlation model.

[0129] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] The various embodiments of the present invention are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to in detail.

[0131] 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.

[0132] Figure 5 1 is a structural block diagram of a correlation model training device or a network site ranking device as a device according to an exemplary embodiment. For example, the device 900 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0133] Reference Figure 5, the device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .

[0134] The processing component 902 generally controls the overall operation of the device 900, such as operations associated with display, incoming calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.

[0135] The memory 904 is configured to store various types of data to support the operation of the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, caller book data, messages, pictures, videos, etc. The memory 904 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, magnetic disk or optical disk.

[0136] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.

[0137] The multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide motion action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0138] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0139] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0140] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor assembly 914 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0141] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0142] In an exemplary embodiment, the apparatus 900 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0143] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by a processor 920 of the device 900 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0144] Figure 6 1 is a block diagram of the structure of the server in some embodiments of the present invention. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.

[0145] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0146] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an apparatus (device or server), enables the apparatus to execute a correlation model training method, the method comprising: obtaining a training data set based on user historical query data, wherein the training data set comprises a positive sample data set and a negative sample data set, and each training data in the training data set comprises a query word and a website, wherein the website is extracted from a result web page corresponding to the query word; for each training data in the training data set, mapping the word vector of the query word in the training data to an embedding layer in a convolutional neural network to obtain a mapped word vector of the query word in the training data; obtaining a site feature vector of the website in the training data; obtaining a correlation value between the query word and the website in the training data based on the mapped word vector and the site feature vector; and obtaining the correlation model based on the correlation value between the query word and the website in each training data, wherein the correlation model is an end-to-end model.

[0147] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that has the functions specified in one or more boxes.

[0148] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0150] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0151] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A correlation model training method, characterized in that: include: According to the user's historical query data, a training data set is obtained, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query word and a website, wherein the website is extracted from a result web page corresponding to the query word; For each training data in the training data set, the word vector of the query word in the training data is mapped to the embedding layer in the convolutional neural network to obtain the mapped word vector of the query word in the training data; the site feature vector of the network site in the training data is obtained; according to the mapped word vector and the site feature vector, the correlation value between the query word and the network site in the training data is obtained; Based on the correlation values ​​between the query words and the website in each training data, the correlation model is obtained, wherein the correlation model is an end-to-end model; The step of obtaining a training data set based on user historical query data includes: Acquire positive sample pairs from the user's historical query data, and acquire the positive sample data set based on the acquired positive sample pairs; Use the negative sampling probability formula in word2vec to negatively sample the user's historical query data to obtain the negative sample pair; The negative sampling probability formula is specifically: Among them, in formula 1 Represents a network site is the probability of negative sampling, express The frequency of occurrence, t is a hyperparameter, t=0.75; Based on the acquired negative sample pairs, acquiring the negative sample dataset; The training data set is acquired based on the positive sample data set and the negative sample data set.

2. The training method according to claim 1, characterized in that: The mapping of the word vectors of the query words in the training data to the embedding layer in the convolutional neural network to obtain the mapped word vectors of the query words in the training data includes: The pre-trained model and convolutional neural network are used to map the word vector of the query word to the word embedding layer to obtain the mapped word vector of the query word.

3. The training method according to claim 1, characterized in that: In the process of obtaining the correlation model based on the correlation value between the query word and the website in each training data, the method includes: The parameters of the correlation model are adjusted using the logarithmic loss function and the margin distance method.

4. A method for ranking network sites, characterized in that: include: Get the current query word entered by the user in real time; Inputting the word vector of the current query word into the correlation model according to any one of claims 1 to 3 to obtain the correlation value between the current query word and each website in the website collection; The website sites corresponding to the current query word are ranked based on the correlation value between the current query word and each website.

5. A correlation model training device, characterized in that: include: A training data acquisition unit, configured to acquire a training data set according to user historical query data, wherein the training data set includes a positive sample data set and a negative sample data set, and each training data in the training data set includes a query word and a website, wherein the website is extracted from a result web page corresponding to the query word; The step of obtaining a training data set based on user historical query data includes: Acquire positive sample pairs from the user's historical query data, and acquire the positive sample data set based on the acquired positive sample pairs; Use the negative sampling probability formula in word2vec to negatively sample the user's historical query data to obtain the negative sample pair; The negative sampling probability formula is specifically: Among them, in formula 1 Represents a network site is the probability of negative sampling, express The frequency of occurrence, t is a hyperparameter, t=0.75; Based on the acquired negative sample pairs, acquiring the negative sample dataset; Based on the positive sample data set and the negative sample data set, acquiring the training data set; A training unit is used to map the word vector of the query word in the training data to the embedding layer in the convolutional neural network for each training data in the training data set, so as to obtain the mapped word vector of the query word in the training data; obtain the site feature vector of the network site in the training data; and obtain the correlation value between the query word in the training data and the network site according to the mapped word vector and the site feature vector; The model acquisition unit is used to obtain the correlation model based on the correlation value between the query word and the website in each training data, wherein the correlation model is an end-to-end model.

6. A network site sorting device, characterized in that: include: A query word acquisition unit, used to acquire the current query word input by the user in real time; A correlation value acquisition unit, configured to input the word vector of the current query word into the correlation model according to any one of claims 1 to 5, and acquire the correlation value between the current query word and each website in the website collection; The ranking unit is used to rank the websites corresponding to the current query word based on the correlation value between the current query word and each website.

7. A device for data processing, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include the method steps according to any one of claims 1 to 6.

8. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, cause an apparatus to perform the method of one or more of claims 1-6.